:root {
    color-scheme: light;
    --ink: #342e2d;
    --muted: #89817e;
    --paper: #fbf9f7;
    --card: #fff;
    --line: #eee8e4;
    --rose: #bd7882;
    --rose-dark: #995964;
    --rose-soft: #f8ebed;
    --mint: #eaf2ed;
    --sand: #f5efe5;
    --lavender: #efecf6;
    --shadow: 0 10px 34px rgb(74 52 44 / 5%);
    font-family: "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

.calendar-toolbar { display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin:20px 0; }
.calendar-date-nav { display:flex; gap:6px; }
.calendar-views { margin:0 0 0 auto; }
.calendar-key { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:.8rem; flex-wrap:wrap; }
.calendar-key i { display:inline-block; width:14px; height:14px; border-radius:3px; }
.working-key { background:var(--mint); }.blocked-key { background:#d8d1df; }
.calendar-scroll { max-height:75vh; overflow:auto; border:1px solid var(--line); border-radius:16px; background:white; }
.time-calendar { display:grid; grid-template-columns:52px repeat(var(--day-count),minmax(0,1fr)); position:relative; min-height:1592px; }
.time-gutter { position:relative; color:var(--muted); font-size:.65rem; }
.time-gutter>span { position:absolute; right:6px; transform:translateY(-50%); }
.calendar-column { min-width:0; border-left:1px solid var(--line); }
.calendar-day-heading { height:56px; position:sticky; top:0; z-index:9; background:#fff; border-bottom:1px solid var(--line); text-align:center; font-size:.8rem; padding:8px 2px; }
.calendar-day-heading strong { display:block; margin-top:3px; }.calendar-day-heading.is-today { color:var(--rose-dark); background:var(--rose-soft); }
.calendar-day-body { height:1536px; position:relative; background:repeating-linear-gradient(to bottom,#f1eeeb 0px,#f1eeeb 31px,#e6e0dc 32px); }
.working-band { position:absolute; left:0; right:0; background:#f8fffa; border-block:1px solid #d4e5d9; pointer-events:none; }
.calendar-slot { height:32px; position:absolute; left:0; right:0; z-index:1; border-bottom:1px solid rgb(180 180 180 / 15%); }
.calendar-slot:hover,.calendar-slot:focus-visible { background:rgb(189 120 130 / 12%); }
.calendar-buffer { position:absolute; left:2px; right:2px; z-index:2; background:repeating-linear-gradient(135deg,#f4ece8,#f4ece8 4px,#e7dbd4 4px,#e7dbd4 8px); border-radius:4px; font-size:.65rem; overflow:hidden; pointer-events:none; }
.calendar-block { position:absolute; left:2px; right:2px; z-index:2; border:1px dashed #b6a6c6; border-radius:6px; background:repeating-linear-gradient(135deg,#ece7f2,#ece7f2 5px,#e1dae8 5px,#e1dae8 10px); padding:4px; font-size:.7rem; overflow:hidden; }
.calendar-event { position:absolute; width:calc(100% / var(--lanes) - 3px); left:calc(100% / var(--lanes) * var(--lane) + 1px); z-index:3; border:1px solid #dcaeb7; border-left:4px solid var(--rose); border-radius:7px; background:var(--rose-soft); overflow:hidden; padding:4px 2px; font-size:.73rem; min-height:30px; }
.calendar-event>a { display:flex; flex-direction:column; gap:3px; height:100%; overflow:hidden; padding-right:14px; overflow-wrap:anywhere; }
.calendar-event small { display:block; }.calendar-event.status-Pending { background:var(--sand); border-color:#d2b88a; }
.calendar-event.status-Cancelled,.calendar-event.status-NoShow { opacity:.55; border-style:dashed; text-decoration:line-through; }
.calendar-event.status-Completed { background:var(--mint); border-color:#93b89f; }
.event-drag,.event-resize { position:absolute; border:0; color:var(--rose-dark); background:transparent; width:22px; padding:0; cursor:grab; touch-action:none; }
.event-drag { right:0; top:0; height:26px; }.event-resize { bottom:0; right:0; height:18px; cursor:ns-resize; }
.event-moving { z-index:12; box-shadow:0 4px 12px #aaa; opacity:.8; }
.current-time { position:absolute; left:0; right:0; border-top:2px solid #bc354f; z-index:5; pointer-events:none; }
.current-time span { font-size:.65rem; color:#9e2340; background:white; position:absolute; right:0; top:-14px; }
.month-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px; }
.month-day { min-width:0; padding:10px; min-height:150px; }.month-day h2 { font-family:inherit; font-size:.8rem; font-weight:600; }.outside-month { opacity:.55; }
.month-event,.month-block { display:block; border-radius:5px; padding:7px 4px; margin-top:5px; background:var(--rose-soft); font-size:.7rem; overflow-wrap:anywhere; }
.month-block { background:var(--lavender); }.month-event.status-Cancelled { text-decoration:line-through; opacity:.6; }
.month-day .touch-link { font-size:.7rem; }
.service-selector { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:16px; max-height:360px; overflow:auto; }
.crm-form .service-choice { flex-direction:row; align-items:center; padding:12px; border:1px solid var(--line); border-radius:12px; min-height:60px; }
.service-choice input[type="checkbox"] { width:22px; height:22px; flex:none; accent-color:var(--rose-dark); }
.service-choice small { display:block; margin-top:5px; }.appointment-estimate { display:block; background:var(--mint); padding:16px; margin-top:20px; border-radius:12px; font-weight:600; }
[hidden] { display:none !important; }
@media(max-width:760px) {
    .calendar-toolbar>strong { order:-1; width:100%; }.calendar-views { margin:0; width:100%; gap:4px; }.calendar-views a { padding:10px 12px; }
    .time-calendar { grid-template-columns:42px repeat(var(--day-count),minmax(0,1fr)); }.calendar-event { font-size:.7rem; }
    .month-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.month-day { padding:12px; }
    .service-selector { grid-template-columns:1fr; }.event-drag { width:30px; height:30px; }.event-resize { width:36px; height:24px; }
    .calendar-page .module-heading { flex-direction:row; align-items:center; gap:10px; margin-bottom:12px; }
    .calendar-page .module-heading .eyebrow,.calendar-page .page-subtitle,.calendar-interaction-help { display:none; }
    .calendar-page h1 { font-size:1.65rem; margin:0; }
    .calendar-page .module-heading .button { width:auto; max-width:160px; min-height:44px; font-size:.75rem; padding:8px 10px; }
    .calendar-page .calendar-toolbar { margin:8px 0; gap:8px; }
    .calendar-page .calendar-toolbar>strong { order:0; width:auto; font-size:.8rem; }
    .calendar-page .calendar-views a { min-height:44px; padding:10px 12px; }
    .calendar-page .profile-actions { gap:8px; margin:8px 0; }
    .calendar-page .filter-bar { padding:10px; display:flex; flex-direction:row; align-items:end; gap:8px; margin-bottom:12px; }
    .calendar-page .filter-bar .search-field { font-size:0; gap:0; min-width:0; flex:1 1 0; }
    .calendar-page .search-field input { font-size:16px; min-width:0; }
    .calendar-page .filter-bar .button { min-height:46px; flex:none; width:auto; }
    .calendar-page .calendar-views { margin:0; }
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a, select { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
h1 { margin-bottom: .45rem; font-size: clamp(1.8rem, 3.2vw, 2.35rem); font-weight: 600; }
h2 { margin-bottom: .3rem; font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.04rem; }
h1[tabindex="-1"]:focus { outline:none; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: 252px; flex-direction: column;
    padding: 28px 18px 18px; border-right: 1px solid var(--line); background: #fff;
}
.brand { display: inline-flex; width: fit-content; align-items: center; gap: 10px; }
.brand-mark { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 14px 14px 14px 5px; background: var(--rose); color: white; font: 600 1.65rem Georgia, serif; }
.brand-copy { display: flex; flex-direction: column; line-height: 1; }
.brand-copy strong { font: 600 1.32rem Georgia, serif; letter-spacing: -.05em; }
.brand-copy small { margin-top: 5px; color: var(--muted); font-size: .58rem; font-weight: 700; letter-spacing: .19em; }
.studio-switcher { display: flex; min-width: 0; align-items: center; gap: 10px; margin: 34px 0 20px; padding: 12px 10px; border: 1px solid var(--line); border-radius: 13px; }
.studio-avatar, .profile-avatar { display: grid; flex: 0 0 auto; width: 35px; height: 35px; place-items: center; border-radius: 12px; background: var(--rose-soft); color: var(--rose-dark); font-weight: 700; }
.studio-name, .profile-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.studio-name strong, .profile-copy strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.studio-name small, .profile-copy small { color: var(--muted); font-size: .7rem; }
.chevron { color: var(--muted); }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; font-size: .86rem; font-weight: 600; transition: transform .15s ease, background .15s ease; }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--rose); color: #fff; box-shadow: 0 5px 14px rgb(189 120 130 / 20%); }
.button-primary:hover { background: var(--rose-dark); }
.button-secondary { border-color: #ead9da; background: #fff; color: var(--rose-dark); }
.plus-icon { font-size: 1.2rem; font-weight: 400; line-height: 1; }
.new-appointment { width: 100%; justify-content: flex-start; margin-bottom: 24px; }
.new-appointment:disabled { margin-bottom:8px; }
.feature-availability { color:var(--muted); font-size:.75rem; line-height:1.5; margin-bottom:20px; }
button:disabled, .feature-disabled { opacity:.55; cursor:not-allowed; }
button:disabled:active { transform:none; }
button.quick-action { width:100%; text-align:left; border:0; background:transparent; color:inherit; }
button.mobile-add { border:0; }
.primary-nav { display: grid; gap: 5px; }
.nav-link { display: flex; min-height: 44px; align-items: center; gap: 13px; padding: 0 12px; border-radius: 10px; color: #716a67; font-size: .88rem; font-weight: 500; }
.nav-link:hover { background: #faf6f4; color: var(--ink); }
.nav-link.active { background: var(--rose-soft); color: var(--rose-dark); font-weight: 600; }
.nav-icon { display: inline-grid; width: 21px; place-items: center; font-size: 1.1rem; }
.sidebar-bottom { display: grid; gap: 10px; margin-top: auto; }
.language-form select { max-width: 100%; padding: 9px 28px 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: .78rem; }
.profile-link { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 10px 6px 2px; border-top: 1px solid var(--line); }
.profile-menu { color: var(--muted); }
.logout-form { padding-left: 5px; }
.logout-button { padding: 7px 4px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: .76rem; }
.logout-button:hover { color: var(--rose-dark); }
.main-content { min-height: 100vh; margin-left: 252px; }
.page-content { width: min(1320px, 100%); margin: 0 auto; padding: 42px clamp(22px, 4vw, 58px) 54px; }
.mobile-header, .mobile-nav { display: none; }
.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.eyebrow { margin-bottom: 9px; color: var(--rose-dark); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.page-subtitle { margin-bottom: 0; color: var(--muted); font-size: .92rem; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.summary-card, .panel { border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.summary-card { min-width: 0; padding: 17px 18px 16px; }
.summary-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .76rem; font-weight: 600; }
.summary-icon { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #6b5554; }
.blush { background: var(--rose-soft); }.sand { background: var(--sand); }.mint { background: var(--mint); }.lavender { background: var(--lavender); }
.summary-value { display: block; margin-top: 12px; font-size: 1.65rem; font-weight: 600; letter-spacing: -.04em; }
.summary-footnote { color: #a59c98; font-size: .72rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(265px, .9fr); gap: 18px; align-items: start; }
.panel { padding: 21px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: .8rem; }
.text-link { flex: 0 0 auto; color: var(--rose-dark); font-size: .8rem; font-weight: 600; }
.empty-schedule { display: flex; min-height: 340px; flex-direction: column; align-items: center; justify-content: center; padding: 35px 20px; text-align: center; }
.empty-illustration { position: relative; display: grid; width: 84px; height: 84px; place-items: center; margin-bottom: 18px; border-radius: 26px; background: #faf1f0; color: var(--rose); }
.empty-calendar { font-size: 2.1rem; }
.empty-sun { position: absolute; top: 6px; right: 8px; color: #d2a35f; font-size: 1.3rem; }
.empty-schedule h3 { margin-bottom: 7px; }
.empty-schedule p { max-width: 280px; margin-bottom: 17px; color: var(--muted); font-size: .84rem; line-height: 1.6; }
.side-panels { display: grid; gap: 16px; }
.compact { align-items: center; }
.compact h2 { font-size: 1.2rem; }
.compact p { font-size: .76rem; }
.panel-heading-icon { display: grid; width: 33px; height: 33px; place-items: center; border-radius: 11px; background: var(--rose-soft); color: var(--rose-dark); }
.next-client-empty { display: flex; align-items: center; gap: 13px; margin-top: 20px; padding: 16px 12px; border-radius: 12px; background: #fcf9f7; }
.next-client-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 13px; background: var(--rose-soft); color: var(--rose-dark); }
.next-client-empty p { margin: 0; color: var(--muted); font-size: .8rem; }
.quick-actions-panel { padding-bottom: 12px; }
.quick-actions-panel .panel-heading { margin-bottom: 9px; }
.quick-action { display: flex; min-height: 52px; align-items: center; gap: 11px; border-top: 1px solid #f4efed; font-size: .82rem; font-weight: 500; }
.quick-action-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; color: var(--rose-dark); font-size: 1rem; }
.quick-action-arrow { margin-left: auto; color: #a69b97; }
.auth-card { width: min(440px, calc(100% - 32px)); margin: 12vh auto; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: var(--shadow); }
.auth-card p { color: var(--muted); }
.login-page { display: grid; min-height: 100vh; grid-template-columns: 1fr 1fr; background: #fff; }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 44px clamp(26px, 6vw, 90px); background: #f6edeb; }
.login-brand > p { max-width: 370px; margin: auto 0 12vh; color: #705d58; font: 500 clamp(1.35rem, 2.5vw, 2.15rem) Georgia, serif; line-height: 1.45; }
.login-art { position: absolute; inset: 22% 9% 20%; display: grid; place-items: center; border: 1px solid rgb(189 120 130 / 14%); border-radius: 50%; color: #c68d92; font-size: 4rem; }
.login-art span:nth-child(2) { position: absolute; top: 18%; right: 14%; font-size: 2rem; }
.login-art span:nth-child(3) { position: absolute; bottom: 13%; left: 14%; font-size: 2rem; }
.login-form-panel { display: grid; place-items: center; padding: 32px; }
.login-form-wrap { width: min(390px, 100%); }
.login-form-wrap h1 { margin-top: 6px; }
.login-form-wrap form { display: grid; gap: 9px; margin-top: 28px; }
.login-form-wrap label { margin-top: 9px; font-size: .82rem; font-weight: 600; }
.form-control { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid #e5ddda; border-radius: 10px; outline: none; background: #fff; color: var(--ink); }
.form-control:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgb(189 120 130 / 12%); }
.login-submit { width: 100%; margin-top: 15px; }
.form-error, .validation-message { color: #a93445; font-size: .8rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

#blazor-error-ui { position: fixed; z-index: 50; right: 1rem; bottom: 1rem; display: none; max-width: calc(100% - 2rem); padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
#blazor-error-ui .reload { margin-left: 12px; color: var(--rose-dark); }
#blazor-error-ui .dismiss { margin-left: 10px; cursor: pointer; }
#blazor-error-ui .blazor-error-boundary { display: none; }

@media (max-width: 1100px) {
    .sidebar { width: 220px; padding-inline: 14px; }
    .main-content { margin-left: 220px; }
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: minmax(0, 1.3fr) minmax(240px, .9fr); }
}

@media (max-width: 760px) {
    body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .mobile-header { position: sticky; top: 0; z-index: 15; display: flex; min-height: 62px; align-items: center; justify-content: space-between; padding: 8px 17px; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 95%); backdrop-filter: blur(12px); }
    .mobile-header .brand-mark { width: 33px; height: 33px; }
    .mobile-header .brand-copy strong { font-size: 1.18rem; }
    .mobile-header .language-form select { max-width: 122px; padding: 8px 22px 8px 8px; font-size: .72rem; }
    .page-content { padding: 26px 16px 28px; }
    .welcome-row { align-items: flex-start; margin-bottom: 20px; }
    .welcome-row .eyebrow { font-size: .65rem; }
    .welcome-row h1 { font-size: 1.85rem; }
    .welcome-row .page-subtitle { max-width: 270px; font-size: .82rem; line-height: 1.5; }
    .desktop-new-appointment { display: none; }
    .summary-grid { gap: 10px; margin-bottom: 13px; }
    .summary-card { padding: 13px 12px; border-radius: 13px; }
    .summary-card-top { align-items: flex-start; font-size: .69rem; }
    .summary-icon { width: 27px; height: 27px; border-radius: 9px; }
    .summary-value { margin-top: 9px; font-size: 1.42rem; }
    .summary-footnote { font-size: .67rem; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
    .panel { padding: 16px; border-radius: 14px; }
    .panel-heading h2 { font-size: 1.2rem; }
    .panel-heading p { max-width: 220px; font-size: .73rem; line-height: 1.4; }
    .empty-schedule { min-height: 275px; padding: 24px 12px; }
    .empty-illustration { width: 72px; height: 72px; }
    .side-panels { gap: 12px; }
    .mobile-nav { position: fixed; inset: auto 0 0; z-index: 30; display: grid; min-height: calc(64px + env(safe-area-inset-bottom)); grid-template-columns: repeat(4, 1fr) 52px; align-items: center; padding: 5px 9px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgb(255 255 255 / 97%); box-shadow: 0 -6px 20px rgb(74 52 44 / 4%); backdrop-filter: blur(12px); }
    .mobile-nav-link { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #938986; font-size: .63rem; }
    .mobile-nav-link .nav-icon { height: 24px; font-size: 1.15rem; }
    .mobile-nav-link.active { color: var(--rose-dark); font-weight: 700; }
    .mobile-add { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 15px; background: var(--rose); box-shadow: 0 4px 12px rgb(189 120 130 / 24%); color: white; font-size: 1.7rem; }
    .login-page { grid-template-columns: 1fr; }
    .login-brand { min-height: 190px; padding: 24px; }
    .login-brand .login-art { inset: 20px 14% 16px auto; width: 130px; height: 130px; font-size: 2.7rem; }
    .login-brand > p { max-width: 190px; margin: 26px 0 0; font-size: 1.08rem; }
    .login-form-panel { align-items: start; padding: 34px 22px; }
}

@media (max-width: 360px) {
    .page-content { padding-inline: 12px; }
    .summary-card { padding-inline: 9px; }
    .summary-card-top { font-size: .64rem; }
    .mobile-nav { padding-inline: 5px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* CRM: cards and single-column touch forms stay within a narrow viewport. */
.module-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:24px; }
.module-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:22px; }
.module-tabs a { display:flex; align-items:center; min-height:44px; padding:10px 18px; border-radius:12px; color:var(--muted); }
.module-tabs a.active { background:var(--rose-soft); color:var(--rose-dark); font-weight:600; }
.filter-bar { display:flex; align-items:flex-end; flex-wrap:wrap; gap:14px; margin-bottom:22px; }
.filter-bar label { min-width:130px; flex:1; }
.filter-bar .search-field { flex:3; min-width:180px; }
.filter-bar label, .crm-form label { display:flex; flex-direction:column; gap:8px; font-size:.86rem; font-weight:600; }
.filter-bar .form-control { margin-top:2px; }
.result-count, .muted, .empty-inline { color:var(--muted); font-size:.86rem; line-height:1.6; }
.record-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.record-top { display:flex; align-items:center; gap:12px; min-width:0; }
.record-top>div { flex:1; min-width:0; }
.record-top h2 { font-family:inherit; font-size:1.08rem; overflow-wrap:anywhere; }
.record-top p { color:var(--muted); font-size:.82rem; margin-bottom:4px; overflow-wrap:anywhere; }
.client-initial { display:grid; place-items:center; flex:none; width:44px; height:44px; border-radius:16px; background:var(--rose-soft); color:var(--rose-dark); font-size:1.2rem; }
.card-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:22px 0; }
.card-metrics dt { color:var(--muted); font-size:.76rem; margin-bottom:4px; }
.card-metrics dd { margin:0; font-size:.9rem; font-weight:600; overflow-wrap:anywhere; }
.record-footer { display:flex; align-items:center; gap:12px; justify-content:space-between; flex-wrap:wrap; }
.badge { display:inline-flex; padding:5px 10px; border-radius:9px; background:var(--mint); color:#395e48; font-size:.72rem; }
.badge.warning { background:var(--sand); color:#805522; }
.touch-link { display:inline-flex; min-height:44px; align-items:center; }
.empty-module { text-align:center; padding:48px 20px; }
.empty-module p { color:var(--muted); max-width:440px; margin:12px auto 24px; line-height:1.6; }
.empty-symbol { display:grid; place-items:center; width:64px; height:64px; border-radius:22px; margin:0 auto 20px; background:var(--rose-soft); color:var(--rose-dark); font:2rem Georgia,serif; }
.back-link { display:inline-flex; min-height:44px; align-items:center; color:var(--rose-dark); margin-bottom:14px; font-size:.86rem; }
.crm-form { display:grid; gap:20px; max-width:100%; }
.form-section h2 { margin-bottom:20px; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.full-width { grid-column:1 / -1; }
textarea.form-control { min-height:110px; padding:12px; resize:vertical; font:inherit; }
.crm-form small { color:var(--muted); font-weight:400; line-height:1.5; }
.crm-form .check-label { display:flex; flex-direction:row; align-items:center; min-height:44px; margin-top:12px; }
.check-label input { width:22px; height:22px; flex:none; accent-color:var(--rose-dark); }
.form-actions { display:flex; align-items:center; justify-content:flex-end; gap:12px; flex-wrap:wrap; padding:10px 0 18px; }
.notice { padding:18px 20px; border:1px solid var(--line); border-radius:14px; margin-bottom:20px; line-height:1.6; overflow-wrap:anywhere; }
.notice h2 { font-size:1.1rem; }
.notice p:last-child { margin-bottom:0; }
.error-notice { background:#fff2f3; color:#9b2f40; border-color:#f0ccd1; }
.success-notice { background:var(--mint); color:#395e48; }
.warning-notice { background:var(--sand); color:#715327; }
.pagination { display:flex; justify-content:center; align-items:center; gap:18px; margin-top:26px; }
.profile-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:22px; }
.profile-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.profile-section { margin-top:18px; }
.details-list { display:grid; grid-template-columns:minmax(100px,.8fr) minmax(0,1.2fr); gap:14px; font-size:.86rem; }
.details-list dt { color:var(--muted); }
.details-list dd { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.small-id { font-size:.72rem; }
.preserve-text { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.7; }
.timeline-note { border-top:1px solid var(--line); padding:16px 0 4px; margin-top:12px; }
.timeline-note p { margin:8px 0; }
.timeline-note .record-footer { color:var(--muted); font-size:.8rem; }
.sensitive-section summary { cursor:pointer; font-weight:600; min-height:32px; }
.service-dot { width:14px; height:38px; border-radius:8px; flex:none; background:var(--service-color); }
.service-description { color:var(--muted); font-size:.86rem; line-height:1.6; margin-top:16px; overflow-wrap:anywhere; }
.color-input { padding:5px; max-width:160px; }
.category-row { display:flex; align-items:center; gap:16px; flex-wrap:wrap; padding:14px 0; border-bottom:1px solid var(--line); }
.category-row h2 { flex:1; min-width:120px; font-family:inherit; font-size:1rem; overflow-wrap:anywhere; margin:0; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline:3px solid var(--rose-dark); outline-offset:3px; }
@media (max-width:900px) { .record-grid, .profile-grid { grid-template-columns:1fr; } }
@media (max-width:600px) {
    .module-heading { align-items:flex-start; flex-direction:column; gap:16px; }
    .module-heading>.button { width:100%; }
    .form-grid { grid-template-columns:1fr; gap:18px; }
    .filter-bar { gap:12px; padding:16px; }
    .filter-bar .search-field { flex-basis:100%; min-width:0; }
    .filter-bar label { min-width:0; flex-basis:40%; }
    .filter-bar>.button { width:100%; }
    .crm-form .form-control, .filter-bar .form-control { font-size:16px; min-width:0; }
    .record-grid { gap:12px; }
    .record-top { flex-wrap:wrap; }
    .form-actions { position:sticky; bottom:70px; background:var(--paper); padding:12px 0; z-index:5; }
    .form-actions>* { flex:1; }
    .crm-summary .summary-card { font-size:.76rem; }
    .crm-summary .summary-value { font-size:1.3rem; }
    .details-list { grid-template-columns:minmax(90px,.8fr) minmax(0,1.2fr); gap:12px; }
    .mobile-nav-link { min-height:44px; }
}
