@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  --ink: #101658;
  --ink-soft: #4f579d;
  --muted: #7179b8;
  --line: rgba(95, 101, 188, .16);
  --panel: rgba(255, 255, 255, .72);
  --panel-solid: #fff;
  --lavender: #eee9ff;
  --lavender-strong: #e5dcff;
  --purple: #743cff;
  --purple-dark: #4a25d7;
  --blue: #2c84ee;
  --teal: #12b28a;
  --red: #f14562;
  --amber: #ec9d15;
  --shadow: 0 16px 46px rgba(68, 64, 147, .10);
  --radius: 16px;
}

/* Relatórios operacionais e leitura assistida por IA */
.reports-heading { align-items:flex-end; gap:20px; }
.reports-toolbar { display:flex; align-items:flex-end; gap:9px; }
.reports-toolbar label { display:grid; gap:5px; color:var(--ink-soft); font-size:10px; }
.reports-toolbar select { height:39px; min-width:145px; padding:0 10px; border:1px solid #ded8f3; border-radius:10px; color:var(--ink); background:rgba(255,255,255,.76); outline:0; font-size:11px; }
.reports-toolbar .button { min-height:39px; }
.reports-period-note { display:flex; align-items:center; gap:7px; margin:-8px 0 16px; color:var(--ink-soft); font-size:11px; }
.reports-period-note svg { width:15px; height:15px; color:var(--purple); }
.reports-kpi-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:14px; }
.report-kpi-card { min-height:116px; display:flex; align-items:center; gap:12px; padding:17px; border:1px solid rgba(255,255,255,.9); border-radius:15px; background:rgba(255,255,255,.76); box-shadow:var(--shadow); backdrop-filter:blur(16px); }
.report-kpi-card > div:last-child { min-width:0; display:grid; gap:4px; }
.report-kpi-card span { color:var(--ink-soft); font-size:11px; }
.report-kpi-card strong { color:var(--ink); font:800 26px Manrope; letter-spacing:-.8px; }
.report-kpi-card small { color:var(--muted); font-size:10px; line-height:1.25; }
.report-kpi-icon { width:39px; height:39px; display:grid; place-items:center; flex:0 0 auto; color:var(--purple); border-radius:50%; background:#eee8ff; }
.report-kpi-icon svg { width:19px; height:19px; }
.report-kpi-icon.teal { color:#0b9d7d; background:#e0f7f0; }
.report-kpi-icon.amber { color:#ca8110; background:#fff0d2; }
.report-kpi-icon.blue { color:#337bdd; background:#e5efff; }
.reports-main-grid { display:grid; grid-template-columns:1.12fr .88fr; gap:14px; margin-bottom:14px; }
.reports-secondary-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-bottom:14px; }
.report-card { min-width:0; padding:19px; }
.report-card-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:18px; }
.report-card-heading > div { min-width:0; }
.report-card-heading h2 { margin:0; color:var(--ink); font:800 15px Manrope; letter-spacing:-.3px; }
.report-card-heading p { margin:5px 0 0; color:var(--ink-soft); font-size:10px; line-height:1.4; }
.report-badge { flex:0 0 auto; padding:5px 8px; color:var(--purple-dark); border-radius:999px; background:#f0ebff; font-size:9px; white-space:nowrap; }
.report-day-chart { height:164px; display:flex; align-items:flex-end; justify-content:space-around; gap:10px; padding:8px 4px 0; border-bottom:1px solid var(--line); }
.report-day-column { min-width:30px; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:5px; color:var(--ink-soft); font-size:10px; }
.report-day-column strong { color:var(--ink); font-size:11px; }
.report-day-column span { text-transform:capitalize; }
.report-day-track { width:28px; height:108px; display:flex; align-items:flex-end; justify-content:center; border-radius:9px 9px 2px 2px; background:linear-gradient(180deg,rgba(238,233,255,.56),rgba(246,244,255,.4)); overflow:hidden; }
.report-day-track i { width:100%; min-height:2px; display:block; border-radius:9px 9px 2px 2px; background:linear-gradient(180deg,#a878ff,#6841e7); }
.report-chart-legend { display:flex; justify-content:space-between; gap:12px; padding-top:12px; color:var(--muted); font-size:9px; }
.report-chart-legend span { display:flex; align-items:center; gap:5px; }
.legend-dot { width:7px; height:7px; display:inline-block; border-radius:50%; background:#7746ed; }
.report-ranking { display:grid; gap:13px; }
.report-ranking-item { display:grid; gap:6px; }
.report-ranking-head { display:flex; justify-content:space-between; gap:10px; color:var(--ink-soft); font-size:10px; }
.report-ranking-head strong { color:var(--ink); font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.report-progress { height:7px; overflow:hidden; border-radius:99px; background:#eeeaff; }
.report-progress i { height:100%; display:block; min-width:3px; border-radius:inherit; background:linear-gradient(90deg,#8958f7,#b18aff); }
.report-empty-inline { padding:15px 0; color:var(--muted); font-size:11px; }
.report-other-data .report-card-heading { margin-bottom:7px; }
.report-stat-list { display:grid; }
.report-stat-list > div { display:flex; justify-content:space-between; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); color:var(--ink-soft); font-size:10px; }
.report-stat-list > div:last-child { border-bottom:0; }
.report-stat-list strong { color:var(--ink); font-size:12px; }
.report-ai-card { padding:20px; margin-bottom:18px; border-color:#ded3ff; background:linear-gradient(135deg,rgba(252,250,255,.9),rgba(241,236,255,.82)); }
.report-ai-card .report-card-heading { align-items:center; margin-bottom:13px; }
.report-ai-heading { display:flex; align-items:center; gap:10px; }
.report-ai-icon { width:38px; height:38px; display:grid; place-items:center; flex:0 0 auto; color:var(--purple); border-radius:12px; background:#e9e0ff; }
.report-ai-icon svg { width:20px; height:20px; }
.report-ai-note { display:flex; align-items:flex-start; gap:7px; padding:10px 11px; margin-bottom:14px; color:var(--ink-soft); border:1px solid rgba(125,94,226,.13); border-radius:10px; background:rgba(255,255,255,.55); font-size:10px; line-height:1.4; }
.report-ai-note svg { width:15px; height:15px; flex:0 0 auto; color:var(--purple); }
.report-insight-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px 18px; padding:0; margin:0; list-style:none; }
.report-insight-list li { display:flex; align-items:flex-start; gap:8px; color:var(--ink); font-size:11px; line-height:1.45; }
.report-insight-list svg { width:15px; height:15px; flex:0 0 auto; margin-top:1px; color:var(--purple); }
.report-ai-source { display:block; margin-top:15px; color:var(--muted); font-size:9px; }
html[data-theme="dark"] .report-kpi-card,
html[data-theme="dark"] .report-ai-card { border-color:rgba(196,192,255,.14); background:rgba(25,29,65,.82); }
html[data-theme="dark"] .reports-toolbar select { border-color:#4a4f7d; background:#202448; color:var(--ink); }
html[data-theme="dark"] .report-day-track { background:rgba(49,45,93,.8); }
html[data-theme="dark"] .report-progress { background:#302b5e; }
html[data-theme="dark"] .report-ai-note { border-color:rgba(196,192,255,.14); background:rgba(35,39,79,.72); }
@media (max-width: 920px) {
  .reports-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .reports-main-grid, .reports-secondary-grid { grid-template-columns:1fr; }
}
@media (max-width: 650px) {
  .reports-heading { align-items:stretch; }
  .reports-toolbar { align-items:stretch; }
  .reports-toolbar label { flex:1; }
  .reports-toolbar select { width:100%; min-width:0; }
  .reports-toolbar .button { white-space:nowrap; }
  .reports-kpi-grid { grid-template-columns:1fr; }
  .report-insight-list { grid-template-columns:1fr; }
}

html[data-theme="dark"] {
  --ink: #eef0ff;
  --ink-soft: #b8bfdf;
  --muted: #8e97c0;
  --line: rgba(176, 183, 240, .18);
  --panel: rgba(25, 29, 65, .82);
  --panel-solid: #171b3d;
  --lavender: #292650;
  --lavender-strong: #393264;
  --shadow: 0 18px 48px rgba(0, 0, 0, .28);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(ellipse at 23% 18%, rgba(78, 61, 145, .22) 0, rgba(78, 61, 145, 0) 34%),
    radial-gradient(ellipse at 80% 0%, rgba(63, 52, 113, .24) 0, rgba(32, 35, 78, .14) 34%, transparent 62%),
    linear-gradient(115deg, rgba(13,16,40,.65) 0%, rgba(18,22,50,.62) 45%, rgba(16,17,41,.65) 100%),
    url('/waiting-room-background.jpg') center/cover fixed no-repeat;
}
html[data-theme="dark"] .sidebar { background: rgba(17, 20, 50, .88); border-color: rgba(196, 192, 255, .14); }
html[data-theme="dark"] .nav-item { color: #c2c8eb; }
html[data-theme="dark"] .nav-item svg { color: #9aa6df; }
html[data-theme="dark"] .nav-item:hover { background: rgba(89, 73, 160, .28); }
html[data-theme="dark"] .nav-item.active { color: #e7ddff; background: linear-gradient(100deg, rgba(104, 73, 207, .45), rgba(65, 75, 164, .42)); }
html[data-theme="dark"] .sidebar-quote { border-color: rgba(196, 192, 255, .14); background: linear-gradient(145deg, rgba(49, 46, 92, .8), rgba(31, 38, 82, .76)); }
html[data-theme="dark"] .sidebar-quote p { color: #dce0ff; }
html[data-theme="dark"] .profile-switcher:hover { background: rgba(89, 73, 160, .28); }
html[data-theme="dark"] .global-search { border-color: rgba(196, 192, 255, .16); background: rgba(28, 32, 70, .76); }
html[data-theme="dark"] kbd { border-color: rgba(196, 192, 255, .18); background: rgba(37, 40, 81, .82); color: #c5c9ef; }
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .card { border-color: rgba(196, 192, 255, .14); }
html[data-theme="dark"] .button { border-color: rgba(180, 171, 255, .22); background: rgba(40, 43, 83, .82); color: #d9d2ff; }
html[data-theme="dark"] .button.ghost { background: rgba(40, 43, 83, .56); }
html[data-theme="dark"] .metric-icon,
html[data-theme="dark"] .settings-icon { background: linear-gradient(145deg, #302d5c, #252b5c); }
html[data-theme="dark"] .progress { background: #2b2e5c; }
html[data-theme="dark"] .appointment-time { color: #c0c9ff; }
html[data-theme="dark"] .avatar.patient-avatar { background: linear-gradient(145deg, #38336d, #2a3567); color: #d8d6ff; }
html[data-theme="dark"] .status.white { color: #c3c9e8; background: #262b56; border-color: #454a7b; }
html[data-theme="dark"] .header-popover,
html[data-theme="dark"] .profile-modal { border-color: rgba(196, 192, 255, .18); background: linear-gradient(145deg, #202448, #171a38); }
html[data-theme="dark"] .profile-popover::before { border-color: rgba(196, 192, 255, .18); background: #202448; }
html[data-theme="dark"] .notification-grid > div,
html[data-theme="dark"] .google-account-card,
html[data-theme="dark"] .notification-list p,
html[data-theme="dark"] .header-popover footer,
html[data-theme="dark"] .profile-menu-note { background: rgba(35, 39, 79, .8); border-color: rgba(196, 192, 255, .14); }
html[data-theme="dark"] .profile-clinic select,
html[data-theme="dark"] .profile-clinic input,
html[data-theme="dark"] .setting-field input,
html[data-theme="dark"] .setting-field select,
html[data-theme="dark"] .day-setting,
html[data-theme="dark"] .day-setting input { border-color: #4a4f7d; background: #202448; color: var(--ink); }
html[data-theme="dark"] .day-setting:has(input:checked) { border-color: #8e70ff; background: #30295d; color: #e2d9ff; }
html[data-theme="dark"] .patient-menu,
html[data-theme="dark"] .patient-record-menu,
html[data-theme="dark"] .search-results { border-color: rgba(196, 192, 255, .18); background: #202448; }
html[data-theme="dark"] .search-result:hover,
html[data-theme="dark"] .profile-menu-item:hover,
html[data-theme="dark"] .popover-close:hover { background: #302b5e; }
html[data-theme="dark"] .record-section-card,
html[data-theme="dark"] .settings-preview { background: rgba(25, 29, 65, .82); }
html[data-theme="dark"] .settings-hint,
html[data-theme="dark"] .settings-card-heading p { color: #a7afd4; }
html[data-theme="dark"] .prescription-name-mode-card,
html[data-theme="dark"] .medication-preference-row { border-color:rgba(196,192,255,.18); background:rgba(35,39,79,.72); }
html[data-theme="dark"] .prescription-name-mode-toggle i { border-color:#5e5a8b; background:#3b3962; }
html[data-theme="dark"] .prescription-name-preview { border-color:#4a4f7d; background:#25294f; }
html[data-theme="dark"] .prescription-name-preview strong { color:#ddd4ff; }
html[data-theme="dark"] .medication-preference-row input,
html[data-theme="dark"] .medication-catalog-search input { border-color:#4a4f7d; background:#202448; color:var(--ink); }
html[data-theme="dark"] .medication-catalog-note,
html[data-theme="dark"] .medication-catalog-item { border-color:rgba(196,192,255,.16); background:rgba(35,39,79,.78); }
html[data-theme="dark"] .medication-catalog-option { border-color:#514b82; background:#292950; color:#e3dcff; }
html[data-theme="dark"] .medication-catalog-option.active-option { color:#c5c9ef; background:#303253; }
html[data-theme="dark"] .slot strong,
html[data-theme="dark"] .week-slot strong { color: #10152d; }
html[data-theme="dark"] .slot > span:first-child,
html[data-theme="dark"] .week-slot small,
html[data-theme="dark"] .slot small { color: #384365; }
html[data-theme="dark"] .week-slot.is-off { background:repeating-linear-gradient(135deg,#22243f,#22243f 6px,#282a4a 6px,#282a4a 12px); border-left-color:#454870; }
html[data-theme="dark"] .week-slot.is-off span { color:#8a90b8; }
html[data-theme="dark"] .week-head > div.is-off-day { background:#20223d; color:#8a90b8; }
html[data-theme="dark"] .week-head > div.is-off-day strong { color:#8a90b8; }
html[data-theme="dark"] .month-day { background: rgba(39, 43, 84, .88); }
html[data-theme="dark"] .month-day:hover { background: #343064; }
html[data-theme="dark"] .month-day.selected { background: #332b63; }

/* Entrada protegida e configuração inicial do profissional */
#app-gate-root { min-height:100vh; }
.app-shell[hidden] { display:none !important; }
.app-gated { min-height:100vh; }
.app-gate-screen { min-height:100vh; padding:clamp(22px,5vw,70px); display:grid; place-items:center; position:relative; overflow:hidden; background:#050318; }
.auth-gate-screen { display:block; min-height:100vh; padding:0; color:#fff; }
.simple-gate { position:relative; background:#050506; display:flex; align-items:center; justify-content:center; }
.simple-gate::before { content:''; position:absolute; inset:0; pointer-events:none; background:radial-gradient(circle at 18% 14%,rgba(128,82,255,.16),transparent 30%),radial-gradient(circle at 82% 20%,rgba(84,167,255,.13),transparent 28%),radial-gradient(circle at 50% 92%,rgba(21,132,110,.10),transparent 34%); }
.simple-gate-content { position:relative; z-index:1; display:grid; justify-items:center; gap:6px; max-width:560px; padding:0 24px; text-align:center; }
.simple-gate-title { margin:0; font:700 clamp(56px,10.5vw,96px)/1 Manrope,sans-serif; letter-spacing:-.02em; background:linear-gradient(90deg,#8052ff,#9c76ff 25%,#54a7ff 64%,#15846e); -webkit-background-clip:text; background-clip:text; color:transparent; }
.simple-gate-subtitle { margin:16px 0 0; color:#fff; font-size:clamp(17px,2.6vw,22px); font-weight:500; }
.simple-gate-tagline { margin:18px 0 0; color:#8e8e96; font-size:14px; line-height:1.6; }
.simple-gate .google-connect-button { max-width:300px; margin-top:56px; }
.simple-gate .gate-feedback { max-width:320px; }
.gate-eyebrow { display:inline-block; color:#ffb829; font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
.google-connect-button { width:100%; min-height:56px; display:inline-flex; align-items:center; justify-content:center; gap:11px; margin:28px 0 13px; padding:0 20px; border:0; border-radius:999px; background:#fff; color:#1f1f1f; font-size:14px; font-weight:600; letter-spacing:-.01em; box-shadow:0 0 0 1px rgba(255,255,255,.14),0 18px 60px rgba(128,82,255,.20); transition:transform .3s ease,box-shadow .3s ease; }
.google-connect-button:hover { transform:translateY(-2px); box-shadow:0 0 0 1px rgba(255,255,255,.2),0 24px 70px rgba(128,82,255,.32); }
.google-connect-button > svg { width:16px; height:16px; margin-left:auto; color:#8e8e96; }
.google-mark { width:19px; height:19px; display:grid; place-items:center; }
.google-mark svg { width:100%; height:100%; display:block; }
.gate-feedback { min-height:30px; margin:0; color:#8e8e96; text-align:center; font-size:10px; line-height:1.45; }
.gate-feedback[data-tone="error"] { color:var(--red); }
.setup-gate-screen { background:radial-gradient(ellipse at 80% 5%,rgba(224,212,255,.7),transparent 42%),linear-gradient(120deg,#f0edff,#fbfaff 56%,#f0ebff); }
.setup-card { width:min(680px,100%); padding:clamp(24px,5vw,44px); border:1px solid rgba(255,255,255,.96); border-radius:26px; background:rgba(255,255,255,.84); box-shadow:0 22px 65px rgba(68,64,147,.14); backdrop-filter:blur(24px); }
.clinic-setup-card { width:min(600px,100%); }
.setup-heading { display:flex; align-items:flex-start; gap:13px; }
.setup-heading > div:nth-child(2) { flex:1; }
.setup-heading h1 { margin:8px 0 8px; color:var(--ink); font:800 clamp(25px,4vw,36px)/1.1 Manrope,sans-serif; letter-spacing:-1px; }
.setup-heading p { margin:0; color:var(--ink-soft); font-size:13px; line-height:1.5; }
.gate-progress { display:flex; align-items:center; gap:8px; margin:32px 0 25px; padding-bottom:16px; border-bottom:1px solid var(--line); }
.gate-progress span { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:10px; font-weight:700; white-space:nowrap; }
.gate-progress span + span::before { content:'›'; margin-right:5px; color:#c3b9e8; font-size:15px; }
.gate-progress b { width:22px; height:22px; display:grid; place-items:center; border-radius:50%; background:#eeeaff; color:var(--muted); font-size:10px; }
.gate-progress .active { color:var(--purple-dark); }
.gate-progress .active b { color:#fff; background:var(--purple); }
.setup-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; }
.setup-fields label { display:grid; gap:7px; color:var(--ink-soft); font-size:11px; font-weight:700; }
.setup-fields label.full { grid-column:1/-1; }
.setup-fields input { width:100%; height:44px; padding:0 12px; border:1px solid #ded8f3; border-radius:10px; outline:0; color:var(--ink); background:rgba(255,255,255,.9); font-size:13px; }
.setup-fields input:focus { border-color:#8b5cf6; box-shadow:0 0 0 3px rgba(139,92,246,.12); }
.setup-fields input[readonly] { color:var(--ink-soft); background:#f7f5ff; }
.setup-actions { display:flex; justify-content:space-between; gap:10px; margin-top:28px; padding-top:20px; border-top:1px solid var(--line); }
.setup-actions .button.primary { min-width:220px; }

@media (max-width: 820px) {
  .auth-gate-screen { display:block; padding:0; }
}
@media (max-width: 560px) {
  .app-gate-screen { padding:14px; }
  .auth-gate-screen { padding:0; }
  .setup-card { padding:22px 18px; border-radius:20px; }
  .setup-fields { grid-template-columns:1fr; }
  .setup-fields label.full { grid-column:auto; }
  .gate-progress { gap:4px; justify-content:space-between; }
  .gate-progress span { font-size:9px; }
  .gate-progress span + span::before { margin-right:1px; }
  .setup-actions { display:grid; grid-template-columns:1fr; }
  .setup-actions .button.primary { width:100%; }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  font-family: 'DM Sans', system-ui, sans-serif;
  background:
    radial-gradient(ellipse at 23% 18%, rgba(222, 208, 255, .42) 0, rgba(222, 208, 255, 0) 34%),
    radial-gradient(ellipse at 80% 0%, rgba(255, 255, 255, .5) 0, rgba(234, 224, 255, .15) 34%, transparent 62%),
    linear-gradient(115deg, rgba(237,234,255,.45) 0%, rgba(251,250,255,.4) 45%, rgba(240,234,255,.38) 100%),
    url('/waiting-room-background.jpg') center/cover fixed no-repeat;
}
button, input, textarea { font: inherit; }
button { color: inherit; border: 0; cursor: pointer; }
svg { width: 19px; height: 19px; display: block; flex: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); position: relative; overflow: hidden; }
.sidebar {
  margin: 14px 0 14px 14px; min-height: calc(100vh - 28px); padding: 25px 13px 14px;
  background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.92); border-radius: 28px;
  box-shadow: var(--shadow); backdrop-filter: blur(22px); display: flex; flex-direction: column; z-index: 3;
  transition: opacity .22s ease, transform .22s ease;
}
.results-open .sidebar { opacity:0; transform:translateX(-30px); pointer-events:none; visibility:hidden; }
.brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 0 13px 31px; }
.brand strong, .brand small, .profile-switcher strong, .profile-switcher small { display: block; }
.brand strong { font: 700 18px Manrope, sans-serif; letter-spacing: -.5px; }
.brand small { color: var(--ink-soft); font-size: 12px; margin-top: 3px; }
.brand-logo { width: 50px; height: 50px; display: block; object-fit: contain; border-radius: 13px; box-shadow: 0 5px 14px rgba(77,34,117,.22); flex: 0 0 auto; filter: drop-shadow(0 4px 8px rgba(77,34,117,.18)); }
.brand-logo.profile-photo { width:68px; height:68px; border-radius:50%; object-fit:cover; filter:none; }
.patient-consent-brand .consent-logo { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 6px 18px rgba(82,65,145,.22); filter: drop-shadow(0 5px 10px rgba(82,65,145,.18)); }
.doctor-meta span { display:block; }
.doctor-meta span + span { margin-top:2px; color:var(--muted); font-size:10px; }
.brand-mark { width: 31px; height: 34px; position: relative; transform: rotate(-10deg); }
.brand-mark span { position: absolute; display:block; border-radius: 100% 0 100% 0; transform: rotate(-18deg); }
.brand-mark span:nth-child(1){width:18px;height:30px;left:12px;top:0;background:linear-gradient(140deg,#b496ff,#6440e6);}
.brand-mark span:nth-child(2){width:15px;height:25px;left:3px;top:9px;background:linear-gradient(140deg,#d8cfff,#8772ff);}
.brand-mark span:nth-child(3){width:14px;height:18px;left:0;top:19px;background:linear-gradient(140deg,#f1eaff,#8e89e9);}
.nav-list { display: grid; gap: 5px; }
.nav-item { min-height: 47px; border-radius: 13px; padding: 0 15px; display: flex; gap: 17px; align-items: center; background: transparent; color: #36408a; font-size: 14px; text-align: left; transition: .2s ease; }
.nav-item svg { color: #4e5ab6; stroke-width: 2; }
.nav-item:hover { background: rgba(241,238,255,.9); color: var(--purple-dark); }
.nav-item.active { color: var(--purple-dark); background: linear-gradient(100deg,#f2edff,#e8e0ff); box-shadow: inset 0 0 0 1px rgba(126, 93, 255, .04); }
.nav-item.active svg { color: var(--purple); }
.sidebar-quote { margin: auto 0 22px; min-height: 165px; border: 1px solid rgba(255,255,255,.92); border-radius: 17px; overflow: hidden; padding: 58px 17px 18px; position: relative; background: linear-gradient(145deg, rgba(255,255,255,.78), rgba(235,231,255,.65)); }
.quote-shape { position: absolute; width: 165px; height: 76px; right: -37px; top: 18px; border-radius: 100% 0 100% 0; transform: rotate(-20deg); background: linear-gradient(135deg, #d5c6ff, #eff4ff); opacity:.84; }
.sidebar-quote p { margin: 0; position: relative; font-size: 14px; line-height: 1.52; color: #202879; }
.profile-switcher { border-radius: 13px; padding: 10px; display: grid; grid-template-columns: 46px 1fr 17px; align-items: center; gap: 8px; background: transparent; text-align: left; }
.profile-switcher:hover { background: rgba(241,238,255,.8); }
.profile-switcher strong { font-size: 12px; }
.profile-switcher small { color: var(--ink-soft); font-size: 11px; margin-top: 2px; }
.profile-switcher svg { color: var(--purple); }
.avatar, .top-avatar { border-radius: 50%; display: grid; place-items: center; font-weight: 700; }
.doctor-avatar { width: 46px; height: 46px; color: #fff; font-size: 14px; background: linear-gradient(145deg,#5c6da7,#283163); box-shadow: inset 0 0 0 3px #fff; overflow:hidden; }
.doctor-avatar.photo { background:#fff; }
.doctor-avatar img, .top-avatar img { width:100%; height:100%; display:block; object-fit:cover; }

.main-area { min-width: 0; position: relative; z-index: 1; }
.topbar { height: 80px; padding: 20px 28px 0; max-width: 1250px; margin: 0 auto; display: grid; grid-template-columns: max-content minmax(290px,405px) 1fr 140px; align-items: start; gap: 18px; }
.breadcrumb { color: var(--ink-soft); font-size: 12px; display: flex; align-items: center; gap: 8px; padding-top: 12px; opacity: .9; }
.breadcrumb svg { width: 16px; height: 16px; color: var(--purple); }
.global-search { height: 43px; border: 1px solid rgba(255,255,255,.95); border-radius: 10px; background: rgba(255,255,255,.67); display:flex; align-items:center; gap: 10px; padding: 0 11px; box-shadow: 0 6px 18px rgba(93, 84, 177, .06); position: relative; }
.global-search > svg { color: #5263c0; width: 18px; }
.global-search input { min-width: 0; flex:1; border:0; outline:0; background: transparent; color: var(--ink); font-size: 12px; }
.global-search input::placeholder { color: #7079b6; }
kbd { border: 1px solid rgba(108,102,193,.15); background: rgba(255,255,255,.72); border-radius: 5px; padding: 3px 7px; color: #4a54a5; font-size: 11px; white-space: nowrap; }
.global-clock { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; padding-top: 10px; text-align: right; }
.global-clock span { color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.global-clock strong { color: var(--ink); font-size: 16px; font-weight: 800; }
/* grid-column:-2/-1 (a última faixa declarada, sempre) em vez de contar na posição natural: o .mobile-menu
   (1ª coluna) fica display:none no desktop, então some do fluxo do grid e os 3 itens visíveis ocupavam as
   colunas 1-3 em vez de 2-4 — sobrava a faixa da direita (140px) vazia e o avatar/sino ficavam presos mais
   à esquerda do que a borda real do conteúdo. -2/-1 vale tanto para o grid de 4 colunas do desktop quanto
   para os de 3 do mobile, sem depender de quantos itens anteriores estão visíveis. */
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; grid-column: -2 / -1; }
.icon-button { background: transparent; color: #5261b7; position: relative; padding: 10px 3px; }
.icon-button i { position:absolute; right: 0; top: 7px; width: 6px; height: 6px; background: #ec3a75; border: 2px solid #f6f2ff; border-radius: 50%; }
.top-avatar { width: 48px; height: 48px; background: #e6e0ff; color: #19206a; font-size: 16px; border:0; overflow:hidden; padding:0; }
.top-avatar.photo { background:#fff; }
.mobile-menu { display: none; background: transparent; color: var(--purple); }
#header-popover-root { position:absolute; top:68px; right:24px; z-index:20; }
.header-popover { width:min(360px,calc(100vw - 34px)); border:1px solid #e0d9f8; border-radius:16px; background:rgba(255,255,255,.97); box-shadow:0 20px 50px rgba(45,31,120,.18); backdrop-filter:blur(18px); overflow:hidden; }
.header-popover header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:16px 17px; border-bottom:1px solid var(--line); }
.header-popover header > div { display:grid; gap:4px; }
.header-popover header strong { color:var(--ink); font:800 14px Manrope; }
.header-popover header small { color:var(--ink-soft); font-size:10px; }
.popover-close { width:28px; height:28px; display:grid; place-items:center; border-radius:8px; color:var(--ink-soft); background:#f6f3ff; font-size:18px; }
.popover-close:hover { color:var(--purple); background:#eee8ff; }
.notification-popover { width:min(390px,calc(100vw - 34px)); }
.notification-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:9px; padding:15px 16px 10px; }
.notification-grid > div { display:grid; gap:3px; padding:11px 12px; border:1px solid #e6e0f8; border-radius:11px; background:#fbfaff; }
.notification-grid strong { color:var(--purple-dark); font:800 20px Manrope; }
.notification-grid span { color:var(--ink-soft); font-size:10px; line-height:1.25; }
.notification-list { display:grid; gap:0; padding:0 16px; }
.notification-list p { display:flex; align-items:flex-start; gap:8px; margin:0; padding:10px 0; border-top:1px solid #eeeaf8; color:var(--ink-soft); font-size:11px; line-height:1.35; }
.notification-list svg { width:15px; height:15px; color:var(--purple); }
.notification-list b { color:var(--ink); font-weight:700; }
.notification-patricia-section { padding:12px 16px 16px; border-top:1px solid #eeeaf8; }
.notification-patricia-section .pat-sub { margin:0 0 9px; }
.notification-patricia-list { max-height:280px; overflow:auto; padding-right:2px; }
.notification-patricia-list .pat-booking { align-items:flex-start; }
.notification-patricia-list .pat-alert-icon { flex:none; width:26px; height:26px; display:grid; place-items:center; border-radius:50%; background:#f2edff; color:var(--purple); }
.notification-patricia-list .pat-alert-icon svg { width:14px; height:14px; }
.header-popover footer { padding:11px 16px; color:var(--muted); background:#f8f6ff; font-size:10px; }
.profile-popover { width:min(340px,calc(100vw - 34px)); position:relative; }
.profile-popover::before { content:""; position:absolute; top:-7px; right:18px; width:13px; height:13px; border-top:1px solid #e0d9f8; border-left:1px solid #e0d9f8; background:rgba(255,255,255,.97); transform:rotate(45deg); }
.profile-popover-heading { align-items:center !important; }
.profile-popover-heading > div:first-child { flex:1; }
.profile-popover-heading .avatar { width:42px; height:42px; background:#e6e0ff; color:var(--purple-dark); font-size:13px; }
.profile-popover-heading .avatar.photo { background:#fff; }
.profile-popover-heading > div:nth-child(2) { flex:1; }
.profile-header-clinic { display:block; margin-top:2px; color:var(--muted); font-size:10px; }
.profile-photo-control { display:grid; justify-items:center; gap:9px; padding:18px 16px 17px; text-align:center; border-bottom:1px solid var(--line); }
.profile-photo-picker { display:inline-flex; border-radius:50%; cursor:pointer; outline:0; }
.profile-photo-picker:focus-visible { box-shadow:0 0 0 4px rgba(139,92,246,.2); }
.profile-photo-preview { width:88px; height:88px; display:grid; place-items:center; position:relative; overflow:hidden; border:3px solid #eee8ff; border-radius:50%; color:#fff; font-size:22px; font-weight:700; background:linear-gradient(145deg,#5c6da7,#283163); box-shadow:0 8px 18px rgba(71,49,159,.16); }
.profile-photo-preview.has-photo { background:#fff; }
.profile-photo-preview img { width:100%; height:100%; display:block; object-fit:cover; }
.profile-photo-upload-overlay { position:absolute; inset:0; display:grid; place-items:center; color:#fff; background:rgba(74,48,175,.72); opacity:0; transition:opacity .18s ease; pointer-events:none; }
.profile-photo-upload-overlay svg { width:23px; height:23px; stroke-width:2.2; }
.profile-photo-picker:hover .profile-photo-upload-overlay, .profile-photo-picker:focus-within .profile-photo-upload-overlay { opacity:1; }
.profile-photo-input { position:absolute; inset:0; width:100%; height:100%; cursor:pointer; opacity:0; }
.profile-photo-copy { display:grid; min-width:0; gap:2px; text-align:center; }
.profile-photo-copy strong { color:var(--ink); font:800 13px Manrope; }
.profile-photo-copy small { max-width:245px; color:var(--ink-soft); font-size:10px; line-height:1.35; }
.profile-photo-copy .profile-photo-clinic { color:var(--muted); }
.profile-clinic { display:flex; align-items:end; gap:9px; padding:14px 16px; border-bottom:1px solid var(--line); }
.profile-clinic label { display:grid; flex:1; gap:6px; color:var(--ink-soft); font-size:10px; }
.profile-clinic select, .profile-clinic input { width:100%; height:37px; padding:0 9px; border:1px solid #ded8f3; border-radius:9px; color:var(--ink); background:#fff; font:500 11px Manrope; outline:0; }
.profile-clinic input:focus { border-color:#8b5cf6; box-shadow:0 0 0 3px rgba(139,92,246,.12); }
.profile-menu-item { width:100%; display:flex; align-items:center; gap:9px; padding:12px 16px; color:var(--ink-soft); background:transparent; text-align:left; font-size:11px; }
.profile-menu-item:hover { color:var(--purple-dark); background:#f7f3ff; }
.profile-menu-item svg { width:16px; height:16px; color:var(--purple); }
.google-auth-button { width:calc(100% - 26px); margin:13px; display:flex; align-items:center; gap:10px; padding:11px 12px; border:1px solid #ddd4ff; border-radius:12px; color:var(--purple-dark); background:linear-gradient(135deg,#fbf9ff,#f2edff); text-align:left; }
.google-auth-button:hover { border-color:#a879ff; background:#f5efff; }
.google-auth-button > svg { flex:0 0 auto; width:18px; height:18px; color:var(--purple); }
.google-auth-button > span { display:grid; flex:1; gap:2px; }
.google-auth-button strong { font-size:11px; font-weight:800; }
.google-auth-button small { color:var(--ink-soft); font-size:9px; line-height:1.35; }
.google-auth-button > svg:last-child { width:14px; height:14px; color:var(--ink-soft); }
.google-account-card { display:flex; align-items:center; gap:9px; margin:13px; padding:9px 10px; border:1px solid #ded8f3; border-radius:12px; background:#faf9ff; }
.google-account-avatar { width:30px; height:30px; display:grid; place-items:center; overflow:hidden; border-radius:50%; color:var(--purple); background:#ebe5ff; }
.google-account-avatar img { width:100%; height:100%; object-fit:cover; }
.google-account-avatar svg { width:15px; height:15px; }
.google-account-card > div:nth-child(2) { display:grid; flex:1; min-width:0; gap:2px; }
.google-account-card strong { font-size:10px; color:var(--ink); }
.google-account-card small { overflow:hidden; color:var(--ink-soft); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.profile-google-logout { padding:5px 6px; border:0; border-radius:7px; color:var(--purple); background:transparent; font-size:9px; }
.profile-google-logout:hover { background:#eee8ff; }
.profile-menu-note { padding:11px 16px; color:var(--muted); background:#f8f6ff; font-size:10px; }
.profile-modal-backdrop { position:fixed; inset:0; z-index:40; display:grid; place-items:center; padding:24px; background:rgba(47,39,105,.26); backdrop-filter:blur(5px); }
body.medication-catalog-open { overflow:hidden; }
.profile-modal { width:min(600px,100%); max-height:calc(100vh - 48px); overflow:auto; padding:22px; border:1px solid rgba(255,255,255,.95); border-radius:20px; background:linear-gradient(145deg,#fff,#f8f6ff); box-shadow:0 24px 70px rgba(39,27,113,.25); }
.profile-modal.compact { width:min(420px,100%); }
.profile-modal-header { display:flex; align-items:flex-start; gap:12px; }
.profile-modal-header > div:nth-child(2) { flex:1; }
.profile-modal-header h2 { margin:0 0 5px; color:var(--ink); font:800 19px Manrope; }
.profile-modal-header p { margin:0; color:var(--ink-soft); font-size:11px; line-height:1.4; }
.profile-modal-header .dialog-close { margin-left:auto; }
.content { padding: 5px 28px 30px; max-width: 1250px; margin: 0 auto; }
.page-heading { display:flex; justify-content: space-between; align-items:flex-end; gap: 20px; margin: 0 2px 21px; }
.page-heading h1 { margin:0; font: 800 30px/1.15 Manrope, sans-serif; letter-spacing: -1.3px; }
.page-heading p { margin: 7px 0 0; color: var(--ink-soft); font-size: 15px; }
.date-note { color: var(--ink-soft); font-size:12px; font-weight:600; text-align:right; }
.date-note strong { display:block; font-size: 20px; color: var(--ink); margin-top: 3px; }
.page-actions { display:flex; gap: 10px; align-items:center; }
.button { min-height: 40px; border: 1px solid rgba(105,90,216,.14); padding: 0 17px; border-radius: 10px; background: rgba(255,255,255,.66); color: var(--purple-dark); display:inline-flex; align-items:center; justify-content:center; gap:8px; font-size:13px; font-weight:600; transition:.2s ease; }
.button:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(85,55,200,.12); }
.button.primary { color:#fff; border:0; background: linear-gradient(100deg,#be4df3,#4b78ed); box-shadow: 0 8px 22px rgba(117,64,235,.23); }
.button.primary:hover { filter: brightness(1.03); }
.button.ghost { background: rgba(255,255,255,.46); }
.button.danger { color: var(--red); }
.button.small { min-height: 33px; padding: 0 12px; font-size: 12px; }

.metric-grid { display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.metric-grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.metric-card, .card { background: var(--panel); border: 1px solid rgba(255,255,255,.9); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.metric-card { min-height: 101px; display:grid; grid-template-columns: 56px 1fr; align-items:center; padding: 15px; gap: 12px; }
.metric-icon { width: 52px; height: 52px; border-radius: 50%; display:grid; place-items:center; background: linear-gradient(145deg,#faf8ff,#ece6ff); color: var(--purple); }
.metric-icon svg { width:25px; height:25px; }
.metric-card strong { font: 800 22px Manrope, sans-serif; display:block; letter-spacing:-.5px; }
.metric-card span { display:block; color: var(--ink-soft); font-size: 12px; margin-top: 4px; line-height:1.35; }
.progress { height: 5px; background: #e8e3fb; border-radius:99px; margin-top:8px; display:flex; align-items:center; gap: 7px; }
.progress i { display:block; height:100%; width:100%; background:linear-gradient(90deg,#633cff,#a55eff); border-radius:99px; }
.progress em { color: var(--ink-soft); font-size:10px; font-style:normal; margin-top:-1px; }
.dashboard-grid, .waiting-layout { display:grid; grid-template-columns: minmax(0, 1.55fr) minmax(265px, .65fr); gap: 14px; }
/* Sala de espera: os 3 blocos de métrica + o card "Sala de espera" ficam empilhados na coluna da esquerda
   (mesma largura do card "Sala de espera"); "Próximo paciente" é o item da direita, que por padrão do grid
   (align-items:stretch) já cresce para acompanhar a altura dessa coluna inteira, sem precisar de altura fixa. */
.waiting-main { display:grid; gap:14px; }
.waiting-main .metric-grid { margin-bottom:0; }
.card { padding: 17px 18px; }
.card-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:14px; }
.card-heading h2 { margin:0; font:700 16px Manrope, sans-serif; letter-spacing:-.4px; }
.card-heading a, .link-button { color: var(--purple-dark); background:transparent; font-size:12px; }
.settings-back-link { display:inline-block; margin-bottom:8px; padding:0; font-weight:700; }
.appointment-list { border-top: 1px solid var(--line); }
.appointment-row { min-height: 62px; display:grid; grid-template-columns: 55px minmax(130px,1fr) 125px 97px 24px; gap: 10px; align-items:center; border-bottom:1px solid var(--line); font-size:12px; }
.appointment-row.waiting-room-row, .appointment-row.dashboard-row:has(.waiting-start) { grid-template-columns:55px minmax(130px,1fr) 125px 165px 24px; }
.arrival-time { color:var(--purple) !important; font-weight:700; }
.appointment-row:last-child { border-bottom:0; }
.appointment-time { color: #23317f; font-weight:600; }
.patient-cell { display:flex; gap:10px; align-items:center; min-width:0; }
.patient-cell > div:last-child { min-width:0; }
.avatar.patient-avatar { width:34px; height:34px; background: linear-gradient(145deg,#efeaff,#dcd3ff); color:#4f40bf; font-size:11px; }
.patient-avatar.photo { background: linear-gradient(145deg,#efeaff,#dcd3ff); color:#4f40bf; }
.patient-cell strong { display:block; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.patient-cell small { color:var(--ink-soft); display:block; margin-top:3px; }
.status { display:inline-flex; align-items:center; gap:7px; border-radius:99px; padding:6px 9px; white-space:nowrap; font-size:11px; color:#16876f; background:#def6ee; }
.status::before { content:''; width:7px; height:7px; border-radius:50%; background:currentColor; }
.status.blue { color:#216ed5; background:#e0edff; }
.status.purple { color:#7132e7; background:#eee5ff; }
.status.amber { color:#c77d00; background:#fff0d5; }
.status.red { color:#db3050; background:#ffe1e9; }
.status.gray { color:#6c7090; background:#edeef6; }
.status.white { color:#6c7090; background:#fff; border:1px solid #dfe0ec; }
.row-more { background:transparent; color:#4554ad; font-size:17px; letter-spacing:2px; }
.next-card { min-height: 430px; }
.next-patient { display:flex; align-items:center; gap:10px; padding-bottom:14px; border-bottom:1px solid var(--line); }
.next-patient .patient-avatar { width: 48px; height:48px; }
.next-patient strong { font-size:14px; display:block; }
.next-patient small { color:var(--ink-soft); display:block; margin-top:4px; }
.next-time { margin-left:auto; color: var(--ink-soft); font-size:11px; text-align:right; }
.next-time strong { display:block; color:var(--ink); font-size:15px; margin-top:4px; }
.quick-info { padding:15px 0; border-bottom: 1px solid var(--line); }
.quick-info h3, .mini-heading { font:700 13px Manrope, sans-serif; margin:0 0 10px; }
.quick-info h3 small { float:right; color:var(--purple); font:700 10px Manrope, sans-serif; }
.quick-info p { margin:8px 0; color:var(--ink-soft); font-size:12px; display:flex; align-items:center; gap:8px; }
.quick-info p svg { width:15px; height:15px; color:var(--purple); }
.preconsultation-briefing { margin:14px 0 0; padding:13px 0 14px; border-bottom:1px solid var(--line); }
.preconsultation-briefing.empty { padding-bottom:14px; }
.preconsultation-heading { display:flex; align-items:center; gap:9px; min-width:0; }
.preconsultation-heading > div { min-width:0; flex:1; }
.briefing-icon { width:29px; height:29px; display:grid; place-items:center; flex:0 0 auto; border-radius:10px; color:var(--purple); background:#eee8ff; }
.briefing-icon svg { width:16px; height:16px; }
.preconsultation-heading h3 { margin:0; color:var(--ink); font:700 12px Manrope, sans-serif; }
.preconsultation-heading small { display:block; margin-top:3px; color:var(--purple); font:700 9px Manrope, sans-serif; }
.briefing-date { flex:0 0 auto; color:var(--muted); font-size:9px; white-space:nowrap; }
.preconsultation-summary { margin:10px 0 9px; color:var(--ink); font-size:11px; line-height:1.45; }
.preconsultation-facts { display:grid; gap:6px; }
.preconsultation-facts span { display:grid; gap:2px; color:var(--ink-soft); font-size:10px; line-height:1.3; }
.preconsultation-facts strong { color:var(--ink); font:700 10px Manrope, sans-serif; }
.preconsultation-focus { margin-top:10px; padding:9px 10px; border:1px solid #e3dcff; border-radius:10px; background:rgba(244,240,255,.62); }
.preconsultation-focus > span { display:flex; align-items:center; gap:5px; color:var(--purple-dark); font:700 10px Manrope, sans-serif; }
.preconsultation-focus > span svg { width:13px; height:13px; }
.preconsultation-focus ul { margin:6px 0 0 16px; padding:0; color:var(--ink-soft); font-size:10px; line-height:1.4; }
.preconsultation-focus li + li { margin-top:3px; }
.preconsultation-update { margin-top:10px; padding:9px 10px; border:1px solid #cfe9e2; border-radius:10px; background:rgba(237,250,245,.65); }
.preconsultation-update > span { display:flex; align-items:center; gap:5px; color:#157a61; font:700 10px Manrope, sans-serif; }
.preconsultation-update > span svg { width:13px; height:13px; }
.preconsultation-update ul { display:grid; gap:6px; margin:7px 0 0; padding:0; list-style:none; }
.preconsultation-update li { display:grid; gap:1px; color:var(--ink); font-size:10.5px; line-height:1.4; }
.preconsultation-update li strong { color:var(--ink-soft); font:700 9.5px Manrope, sans-serif; text-transform:uppercase; letter-spacing:.2px; }
.preconsultation-empty-copy { margin:10px 0 0; color:var(--ink-soft); font-size:11px; line-height:1.45; }
.next-card .button { width:100%; margin-top:11px; }
.next-patient-hint { display:flex; align-items:center; gap:6px; margin-top:11px; padding:10px 11px; border:1px dashed var(--line); border-radius:10px; color:var(--muted); font-size:10.5px; line-height:1.4; }
.next-patient-hint svg { width:14px; height:14px; flex:none; }
.lower-grid { display:grid; grid-template-columns: 1fr 1fr; gap:14px; margin-top:14px; }
.dashboard-followup-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:14px; }
.dashboard-followup-card { min-width:0; }
.dashboard-followup-card .card-heading { align-items:flex-start; margin-bottom:13px; }
.dashboard-followup-card .card-heading > div { min-width:0; }
.dashboard-followup-card .card-heading p { margin:5px 0 0; color:var(--ink-soft); font-size:10px; line-height:1.4; }
.dashboard-card-count { min-width:27px; height:27px; display:grid; place-items:center; flex:0 0 auto; border:1px solid var(--line); border-radius:9px; color:var(--muted); background:rgba(255,255,255,.38); font:800 12px Manrope; }
.dashboard-card-count.has-items { color:var(--purple-dark); border-color:#d9cffb; background:#f0ebff; }
.dashboard-followup-list { display:grid; gap:8px; }
.dashboard-followup-item { min-width:0; display:grid; grid-template-columns:34px minmax(0,1fr) auto; align-items:center; gap:9px; padding:9px 10px; border:1px solid var(--line); border-radius:11px; background:rgba(255,255,255,.34); }
.dashboard-followup-icon { width:31px; height:31px; display:grid; place-items:center; border-radius:10px; color:var(--purple); background:#eee8ff; }
.dashboard-followup-icon svg { width:16px; height:16px; }
.dashboard-followup-icon.danger { color:#cb3d58; background:#ffe9ef; }
.dashboard-followup-icon.attention { color:#c27b08; background:#fff2d9; }
.dashboard-followup-item > div { min-width:0; display:grid; gap:3px; }
.dashboard-followup-item strong { overflow:hidden; color:var(--ink); font:700 11px Manrope; text-overflow:ellipsis; white-space:nowrap; }
.dashboard-followup-item small { overflow:hidden; color:var(--ink-soft); font-size:10px; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
.dashboard-followup-tag { max-width:150px; overflow:hidden; padding:5px 7px; border-radius:99px; color:var(--purple-dark); background:#f0ebff; font-size:9px; font-weight:700; text-align:center; text-overflow:ellipsis; white-space:nowrap; }
.dashboard-followup-tag.pending { color:#7652d4; background:#f1ebff; }
.dashboard-followup-tag.danger { color:#bd3c56; background:#ffe8ee; }
.dashboard-followup-tag.attention { color:#a86b08; background:#fff1d6; }
.dashboard-followup-empty { display:flex; align-items:flex-start; gap:9px; min-height:76px; padding:13px; border:1px dashed #cfc8ee; border-radius:11px; color:var(--muted); background:rgba(250,248,255,.44); }
.dashboard-followup-empty > svg { width:17px; height:17px; flex:none; margin-top:1px; color:var(--teal); }
.dashboard-followup-empty div { display:grid; gap:4px; }
.dashboard-followup-empty strong { color:var(--ink); font:700 11px Manrope; }
.dashboard-followup-empty span { font-size:10px; line-height:1.4; }
html[data-theme="dark"] .dashboard-card-count { background:rgba(40,43,83,.72); }
html[data-theme="dark"] .dashboard-card-count.has-items { color:#ded7ff; border-color:#514a82; background:#332b63; }
html[data-theme="dark"] .dashboard-followup-item { border-color:rgba(196,192,255,.16); background:rgba(35,39,79,.58); }
html[data-theme="dark"] .dashboard-followup-empty { border-color:#514a82; background:rgba(35,39,79,.46); }
html[data-theme="dark"] .dashboard-followup-tag.pending { color:#ddd4ff; background:#332b63; }
html[data-theme="dark"] .dashboard-followup-tag.danger { color:#ffc3d0; background:#532c4a; }
html[data-theme="dark"] .dashboard-followup-tag.attention { color:#ffda91; background:#4d3b26; }
html[data-theme="dark"] .dashboard-followup-icon.danger { color:#ff9aae; background:#532c4a; }
html[data-theme="dark"] .dashboard-followup-icon.attention { color:#ffd27f; background:#4d3b26; }
.donut-wrap { display:flex; align-items:center; gap:17px; }
.donut { width:110px; height:110px; flex:none; border-radius:50%; background: conic-gradient(#7754f5 0 32%,#8e9dfa 32% 60%,#b4b8ff 60% 78%,#e6e8ff 78% 100%); position:relative; display:grid; place-items:center; }
.donut::after { content:''; width:74px; height:74px; border-radius:50%; background:#f9f8ff; position:absolute; }
.donut-label { position:relative; z-index:1; text-align:center; }
.donut-label strong { font:700 18px Manrope; display:block; }
.donut-label small { color:var(--ink-soft); font-size:10px; }
.legend-list { display:grid; gap:8px; width:100%; }
.legend-list div { display:grid; grid-template-columns: 10px 1fr auto; gap:8px; align-items:center; color:var(--ink-soft); font-size:11px; }
.legend-list i { width:9px; height:9px; border-radius:50%; background:#7f56f5; }
.legend-list b { color:var(--ink); font-weight:500; }
.bar-chart { height:142px; display:flex; align-items:flex-end; justify-content:space-around; padding: 18px 2px 0; border-bottom:1px solid var(--line); }
.bar-chart .chart-bar { height:100%; min-width:30px; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:7px; color:var(--ink-soft); font-size:10px; position:relative; outline:0; }
.bar-chart .chart-bar i { width:24px; height:var(--h); border-radius:6px 6px 0 0; background:linear-gradient(#dbd6fb,#cbc9f9); transition:filter .2s ease, transform .2s ease; }
.bar-chart .chart-bar i.highlight { background:linear-gradient(#b760f1,#8150ee); }
.bar-chart .chart-bar:hover i, .bar-chart .chart-bar:focus i { filter:brightness(1.04); transform:translateY(-2px); }
.chart-tooltip { position:absolute; bottom:calc(var(--h) + 25px); left:50%; transform:translateX(-50%) translateY(4px); opacity:0; pointer-events:none; white-space:nowrap; color:#fff; background:#1a216d; border-radius:7px; padding:7px 9px; font-size:10px; font-weight:600; box-shadow:0 8px 18px rgba(31,32,113,.2); transition:.18s ease; z-index:2; }
.chart-tooltip::after { content:''; position:absolute; left:50%; bottom:-4px; width:8px; height:8px; background:#1a216d; transform:translateX(-50%) rotate(45deg); }
.bar-chart .chart-bar:hover .chart-tooltip, .bar-chart .chart-bar:focus .chart-tooltip { opacity:1; transform:translateX(-50%) translateY(0); }
.task-list { display:grid; gap:10px; }
.task-row { display:flex; align-items:center; gap:7px; min-width:0; }
.task { display:flex; gap:8px; align-items:center; color:var(--ink-soft); font-size:12px; cursor:pointer; }
.task span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.task span.done { color:#969ac4; text-decoration:line-through; }
.task input { appearance:none; width:18px; height:18px; border:1px solid #9a9de0; border-radius:4px; background:#fff; position:relative; flex:none; }
.task input:checked { border-color:#7450e9; background:#7450e9; }
.task input:checked::after { content:'✓'; color:#fff; position:absolute; left:3px; top:-1px; font-size:14px; }
.task-row .task { min-width:0; flex:1; }
.reminder-actions { display:flex; gap:2px; opacity:0; transition:.18s ease; }
.task-row:hover .reminder-actions, .task-row.editing .reminder-actions { opacity:1; }
.reminder-action { width:26px; height:26px; display:grid; place-items:center; border-radius:6px; color:#7378b4; background:transparent; }
.reminder-action:hover { color:var(--purple-dark); background:#eee9ff; }
.reminder-action.delete:hover { color:var(--red); background:#ffe8ef; }
.reminder-action.save { color:var(--teal); }
.reminder-action svg { width:14px; height:14px; }
.reminder-edit-input { min-width:0; flex:1; height:31px; border:1px solid #cfc9f1; border-radius:7px; padding:0 9px; outline:0; background:#fff; color:var(--ink); font-size:12px; }
.reminder-edit-input:focus { border-color:var(--purple); box-shadow:0 0 0 3px #eee9ff; }
.add-reminder { margin-top:12px; border:1px dashed #bcb6e9; border-radius:8px; padding:8px 10px; background:transparent; color:var(--purple-dark); display:inline-flex; align-items:center; gap:6px; font-size:11px; }
.add-reminder:hover { background:#f3efff; }
.add-reminder svg { width:14px; height:14px; }

.agenda-toolbar { display:flex; gap:12px; align-items:center; margin-bottom:12px; }
.date-control { height:43px; display:flex; align-items:center; gap:12px; padding:0 12px; border-radius:10px; background:rgba(255,255,255,.66); border:1px solid rgba(255,255,255,.9); color:var(--ink); font-size:12px; font-weight:600; }
.date-control button { background:transparent; color:var(--purple-dark); display:grid; place-items:center; }
.view-switch { margin-left:auto; display:flex; padding:2px; background:rgba(255,255,255,.65); border:1px solid rgba(255,255,255,.9); border-radius:10px; }
.view-switch button { padding:9px 17px; background:transparent; color:var(--ink-soft); border-radius:8px; font-size:12px; }
.view-switch button.active { background:#eee7ff; color:var(--purple-dark); box-shadow:0 2px 6px rgba(90,65,207,.10); }
.agenda-layout { display:grid; grid-template-columns:minmax(0, 1fr) 258px; gap:14px; }
.list-board { padding:0; overflow:hidden; }
.list-board .card-heading { padding:17px 18px 0; }
.month-board { padding:18px; }
.month-board-head { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:18px; }
.month-board-head h2 { margin:0; font:700 16px Manrope, sans-serif; }
.month-board-head span { color:var(--ink-soft); font-size:11px; }
.month-board-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:8px; }
.month-day { min-height:72px; border:1px solid var(--line); border-radius:10px; background:rgba(255,255,255,.55); text-align:left; padding:9px; color:var(--ink); }
.month-day:hover { background:#f1ecff; border-color:#cfc5ff; }
.month-day strong { display:block; font-size:12px; }
.month-day small { display:block; color:var(--purple-dark); font-size:10px; margin-top:22px; }
.month-day.muted { color:#b0b3ce; background:rgba(245,244,252,.42); }
.month-day.selected { border:2px solid var(--purple); background:#efe8ff; }
.day-grid { padding: 0; overflow:hidden; }
.day-grid-header { display:grid; grid-template-columns:72px 1fr; padding:14px 16px 8px; border-bottom:1px solid var(--line); color:var(--ink-soft); font-size:11px; }
.day-grid-header strong { color:var(--ink); font-size:13px; }
.time-list { position:relative; }
.time-row { min-height:55px; display:grid; grid-template-columns:72px 1fr; border-bottom:1px solid var(--line); }
.time-row > span { padding:14px 0 0 16px; color:var(--ink-soft); font-size:11px; }
.slot { margin:5px 8px 5px 0; min-height:45px; border-radius:5px; display:grid; grid-template-columns:42px minmax(80px,1fr) auto; gap:8px; align-items:center; padding:4px 10px; background:linear-gradient(90deg,#dff7f0,#d7f0ed); border-left:3px solid var(--teal); font-size:11px; }
.slot.blue { background:linear-gradient(90deg,#e0edff,#d6eaff); border-left-color:var(--blue); }
.slot.purple { background:linear-gradient(90deg,#eee5ff,#e9defd); border-left-color:var(--purple); }
.slot.amber { background:linear-gradient(90deg,#fff5e6,#ffecd6); border-left-color:var(--amber); }
.slot.red { background:linear-gradient(90deg,#ffe5ed,#ffdce8); border-left-color:var(--red); }
.slot.white { background:#fff; border-left-color:#cfd1df; box-shadow:inset 0 0 0 1px #e5e6ef; }
.slot > span:first-child { color:var(--ink-soft); }
.slot strong { display:block; font-size:11px; }
.slot small { display:block; color:var(--ink-soft); margin-top:2px; }
.slot .status { justify-self:end; font-size:10px; padding:5px 7px; }
.lunch { min-height:44px; margin:5px 8px 5px 0; border-radius:5px; background:#e4e5f2; color:#65709f; display:flex; align-items:center; gap:10px; padding:4px 15px; font-size:11px; }
.mini-calendar { padding: 16px; }
.mini-calendar .month-title { display:flex; justify-content:space-between; align-items:center; font:700 14px Manrope; margin-bottom:14px; }
.mini-calendar .month-title div { display:flex; gap:5px; }
.calendar-nav { width:26px; height:26px; border:1px solid var(--line); border-radius:50%; background:rgba(255,255,255,.6); display:grid; place-items:center; color:var(--purple); }
.calendar-days, .calendar-dates { display:grid; grid-template-columns:repeat(7,1fr); gap:7px 3px; text-align:center; }
.calendar-days { color:var(--ink-soft); font-size:9px; margin-bottom:8px; }
.calendar-dates button { width:26px; height:26px; background:transparent; color:var(--ink); font-size:11px; border-radius:50%; margin:auto; }
.calendar-dates button:hover { background:#eee8ff; }
.calendar-dates button.selected { background:linear-gradient(145deg,#9960f0,#653ce8); color:#fff; box-shadow:0 4px 9px rgba(95,57,216,.24); }
.calendar-dates button.muted { color:#b0b3ce; }
.side-info { margin-top:14px; }
.side-info .mini-heading { margin-bottom:14px; }
.status-legend { display:grid; gap:10px; }
.status-legend div { display:grid; grid-template-columns:12px 1fr auto; gap:7px; align-items:center; font-size:10px; color:var(--ink-soft); }
.status-legend i { width:10px; height:10px; border-radius:50%; background:#12b28a; box-shadow:0 0 0 4px #d9f5ec; }
.status-legend i.purple { background:#743cff; box-shadow:0 0 0 4px #eee3ff; }
.status-legend i.blue { background:#2d82ef; box-shadow:0 0 0 4px #e0edff; }
.status-legend i.amber { background:#eca016; box-shadow:0 0 0 4px #fff0d4; }
.status-legend i.red { background:#f14562; box-shadow:0 0 0 4px #ffe0e8; }
.status-legend i.gray { background:#6d7190; box-shadow:0 0 0 4px #e7e8f0; }
.status-legend strong { font-size:10px; color:var(--ink); }

.week-board { padding: 0; overflow:hidden; }
.week-head { display:grid; grid-template-columns:55px repeat(5,1fr); border-bottom:1px solid var(--line); }
.week-head > div { padding:13px 7px 10px; text-align:center; color:var(--ink-soft); font-size:10px; border-left:1px solid var(--line); }
.week-head strong { display:block; color:var(--ink); font-size:12px; margin-top:4px; }
.week-body { display:grid; grid-template-columns:55px repeat(5,1fr); min-height: 590px; }
.week-times { display:grid; grid-template-rows:repeat(9,1fr); color:var(--ink-soft); font-size:10px; }
.week-times span { padding:13px 0 0 11px; border-bottom:1px solid var(--line); }
.week-column { border-left:1px solid var(--line); display:grid; grid-template-rows:repeat(9,1fr); }
.week-column > div { border-bottom:1px solid var(--line); padding:5px; }
.week-slot { border-radius:5px; border-left:3px solid var(--teal); background:#ddf5ef; padding:7px 6px; font-size:10px; min-height:42px; }
.week-slot.blue { border-left-color:var(--blue); background:#e0edff; }
.week-slot.purple { border-left-color:var(--purple); background:#eee5ff; }
.week-slot.white { border-left-color:#cfd1df; background:#fff; box-shadow:inset 0 0 0 1px #e5e6ef; }
.week-slot strong { display:block; font-size:10px; }
.week-slot small { display:block; color:var(--ink-soft); margin-top:3px; }
.week-slot.lunch { min-height:42px; padding:7px 5px; background:#e7e8f2; border-left:0; display:block; }
.week-slot.is-off { min-height:42px; padding:7px 6px; background:repeating-linear-gradient(135deg,#f1f1f6,#f1f1f6 6px,#e8e8ef 6px,#e8e8ef 12px); border-left:3px solid #cfd1df; display:flex; align-items:center; }
.week-slot.is-off span { color:var(--muted); font-size:10px; }
.week-head > div.is-off-day { color:var(--muted); background:#f7f7fb; }
.week-head > div.is-off-day strong { color:var(--muted); }

.patients-toolbar { display:flex; gap:10px; align-items:center; margin-bottom:14px; }
.inner-search { min-width:240px; height:40px; border:1px solid rgba(255,255,255,.92); background:rgba(255,255,255,.67); border-radius:10px; display:flex; align-items:center; padding:0 11px; gap:8px; }
.inner-search svg { color:var(--purple); }
.inner-search input { border:0; background:transparent; outline:0; flex:1; min-width:0; color:var(--ink); font-size:12px; }
.filter-pill { height:40px; border:1px solid rgba(255,255,255,.92); background:rgba(255,255,255,.55); border-radius:10px; padding:0 14px; color:var(--ink-soft); font-size:12px; }
.patients-table { padding:0; overflow:hidden; }
.table-head, .patient-table-row { display:grid; grid-template-columns: 2.1fr 1fr 1fr 1.15fr 1fr 26px; gap:12px; align-items:center; padding:0 17px; }
.table-head { min-height:42px; background:rgba(245,243,255,.74); color:var(--ink-soft); font-size:10px; text-transform:uppercase; letter-spacing:.4px; }
.patient-table-row { min-height:73px; border-top:1px solid var(--line); font-size:12px; }
.patient-table-row:hover { background:rgba(245,242,255,.45); }
.patient-table-row .patient-cell { font-size:12px; }
.patient-table-row .muted { color:var(--ink-soft); font-size:11px; }
.patient-directory-head, .patient-directory-row { grid-template-columns: 2.1fr 1fr 1fr; }
.patient-directory-head > span:first-child { padding-left:14px; }
.patient-directory-row > .patient-cell { padding-left:14px; }
.patient-directory-row { cursor:pointer; }
.patient-directory-row:hover { background:rgba(245,242,255,.45); }
.waiting-actions { position:relative; justify-self:end; }
.waiting-action-menu { position:absolute; top:calc(100% + 7px); right:0; z-index:20; min-width:168px; padding:5px; border:1px solid #e2dcfb; border-radius:11px; background:rgba(255,255,255,.98); box-shadow:0 14px 30px rgba(55,43,135,.16); }
.waiting-action-menu[hidden] { display:none; }
.waiting-action-menu button { width:100%; display:flex; align-items:center; gap:7px; padding:9px 10px; border-radius:8px; color:#6e2db7; background:transparent; text-align:left; font-size:11px; }
.waiting-action-menu button:hover { background:#f5efff; }
.waiting-action-menu svg { width:15px; height:15px; }
.patient-edit-backdrop { position:fixed; inset:0; z-index:60; display:grid; place-items:center; padding:20px; background:rgba(36,32,82,.43); backdrop-filter:blur(9px); }
.patient-edit-dialog { width:min(720px,100%); max-height:calc(100vh - 40px); overflow:auto; padding:24px; border:1px solid rgba(255,255,255,.95); border-radius:22px; background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(248,246,255,.96)); box-shadow:0 24px 70px rgba(40,27,122,.22); }
.patient-edit-header { display:flex; align-items:flex-start; gap:12px; padding-bottom:18px; border-bottom:1px solid var(--line); }
.patient-edit-header h2 { margin:0 0 5px; font:800 20px Manrope; color:var(--ink); }
.patient-edit-header p { margin:0; color:var(--ink-soft); font-size:12px; }
.patient-edit-header .dialog-close { margin-left:auto; }
.history-backdrop { position:fixed; inset:0; z-index:65; display:grid; place-items:center; padding:20px; background:rgba(36,32,82,.43); backdrop-filter:blur(9px); }
.history-dialog { width:min(760px,100%); max-height:calc(100vh - 40px); overflow:auto; padding:24px; border:1px solid rgba(255,255,255,.95); border-radius:22px; background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(248,246,255,.96)); box-shadow:0 24px 70px rgba(40,27,122,.22); scrollbar-width:thin; scrollbar-color:#8d72f4 rgba(229,224,255,.62); }
.history-dialog::-webkit-scrollbar { width:10px; }
.history-dialog::-webkit-scrollbar-track { background:#f0ecff; border-radius:99px; margin:9px 0; }
.history-dialog::-webkit-scrollbar-thumb { border:2px solid transparent; border-radius:99px; background:linear-gradient(180deg,#c084fc,#765ee8); background-clip:padding-box; }
.history-header { display:flex; align-items:flex-start; gap:12px; padding-bottom:18px; border-bottom:1px solid var(--line); }
.history-header h2 { margin:0 0 5px; font:800 20px Manrope; color:var(--ink); }
.history-header p { margin:0; color:var(--ink-soft); font-size:12px; }
.history-header .dialog-close { margin-left:auto; }
.history-list { display:grid; gap:12px; padding:18px 0; }
.history-visit { padding:16px; border:1px solid #e2ddf6; border-radius:16px; background:linear-gradient(135deg,#fff,#faf8ff); }
.history-visit-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding-bottom:12px; border-bottom:1px solid #ece9f7; }
.history-visit-head div { display:grid; gap:3px; }
.history-visit-head span:first-child { color:var(--purple); font-size:11px; font-weight:700; }
.history-visit-head strong { color:var(--ink); font:800 15px Manrope; }
.history-badge { color:#16876f; background:#def6ee; border-radius:99px; padding:5px 9px; font-size:10px; white-space:nowrap; }
.history-fields { display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:14px 0; }
.history-fields div { display:grid; gap:4px; }
.history-fields small, .history-transcript small { color:var(--ink-soft); font-size:10px; }
.history-fields strong { color:var(--ink); font-size:12px; }
.history-full-record { margin:2px 0 14px; padding:13px 14px; border:1px solid #e2dcf8; border-radius:13px; background:#fbfaff; }
.history-full-record h3 { margin:0 0 10px; color:var(--purple-dark); font:800 12px Manrope; }
.history-full-field { display:grid; gap:4px; padding:9px 0; border-top:1px solid #ece9f7; }
.history-full-field:first-of-type { padding-top:0; border-top:0; }
.history-full-field small { color:var(--ink-soft); font-size:10px; font-weight:700; }
.history-full-field p { margin:0; color:var(--ink-soft); font-size:11px; line-height:1.55; }
.history-insights { padding-top:11px; border-top:1px solid #ece9f7; }
.history-insights h3 { margin:0 0 7px; color:var(--ink); font:700 12px Manrope; }
.history-insights ul { margin:0; padding-left:17px; color:var(--ink-soft); font-size:11px; line-height:1.55; }
.history-transcript { margin-top:12px; padding:11px 12px; border-radius:11px; background:#f5f1ff; }
.history-transcript p { margin:5px 0 0; color:var(--ink-soft); font-size:11px; line-height:1.5; }
.history-empty { padding:38px 18px; text-align:center; color:var(--ink-soft); }
.history-empty .dialog-heading-icon { margin:0 auto 10px; }
.history-empty h3 { margin:0 0 5px; color:var(--ink); font:800 15px Manrope; }
.history-empty p { margin:0; font-size:12px; }
.history-footer { display:flex; justify-content:flex-end; gap:9px; padding-top:15px; border-top:1px solid var(--line); }
.patient-edit-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; padding:20px 0; }
.patient-edit-grid label { display:grid; gap:7px; color:var(--ink-soft); font-size:11px; }
.patient-edit-grid label[data-minor-fields][hidden] { display:none !important; }
.patient-identity-lookup { min-height:16px; margin-top:-7px; color:var(--ink-soft); font-size:10px; line-height:1.4; }
.patient-identity-lookup.success { color:#078c75; }
.patient-identity-lookup.loading { color:#6441d8; }
.patient-identity-lookup.error { color:#c63b50; }
.patient-identity-lookup.hint { color:#6d6b9c; }
.patient-address-lookup { min-height:16px; margin-top:-7px; color:var(--ink-soft); font-size:10px; line-height:1.4; }
.patient-address-lookup.success { color:#078c75; }
.patient-address-lookup.loading { color:#6441d8; }
.patient-address-lookup.error { color:#c63b50; }
.patient-address-lookup.hint { color:#6d6b9c; }
.patient-edit-grid label.full, .patient-identity-lookup.full { grid-column:1 / -1; }
.patient-address-lookup.full { grid-column:1 / -1; }
.patient-edit-grid input, .patient-edit-grid select { width:100%; height:42px; padding:0 12px; border:1px solid #ddd8f6; border-radius:10px; outline:0; color:var(--ink); background:rgba(255,255,255,.8); font:500 12px Manrope; }
.patient-edit-grid input:focus, .patient-edit-grid select:focus { border-color:#8b5cf6; box-shadow:0 0 0 3px rgba(139,92,246,.12); }
.birth-date-picker { position:relative; }
.birth-date-control { display:flex; align-items:center; gap:6px; }
.birth-date-control input { flex:1; cursor:pointer; }
.birth-date-control button { width:42px; height:42px; display:grid; place-items:center; flex:none; border:1px solid #ddd8f6; border-radius:10px; color:var(--purple); background:linear-gradient(145deg,#faf8ff,#eeeaff); cursor:pointer; }
.birth-date-control button:hover { border-color:#9a7cf2; background:#f1edff; }
.birth-date-control button svg { width:17px; height:17px; }
.birth-date-popover { position:absolute; top:calc(100% + 8px); left:0; z-index:4; width:min(290px,calc(100vw - 64px)); padding:13px; border:1px solid #ded8f6; border-radius:16px; background:linear-gradient(145deg,#fff,#f8f6ff); box-shadow:0 18px 45px rgba(45,31,120,.2); }
.birth-date-popover[hidden] { display:none; }
.birth-calendar-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:11px; color:var(--ink); }
.birth-calendar-title { display:flex; align-items:center; gap:6px; }
.birth-calendar-head strong { font:800 12px Manrope; }
.birth-calendar-head select { height:27px; padding:0 22px 0 7px; border:1px solid #e2dcf8; border-radius:8px; outline:0; color:var(--purple-dark); background:#fff; font:800 11px Manrope; cursor:pointer; }
.birth-calendar-head select:focus { border-color:var(--purple); box-shadow:0 0 0 3px #eee9ff; }
.birth-calendar-head > div { display:flex; gap:4px; }
.birth-calendar-head button { width:27px; height:27px; display:grid; place-items:center; border:1px solid #e2dcf8; border-radius:8px; color:var(--purple); background:#fff; cursor:pointer; }
.birth-calendar-head button:hover { background:#f0ecff; }
.birth-calendar-head button svg { width:14px; height:14px; }
.birth-calendar-weekdays, .birth-calendar-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; text-align:center; }
.birth-calendar-weekdays { margin-bottom:5px; color:var(--ink-soft); font-size:9px; }
.birth-calendar-grid button { height:29px; border:0; border-radius:9px; color:var(--ink); background:transparent; font:600 11px Manrope; cursor:pointer; }
.birth-calendar-grid button:hover { background:#eee9ff; color:var(--purple); }
.birth-calendar-grid button.muted { color:#c0bbd5; }
.birth-calendar-grid button.selected { color:#fff; background:linear-gradient(135deg,#a855f7,#6655e9); box-shadow:0 5px 13px rgba(103,76,223,.25); }
.patient-edit-actions { display:flex; align-items:center; justify-content:space-between; gap:10px; padding-top:16px; border-top:1px solid var(--line); }
.patient-edit-actions > div { display:flex; gap:9px; }
.patient-edit-actions svg { width:15px; height:15px; }
.attention { display:inline-flex; color:#ca4193; background:#ffe9f5; border-radius:99px; font-size:10px; padding:5px 8px; }

.record-top { display:flex; align-items:center; gap:14px; margin-bottom:11px; color:var(--purple-dark); }
.back-button { display:flex; align-items:center; gap:7px; background:transparent; color:var(--ink-soft); font-size:12px; }
.record-layout { display:grid; grid-template-columns:minmax(0,1fr) 292px; gap:14px; }
.record-main { min-width:0; }
.record-consultation-timer { display:flex; justify-content:flex-end; margin:0 0 8px; }
.consultation-header-timer { display:grid; gap:3px; min-width:112px; padding:8px 12px; border:1px solid #d8cff9; border-radius:11px; color:var(--purple-dark); background:linear-gradient(145deg,#faf8ff,#f0eaff); box-shadow:0 5px 15px rgba(91,75,220,.08); }
.consultation-header-timer span { color:var(--muted); font-size:9px; font-weight:700; line-height:1; text-transform:uppercase; letter-spacing:.35px; }
.consultation-header-timer strong { font:800 16px Manrope; letter-spacing:.4px; }
.patient-banner { min-height:112px; display:flex; align-items:center; padding:18px; gap:14px; margin-bottom:11px; }
.patient-banner > .patient-avatar { width:70px; height:70px; font-size:22px; }
.patient-banner h1 { margin:0; font:800 23px Manrope; letter-spacing:-.8px; }
.patient-banner p { margin:5px 0 0; color:var(--ink-soft); font-size:12px; }
.tag-list { display:flex; gap:7px; margin-top:10px; flex-wrap:wrap; }
.tag { padding:5px 9px; border-radius:7px; color:#4d32c6; background:#eee7ff; font-size:10px; }
.banner-actions { display:flex; gap:9px; margin-left:auto; align-self:flex-start; }
.patient-menu-anchor { position:relative; }
.patient-record-menu { position:absolute; top:43px; right:0; z-index:18; min-width:190px; padding:6px; border:1px solid #e1daf8; border-radius:12px; background:rgba(255,255,255,.98); box-shadow:0 16px 35px rgba(56,39,137,.18); }
.patient-record-menu button { width:100%; display:flex; align-items:center; gap:8px; padding:10px 11px; border:0; border-radius:8px; color:var(--ink-soft); background:transparent; text-align:left; font-size:12px; }
.patient-record-menu button:hover { color:var(--purple-dark); background:#f5f1ff; }
.patient-record-menu svg { width:15px; height:15px; color:var(--purple); }
.tabbar { min-height:51px; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); align-items:stretch; padding:0 15px; margin-bottom:11px; overflow:visible; }
.tabbar button { min-height:51px; background:transparent; color:var(--ink-soft); padding:0 14px; display:flex; align-items:center; justify-content:flex-start; gap:8px; font-size:11px; border-bottom:2px solid transparent; white-space:normal; text-align:left; line-height:1.25; }
.tabbar button.active { color:var(--purple-dark); border-bottom-color:var(--purple); }
.tabbar button svg { width:16px; height:16px; }
.record-section-card { min-height:405px; padding:24px; }
.record-section-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding-bottom:18px; border-bottom:1px solid var(--line); }
.record-section-heading h2 { margin:0 0 5px; color:var(--ink); font:800 20px Manrope; }
.record-section-heading p { margin:0; color:var(--ink-soft); font-size:12px; line-height:1.5; }
.ai-pill { display:inline-flex; align-items:center; gap:6px; flex:none; padding:7px 10px; border:1px solid #ded5ff; border-radius:99px; color:var(--purple-dark); background:#f5f1ff; font-size:10px; white-space:nowrap; }
.ai-pill svg { width:14px; height:14px; }
.scale-safety-note { display:flex; align-items:flex-start; gap:9px; margin:17px 0 14px; padding:12px 13px; border:1px solid #e2dcf8; border-radius:11px; color:var(--purple-dark); background:#f8f6ff; font-size:11px; line-height:1.45; }
.scale-safety-note svg { flex:none; width:18px; height:18px; }
.scale-ai-panel { display:flex; align-items:center; gap:11px; margin:14px 0; padding:13px 14px; border:1px solid #e3dcfb; border-radius:12px; color:var(--purple-dark); background:linear-gradient(110deg,#faf8ff,#f4f0ff); }
.scale-ai-panel > svg { flex:none; width:18px; height:18px; }
.scale-ai-panel > div { display:grid; gap:3px; flex:1; }
.scale-ai-panel strong { color:var(--ink); font-size:12px; }
.scale-ai-panel span { color:var(--ink-soft); font-size:10px; line-height:1.45; }
.scale-ai-panel.is-warning { border-color:#f0d8b1; background:#fffaf2; }
.scale-ai-panel.is-warning > svg { color:#a46a22; }
.scale-ai-panel.is-ready > svg { color:var(--purple); }
.scale-ai-spinner { width:15px; height:15px; flex:none; border:2px solid #ddd4fb; border-top-color:var(--purple); border-radius:50%; animation:scale-spin .8s linear infinite; }
@keyframes scale-spin { to { transform:rotate(360deg); } }
.scale-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.scale-card { display:grid; gap:7px; padding:14px; border:1px solid #e4def9; border-radius:12px; background:linear-gradient(145deg,#fff,#fbfaff); }
.scale-card.is-blocked { opacity:.78; border-style:dashed; background:#faf9ff; }
.scale-card.is-retained { border-color:#cfe9e2; background:linear-gradient(145deg,#fff,#f8fffd); }
.scale-card-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.scale-card-heading strong { color:var(--ink); font:800 15px Manrope; }
.scale-card-title { display:flex; align-items:center; gap:6px; }
.scale-help-icon { display:inline-flex; align-items:center; justify-content:center; width:17px; height:17px; border-radius:99px; border:1px solid var(--purple-dark); background:none; color:var(--purple-dark); font:800 10px Manrope; line-height:1; cursor:help; padding:0; }
.scale-help-icon:hover, .scale-help-icon:focus-visible { background:var(--purple-dark); color:#fff; }
html[data-theme="dark"] .scale-help-icon { border-color:#cabfff; color:#cabfff; }
html[data-theme="dark"] .scale-help-icon:hover, html[data-theme="dark"] .scale-help-icon:focus-visible { background:#cabfff; color:#221c46; }
.scale-interpretation-dialog { max-width:420px; }
.scale-interpretation-bands { list-style:none; margin:14px 25px 0; padding:0; display:grid; gap:7px; }
.scale-interpretation-bands li { display:flex; align-items:baseline; justify-content:space-between; gap:10px; padding:9px 11px; border:1px solid var(--line); border-radius:10px; background:rgba(255,255,255,.55); }
.scale-interpretation-bands strong { color:var(--purple-dark); font:800 11px Manrope; white-space:nowrap; }
.scale-interpretation-bands span { color:var(--ink); font:600 11px 'DM Sans',system-ui,sans-serif; text-align:right; }
.scale-interpretation-note { margin:12px 25px 0; color:var(--muted); font-size:10.5px; line-height:1.5; }
html[data-theme="dark"] .scale-interpretation-bands li { background:rgba(40,43,83,.4); border-color:rgba(196,192,255,.16); }
.scale-status { color:var(--muted); background:#f1eff8; border-radius:99px; padding:4px 7px; font-size:9px; }
.scale-status.active { color:#168b78; background:#e6f7f1; }
.scale-status.blocked { color:#9a5b1c; background:#fff0dc; }
.scale-card h3 { margin:0; color:var(--ink); font:700 12px Manrope; }
.scale-card p { min-height:31px; margin:0; color:var(--ink-soft); font-size:10px; line-height:1.45; }
.scale-recommendation { display:grid; gap:3px; padding:8px 9px; border-radius:9px; background:#f6f2ff; border:1px solid #e8e0ff; }
.scale-recommendation strong { color:var(--purple-dark); font-size:10px; }
.scale-recommendation span { color:var(--ink-soft); font-size:10px; line-height:1.4; }
.scale-recommendation small { color:var(--muted); font-size:9px; text-transform:capitalize; }
.scale-retained-note { padding:8px 9px; border-radius:9px; color:#168b78; background:#edf9f5; border:1px solid #d7efe8; font-size:10px; line-height:1.4; }
.scale-latest-result { display:flex; align-items:baseline; flex-wrap:wrap; gap:4px 9px; padding:8px 9px; border-radius:9px; background:#f4f0ff; border:1px solid #e1daf7; }
.scale-latest-result strong { color:var(--ink); font:800 13px Manrope; }
.scale-latest-interpretation { flex:1; min-width:0; color:var(--purple-dark); font:700 10.5px Manrope; }
.scale-latest-result small { margin-left:auto; color:var(--muted); font-size:9px; white-space:nowrap; }
html[data-theme="dark"] .scale-latest-result { background:#2a2650; border-color:#4a4483; }
html[data-theme="dark"] .scale-latest-result strong { color:#eef0ff; }
html[data-theme="dark"] .scale-latest-interpretation { color:#cabfff; }
.scale-meta { display:flex; flex-wrap:wrap; gap:5px 9px; color:var(--muted); font-size:9px; line-height:1.35; }
.scale-frequency { display:grid; gap:5px; color:var(--ink-soft); font-size:10px; }
.scale-frequency select { width:100%; height:34px; padding:0 9px; border:1px solid #ded8f3; border-radius:9px; color:var(--ink); background:#fff; font:500 10px Manrope; outline:0; }
.scale-frequency select:focus { border-color:var(--purple); box-shadow:0 0 0 3px #eee9ff; }
.scale-library-summary { display:grid; grid-template-columns:160px minmax(0,1fr); gap:12px; padding:13px 0; border-bottom:1px solid var(--line); }
.scale-library-summary div { display:grid; gap:4px; }
.scale-library-summary small { color:var(--muted); font-size:10px; }
.scale-library-summary strong { color:var(--ink); font-size:12px; line-height:1.4; }
.scale-rights { display:block; min-height:27px; color:var(--muted); font-size:9px; line-height:1.35; }
.scale-card .button { justify-self:start; margin-top:3px; }
.scale-card .button svg { width:14px; height:14px; }
.scale-retained-heading { display:flex; align-items:baseline; gap:8px; margin:19px 0 9px; }
.scale-retained-heading strong { color:var(--ink); font:800 12px Manrope; }
.scale-retained-heading span { color:var(--muted); font-size:10px; }
.scale-library-footnote { margin-top:16px; color:var(--muted); font-size:10px; line-height:1.45; }
.scale-trend-panel { --scale-chart-surface:#fff; margin:16px 0 18px; padding:16px; border:1px solid #e1d9fa; border-radius:16px; background:linear-gradient(145deg,rgba(252,250,255,.96),rgba(244,240,255,.82)); box-shadow:0 10px 28px rgba(84,66,176,.07); }
.scale-trend-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.scale-trend-heading > div { display:grid; gap:4px; min-width:0; }
.scale-trend-kicker { color:var(--purple); font-size:9px; font-weight:800; letter-spacing:.65px; text-transform:uppercase; }
.scale-trend-heading h3 { margin:0; color:var(--ink); font:800 15px Manrope; }
.scale-trend-heading p { margin:0; color:var(--ink-soft); font-size:10px; line-height:1.4; }
.scale-trend-badge { display:inline-flex; align-items:center; gap:5px; flex:none; padding:6px 9px; border:1px solid #ded3ff; border-radius:99px; color:var(--purple-dark); background:#f5f0ff; font-size:9px; white-space:nowrap; }
.scale-trend-badge svg { width:13px; height:13px; }
.scale-trend-selector { display:grid; gap:10px; margin-top:15px; padding:12px; border:1px solid #e5def9; border-radius:12px; background:rgba(255,255,255,.64); }
.scale-trend-selector > div:first-child { display:grid; gap:3px; }
.scale-trend-selector strong { color:var(--ink); font-size:11px; }
.scale-trend-selector span { color:var(--muted); font-size:9px; line-height:1.35; }
.scale-trend-selector-list { display:flex; flex-wrap:wrap; gap:7px; }
.scale-trend-option { min-width:145px; display:flex; align-items:center; gap:7px; padding:7px 8px; border:1px solid #e3ddf5; border-radius:10px; background:rgba(255,255,255,.76); cursor:pointer; transition:.18s ease; }
.scale-trend-option:hover { border-color:#b7a6f4; transform:translateY(-1px); }
.scale-trend-option input { width:14px; height:14px; flex:none; margin:0; accent-color:var(--purple); }
.scale-trend-option i, .scale-trend-latest > i { width:9px; height:9px; flex:none; display:block; border-radius:50%; background:var(--scale-chart-color); box-shadow:0 0 0 3px color-mix(in srgb,var(--scale-chart-color) 16%,transparent); }
.scale-trend-option > span { display:grid; gap:2px; min-width:0; }
.scale-trend-option > span strong { color:var(--ink); font-size:10px; }
.scale-trend-option > span small { overflow:hidden; color:var(--muted); font-size:8px; text-overflow:ellipsis; white-space:nowrap; }
.scale-trend-chart-wrap { min-width:0; margin-top:14px; padding:10px 8px 12px; border:1px solid #e8e2fa; border-radius:13px; background:rgba(255,255,255,.72); overflow:hidden; }
.scale-trend-chart { width:100%; min-height:220px; display:block; overflow:visible; }
.scale-chart-grid-line { stroke:rgba(111,95,191,.14); stroke-width:1; stroke-dasharray:3 4; }
.scale-chart-axis-line { stroke:rgba(111,95,191,.28); stroke-width:1; }
.scale-chart-axis-label, .scale-chart-date-label { fill:var(--muted); font:500 9px Manrope; }
.scale-chart-point-label { fill:var(--ink); font:800 9px Manrope; }
.scale-chart-series circle { transition:r .18s ease; cursor:help; }
.scale-chart-series circle:hover { r:7; }
.scale-trend-latest-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(165px,1fr)); gap:8px; margin-top:8px; }
.scale-trend-latest { min-width:0; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:2px 7px; padding:8px 9px; border:1px solid #e6e0f7; border-radius:10px; background:rgba(255,255,255,.68); }
.scale-trend-latest > i { grid-row:span 2; }
.scale-trend-latest > div { min-width:0; display:grid; gap:2px; }
.scale-trend-latest strong { color:var(--ink); font-size:10px; }
.scale-trend-latest small { overflow:hidden; color:var(--muted); font-size:8px; text-overflow:ellipsis; white-space:nowrap; }
.scale-trend-latest b { color:var(--ink); font:800 11px Manrope; }
.scale-trend-latest > span { grid-column:2 / 4; color:var(--muted); font-size:8px; }
.scale-trend-empty { min-height:148px; display:flex; align-items:center; justify-content:center; gap:11px; margin-top:14px; padding:18px; border:1px dashed #d8cef4; border-radius:13px; color:var(--purple); background:rgba(255,255,255,.46); }
.scale-trend-empty > svg { width:23px; height:23px; flex:none; }
.scale-trend-empty > div { display:grid; gap:4px; }
.scale-trend-empty strong { color:var(--ink); font:800 12px Manrope; }
.scale-trend-empty span { color:var(--ink-soft); font-size:10px; line-height:1.45; }
.scale-trend-empty.is-filtered { min-height:130px; }
.scale-trend-note { margin:10px 2px 0; color:var(--muted); font-size:9px; line-height:1.45; }
html[data-theme="dark"] .scale-trend-panel { --scale-chart-surface:#191d41; border-color:rgba(196,192,255,.18); background:linear-gradient(145deg,rgba(31,35,76,.92),rgba(29,27,64,.9)); }
html[data-theme="dark"] .scale-trend-badge { border-color:rgba(177,157,255,.3); color:#ded7ff; background:#332b63; }
html[data-theme="dark"] .scale-trend-selector,
html[data-theme="dark"] .scale-trend-chart-wrap { border-color:rgba(196,192,255,.16); background:rgba(22,26,58,.68); }
html[data-theme="dark"] .scale-trend-option,
html[data-theme="dark"] .scale-trend-latest { border-color:rgba(196,192,255,.16); background:rgba(40,43,83,.62); }
html[data-theme="dark"] .scale-chart-grid-line { stroke:rgba(196,192,255,.16); }
html[data-theme="dark"] .scale-chart-axis-line { stroke:rgba(196,192,255,.32); }
html[data-theme="dark"] .scale-chart-axis-label,
html[data-theme="dark"] .scale-chart-date-label { fill:#aeb6e1; }
html[data-theme="dark"] .scale-chart-point-label { fill:#e4e7ff; }
html[data-theme="dark"] .scale-trend-empty { border-color:rgba(177,157,255,.32); background:rgba(35,39,79,.5); }
.source-status { display:flex; align-items:center; gap:8px; margin:17px 0 12px; color:var(--ink-soft); font-size:11px; }
.source-status svg { width:15px; height:15px; color:var(--purple); }
.extraction-grid { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:14px; margin-top:17px; }
.extraction-card { display:grid; gap:6px; padding:15px; border:1px solid #e4def9; border-radius:12px; background:#fbfaff; }
.extraction-card small { color:var(--ink-soft); font-size:10px; }
.extraction-card strong { color:var(--ink); font-size:13px; }
.document-generator { display:flex; align-items:end; gap:12px; margin-top:20px; }
.document-generator label { display:grid; flex:1; gap:7px; color:var(--ink-soft); font-size:11px; }
.document-generator select { height:42px; padding:0 12px; border:1px solid #ded8f3; border-radius:10px; color:var(--ink); background:#fff; font:500 12px Manrope; outline:0; }
.document-type-picker { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:20px; }
.document-type-option { display:flex; align-items:center; gap:11px; min-height:72px; padding:12px 13px; border:1px solid #e3ddf6; border-radius:14px; color:var(--ink-soft); background:linear-gradient(145deg,#fff,#fbf9ff); text-align:left; cursor:pointer; transition:.18s ease; }
.document-type-option:hover { border-color:#b9a8f2; transform:translateY(-1px); box-shadow:0 8px 22px rgba(87,66,166,.08); }
.document-type-option.selected { border-color:var(--purple); background:linear-gradient(145deg,#f8f3ff,#eee8ff); box-shadow:0 0 0 3px rgba(124,88,235,.09); }
.document-type-option > svg:first-child { width:21px; height:21px; flex:none; color:var(--purple); }
.document-type-option > span { display:grid; gap:3px; min-width:0; flex:1; }
.document-type-option strong { color:var(--ink); font:800 11px Manrope; }
.document-type-option small { color:var(--muted); font-size:10px; line-height:1.35; }
.document-type-option > svg:last-child { width:15px; height:15px; flex:none; color:var(--purple); }
.document-selected-type { display:grid; gap:4px; flex:1; padding:10px 12px; border:1px solid #e3ddf6; border-radius:11px; background:#faf8ff; }
.document-selected-type span { color:var(--muted); font-size:10px; }
.document-selected-type strong { color:var(--ink); font:800 12px Manrope; }
.document-editor-backdrop, .document-package-dialog-backdrop { position:fixed; inset:0; z-index:130; display:grid; place-items:center; padding:20px; background:rgba(38,33,84,.42); backdrop-filter:blur(9px); }
.document-editor-modal, .document-package-dialog { width:min(720px,100%); max-height:calc(100vh - 40px); overflow:auto; border:1px solid rgba(255,255,255,.96); border-radius:22px; background:linear-gradient(145deg,#fff,#faf8ff); box-shadow:0 26px 90px rgba(36,25,101,.29); }
.document-editor-header, .document-modal-brand { display:flex; align-items:flex-start; gap:13px; }
.document-editor-header { padding:23px 24px 18px; border-bottom:1px solid rgba(125,98,222,.12); background:linear-gradient(135deg,#fff8ff,#f1ebff 68%,#f7fbff); }
.document-editor-header > .dialog-close { margin-left:auto; }
.document-modal-brand { flex:1; }
.document-modal-brand > div:last-child { display:grid; gap:4px; min-width:0; }
.document-modal-brand h2 { margin:1px 0 0; color:var(--ink); font:800 19px Manrope; letter-spacing:-.3px; }
.document-modal-brand p { margin:0; color:var(--ink-soft); font-size:11px; line-height:1.45; }
.document-modal-icon { display:grid; place-items:center; width:40px; height:40px; flex:none; border-radius:13px; color:#fff; background:linear-gradient(135deg,#a855f7,#5b5ce2); box-shadow:0 8px 20px rgba(112,76,213,.2); }
.document-modal-icon.success { background:linear-gradient(135deg,#22b58b,#168b78); }
.document-modal-icon.warning { background:linear-gradient(135deg,#dd9a39,#b46b17); }
.document-thinking { display:flex; align-items:center; gap:13px; margin:24px; padding:18px; border:1px solid #ded5fb; border-radius:15px; color:var(--ink-soft); background:linear-gradient(145deg,#fbfaff,#f3efff); }
.document-thinking > div { display:grid; gap:4px; }
.document-thinking strong { color:var(--ink); font:800 13px Manrope; }
.document-thinking p { margin:0; font-size:11px; line-height:1.45; }
.document-processing-steps { display:grid; gap:9px; margin:0 24px 24px; padding:14px; border-top:1px solid var(--line); color:var(--muted); font-size:10px; }
.document-processing-steps span { display:flex; align-items:center; gap:7px; }
.document-processing-steps svg { width:14px; height:14px; }
.document-processing-steps .complete { color:#168b78; }
.document-processing-steps .active { color:var(--purple-dark); font-weight:800; }
.document-review-note, .document-dialog-warning, .document-confirmed-copy { display:flex; align-items:flex-start; gap:8px; margin:17px 24px 0; padding:11px 12px; border:1px solid #e0d8f8; border-radius:12px; color:var(--ink-soft); background:#faf8ff; font-size:11px; line-height:1.45; }
.document-review-note svg, .document-dialog-warning svg, .document-confirmed-copy svg { width:16px; height:16px; flex:none; color:var(--purple); }
.document-draft-field { display:grid; gap:7px; margin:17px 24px 0; color:var(--ink); font:800 11px Manrope; }
.document-draft-field textarea { min-height:280px; resize:vertical; padding:13px 14px; border:1px solid #d9d1f5; border-radius:13px; color:var(--ink-soft); background:#fff; font:500 13px/1.55 Manrope; outline:0; }
.document-draft-field textarea:focus { border-color:var(--purple); box-shadow:0 0 0 3px #eee9ff; }
.document-editor-footer { display:flex; justify-content:flex-end; gap:9px; margin-top:20px; padding:16px 24px 21px; border-top:1px solid var(--line); background:#fcfbff; }
.document-confirmed-copy { align-items:center; margin-top:20px; color:#18785f; border-color:#c9eadc; background:#effaf5; }
.document-confirmed-copy div { display:grid; gap:3px; }
.document-confirmed-copy strong { color:#16785d; font:800 12px Manrope; }
.document-confirmed-copy span { font-size:10px; }
.document-package-patient { display:grid; gap:3px; margin:19px 24px 0; padding:12px 13px; border-radius:12px; color:var(--ink-soft); background:#faf8ff; }
.document-package-patient strong { color:var(--ink); font:800 13px Manrope; }
.document-package-patient span { font-size:10px; }
.document-package-link { display:grid; gap:7px; margin:17px 24px 0; color:var(--ink); font:800 11px Manrope; }
.document-package-link > div { display:flex; gap:8px; }
.document-package-link input { min-width:0; flex:1; height:42px; padding:0 12px; border:1px solid #d9d1f5; border-radius:11px; color:var(--ink-soft); background:#fff; font:500 10px Manrope; }
.document-package-delivery { display:flex; align-items:flex-start; gap:8px; margin:14px 24px 0; padding:11px 12px; border-radius:11px; color:#8a621e; background:#fff8e9; font-size:10px; line-height:1.4; }
.document-package-delivery svg { width:15px; height:15px; flex:none; }
.document-package-list { display:grid; gap:7px; margin:17px 24px 0; padding:0; list-style:none; }
.document-package-list li { display:flex; align-items:center; gap:8px; padding:9px 10px; border:1px solid #e6e0f5; border-radius:10px; color:var(--ink-soft); background:#fff; font-size:11px; }
.document-package-list li svg { width:15px; height:15px; color:var(--purple); }
.document-package-list li span { flex:1; }
.document-package-list li small { color:#168b78; font-size:9px; }
.document-package-dialog .document-editor-footer { margin-top:19px; }
.document-button-spinner { display:inline-block; width:12px; height:12px; margin-right:6px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:spin .8s linear infinite; vertical-align:-2px; }
.document-package-page { min-height:100vh; margin:0; background:radial-gradient(circle at 20% 0%,#f0eaff 0,#f8f7ff 44%,#edf2ff 100%); }
.patient-document-screen { display:grid; justify-items:center; gap:18px; min-height:100vh; padding:46px 20px 28px; color:var(--ink); }
.patient-document-brand { display:flex; align-items:center; gap:10px; }
.patient-document-brand img { width:42px; height:42px; object-fit:contain; border-radius:12px; box-shadow:0 8px 20px rgba(82,65,145,.16); }
.patient-document-brand strong { display:block; color:var(--ink); font:800 18px Manrope; }
.patient-document-brand small { display:block; color:var(--muted); font-size:11px; }
.patient-document-card { width:min(620px,100%); padding:30px; border:1px solid rgba(143,116,229,.18); border-radius:24px; background:rgba(255,255,255,.9); box-shadow:0 24px 70px rgba(82,65,145,.14); }
.patient-document-heading { display:flex; align-items:flex-start; gap:13px; }
.patient-document-heading h1 { margin:2px 0 0; color:var(--ink); font:800 24px/1.18 Manrope; }
.patient-document-icon, .patient-document-success-icon { display:grid; place-items:center; width:43px; height:43px; flex:none; border-radius:14px; color:#fff; background:linear-gradient(135deg,#a855f7,#5b5ce2); }
.patient-document-success-icon { border-radius:50%; background:linear-gradient(135deg,#22b58b,#168b78); }
.patient-document-eyebrow { color:var(--purple-dark); font:800 10px Manrope; letter-spacing:.07em; text-transform:uppercase; }
.patient-document-greeting { margin:23px 0 5px; color:var(--ink); font:800 17px Manrope; }
.patient-document-copy { margin:0 0 17px; color:var(--ink-soft); font-size:13px; line-height:1.6; }
.patient-document-security { display:flex; align-items:flex-start; gap:8px; margin:16px 0; padding:11px 12px; border:1px solid #e0d8f8; border-radius:12px; color:var(--ink-soft); background:#faf8ff; font-size:11px; line-height:1.4; }
.patient-document-security svg { width:15px; height:15px; flex:none; color:var(--purple); }
.patient-document-form { display:grid; gap:14px; }
.patient-document-form label { display:grid; gap:7px; color:var(--ink); font:800 11px Manrope; }
.patient-document-form input { height:44px; padding:0 13px; border:1px solid #d9d1f5; border-radius:11px; color:var(--ink); background:#fff; font:500 14px Manrope; outline:0; }
.patient-document-form input:focus { border-color:var(--purple); box-shadow:0 0 0 3px #eee9ff; }
.patient-document-error-message { min-height:18px; color:#bd3548; font-size:11px; }
.document-primary-button { display:flex; align-items:center; justify-content:center; gap:7px; min-height:44px; border:0; border-radius:11px; color:#fff; background:linear-gradient(135deg,#7c3aed,#5b5ce2); font:800 12px Manrope; cursor:pointer; }
.document-primary-button:disabled { opacity:.7; cursor:wait; }
.patient-document-expiry, .patient-document-legal { color:var(--muted); font-size:10px; text-align:center; }
.patient-document-files-card { padding-bottom:23px; }
.patient-document-files-card .patient-document-copy { margin-top:18px; }
.patient-document-file-list { display:grid; gap:9px; }
.patient-document-file { display:flex; align-items:center; gap:10px; padding:12px; border:1px solid #e3ddf6; border-radius:13px; background:#fff; }
.patient-document-file-icon { display:grid; place-items:center; width:34px; height:34px; flex:none; border-radius:10px; color:var(--purple); background:#f1ecff; }
.patient-document-file > div:nth-child(2) { display:grid; gap:3px; min-width:0; flex:1; }
.patient-document-file strong { color:var(--ink); font:800 11px Manrope; }
.patient-document-file small { color:var(--muted); font-size:9px; }
.document-download-button { display:flex; align-items:center; gap:5px; padding:8px 9px; border:1px solid #d9d0fb; border-radius:9px; color:var(--purple-dark); background:#faf8ff; font:800 10px Manrope; cursor:pointer; white-space:nowrap; }
.document-download-button svg { width:13px; height:13px; }
.patient-document-error, .patient-document-loading { display:grid; justify-items:center; gap:12px; text-align:center; }
.patient-document-error h1, .patient-document-loading h1 { margin:0; color:var(--ink); font:800 22px Manrope; }
.patient-document-error p, .patient-document-loading p { max-width:440px; margin:0; color:var(--ink-soft); font-size:13px; line-height:1.55; }
.patient-document-error small { color:var(--muted); font-size:11px; }
.patient-document-error-icon { display:grid; place-items:center; width:56px; height:56px; border-radius:50%; color:#fff; background:linear-gradient(135deg,#e56b7a,#b52d4b); font:800 25px Manrope; }
.document-package-spinner { display:block; width:42px; height:42px; border:4px solid #e6ddff; border-top-color:var(--purple); border-radius:50%; animation:spin .8s linear infinite; }
.patient-document-empty { padding:14px; border-radius:11px; color:var(--muted); background:#faf8ff; font-size:11px; text-align:center; }
.pdf-analyzer { margin-top:20px; }
.pdf-dropzone { position:relative; min-height:92px; display:flex; align-items:center; gap:13px; padding:15px 17px; border:1px dashed #bca8f4; border-radius:14px; color:var(--ink); background:linear-gradient(135deg,#fbf9ff,#f5f0ff); cursor:pointer; transition:border-color .18s ease,background .18s ease,box-shadow .18s ease; }
.pdf-dropzone:hover, .pdf-dropzone.is-dragging { border-color:#7b4df2; background:linear-gradient(135deg,#f7f1ff,#eee8ff); box-shadow:0 8px 22px rgba(107,72,220,.1); }
.pdf-file-input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.pdf-dropzone-icon { width:40px; height:40px; display:grid; place-items:center; flex:none; border-radius:12px; color:#7b45ee; background:#ebe2ff; }
.pdf-dropzone-icon svg { width:21px; height:21px; }
.pdf-dropzone span:not(.pdf-dropzone-icon) { display:grid; gap:4px; min-width:0; }
.pdf-dropzone strong { font:700 12px Manrope; }
.pdf-dropzone small { color:var(--ink-soft); font-size:10px; line-height:1.4; }
.pdf-dropzone em { margin-left:auto; padding:8px 11px; border:1px solid #d9cdf8; border-radius:9px; color:var(--purple-dark); background:#fff; font-style:normal; font-size:10px; white-space:nowrap; }
.pdf-file-meta { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:10px; padding:10px 12px; border:1px solid #e2dcf7; border-radius:11px; background:#fff; }
.pdf-file-meta > div { display:flex; align-items:center; gap:9px; min-width:0; color:var(--purple); }
.pdf-file-meta > div > svg { width:18px; height:18px; flex:none; }
.pdf-file-meta div div { display:grid; gap:3px; min-width:0; }
.pdf-file-meta strong { overflow:hidden; color:var(--ink); font:700 11px Manrope; text-overflow:ellipsis; white-space:nowrap; }
.pdf-file-meta small { color:var(--ink-soft); font-size:10px; }
.neuropsi-analysis { margin-top:18px; border:1px solid #ded5fb; border-radius:14px; overflow:hidden; background:#fff; }
.neuropsi-analysis.warning { padding:17px; color:var(--ink-soft); }
.neuropsi-analysis-heading { display:flex; align-items:center; gap:10px; padding:14px 16px; background:linear-gradient(135deg,#f6f0ff,#eee9ff); color:var(--purple-dark); }
.neuropsi-analysis-heading > svg { width:21px; height:21px; flex:none; }
.neuropsi-analysis-heading > div { display:grid; gap:3px; min-width:0; }
.neuropsi-analysis-heading strong { font:800 13px Manrope; }
.neuropsi-analysis-heading small { color:var(--ink-soft); font-size:10px; }
.neuropsi-analysis-heading > span { margin-left:auto; padding:6px 9px; border-radius:99px; color:#7046d9; background:#e7dcff; font-size:9px; white-space:nowrap; }
.neuropsi-classification { display:flex; align-items:center; gap:10px; margin:14px 16px 0; padding:11px 13px; border:1px solid #e5def8; border-radius:10px; background:#fbfaff; }
.neuropsi-classification small { color:var(--ink-soft); font-size:10px; }
.neuropsi-classification strong { color:var(--purple-dark); font:800 12px Manrope; }
.neuropsi-sections { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 12px; padding:4px 16px 0; }
.neuropsi-section { padding:13px 0; border-bottom:1px solid var(--line); }
.neuropsi-section h3, .neuropsi-diagnoses h3, .neuropsi-patient h3, .neuropsi-opinion h3 { margin:0 0 6px; color:var(--ink); font:800 11px Manrope; }
.neuropsi-section p, .neuropsi-patient p, .neuropsi-opinion p { margin:0; color:var(--ink-soft); font-size:11px; line-height:1.55; }
.neuropsi-diagnoses, .neuropsi-patient, .neuropsi-opinion { margin:0 16px; padding:14px 0; border-top:1px solid var(--line); }
.neuropsi-diagnoses > div { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 10px; margin-top:7px; border-radius:8px; background:#f7f3ff; color:var(--purple-dark); font-size:10px; }
.neuropsi-diagnoses span { color:var(--ink-soft); text-align:right; }
.neuropsi-opinion textarea { display:block; width:100%; min-height:110px; margin-top:8px; padding:11px; border:1px solid #ded8f3; border-radius:9px; resize:vertical; outline:0; color:var(--ink-soft); background:#fbfaff; font:500 11px/1.55 Manrope; }
.neuropsi-transcript-action { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:14px; padding:11px 13px; border:1px solid #e3ddf7; border-radius:10px; color:var(--ink-soft); font-size:10px; }
.neuropsi-transcript-action span { display:flex; align-items:center; gap:7px; }
.neuropsi-transcript-action svg { width:14px; height:14px; color:var(--purple); }
.neuropsi-transcript-action .button { flex:none; }
.record-output { margin-top:20px; border:1px solid #e1daf8; border-radius:13px; overflow:hidden; background:#fff; }
.record-output-heading { display:grid; gap:4px; padding:12px 14px; background:#f5f1ff; }
.record-output-heading span { display:flex; align-items:center; gap:7px; color:var(--purple-dark); font:700 12px Manrope; }
.record-output-heading span svg { width:16px; height:16px; }
.record-output-heading small { color:var(--muted); font-size:10px; }
.record-output textarea { display:block; width:100%; min-height:150px; padding:15px; border:0; resize:vertical; outline:0; color:var(--ink-soft); background:#fff; font:500 12px/1.6 Manrope; }
.prescription-ai-status { display:flex; align-items:center; gap:11px; margin:14px 0 18px; padding:13px 14px; border:1px solid #e3dcfb; border-radius:12px; background:#faf8ff; }
.prescription-ai-status > svg { flex:none; width:18px; height:18px; color:var(--purple); }
.prescription-ai-status > div { display:grid; gap:3px; flex:1; }
.prescription-ai-status strong { color:var(--ink); font-size:12px; }
.prescription-ai-status span { color:var(--ink-soft); font-size:10px; line-height:1.45; }
.prescription-ai-status.is-warning { border-color:#f0d8b1; background:#fffaf2; }
.prescription-ai-status.is-warning > svg { color:#a46a22; }
.prescription-editor-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:8px 0 10px; }
.prescription-editor-heading div { display:grid; gap:3px; }
.prescription-editor-heading strong { color:var(--ink); font:800 13px Manrope; }
.prescription-editor-heading span { color:var(--muted); font-size:10px; }
.prescription-rows { display:grid; gap:12px; }
.prescription-row { padding:14px; border:1px solid #e4def9; border-radius:12px; background:linear-gradient(145deg,#fff,#fbfaff); }
.prescription-row-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:11px; }
.prescription-row-heading strong { color:var(--purple-dark); font:800 12px Manrope; }
.prescription-row-heading .icon-button { width:28px; height:28px; color:#a15b70; }
.prescription-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.prescription-fields label { display:grid; gap:5px; color:var(--ink-soft); font-size:10px; }
.prescription-fields label.full { grid-column:1 / -1; }
.prescription-fields input, .prescription-fields textarea { width:100%; padding:9px 10px; border:1px solid #ded8f3; border-radius:9px; color:var(--ink); background:#fff; font:500 11px/1.4 Manrope; outline:0; }
.prescription-fields input:focus, .prescription-fields textarea:focus { border-color:var(--purple); box-shadow:0 0 0 3px #eee9ff; }
.prescription-actions { display:flex; justify-content:flex-end; gap:9px; margin-top:15px; }
.prescription-name-mode-card { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:14px; margin:0 0 17px; padding:14px 15px; border:1px solid #e1daf8; border-radius:13px; background:linear-gradient(135deg,#fbf9ff,#f5f1ff); }
.prescription-name-mode-copy { display:grid; gap:4px; }
.prescription-name-mode-copy strong { color:var(--ink); font:800 12px Manrope; }
.prescription-name-mode-copy span { color:var(--ink-soft); font-size:10px; line-height:1.4; }
.prescription-name-mode-toggle { display:flex; align-items:center; gap:9px; color:var(--ink-soft); font-size:10px; white-space:nowrap; cursor:pointer; }
.prescription-name-mode-toggle strong { color:var(--purple-dark); font-size:10px; }
.prescription-name-mode-toggle input { position:absolute; opacity:0; pointer-events:none; }
.prescription-name-mode-toggle i { position:relative; width:42px; height:24px; flex:none; border:1px solid #cfc6f2; border-radius:999px; background:#ded9ee; transition:.2s ease; }
.prescription-name-mode-toggle i::after { content:''; position:absolute; top:3px; left:3px; width:16px; height:16px; border-radius:50%; background:#fff; box-shadow:0 2px 5px rgba(42,30,112,.2); transition:.2s ease; }
.prescription-name-mode-toggle input:checked + i { border-color:#895cff; background:linear-gradient(90deg,#a26bff,#6749eb); }
.prescription-name-mode-toggle input:checked + i::after { transform:translateX(18px); }
.prescription-name-mode-toggle input:focus-visible + i { outline:2px solid var(--purple); outline-offset:3px; }
.prescription-name-mode-card .settings-hint { grid-column:1 / -1; margin-top:0; }
.prescription-name-preview { display:grid; gap:4px; align-content:center; min-height:58px; padding:9px 11px; border:1px solid #ded8f3; border-radius:9px; background:#f8f6ff; }
.prescription-name-preview span { color:var(--muted); font-size:9px; }
.prescription-name-preview strong { overflow:hidden; color:var(--purple-dark); font:800 11px Manrope; text-overflow:ellipsis; white-space:nowrap; }
.signature-output-actions, .signature-output-status { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:11px 14px; border-top:1px solid #e8e2f7; color:var(--muted); font-size:10px; line-height:1.4; }
.signature-output-actions > span { display:flex; align-items:center; gap:6px; }
.signature-output-actions svg, .signature-output-status > svg { width:15px; height:15px; flex:none; color:var(--purple); }
.signature-output-status { color:#168b78; background:#edf9f5; }
.signature-output-status.is-loading { color:var(--purple-dark); background:#faf8ff; }
.signature-output-status button { margin-left:auto; }
.record-empty { display:grid; place-items:center; min-height:180px; padding:24px; text-align:center; color:var(--ink-soft); font-size:12px; }
.record-timeline { position:relative; display:grid; gap:16px; padding:22px 0 4px 23px; }
.record-timeline::before { content:''; position:absolute; top:26px; bottom:16px; left:5px; width:1px; background:#ddd5f7; }
.timeline-item { position:relative; }
.timeline-item-clickable { cursor:pointer; }
.timeline-item-clickable:hover .timeline-content { border-color:#bca7ff; box-shadow:0 12px 26px rgba(108,78,218,.12); transform:translateY(-1px); }
.timeline-item-clickable:focus-visible { outline:2px solid var(--purple); outline-offset:4px; border-radius:14px; }
.timeline-dot { position:absolute; top:17px; left:-23px; width:11px; height:11px; border:3px solid #fff; border-radius:50%; background:linear-gradient(135deg,#b46cff,#6257ed); box-shadow:0 0 0 1px #cfc4f5; }
.timeline-content { padding:14px 16px; border:1px solid #e3ddf6; border-radius:13px; background:linear-gradient(135deg,#fff,#fbfaff); transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease; }
.timeline-item.current .timeline-content { border-color:#bca7ff; box-shadow:0 7px 22px rgba(108,78,218,.08); }
.timeline-head { display:flex; justify-content:space-between; gap:10px; color:var(--ink); }
.timeline-head strong { font:700 12px Manrope; }
.timeline-head span { color:var(--ink-soft); font-size:10px; }
.timeline-content p { margin:9px 0; color:var(--ink-soft); font-size:12px; line-height:1.55; }
.timeline-meta { display:flex; flex-wrap:wrap; gap:7px 14px; color:var(--purple-dark); font-size:10px; }
.timeline-open-hint { display:block; margin-top:9px; color:var(--purple-dark); font:700 10px Manrope; }
.transcribe-card { min-height:405px; display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center; position:relative; overflow:hidden; padding:35px; }
.transcribe-card::before, .transcribe-card::after { content:''; position:absolute; width:56%; height:88px; border-top:2px solid rgba(151,121,255,.1); border-radius:50%; transform:rotate(-12deg); top:31px; left:-4%; }
.transcribe-card::after { top:45px; left:55%; transform:rotate(13deg); }
.mic-disc { width:76px; height:76px; border-radius:50%; display:grid; place-items:center; color:#7943f5; background:linear-gradient(145deg,#f3edff,#e9e0ff); position:relative; z-index:1; }
.mic-disc svg { width:34px; height:34px; }
.transcribe-card h2 { font:800 24px Manrope; letter-spacing:-.8px; margin:18px 0 6px; position:relative; z-index:1; }
.transcribe-card > p { color:var(--ink-soft); margin:0; font-size:14px; line-height:1.6; position:relative; z-index:1; }
.transcribe-card .button { margin-top:18px; min-width:260px; min-height:51px; font-size:15px; position:relative; z-index:1; }
.transcribe-card .transcription-cta { isolation:isolate; overflow:visible; color:#fff !important; border:1px solid rgba(255,255,255,.34) !important; background:linear-gradient(100deg,#c04df5 0%,#7959ff 48%,#389ff7 100%) !important; box-shadow:0 8px 22px rgba(117,64,235,.28); }
.transcribe-card .transcription-cta::after { content:''; position:absolute; inset:-9px; z-index:-1; border-radius:inherit; background:linear-gradient(100deg,rgba(192,77,245,.82),rgba(121,89,255,.78),rgba(56,159,247,.82)); filter:blur(13px); opacity:.38; transform:none; animation:transcription-cta-halo 2.6s ease-in-out infinite; pointer-events:none; }
.transcribe-card .transcription-cta:hover { filter:brightness(1.08); }
@keyframes transcription-cta-halo { 0%,100% { opacity:.3; filter:blur(12px); } 50% { opacity:.72; filter:blur(18px); } }
html[data-theme="dark"] .transcribe-card .transcription-cta { color:#fff !important; background:linear-gradient(100deg,#b94cf2 0%,#7057ff 48%,#329cf2 100%) !important; border-color:rgba(255,255,255,.38) !important; }
@media (prefers-reduced-motion: reduce) { .transcribe-card .transcription-cta, .transcribe-card .transcription-cta::after { animation:none; } }
.feature-cards { width:100%; display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:20px; position:relative; z-index:1; }
.feature-card { border:1px solid rgba(119,95,228,.14); border-radius:10px; padding:14px; text-align:left; display:grid; grid-template-columns:39px 1fr; gap:10px; }
.feature-card .feature-icon { width:39px; height:39px; display:grid; place-items:center; border-radius:50%; background:#f0eaff; color:var(--purple); }
.feature-card strong { font-size:12px; display:block; }
.feature-card span { display:block; color:var(--ink-soft); font-size:11px; line-height:1.45; margin-top:5px; }
.notes-card { margin-top:11px; padding:14px 17px 16px; }
.editor { border:1px solid #d9d8f3; border-radius:10px; overflow:hidden; background:rgba(255,255,255,.53); }
.editor-toolbar { height:42px; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:16px; padding:0 16px; color:#5160b9; }
.editor-toolbar button { background:transparent; color:inherit; font-weight:700; }
.editor textarea { width:100%; min-height:100px; resize:vertical; border:0; outline:0; padding:15px 16px; background:transparent; color:var(--ink); font-size:12px; }
.editor textarea::placeholder { color:#7a80c0; }
.save-state { text-align:right; color:#6873ad; font-size:11px; margin:-23px 16px 9px 0; position:relative; pointer-events:none; }
.save-state::before { content:'✓'; color:#0dad9b; font-size:15px; margin-right:7px; }
.save-state-error { color:#c0392b; }
.save-state-error::before { content:'⚠'; color:#c0392b; }
.record-sidebar { display:flex; flex-direction:column; gap:11px; }
.record-sidebar .card { padding:16px; }
.side-tabs { display:grid; grid-template-columns:repeat(3,1fr) 35px; gap:2px; border-bottom:1px solid var(--line); margin:-2px -3px 16px; }
.side-tabs button { background:transparent; color:var(--ink-soft); padding:10px 2px; font-size:10px; border-bottom:2px solid transparent; }
.side-tabs button.active { color:var(--purple-dark); border-bottom-color:var(--purple); }
.info-section { padding:0 0 14px; border-bottom:1px solid var(--line); margin-bottom:14px; }
.info-section:last-child { border-bottom:0; margin-bottom:0; padding-bottom:0; }
.info-section h3 { margin:0 0 11px; font:700 12px Manrope; }
.info-line { display:flex; gap:9px; align-items:flex-start; color:var(--ink-soft); font-size:11px; margin:9px 0; }
.info-line svg { width:15px; height:15px; color:var(--purple); }
.info-line b { display:block; color:var(--ink); font-weight:500; margin-top:3px; }
.mini-tags { display:flex; flex-wrap:wrap; gap:6px; }
.mini-tags .tag { font-size:10px; }
.alert-box { border-radius:10px; padding:11px; color:#6068ab; background:#f0efff; font-size:10px; line-height:1.5; display:flex; gap:7px; }
.alert-box svg { color:var(--purple); width:15px; }

.live-card { padding:12px 16px 15px; margin-bottom:11px; }
.tabbar button:disabled { opacity:.45; cursor:not-allowed; color:#9692ba; }
.processing-results-card { display:grid; grid-template-columns:64px minmax(0,1fr); align-items:start; gap:18px; padding:28px; margin-bottom:11px; background:linear-gradient(135deg,rgba(255,255,255,.94),rgba(245,240,255,.9)); border:1px solid rgba(126,91,230,.16); }
.processing-results-icon { width:64px; height:64px; display:grid; place-items:center; border-radius:22px; color:#713cff; background:linear-gradient(135deg,#f3e8ff,#e0e7ff); }
.processing-results-icon svg { width:30px; height:30px; }
.processing-results-icon .synthesis-spinner { position:absolute; width:48px; height:48px; border:3px solid rgba(113,60,255,.16); border-top-color:#713cff; border-right-color:#a34dff; border-radius:50%; animation:synthesis-spin .85s linear infinite; }
.processing-results-icon { position:relative; }
.processing-results-icon .synthesis-spinner + svg { position:relative; z-index:1; }
.processing-results-card h2 { margin:4px 0 7px; color:var(--ink); font-size:22px; }
.processing-results-card p { margin:0; color:var(--ink-soft); line-height:1.6; }
.processing-live { display:flex; align-items:center; gap:8px; margin-top:16px; color:#6436d8; font-size:12px; }
.processing-live span:last-child { color:#8a86ae; }
.synthesis-spinner.small { display:inline-block; width:14px; height:14px; border:2px solid rgba(113,60,255,.2); border-top-color:#713cff; border-radius:50%; animation:synthesis-spin .85s linear infinite; }
@keyframes synthesis-spin { to { transform:rotate(360deg); } }
.processing-steps { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.processing-steps span { display:inline-flex; align-items:center; gap:6px; padding:8px 11px; border-radius:999px; color:#74739a; background:#f2f0fb; font-size:12px; }
.processing-steps svg { width:14px; height:14px; }
.processing-steps .complete { color:#168b78; background:#e6f7f1; }
.processing-steps .active { color:#6436d8; background:#eee7ff; }
.processing-steps span:last-child { color:var(--purple-dark); background:#eee7ff; }
.recording-strip { min-height:64px; display:flex; align-items:center; gap:14px; padding:0 13px; border-radius:11px; background:rgba(249,248,255,.7); }
.recording-dot { width:10px; height:10px; border-radius:50%; background:var(--teal); box-shadow:0 0 0 5px #daf5ec; flex:none; }
.recording-text { font-weight:600; white-space:nowrap; font-size:13px; }
.recording-text small { color:var(--purple-dark); font-size:12px; margin-left:8px; }
.timer-readouts { display:flex; align-items:center; gap:8px; flex:none; }
.timer-readout { display:grid; gap:2px; min-width:74px; padding:6px 9px; border:1px solid #ded8f7; border-radius:9px; background:#fff; }
.timer-readout span { color:var(--muted); font-size:9px; font-weight:700; line-height:1; text-transform:uppercase; letter-spacing:.35px; }
.timer-readout strong { color:var(--purple-dark); font:800 12px Manrope; letter-spacing:.35px; }
.timer-readout.recording-readout { border-color:#d7c9ff; background:#f7f3ff; }
.timer-readout.recording-readout strong { color:var(--purple-dark); }
.recording-strip .timer-readout:not(.recording-readout), .footer-timers .timer-readout:not(.recording-readout) { display:none; }
.recording-timer-inline { flex:none; }
.footer-timers { margin-right:auto; }
.capture-mode { flex:none; padding:5px 8px; border-radius:99px; color:#5370a6; background:#edf3ff; font-size:10px; white-space:nowrap; }
.wave { flex:1; height:35px; display:flex; align-items:center; justify-content:center; gap:2px; overflow:hidden; }
.wave i { width:2px; height:var(--h); background:linear-gradient(#a798ff,#6746f4); border-radius:2px; animation:pulse 1.15s ease-in-out infinite alternate; }
.wave i:nth-child(3n){ animation-delay:.2s;}.wave i:nth-child(4n){ animation-delay:.45s;}
@keyframes pulse { from{transform:scaleY(.55);opacity:.46} to{transform:scaleY(1.15);opacity:1} }
.recording-actions { display:flex; gap:8px; }
.round-action { width:45px; height:45px; border:1px solid #dad7f2; border-radius:50%; display:grid; place-items:center; background:#fff; color:var(--purple); }
.round-action:disabled { opacity:.35; cursor:default; }
.round-action.stop { color:#f13f5e; border-color:#ffbdca; background:#fff8f9; }
.live-transcript-card { margin-top:11px; padding:0; overflow:hidden; }
.live-transcript-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:15px 17px; border-bottom:1px solid var(--line); }
.live-transcript-heading div { display:grid; gap:4px; }
.live-transcript-heading strong { color:var(--ink); font:700 13px Manrope; }
.live-transcript-heading span { color:var(--muted); font-size:11px; }
.transcript-status { padding:5px 9px; border-radius:99px; color:#168c78 !important; background:#e7f8f2; font-size:10px !important; }
.transcript-body { min-height:112px; max-height:190px; overflow:auto; padding:15px 17px 17px; color:var(--ink-soft); font-size:13px; line-height:1.6; }
.transcript-body p { margin:0; }
.transcript-body .interim-transcript { color:#8b84ba; font-style:italic; margin-top:7px; }
.live-work { display:grid; grid-template-columns:minmax(0,1fr) 292px; gap:11px; }
.copilot-card { margin-top:11px; }
.copilot-tip { padding:13px; border-radius:10px; background:#f4f1ff; color:var(--ink-soft); font-size:11px; line-height:1.55; display:flex; gap:10px; }
.copilot-tip > svg { flex:none; width:21px; height:21px; color:var(--purple); }
.copilot-tip > div { flex:1; min-width:0; position:relative; z-index:1; }
.copilot-tip strong { display:block; color:var(--purple-dark); margin-bottom:4px; }
.copilot-tip span { display:block; color:var(--ink-soft); }
.insight-bullet-list { margin:0; padding-left:17px; color:var(--ink-soft); }
.insight-bullet-list li { padding-left:2px; font-size:13px; font-weight:700; }
.insight-bullet-list strong, .copilot-message strong { color:var(--ink); font-weight:800; }
.copilot-tip.has-insights { position:relative; box-shadow:0 5px 0 -2px #e8e1ff, 0 10px 0 -4px #f0ebff; }
.copilot-tip:not(.has-insights) { display:none; }
.copilot-tip.has-insights { font-size:13px; line-height:1.6; }
.copilot-tip.has-insights > div > strong { font-size:14px; font-weight:800; }
.copilot-tip.has-insights::before,
.copilot-tip.has-insights::after { content:""; position:absolute; inset:5px 7px -5px; border:1px solid #e8e1ff; border-radius:10px; background:#faf9ff; z-index:0; }
.copilot-tip.has-insights::after { inset:10px 13px -10px; background:#fdfcff; border-color:#f0ebff; z-index:-1; }
.insight-card-nav { display:flex; align-items:center; gap:7px; margin-top:9px; }
.insight-card-nav button { width:23px; height:23px; display:grid; place-items:center; border:1px solid #d9d3ff; border-radius:7px; color:var(--purple-dark); background:#fff; padding:0; }
.insight-card-nav button:disabled { opacity:.35; cursor:default; }
.insight-card-nav button svg { width:13px; height:13px; }
.insight-card-nav small { color:var(--muted); font-size:10px; }
.copilot-chat { display:grid; gap:8px; max-height:none; overflow:visible; margin-top:11px; padding-right:3px; }
.copilot-message { max-width:88%; padding:9px 11px; border-radius:11px; font-size:11px; line-height:1.45; }
.copilot-message span { display:block; margin-bottom:3px; color:var(--purple-dark); font:700 10px Manrope; }
.copilot-message p { margin:0; color:var(--ink-soft); }
.copilot-message.user { justify-self:end; background:#ede9ff; border-bottom-right-radius:4px; }
.copilot-message.assistant { justify-self:start; background:#f6f8ff; border:1px solid #e7e4ff; border-bottom-left-radius:4px; }
.copilot-empty { padding:9px 11px; border:1px dashed #d9d3ff; border-radius:10px; color:var(--muted); font-size:11px; line-height:1.45; }
.suggestions { display:flex; flex-wrap:wrap; gap:7px; margin-top:11px; }
.suggestions button { border:1px solid #d9d3ff; color:var(--purple-dark); background:transparent; border-radius:99px; padding:7px 10px; font-size:10px; }
.copilot-input { margin-top:11px; height:43px; border:1px solid #d8d5f4; border-radius:8px; display:flex; align-items:center; gap:8px; padding:0 10px; }
.copilot-input input { border:0; outline:0; flex:1; min-width:0; background:transparent; font-size:11px; }
.copilot-input button { background:transparent; color:var(--purple); }
.record-footer { display:flex; align-items:center; gap:17px; margin-top:11px; }
.record-footer .button.primary { margin-left:auto; min-width:183px; }
.record-footer .timer { color:var(--purple-dark); font-size:12px; }
.ai-summary h2 { font:700 14px Manrope; margin:0; }
.ai-summary h3 { font:700 11px Manrope; margin:17px 0 8px; }
.ai-summary ul { padding-left:16px; margin:0; color:var(--ink-soft); font-size:11px; line-height:1.7; }
.risk-line { display:grid; grid-template-columns:1fr 1fr; border-top:1px solid var(--line); padding-top:13px; margin-top:13px; gap:10px; }
.risk-line strong { color:#139d7b; display:block; font-size:13px; }
.risk-line span { color:var(--ink-soft); font-size:10px; }

.empty-card { text-align:center; min-height:360px; display:grid; place-items:center; }
.empty-card h2 { margin:14px 0 6px; font:700 20px Manrope; }
.empty-card p { color:var(--ink-soft); font-size:13px; max-width:420px; margin:0 auto 18px; line-height:1.6; }
.saved-session-card { display:flex; align-items:center; gap:14px; padding:22px; }
.saved-consultation-card { padding:24px; }
.saved-consultation-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding-bottom:20px; border-bottom:1px solid rgba(115,93,210,.12); }
.saved-consultation-heading h2 { margin:4px 0 6px; color:var(--ink); font:800 22px Manrope; }
.saved-consultation-heading p { margin:0; color:var(--ink-soft); }
.saved-consultation-badge { display:inline-flex; align-items:center; gap:6px; padding:8px 11px; color:#168b78; background:#e6f7f1; border-radius:999px; font-size:12px; white-space:nowrap; }
.saved-consultation-badge svg { width:14px; height:14px; }
.saved-consultation-document { max-height:520px; overflow:auto; padding:22px 4px 10px 0; scrollbar-width:thin; scrollbar-color:#8d72f4 rgba(229,224,255,.62); }
.saved-consultation-document h3 { margin:0 0 6px; color:var(--ink); font:800 15px Manrope; }
.saved-consultation-document p { margin:0 0 20px; color:#4c4c84; font-size:14px; line-height:1.65; }
.saved-consultation-notes { margin-top:18px; padding-top:18px; border-top:1px solid rgba(115,93,210,.12); }
.saved-consultation-notes h3 { margin:0 0 7px; color:var(--ink); font:800 14px Manrope; }
.saved-consultation-notes p { margin:0; color:var(--ink-soft); font-size:14px; line-height:1.65; }
.saved-consultation-note { display:flex; align-items:center; gap:8px; margin-top:12px; padding:12px 14px; color:#69659d; background:#f3f0ff; border-radius:12px; font-size:12px; }
.saved-consultation-note svg { flex:none; width:18px; height:18px; color:#7545e8; }
.saved-consultation-actions { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:16px; padding-top:16px; border-top:1px solid rgba(115,93,210,.12); }
.saved-consultation-actions span { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:11px; line-height:1.45; }
.saved-consultation-actions span svg { flex:none; width:17px; height:17px; color:var(--purple); }
.saved-session-icon { width:46px; height:46px; display:grid; place-items:center; flex:none; border-radius:15px; color:var(--purple); background:linear-gradient(145deg,#f2e9ff,#e4e4ff); }
.saved-session-icon svg { width:23px; height:23px; }
.saved-session-card h2 { margin:0 0 5px; font:800 16px Manrope; }
.saved-session-card p { margin:0; color:var(--ink-soft); font-size:12px; }
.saved-session-actions { display:flex; gap:9px; margin-left:auto; }
.waiting-start { justify-self:end; gap:6px; margin-right:14px; color:var(--purple-dark); border-color:#d8cff9; background:#f8f5ff; white-space:nowrap; }
.waiting-start:hover { color:#fff; border-color:transparent; background:linear-gradient(135deg,#a855f7,#5b5ce2); }
.waiting-start svg { width:15px; height:15px; }
.consultation-started-card { display:grid; grid-template-columns:52px minmax(0,1fr) auto; align-items:center; gap:15px; padding:24px; }
.started-consultation-icon { width:52px; height:52px; display:grid; place-items:center; border-radius:16px; color:#fff; background:linear-gradient(145deg,#a855f7,#5b5ce2); box-shadow:0 8px 22px rgba(91,75,220,.22); }
.started-consultation-icon svg { width:25px; height:25px; }
.started-consultation-copy { min-width:0; }
.started-eyebrow { color:var(--purple); font-size:11px; font-weight:700; }
.consultation-ready-card > .started-eyebrow { margin-bottom:18px; }
.started-consultation-copy h2 { margin:4px 0; color:var(--ink); font:800 18px Manrope; }
.started-consultation-copy p { margin:0; color:var(--ink-soft); font-size:12px; line-height:1.45; }
.consultation-timer { display:grid; gap:4px; min-width:108px; padding:9px 13px; border:1px solid #d8cff9; border-radius:11px; color:var(--purple-dark); background:#f5f1ff; }
.consultation-timer span { color:var(--muted); font-size:9px; font-weight:700; line-height:1; text-transform:uppercase; letter-spacing:.35px; }
.consultation-timer strong { font:800 17px Manrope; letter-spacing:.4px; }
.consultation-started-card > .button { grid-column:2 / -1; justify-self:end; }
.settings-layout { display:grid; grid-template-columns:1fr; gap:14px; align-items:start; }
/* Ordem pensada como fluxo: preferência pessoal -> como a agenda funciona -> privacidade -> documentos
   clínicos (medicamentos/assinatura) -> canais de envio (SMS). As seções fora deste form (papel timbrado,
   lembretes de consulta e Patrícia, montadas em renderSettings()) seguem depois, nessa ordem de DOM, com Patrícia por último. */
.settings-layout > .appearance-settings-card { order:1; }
.settings-layout > .settings-duration-card { order:2; }
.settings-layout > .settings-main { order:3; }
.settings-layout > .settings-days { order:4; }
.settings-layout > .settings-preview { order:5; }
.settings-layout > .privacy-settings-card { order:6; }
.settings-layout > .medication-preferences-card { order:7; }
.settings-layout > .sms-settings-card { order:8; }
.settings-layout > .signature-settings-card { order:9; }
.settings-card, .settings-preview { padding:20px; }
/* .card usa backdrop-filter, que cria um contexto de empilhamento próprio — o z-index do painel do seletor
   (.csel-panel) só vale DENTRO desse contexto, então um card mais abaixo no HTML (sem z-index nenhum) ainda
   pinta por cima dele. Sem isso, abrir "Aparência" mostrava o painel nascendo escondido atrás do card de
   "Duração das consultas" logo abaixo — parecia estar fechando sozinho. */
.settings-card { position:relative; }
.settings-card:has(.csel-panel:not([hidden])) { z-index:50; }
.settings-card-heading { display:flex; align-items:flex-start; gap:12px; margin-bottom:20px; }
.settings-card-heading h2 { margin:1px 0 5px; font:700 16px Manrope; color:var(--ink); }
.settings-card-heading p { margin:0; color:var(--ink-soft); font-size:12px; line-height:1.45; }
.settings-icon { width:40px; height:40px; border-radius:13px; flex:none; display:grid; place-items:center; color:var(--purple); background:linear-gradient(145deg,#faf8ff,#e9e2ff); }
.settings-icon svg { width:21px; height:21px; }
.settings-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.setting-field { display:grid; gap:7px; color:var(--ink-soft); font-size:11px; }
.settings-card .setting-field.full { grid-column:1 / -1; }
.setting-field input, .setting-field select { width:100%; height:40px; border:1px solid #d8d4f0; border-radius:9px; padding:0 11px; outline:0; background-color:rgba(255,255,255,.78); color:var(--ink); font-size:13px; }
.setting-field input:focus, .setting-field select:focus { border-color:var(--purple); box-shadow:0 0 0 3px #eee9ff; }
.setting-field select { appearance:none; -webkit-appearance:none; -moz-appearance:none; padding-right:36px; cursor:pointer; background-repeat:no-repeat; background-position:right 12px center; background-size:16px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23743cff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.setting-field select:disabled { cursor:not-allowed; opacity:.65; }
html[data-theme="dark"] .setting-field select { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23743cff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
/* Seletor personalizado (csel): substitui o <select> nativo por um gatilho + painel no estilo do seletor de paciente da agenda. */
.csel { position:relative; }
.csel-native { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.csel-trigger { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; height:40px; padding:0 12px; border:1px solid #d8d4f0; border-radius:9px; background:rgba(255,255,255,.78); color:var(--ink); font:700 12.5px Manrope,'DM Sans',system-ui,sans-serif; text-align:left; cursor:pointer; }
.csel-trigger span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.csel-trigger svg { width:15px; height:15px; flex:none; color:var(--purple); transition:transform .18s ease; }
.csel.is-open .csel-trigger svg { transform:rotate(180deg); }
.csel-trigger:hover { border-color:#c5b5ff; }
.csel-trigger:focus-visible, .csel.is-open .csel-trigger { outline:0; border-color:var(--purple); box-shadow:0 0 0 3px #eee9ff; }
.csel-trigger:disabled { opacity:.55; cursor:not-allowed; }
.csel-panel { position:absolute; z-index:45; left:0; right:0; top:calc(100% + 7px); display:grid; gap:5px; max-height:250px; overflow:auto; margin:0; padding:7px; border:1px solid #e3ddfa; border-radius:14px; background:#fff; box-shadow:0 20px 45px rgba(38,31,108,.18); }
/* O atributo `hidden` sozinho não vence a regra acima (mesma especificidade, mas o CSS do site sempre
   ganha do estilo padrão do navegador) — sem isso, todo painel de seleção customizado renderiza sempre
   aberto, mesmo antes de qualquer clique. */
.csel-panel[hidden] { display:none; }
.csel-option { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; padding:9px 11px; border:1px solid transparent; border-radius:10px; color:var(--ink); background:#fff; text-align:left; font:600 12px Manrope,'DM Sans',system-ui,sans-serif; }
.csel-option:hover { border-color:#c5b5ff; background:#f2edff; }
.csel-option.selected { border-color:#c5b5ff; background:#eee8ff; color:var(--purple-dark); }
.csel-option svg { width:14px; height:14px; flex:none; color:var(--purple); }
.csel-panel::-webkit-scrollbar { width:8px; }
.csel-panel::-webkit-scrollbar-track { background:transparent; }
.csel-panel::-webkit-scrollbar-thumb { border-radius:99px; background:#c9bdf2; }
html[data-theme="dark"] .csel-trigger { border-color:#4a4f7d; background:#202448; color:var(--ink); }
html[data-theme="dark"] .csel-panel { border-color:#4a4f7d; background:#20244a; box-shadow:0 20px 45px rgba(0,0,0,.4); }
html[data-theme="dark"] .csel-option { background:#20244a; color:var(--ink); }
html[data-theme="dark"] .csel-option:hover { border-color:#5b5399; background:#302b5e; }
html[data-theme="dark"] .csel-option.selected { border-color:#5b5399; background:#392f6e; color:#cabfff; }
/* Roda de horário (wheel): seletor de rolagem no estilo "picker" para os campos de horário. */
.wheel { position:relative; border:1px solid #d8d4f0; border-radius:12px; background:rgba(255,255,255,.78); overflow:hidden; }
.wheel-track { overflow-y:auto; scroll-snap-type:y mandatory; scrollbar-width:none; -ms-overflow-style:none; outline:0; }
.wheel-track:focus-visible { box-shadow:inset 0 0 0 2px var(--purple); }
.wheel-track::-webkit-scrollbar { display:none; }
.wheel-item { height:34px; display:flex; align-items:center; justify-content:center; scroll-snap-align:center; color:var(--muted); font:600 13px Manrope,'DM Sans',system-ui,sans-serif; cursor:pointer; }
.wheel-item.is-selected { color:var(--purple-dark); font:800 15px Manrope,'DM Sans',system-ui,sans-serif; }
.wheel-highlight { position:absolute; left:0; right:0; pointer-events:none; border-top:1px solid #d8c9ff; border-bottom:1px solid #d8c9ff; background:linear-gradient(180deg,rgba(238,232,255,.55),rgba(238,232,255,.25)); }
html[data-theme="dark"] .wheel { border-color:#4a4f7d; background:#202448; }
html[data-theme="dark"] .wheel-item { color:#8e97c0; }
html[data-theme="dark"] .wheel-item.is-selected { color:#cabfff; }
html[data-theme="dark"] .wheel-highlight { border-color:#5b5399; background:linear-gradient(180deg,rgba(57,47,110,.6),rgba(57,47,110,.25)); }
.whatsapp-settings-actions { display:flex; gap:9px; flex-wrap:wrap; margin-top:14px; }
.signature-settings-status { display:flex; align-items:flex-start; gap:9px; margin-bottom:16px; }
.signature-settings-status > div { display:grid; gap:3px; }
.signature-settings-status strong { color:var(--ink); font-size:12px; }
.signature-settings-status small { color:var(--muted); font-size:10px; line-height:1.4; }
.signature-settings-actions { display:flex; gap:9px; flex-wrap:wrap; margin-top:14px; }
.settings-hint { display:block; margin-top:10px; color:var(--muted); font-size:10px; line-height:1.45; }
.settings-hint-error { color:#c22346; font-weight:700; }
.medication-preference-list { display:grid; gap:10px; margin-top:14px; }
.medication-preference-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; gap:10px; align-items:end; padding:12px; border:1px solid #e1dcf5; border-radius:12px; background:rgba(250,249,255,.78); }
.medication-preference-row label { display:grid; gap:6px; color:var(--ink-soft); font-size:10px; }
.medication-preference-row input { width:100%; height:38px; padding:0 10px; border:1px solid #d8d4f0; border-radius:9px; outline:0; background:rgba(255,255,255,.8); color:var(--ink); font-size:12px; }
.medication-preference-row input:focus { border-color:var(--purple); box-shadow:0 0 0 3px #eee9ff; }
.medication-preference-row-actions { display:flex; align-items:center; gap:8px; grid-column:1 / -1; }
.medication-preference-row-actions .button { min-height:31px; }
.medication-preference-row-actions .button svg { width:14px; height:14px; }
.medication-preference-row-actions .icon-button { width:30px; height:30px; margin-left:auto; color:#a15b70; }
.medication-preference-actions { display:flex; flex-wrap:wrap; gap:9px; margin-top:10px; }
.medication-catalog-modal { width:min(760px,100%); height:min(760px,calc(100vh - 48px)); max-height:calc(100vh - 48px); overflow:hidden; display:flex; flex-direction:column; }
.medication-catalog-modal > * { flex-shrink:0; }
.medication-catalog-note { margin:17px 0 15px; padding:11px 12px; border:1px solid #e1daf7; border-radius:11px; color:var(--ink-soft); background:#faf8ff; font-size:10px; line-height:1.45; }
.medication-catalog-search { display:grid; gap:6px; color:var(--ink-soft); font-size:10px; }
.medication-catalog-search input { width:100%; height:40px; padding:0 11px; border:1px solid #d8d4f0; border-radius:9px; outline:0; color:var(--ink); background:#fff; font-size:12px; }
.medication-catalog-search input:focus { border-color:var(--purple); box-shadow:0 0 0 3px #eee9ff; }
.medication-catalog-count { margin:10px 0 8px; color:var(--muted); font-size:10px; }
.medication-catalog-list { display:grid; gap:8px; flex:1 1 auto; min-height:0; max-height:none; overflow-y:auto; overflow-x:hidden; padding-right:8px; }
.medication-catalog-item { display:grid; grid-template-columns:minmax(150px,.7fr) minmax(0,1.3fr); gap:12px; align-items:center; padding:11px 12px; border:1px solid #e3ddf6; border-radius:11px; background:rgba(255,255,255,.7); }
.medication-catalog-item[hidden] { display:none; }
.medication-catalog-item-heading { display:grid; gap:3px; }
.medication-catalog-item-heading strong { color:var(--ink); font:800 11px Manrope; }
.medication-catalog-item-heading small { color:var(--muted); font-size:9px; line-height:1.3; }
.medication-catalog-options { display:flex; flex-wrap:wrap; gap:6px; }
.medication-catalog-option { min-height:29px; padding:0 9px; border:1px solid #ddd5f5; border-radius:999px; color:var(--purple-dark); background:#faf8ff; font-size:10px; text-align:left; }
.medication-catalog-option:hover { border-color:#9a7aff; background:#f0eaff; }
.medication-catalog-option.active-option { color:var(--ink-soft); background:#f5f4fb; }
.medication-catalog-option.is-selected { border-color:#7c55ec; color:#fff; background:linear-gradient(135deg,#9d5cff,#5b5ce2); box-shadow:0 4px 10px rgba(101,75,220,.18); }
.day-settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.day-setting { display:flex; align-items:center; gap:9px; min-height:40px; padding:0 11px; border:1px solid #e1def5; border-radius:9px; background:rgba(255,255,255,.45); color:var(--ink); font-size:12px; cursor:pointer; }
.day-setting:has(input:checked) { border-color:#bca8ff; background:#f2edff; color:var(--purple-dark); }
.day-setting input { appearance:none; width:17px; height:17px; border:1px solid #aaa8d6; border-radius:5px; background:#fff; position:relative; flex:none; }
.day-setting input:checked { border-color:var(--purple); background:var(--purple); }
.day-setting input:checked::after { content:'✓'; color:#fff; position:absolute; left:3px; top:-1px; font-size:13px; }
.settings-preview { min-height:100%; }
.preview-stat { display:flex; justify-content:space-between; gap:12px; padding:13px 0; border-bottom:1px solid var(--line); color:var(--ink-soft); font-size:11px; }
.preview-stat:last-child { border-bottom:0; }
.preview-stat strong { color:var(--ink); font-size:12px; text-align:right; }
.orientation-types { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0; }
.orientation-type { display:inline-flex; align-items:center; min-height:34px; padding:0 12px; border:1px solid #ded8f4; border-radius:999px; background:rgba(255,255,255,.58); color:var(--ink-soft); font-size:11px; }
.orientation-type.active { border-color:#bca8ff; background:#f2edff; color:var(--purple-dark); font-weight:700; }
html[data-theme="dark"] .orientation-type { border-color:#484276; background:rgba(45,40,89,.72); color:#c5c9e8; }
html[data-theme="dark"] .orientation-type.active { border-color:#9582e9; background:#352e70; color:#eeeaff; }

.ambient-panel { position:relative; overflow:hidden; background: linear-gradient(90deg, rgba(237,232,255,.65), rgba(255,247,250,.22)), url('/waiting-room-background.jpg') center/cover no-repeat; border-left:1px solid rgba(255,255,255,.76); }
.ambient-panel::before { content:''; position:absolute; inset:0; background: radial-gradient(ellipse at 55% 46%, rgba(255,255,255,.61), transparent 45%), linear-gradient(180deg,rgba(241,235,255,.45),rgba(215,194,217,.2)); opacity:.52; }
.ambient-letters { position:absolute; z-index:2; top:205px; left:26px; color:#6c65a7; font:500 13px/2.25 Manrope; letter-spacing:2px; transform:rotate(-4deg); opacity:.84; }
.ambient-plant { position:absolute; z-index:1; width:35px; height:170px; border-radius:100% 0 100% 0; border-left:4px solid rgba(94,131,106,.5); background:linear-gradient(135deg,rgba(107,170,135,.38),rgba(202,225,188,.05)); transform:rotate(25deg); right:24px; bottom:216px; }
.ambient-plant-two { width:44px; height:225px; right:7px; bottom:144px; transform:rotate(-20deg); opacity:.75; }
.ambient-plant, .ambient-plant-two, .ambient-table { display:none; }

.search-results { display:none; position:absolute; top:48px; left:0; right:0; z-index:9; background:#fff; border:1px solid var(--line); border-radius:12px; padding:6px; box-shadow:0 16px 35px rgba(44,34,114,.15); }
.search-results.open { display:block; }
.search-result { display:flex; gap:9px; align-items:center; padding:9px; border-radius:8px; text-align:left; background:transparent; width:100%; }
.search-result:hover { background:#f4f0ff; }
.search-result span { color:var(--ink-soft); font-size:11px; display:block; margin-top:2px; }
.toast { position:fixed; right:26px; bottom:22px; z-index:20; background:#161c66; color:#fff; padding:12px 16px; border-radius:10px; box-shadow:0 10px 30px rgba(26,21,90,.24); font-size:12px; opacity:0; transform:translateY(15px); pointer-events:none; transition:.25s ease; }
.toast.show { opacity:1; transform:translateY(0); }

.results-modal-backdrop { position:fixed; inset:0; z-index:60; display:flex; align-items:center; justify-content:center; padding:24px; background:rgba(37,34,77,.44); backdrop-filter:blur(9px); }
.results-modal { width:min(1350px,calc(100vw - 110px)); max-height:calc(100vh - 70px); overflow:auto; background:linear-gradient(145deg,rgba(255,253,255,.98),rgba(249,248,255,.98)); border:1px solid rgba(255,255,255,.95); border-radius:16px; box-shadow:0 25px 80px rgba(26,26,78,.28); }
.results-header { position:relative; display:flex; justify-content:space-between; overflow:hidden; padding:26px 30px 18px; background:linear-gradient(135deg,#fff8ff,#f5efff 58%,#fbfcff); }
.results-header::after { content:''; position:absolute; width:54%; height:95px; right:4%; top:8px; border-radius:55% 45% 50% 42%; background:linear-gradient(135deg,rgba(201,178,255,.18),rgba(255,255,255,0)); transform:rotate(-9deg); border:1px solid rgba(184,151,255,.16); }
.results-title { position:relative; z-index:1; display:flex; align-items:flex-start; gap:17px; }
.results-sparkle { width:45px; height:45px; display:grid; place-items:center; color:var(--purple); }
.results-sparkle svg { width:34px; height:34px; }
.results-title h1 { margin:0; color:var(--ink); font:800 22px Manrope; letter-spacing:-.7px; }
.results-title p { margin:8px 0 0; color:var(--ink-soft); font-size:13px; }
.results-close { position:relative; z-index:2; align-self:flex-start; background:transparent; color:#56609a; font-size:30px; line-height:1; }
.results-tabs { display:flex; max-width:650px; margin:0 28px; overflow:hidden; border:1px solid var(--line); border-radius:14px 14px 0 0; background:rgba(247,244,255,.75); }
.results-tabs button { min-width:310px; display:flex; align-items:center; gap:12px; padding:15px 22px; background:transparent; color:var(--ink-soft); text-align:left; border-bottom:3px solid transparent; }
.results-tabs button.active { background:#fff; color:var(--ink); border-bottom-color:var(--purple); }
.results-tabs svg { width:25px; height:25px; color:var(--purple); }
.results-tabs span { display:grid; gap:4px; }
.results-tabs strong { font:700 13px Manrope; }
.results-tabs small { color:var(--muted); font-size:11px; }
.results-editor-shell { margin:0 28px; overflow:hidden; border:1px solid var(--line); border-radius:0 14px 14px 14px; background:rgba(255,255,255,.9); }
.results-toolbar { height:56px; display:flex; align-items:center; gap:16px; padding:0 20px; color:#4f579d; border-bottom:1px solid var(--line); }
.results-toolbar button { display:inline-flex; align-items:center; gap:7px; background:transparent; color:inherit; font-size:14px; }
.results-toolbar button svg { width:17px; height:17px; }
.style-select, .results-model, .results-ai { padding:9px 11px; border:1px solid var(--line) !important; border-radius:9px; font-size:12px !important; }
.results-model-anchor { position:relative; margin-left:auto; }
.results-model { margin-left:0; }
.results-template-menu { position:absolute; top:calc(100% + 7px); right:0; z-index:25; min-width:150px; padding:6px; border:1px solid #ddd4ff; border-radius:11px; background:#fff; box-shadow:0 12px 28px rgba(56,42,137,.16); }
.results-template-menu[hidden] { display:none; }
.results-template-menu button { display:flex; width:100%; padding:9px 10px; border-radius:8px; color:var(--ink-soft); text-align:left; font:600 12px Manrope; }
.results-template-menu button:hover, .results-template-menu button.active { color:var(--purple-dark); background:#f2edff; }
.results-ai { color:var(--purple-dark) !important; background:#f0eaff !important; }
.toolbar-divider { width:1px; height:24px; background:var(--line); }
.results-document, .results-transcription { min-height:370px; max-height:470px; overflow:auto; outline:0; padding:20px 26px 28px; color:#4c568f; font-size:15px; line-height:1.45; }
.results-modal, .results-document, .results-transcription { scrollbar-width:thin; scrollbar-color:#8d72f4 rgba(229,224,255,.62); scrollbar-gutter:stable; }
.results-modal::-webkit-scrollbar, .results-document::-webkit-scrollbar, .results-transcription::-webkit-scrollbar { width:11px; height:11px; }
.results-modal::-webkit-scrollbar-track, .results-document::-webkit-scrollbar-track, .results-transcription::-webkit-scrollbar-track { margin:9px 0; border-radius:99px; background:linear-gradient(180deg,rgba(247,244,255,.82),rgba(232,226,255,.62)); }
.results-modal::-webkit-scrollbar-thumb, .results-document::-webkit-scrollbar-thumb, .results-transcription::-webkit-scrollbar-thumb { min-height:58px; border:3px solid transparent; border-radius:99px; background:linear-gradient(180deg,#c084fc 0%,#8b5cf6 48%,#5b5ce2 100%); background-clip:padding-box; box-shadow:inset 0 0 0 1px rgba(255,255,255,.48),0 3px 9px rgba(101,76,211,.22); }
.results-modal::-webkit-scrollbar-thumb:hover, .results-document::-webkit-scrollbar-thumb:hover, .results-transcription::-webkit-scrollbar-thumb:hover { background:linear-gradient(180deg,#d09aff 0%,#986cff 48%,#6265ec 100%); background-clip:padding-box; }
.results-document h3 { margin:0 0 3px; color:var(--ink); font:700 15px Manrope; }
.results-document p { margin:0 0 22px; padding-bottom:18px; border-bottom:1px solid rgba(95,101,188,.1); }
.ai-extraction-note { display:flex; align-items:flex-start; gap:10px; margin:4px 0 18px; padding:11px 13px; border:1px solid #ddd4ff; border-radius:10px; color:var(--purple-dark); background:linear-gradient(135deg,#faf8ff,#f1edff); }
.ai-extraction-note > svg { flex:0 0 auto; width:20px; height:20px; }
.ai-extraction-note > div { display:grid; gap:3px; }
.ai-extraction-note strong { font:700 12px Manrope; }
.ai-extraction-note span { color:var(--muted); font-size:11px; line-height:1.35; }
.results-transcription p { margin:0 0 18px; }
.review-banner { display:flex; align-items:center; gap:11px; margin:13px 28px 0; padding:13px 18px; border:1px solid #e3dcff; border-radius:10px; color:var(--purple-dark); background:#f4f1ff; }
.review-banner > svg { width:25px; height:25px; }
.review-banner > div { display:grid; flex:1; gap:4px; }
.review-banner strong { font:700 13px Manrope; }
.review-banner span { color:var(--muted); font-size:11px; }
.review-banner button { display:flex; align-items:center; gap:6px; min-height:37px; padding:0 12px; border:1px solid #d8d0ff; border-radius:9px; color:var(--purple-dark); background:#fff; font-size:11px; }
.review-banner button svg { width:15px; height:15px; }
.results-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:23px 28px 22px; }
.results-footer-left, .results-footer-right { display:flex; align-items:center; gap:12px; }
.results-footer-right { display:flex; gap:12px; }
.results-footer .button svg { width:17px; height:17px; }
.results-audio-bar { display:flex; align-items:center; gap:11px; margin:12px 28px 0; padding:11px 14px; border:1px solid #ded7fb; border-radius:11px; color:var(--purple-dark); background:linear-gradient(135deg,#faf8ff,#f0ecff); }
.results-audio-bar > svg { width:22px; height:22px; }
.results-audio-bar > div { display:grid; flex:1; gap:3px; }
.results-audio-bar strong { font:700 12px Manrope; }
.results-audio-bar span, .results-audio-bar small { color:var(--muted); font-size:10px; }
.results-audio-bar audio { width:min(290px,38%); height:32px; accent-color:var(--purple); }

.agenda-slot { cursor:pointer; border-radius:10px; transition:background .18s ease; }
.agenda-slot:hover { background:rgba(237,232,255,.56); }
.agenda-slot:hover .slot, .agenda-slot:hover .lunch, .agenda-slot:hover .week-slot { filter:saturate(1.08); box-shadow:0 5px 16px rgba(91,76,190,.1); }
.week-slot { transition:.18s ease; }
.agenda-dialog-backdrop { position:fixed; inset:0; z-index:55; display:grid; place-items:center; padding:20px; background:rgba(36,32,82,.43); backdrop-filter:blur(9px); }
.agenda-dialog { width:min(760px,100%); max-height:min(790px,calc(100vh - 40px)); overflow:auto; padding:24px; border:1px solid rgba(255,255,255,.95); border-radius:24px; background:linear-gradient(145deg,rgba(255,253,255,.98),rgba(247,246,255,.98)); box-shadow:0 25px 80px rgba(38,31,108,.3); scrollbar-width:thin; scrollbar-color:#8d72f4 rgba(229,224,255,.62); }
.agenda-dialog::-webkit-scrollbar { width:10px; }
.agenda-dialog::-webkit-scrollbar-track { background:#f0ecff; border-radius:99px; margin:9px 0; }
.agenda-dialog::-webkit-scrollbar-thumb { border:2px solid transparent; border-radius:99px; background:linear-gradient(180deg,#c084fc,#765ee8); background-clip:padding-box; }
.agenda-dialog-header { display:flex; align-items:flex-start; gap:13px; position:relative; padding-bottom:21px; border-bottom:1px solid var(--line); }
.dialog-heading-icon { width:42px; height:42px; display:grid; place-items:center; flex:none; color:var(--purple); border-radius:14px; background:linear-gradient(145deg,#f5eaff,#e7e4ff); }
.dialog-heading-icon svg { width:22px; height:22px; }
.agenda-dialog-header h2 { margin:2px 0 5px; color:var(--ink); font:800 19px Manrope; letter-spacing:-.4px; }
.agenda-dialog-header p { margin:0; color:var(--ink-soft); font-size:12px; line-height:1.45; }
.dialog-close { margin-left:auto; width:32px; height:32px; color:#59629b; background:transparent; font-size:27px; line-height:1; }
.agenda-dialog-patient { display:flex; align-items:center; gap:12px; margin:18px 0; padding:14px; border:1px solid #e3ddfa; border-radius:16px; background:linear-gradient(135deg,#fbfaff,#f4f0ff); }
.agenda-dialog-patient > div:nth-child(2) { display:grid; gap:3px; flex:1; }
.agenda-dialog-patient strong { color:var(--ink); font:700 14px Manrope; }
.agenda-dialog-patient span, .agenda-dialog-patient small { color:var(--ink-soft); font-size:11px; }
.agenda-dialog-patient small { margin-top:2px; }
.dialog-status { align-self:flex-start; padding:7px 10px; border-radius:99px; color:var(--purple-dark) !important; background:#e9e1ff; }
.agenda-dialog-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:9px; }
.agenda-dialog-actions .button { min-height:42px; }
.button.danger { color:#d64662; border-color:#f5c8d0; background:#fff8fa; }
.button.danger:hover { background:#fff0f3; }
.agenda-dialog-grid { display:grid; grid-template-columns:minmax(300px,1fr) minmax(220px,.8fr); gap:18px; padding:20px 0; }
.agenda-dialog-calendar { padding:15px; border:1px solid #e3ddfa; border-radius:16px; background:rgba(255,255,255,.62); }
.dialog-calendar-head, .dialog-section-title { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.dialog-calendar-head { color:var(--ink); font:700 13px Manrope; margin-bottom:13px; }
.dialog-calendar-head div { display:flex; gap:4px; }
.dialog-calendar-head button { width:27px; height:27px; display:grid; place-items:center; border:1px solid #e4def8; border-radius:8px; color:var(--purple-dark); background:#fff; }
.dialog-calendar-head svg { width:14px; height:14px; }
.dialog-calendar-week, .dialog-calendar-dates { display:grid; grid-template-columns:repeat(7,1fr); gap:5px; text-align:center; }
.dialog-calendar-week { margin-bottom:6px; color:var(--muted); font-size:9px; }
.dialog-calendar-dates button { min-height:31px; border-radius:9px; color:var(--ink-soft); background:transparent; font-size:11px; }
.dialog-calendar-dates button:hover { color:var(--purple-dark); background:#f0eaff; }
.dialog-calendar-dates button.muted { color:#bebbd3; }
.dialog-calendar-dates button.selected { color:#fff; background:linear-gradient(145deg,#a855f7,#5b5ce2); box-shadow:0 5px 13px rgba(108,75,220,.25); }
.available-times { padding:15px; border:1px solid #e3ddfa; border-radius:16px; background:rgba(255,255,255,.62); }
.dialog-section-title { margin-bottom:13px; }
.dialog-section-title strong { color:var(--ink); font:700 12px Manrope; }
.dialog-section-title span { color:var(--muted); font-size:10px; text-align:right; }
.time-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; max-height:260px; overflow:auto; padding-right:3px; }
.available-time { display:flex; align-items:center; justify-content:center; gap:6px; min-height:38px; border:1px solid #ded8f7; border-radius:10px; color:var(--purple-dark); background:#fff; font:700 12px Manrope; }
.available-time:hover, .available-time.selected { border-color:#9c7bfa; color:#fff; background:linear-gradient(135deg,#a855f7,#5b5ce2); box-shadow:0 5px 13px rgba(108,75,220,.2); }
.available-time svg { width:15px; height:15px; }
.assignment-time-options { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:-4px 0 19px; max-height:150px; overflow:auto; padding:3px; }
.agenda-dialog-footer { display:flex; justify-content:flex-end; gap:10px; padding-top:18px; margin-top:3px; border-top:1px solid var(--line); }
.agenda-dialog-footer .button[disabled] { opacity:.42; pointer-events:none; }
.assignment-summary { display:flex; justify-content:space-between; align-items:center; margin:20px 0 18px; padding:13px 15px; border:1px solid #e2dcfb; border-radius:13px; color:var(--purple-dark); background:#f4f0ff; font-size:11px; }
.assignment-summary span { display:flex; align-items:center; gap:7px; }
.assignment-summary svg { width:16px; height:16px; }
.assignment-summary strong { font:800 15px Manrope; }
.assignment-time-fixed { display:flex; align-items:center; justify-content:space-between; margin:-4px 0 19px; padding:12px 15px; border:1px solid #d9d0ff; border-radius:12px; color:var(--purple-dark); background:linear-gradient(135deg,#f7f3ff,#eef4ff); font-size:11px; }
.assignment-time-fixed span { display:flex; align-items:center; gap:7px; color:var(--muted); }
.assignment-time-fixed svg { width:16px; height:16px; color:var(--purple); }
.assignment-time-fixed strong { font:800 15px Manrope; color:var(--purple-dark); }
.dialog-search { display:flex; align-items:center; gap:9px; height:45px; padding:0 13px; border:1px solid #dcd6f5; border-radius:11px; color:var(--purple); background:#fff; }
.dialog-search:focus-within { border-color:var(--purple); box-shadow:0 0 0 3px #eee9ff; }
.dialog-search svg { width:17px; height:17px; }
.dialog-search input { width:100%; border:0; outline:0; color:var(--ink); background:transparent; font-size:12px; }
.dialog-patient-results { display:grid; gap:7px; max-height:220px; overflow:auto; margin-top:11px; padding-right:3px; }
.dialog-search-hint { padding:19px 12px; border:1px dashed #d8d1f2; border-radius:11px; color:var(--muted); text-align:center; font-size:11px; }
.dialog-patient-option { display:flex; align-items:center; gap:10px; width:100%; padding:9px 11px; border:1px solid transparent; border-radius:11px; color:var(--ink); background:#fff; text-align:left; }
.dialog-patient-option:hover, .dialog-patient-option.selected { border-color:#c5b5ff; background:#f2edff; }
.dialog-patient-option > span { display:grid; gap:3px; flex:1; }
.dialog-patient-option strong { font:700 12px Manrope; }
.dialog-patient-option small { color:var(--ink-soft); font-size:10px; }
.dialog-patient-option > svg { width:16px; height:16px; color:var(--purple); }
.selected-patient { display:flex; align-items:center; gap:10px; margin-top:12px; padding:10px; border-radius:11px; color:var(--purple-dark); background:#eee8ff; }
.selected-patient > span { display:grid; gap:3px; flex:1; }
.selected-patient strong { font:700 12px Manrope; }
.selected-patient small { color:var(--ink-soft); font-size:10px; }
.selected-patient-clear { display:grid; place-items:center; width:28px; height:28px; flex:0 0 28px; border:1px solid #cfc1ff; border-radius:9px; color:var(--purple-dark); background:#fff; font:700 19px/1 Manrope; }
.selected-patient-clear:hover { border-color:var(--purple); color:#fff; background:linear-gradient(135deg,#a855f7,#5b5ce2); }
.agenda-status-panel { margin:18px 0; padding:14px; border:1px solid #e2dcfb; border-radius:15px; background:linear-gradient(145deg,#fbfaff,#f4f0ff); }
.agenda-status-panel.doctor-controlled { background:linear-gradient(145deg,#f3efff,#eef5ff); }
.agenda-status-panel-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.agenda-status-panel-head > div { display:grid; gap:4px; }
.agenda-status-panel-head strong { color:var(--ink); font:700 12px Manrope; }
.agenda-status-panel-head small { color:var(--muted); font-size:10px; }
.agenda-status-panel-head .status { white-space:nowrap; }
.agenda-status-actions { display:grid; grid-template-columns:minmax(0,1fr) minmax(190px,1fr); gap:10px; margin-top:13px; }
.agenda-status-select, .waiting-switch { display:flex; align-items:center; gap:9px; min-height:43px; padding:8px 10px; border:1px solid #ded8f7; border-radius:11px; background:#fff; }
.agenda-status-select { flex-direction:column; align-items:stretch; gap:4px; }
.agenda-status-select > span { color:var(--muted); font-size:10px; }
.agenda-status-select select { width:100%; border:0; outline:0; color:var(--purple-dark); background:transparent; font:700 12px Manrope; }
.waiting-switch { cursor:pointer; }
.waiting-switch input { position:absolute; opacity:0; pointer-events:none; }
.waiting-switch > span:last-child { display:grid; gap:3px; }
.waiting-switch strong { color:var(--ink); font:700 11px Manrope; }
.waiting-switch small { color:var(--muted); font-size:10px; }
.switch-visual { width:40px; height:23px; flex:none; padding:3px; border-radius:99px; background:#d9d7e8; transition:.2s ease; }
.switch-visual i { display:block; width:17px; height:17px; border-radius:50%; background:#fff; box-shadow:0 2px 5px rgba(35,32,92,.18); transition:.2s ease; }
.waiting-switch input:checked + .switch-visual { background:linear-gradient(135deg,#a855f7,#5b5ce2); }
.waiting-switch input:checked + .switch-visual i { transform:translateX(17px); }
.privacy-consent-backdrop { z-index:120; }
.privacy-consent-modal { width:min(540px,calc(100vw - 32px)); }
.privacy-consent-copy { display:grid; grid-template-columns:42px 1fr; gap:12px; margin:18px 0; color:var(--ink-soft); line-height:1.55; }
.privacy-consent-copy .settings-icon { grid-row:span 3; }
.privacy-consent-copy p { margin:0; }
.privacy-consent-copy small { grid-column:2; color:var(--muted); font-size:12px; }
.privacy-settings-card { grid-column:1 / -1; }
.privacy-status { display:flex; align-items:flex-start; gap:10px; padding:12px 14px; border:1px solid #e5defc; border-radius:13px; background:linear-gradient(145deg,#fbfaff,#f4f0ff); }
.privacy-status > div { display:grid; gap:3px; }
.privacy-status strong { color:var(--ink); font:700 12px Manrope; }
.privacy-status small, .privacy-actions small { color:var(--muted); font-size:11px; line-height:1.45; }
.status-dot { width:10px; height:10px; margin-top:3px; border-radius:50%; background:#15a77d; box-shadow:0 0 0 5px rgba(21,167,125,.12); }
.status-dot.warning { background:#db8b16; box-shadow:0 0 0 5px rgba(219,139,22,.12); }
.privacy-actions { display:flex; align-items:center; gap:12px; margin-top:13px; }
.privacy-actions .button { flex:none; }
.consent-request { display:flex; align-items:center; gap:11px; width:min(100%,520px); margin:16px auto 0; padding:13px 15px; border:1px solid #d9d0fb; border-radius:14px; color:var(--purple-dark); background:linear-gradient(135deg,#faf8ff,#f1edff); text-align:left; cursor:pointer; }
.consent-request > svg:first-child { width:20px; height:20px; flex:none; color:var(--purple); }
.consent-request > span { display:grid; gap:3px; flex:1; }
.consent-request strong { font:700 12px Manrope; }
.consent-request small { color:var(--muted); font-size:11px; line-height:1.4; }
.consent-request > svg:last-child { width:16px; height:16px; }
.consent-request:hover { border-color:var(--purple); transform:translateY(-1px); }
.consent-footer { display:flex; align-items:center; gap:10px; width:min(100%,520px); margin:16px auto 0; padding:11px 13px; border-radius:13px; background:#f5fbf8; color:#167b61; text-align:left; }
.consent-footer.pending { background:#fff9ed; color:#a36b13; }
.consent-footer > svg { width:18px; height:18px; flex:none; }
.consent-footer > span { display:grid; gap:3px; flex:1; }
.consent-footer strong { font:700 11px Manrope; }
.consent-footer small { color:var(--muted); font-size:10px; line-height:1.4; }
.consent-footer .button { flex:none; }
.consent-signed-badge { display:inline-flex; align-items:center; gap:4px; margin-left:8px; padding:5px 8px; border:1px solid #ddd0ff; border-radius:999px; color:var(--purple-dark); background:#f5f0ff; font:700 10px Manrope; vertical-align:middle; white-space:nowrap; }
.consent-dialog-backdrop { z-index:120; background:rgba(36,32,82,.46); backdrop-filter:blur(10px); }
.consent-dialog { width:min(650px,calc(100vw - 32px)); max-height:calc(100vh - 48px); padding:0; overflow:auto; scrollbar-width:thin; scrollbar-color:#8d72f4 rgba(229,224,255,.62); }
.consent-dialog::-webkit-scrollbar { width:9px; }
.consent-dialog::-webkit-scrollbar-track { background:#f0ecff; border-radius:99px; margin:12px 0; }
.consent-dialog::-webkit-scrollbar-thumb { border:2px solid transparent; border-radius:99px; background:linear-gradient(180deg,#c084fc,#765ee8); background-clip:padding-box; }
.consent-dialog-header { display:flex; align-items:flex-start; gap:13px; padding:25px 25px 20px; background:linear-gradient(135deg,#fff8ff,#f1ebff 68%,#f7fbff); border-bottom:1px solid rgba(125,98,222,.12); }
.consent-dialog-header > div:nth-child(2) { flex:1; }
.consent-dialog-header h2 { margin:3px 0 5px; color:var(--ink); font:800 20px Manrope; letter-spacing:-.35px; }
.consent-dialog-header p { margin:0; color:var(--ink-soft); font-size:11px; line-height:1.45; }
.consent-dialog-header .dialog-close { margin-left:auto; }
.consent-dialog-copy { display:grid; grid-template-columns:42px 1fr; gap:10px 12px; margin:20px 25px 17px; padding:15px; border:1px solid #e3dcfa; border-radius:15px; color:var(--ink-soft); background:linear-gradient(145deg,#fbfaff,#f4f1ff); line-height:1.5; }
.consent-dialog-copy .settings-icon { grid-row:span 3; }
.consent-dialog-copy p, .consent-dialog-copy strong { margin:0; }
.consent-dialog-copy > div:nth-child(2) { display:grid; gap:6px; }
.consent-dialog-copy strong { color:var(--ink); font:800 12px Manrope; }
.consent-link-field { display:grid; gap:8px; margin:0 25px; color:var(--ink); font:700 11px Manrope; }
.consent-link-field > div { display:flex; gap:8px; align-items:stretch; }
.consent-link-field input { min-width:0; flex:1; height:42px; padding:0 12px; border:1px solid #d9d1f5; border-radius:11px; color:var(--ink-soft); background:#fff; font:500 11px Manrope; outline:0; }
.consent-link-field input:focus { border-color:var(--purple); box-shadow:0 0 0 3px #eee9ff; }
.consent-link-field .button { min-height:42px; white-space:nowrap; }
.consent-delivery { margin:15px 25px 0; padding:12px 13px; border:1px solid #f0dfb8; border-radius:11px; color:#8a621e; background:#fff8e9; font-size:11px; line-height:1.45; }
.consent-delivery.sent { border-color:#c9eadc; color:#18785f; background:#effaf5; }
.consent-dialog-footer { display:flex; justify-content:flex-end; gap:9px; margin-top:21px; padding:16px 25px 22px; border-top:1px solid var(--line); background:#fcfbff; }
.consent-link-field { display:grid; gap:7px; color:var(--ink); font:700 11px Manrope; }
.consent-link-field > div { display:flex; gap:8px; }
.consent-link-field input { min-width:0; flex:1; padding:11px 12px; border:1px solid #ddd6f7; border-radius:11px; color:var(--ink-soft); background:#faf9ff; font:500 11px Manrope; }
.consent-delivery { margin-top:13px; padding:11px 12px; border-radius:11px; color:#8a621e; background:#fff7e8; font-size:11px; line-height:1.45; }
.consent-delivery.sent { color:#18785f; background:#effaf5; }
.consent-page { min-height:100vh; margin:0; background:radial-gradient(circle at 20% 0%,#f0eaff 0,#f8f7ff 44%,#edf2ff 100%); }
.patient-consent-screen { display:grid; justify-items:center; gap:18px; min-height:100vh; padding:48px 20px 28px; color:var(--ink); }
.patient-consent-brand { display:flex; align-items:center; gap:10px; color:var(--ink); }
.patient-consent-brand strong { display:block; font:800 18px Manrope; }
.patient-consent-brand small { display:block; color:var(--muted); font-size:12px; }
.patient-consent-card { width:min(620px,100%); padding:30px; border:1px solid rgba(143,116,229,.18); border-radius:24px; background:rgba(255,255,255,.88); box-shadow:0 24px 70px rgba(82,65,145,.14); }
.patient-consent-heading { display:flex; align-items:flex-start; gap:14px; }
.patient-consent-heading h1, .patient-consent-success h1, .patient-consent-loading h1 { margin:4px 0 0; color:var(--ink); font:800 25px/1.16 Manrope; }
.patient-consent-text { margin:24px 0; color:var(--ink-soft); font-size:15px; line-height:1.65; }
.patient-consent-text p { margin:0 0 14px; }
.patient-consent-form { display:grid; gap:15px; }
.patient-consent-form .consent-identity-note { display:grid; gap:3px; padding:11px 12px; border:1px solid #ddd6f7; border-radius:11px; color:var(--ink-soft); background:#faf9ff; font-size:12px; line-height:1.45; }
.patient-consent-form .consent-identity-note strong { color:var(--ink); font:700 12px Manrope; }
.patient-consent-form .consent-identity-choice { padding:10px 11px; border:1px solid #d9d0fb; border-radius:11px; background:#f7f3ff; color:var(--purple-dark); }
.patient-consent-form label:not(.patient-consent-check) { display:grid; gap:7px; color:var(--ink); font:700 12px Manrope; }
.patient-consent-form input:not([type="checkbox"]) { width:100%; min-height:48px; padding:13px 14px; border:1px solid #dcd5f7; border-radius:12px; color:var(--ink); background:#fff; font:500 15px Manrope; }
.patient-consent-form input:not([type="checkbox"]):focus { outline:0; border-color:var(--purple); box-shadow:0 0 0 3px #eee9ff; }
.patient-consent-check { display:flex; align-items:flex-start; gap:9px; color:var(--ink-soft); font-size:13px; line-height:1.45; }
.patient-consent-check input { margin-top:3px; accent-color:var(--purple); }
.patient-consent-form-error { min-height:18px; color:#bd3548; font-size:12px; }
.patient-consent-success, .patient-consent-loading { display:grid; justify-items:center; gap:13px; padding:20px 8px; text-align:center; }
.patient-consent-success p, .patient-consent-loading p { max-width:460px; margin:0; color:var(--ink-soft); font-size:15px; line-height:1.6; }
.patient-consent-success small, .patient-consent-loading p { color:var(--muted); }
.consent-success-icon, .consent-error-icon { display:grid; place-items:center; width:58px; height:58px; border-radius:50%; color:#fff; background:linear-gradient(135deg,#a855f7,#5b5ce2); font:800 27px Manrope; }
.consent-error-icon { background:linear-gradient(135deg,#e56b7a,#b52d4b); }
.patient-consent-legal { margin:0; color:var(--muted); font-size:11px; text-align:center; }
.patient-consent-safety .patient-consent-text { text-align:left; margin-top:4px; }
.patient-consent-safety .patient-consent-text p { color:var(--ink); }
.baseline-questionnaires { margin-bottom:14px; padding-bottom:14px; border-bottom:1px solid var(--line); }
.baseline-questionnaires h3 { margin:0; font-size:13px; color:var(--ink); }
.baseline-questionnaires .record-section-heading p { margin:2px 0 0; font-size:10px; color:var(--muted); }
.baseline-questionnaire-list { list-style:none; margin:10px 0 0; padding:0; display:grid; gap:6px; }
.baseline-questionnaire-row { display:flex; align-items:center; gap:8px; padding:8px 9px; border-radius:9px; background:var(--surface-soft,#f7f6fd); font-size:10px; }
.baseline-questionnaire-row svg { width:15px; height:15px; flex:none; color:var(--purple); }
.baseline-questionnaire-row strong { display:block; font-size:11px; color:var(--ink); }
.baseline-questionnaire-row small { color:var(--muted); }
.baseline-questionnaire-row.has-safety-alert { background:#fdecee; }
.baseline-questionnaire-row.has-safety-alert svg { color:#b52d4b; }
.baseline-questionnaire-row.has-review-alert { background:#fff6e5; }
.baseline-questionnaire-row.has-review-alert svg { color:#a9720c; }
.baseline-safety-pill { margin-left:auto; display:flex; align-items:center; gap:4px; padding:3px 8px; border-radius:999px; background:#b52d4b; color:#fff; font:700 9px Manrope; }
.baseline-safety-pill svg { width:11px; height:11px; }
.baseline-review-pill { background:#a9720c; }
html[data-theme="dark"] .baseline-questionnaire-row { background:#2a2740; }
html[data-theme="dark"] .baseline-questionnaire-row.has-safety-alert { background:#4a2430; }
html[data-theme="dark"] .baseline-questionnaire-row.has-review-alert { background:#4a3a1c; }
.baseline-questionnaire-row.is-clickable { cursor:pointer; }
.baseline-questionnaire-row.is-clickable > svg:last-child { flex:none; margin-left:auto; color:var(--muted); }
.baseline-questionnaire-row.is-clickable:hover, .baseline-questionnaire-row.is-clickable:focus-visible { background:#ece6fb; outline:0; }
html[data-theme="dark"] .baseline-questionnaire-row.is-clickable:hover, html[data-theme="dark"] .baseline-questionnaire-row.is-clickable:focus-visible { background:#342f5c; }
.questionnaire-tools { margin-top:14px; padding:17px; }
.questionnaire-tools .record-section-heading { margin-bottom:12px; }
.questionnaire-tools .record-section-heading h2 { font-size:14px; }
.questionnaire-tools .record-section-heading p { font-size:10px; }
.questionnaire-tools .ai-pill { font-size:9px; }
.questionnaire-safety-note { display:flex; align-items:flex-start; gap:7px; margin:0 0 11px; padding:9px 10px; border:1px solid #e2dafb; border-radius:10px; color:var(--ink-soft); background:#faf8ff; font-size:10px; line-height:1.4; }
.questionnaire-safety-note svg { width:14px; height:14px; flex:none; color:var(--purple); }
.questionnaire-list { display:grid; gap:7px; }
.questionnaire-option { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; padding:10px 11px; border:1px solid #e1dbf6; border-radius:11px; color:var(--ink); background:#fff; text-align:left; cursor:pointer; transition:.18s ease; }
.questionnaire-option:hover { border-color:var(--purple); background:#fbf9ff; transform:translateY(-1px); }
.questionnaire-option span { display:grid; gap:3px; min-width:0; }
.questionnaire-option strong { font:700 11px Manrope; }
.questionnaire-option small { color:var(--muted); font-size:9px; line-height:1.35; }
.questionnaire-option > svg { width:15px; height:15px; flex:none; color:var(--purple); }
.questionnaire-last-status { margin-top:10px; padding:9px 10px; border-radius:10px; color:#8a621e; background:#fff8e9; font-size:10px; }
.questionnaire-last-status.completed { color:#18785f; background:#effaf5; }
.questionnaire-last-status > span { display:grid; grid-template-columns:16px 1fr; gap:2px 6px; }
.questionnaire-last-status svg { width:15px; height:15px; grid-row:span 2; }
.questionnaire-last-status small { color:inherit; opacity:.82; font-size:9px; }
.questionnaire-last-status.is-clickable { display:flex; align-items:center; justify-content:space-between; gap:8px; cursor:pointer; }
.questionnaire-last-status.is-clickable > svg:last-child { flex:none; color:inherit; opacity:.7; }
.questionnaire-last-status.is-clickable:hover, .questionnaire-last-status.is-clickable:focus-visible { filter:brightness(.96); outline:0; }
.questionnaire-invites-list .questionnaire-last-status:first-child { margin-top:0; }
.questionnaire-whatsapp-status { display:block; margin-top:9px; color:var(--muted); font-size:9px; line-height:1.4; }
.questionnaire-answers-nav { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:14px 25px 0; padding-top:14px; border-top:1px solid var(--line); color:var(--muted); font-size:10px; }
.questionnaire-answers-nav .button svg { width:13px; height:13px; }
.questionnaire-answers-nav .button[disabled] { opacity:.4; pointer-events:none; }
.questionnaire-safety-note.bad { border-color:#f3c3cf; background:#fdecee; color:#8a1f37; }
.questionnaire-safety-note.bad svg { color:#b52d4b; }
.questionnaire-safety-note.warn { border-color:#f3ddab; background:#fff6e5; color:#7a5610; }
.questionnaire-safety-note.warn svg { color:#a9720c; }
.baseline-answer-list { list-style:none; margin:14px 25px 0; padding:0; display:grid; gap:8px; max-height:320px; overflow:auto; }
.baseline-answer-list li { padding:10px 12px; border:1px solid var(--line); border-radius:11px; background:rgba(255,255,255,.55); }
.baseline-answer-list strong { display:block; margin-bottom:3px; font:700 11.5px Manrope,'DM Sans',system-ui,sans-serif; color:var(--ink); line-height:1.4; }
.baseline-answer-list span { display:block; color:var(--purple-dark); font:700 11px 'DM Sans',system-ui,sans-serif; }
html[data-theme="dark"] .baseline-answer-list li { background:rgba(40,43,83,.4); border-color:rgba(196,192,255,.16); }
.questionnaire-dialog { width:min(560px,calc(100vw - 32px)); }
.questionnaire-review-box, .questionnaire-result-copy { margin:18px 25px 0; padding:13px; border:1px solid #e1daf7; border-radius:13px; color:var(--ink-soft); background:#faf8ff; font-size:11px; line-height:1.5; }
.questionnaire-review-box strong, .questionnaire-result-copy strong { display:block; color:var(--ink); font:800 12px Manrope; margin-bottom:4px; }
.questionnaire-review-box p, .questionnaire-result-copy p { margin:0; }
.questionnaire-dialog form { padding:18px 25px 0; }
.questionnaire-dialog .profile-modal-actions { padding:18px 0 0; }
.questionnaire-link-field { margin-top:16px; }
.patient-questionnaire-note { margin:18px 0; padding:12px 13px; border:1px solid #e1daf7; border-radius:12px; color:var(--ink-soft); background:#faf8ff; font-size:12px; line-height:1.5; }
.patient-progress { margin-top:18px; }
.patient-progress-track { height:8px; border-radius:99px; background:#ece6fb; overflow:hidden; }
.patient-progress-fill { height:100%; border-radius:99px; background:linear-gradient(90deg,#8a5cf6,#be4df3); transition:width .3s ease; }
.patient-progress-label { display:flex; justify-content:space-between; margin-top:6px; color:var(--ink-soft); font:700 11px Manrope; }
.patient-progress-note { display:flex; align-items:flex-start; gap:8px; margin:14px 0 0; padding:11px 13px; border:1px solid #cfe9e2; border-radius:12px; color:#157a61; background:rgba(237,250,245,.65); font-size:12px; line-height:1.5; }
.patient-progress-note svg { width:15px; height:15px; flex:none; margin-top:1px; }
.patient-question { display:grid; gap:7px; color:var(--ink); font:700 12px Manrope; }
.patient-question textarea, .patient-question select { width:100%; min-height:44px; padding:11px 12px; border:1px solid #dcd5f7; border-radius:11px; color:var(--ink); background:#fff; font:500 13px/1.4 Manrope; outline:0; }
.patient-question textarea { min-height:76px; resize:vertical; }
.patient-question textarea:focus, .patient-question select:focus { border-color:var(--purple); box-shadow:0 0 0 3px #eee9ff; }

@media (max-width: 1200px) {
  .app-shell { grid-template-columns:220px minmax(0,1fr); }
  .ambient-panel { display:none; }
  .topbar { grid-template-columns:max-content minmax(260px, 360px) 1fr 90px; padding-right:22px; }
  .content { padding-left:22px; padding-right:22px; }
}
@media (max-width: 920px) {
  .app-shell { display:block; }
  .sidebar { position:fixed; left:-262px; top:0; bottom:0; width:250px; height:100vh; margin:0; border-radius:0 25px 25px 0; transition:.25s ease; }
  .sidebar.open { left:0; }
  .topbar { height:72px; padding:16px 18px 0; grid-template-columns:32px 1fr 84px; gap:10px; }
  .mobile-menu { display:grid; place-items:center; }
  .breadcrumb { display:none; }
  .content { padding: 9px 18px 25px; }
  .dashboard-grid, .waiting-layout, .dashboard-followup-grid, .record-layout, .live-work, .agenda-layout { grid-template-columns:1fr; }
  .record-sidebar { display:grid; grid-template-columns:repeat(2,1fr); }
  .agenda-layout .side-info { margin-top:0; }
  .metric-grid { grid-template-columns:repeat(2,1fr); }
  .lower-grid { grid-template-columns:1fr 1fr; }
  .next-card { min-height: unset; }
  .agenda-status-actions { grid-template-columns:1fr; }
  .scale-grid { grid-template-columns:1fr; }
  .scale-library-summary { grid-template-columns:1fr; }
  .scale-trend-selector-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .scale-trend-option { min-width:0; }
  #header-popover-root { position:fixed; top:60px; right:18px; }
}
@media (max-width: 650px) {
  .topbar { grid-template-columns:28px 1fr 42px; }
  .global-search { min-width:0; }
  .global-search kbd { display:none; }
  .top-actions { gap:0; }
  .top-actions .icon-button { display:none; }
  .top-avatar { width:38px; height:38px; font-size:13px; }
  #header-popover-root { position:fixed; top:56px; right:10px; }
  .profile-modal-backdrop { padding:10px; }
  .profile-modal { max-height:calc(100vh - 20px); padding:18px; border-radius:18px; }
  .page-heading { display:block; }
  .date-note { text-align:left; margin-top:10px; }
  .page-heading .page-actions { margin-top:13px; }
  .scale-trend-panel { padding:13px; }
  .scale-trend-heading { display:grid; }
  .scale-trend-selector-list { grid-template-columns:1fr; }
  .scale-trend-chart-wrap { padding-left:2px; padding-right:2px; }
  .scale-trend-chart { min-height:190px; }
  .results-modal-backdrop { padding:10px; }
  .results-modal { width:100%; max-height:calc(100vh - 20px); }
  .results-header { padding:20px; }
  .results-title h1 { font-size:18px; }
  .results-title p { font-size:11px; }
  .results-tabs { max-width:none; margin:0 14px; overflow:auto; }
  .results-tabs button { min-width:245px; padding:13px; }
  .results-editor-shell { margin:0 14px; }
  .results-toolbar { gap:10px; overflow:auto; }
  .results-document, .results-transcription { min-height:330px; max-height:420px; padding:17px; font-size:13px; }
  .review-banner { flex-wrap:wrap; align-items:flex-start; margin:12px 14px 0; }
  .review-banner button { margin-left:36px; }
  .record-section-heading { flex-direction:column; }
  .prescription-name-mode-card { grid-template-columns:1fr; }
  .prescription-name-mode-toggle { justify-content:space-between; }
  .medication-preference-row { grid-template-columns:1fr; }
  .medication-preference-row-actions { grid-column:auto; }
  .medication-catalog-item { grid-template-columns:1fr; }
  .document-generator, .extraction-grid { grid-template-columns:1fr; display:grid; align-items:stretch; }
  .prescription-fields { grid-template-columns:1fr; }
  .prescription-fields label.full { grid-column:auto; }
  .prescription-editor-heading, .prescription-actions, .signature-output-actions, .signature-output-status { align-items:stretch; flex-direction:column; }
  .document-generator .button, .extraction-grid .button { width:100%; justify-content:center; }
  .pdf-dropzone { align-items:flex-start; flex-wrap:wrap; }
  .pdf-dropzone em { margin-left:53px; }
  .pdf-file-meta { align-items:flex-start; flex-direction:column; }
  .pdf-file-meta .button { width:100%; justify-content:center; }
  .neuropsi-sections { grid-template-columns:1fr; }
  .neuropsi-analysis-heading { align-items:flex-start; flex-wrap:wrap; }
  .neuropsi-analysis-heading > span { margin-left:31px; }
  .neuropsi-diagnoses > div { align-items:flex-start; flex-direction:column; gap:4px; }
  .neuropsi-diagnoses span { text-align:left; }
  .neuropsi-transcript-action { align-items:stretch; flex-direction:column; }
  .neuropsi-transcript-action .button { width:100%; justify-content:center; }
  .results-footer { display:grid; padding:17px 14px; }
  .results-footer-left, .results-footer-right { display:grid; grid-template-columns:1fr 1fr; }
  .results-footer-right { display:grid; grid-template-columns:1fr 1.5fr; }
  .results-footer-right .button { padding:0 10px; font-size:11px; }
  .results-audio-bar { margin:10px 14px 0; flex-wrap:wrap; }
  .results-audio-bar audio { width:100%; }
  .metric-grid, .lower-grid, .dashboard-followup-grid, .feature-cards, .record-sidebar { grid-template-columns:1fr; }
  .settings-layout { grid-template-columns:1fr; }
  .settings-fields, .day-settings-grid { grid-template-columns:1fr; }
  .saved-session-card { align-items:flex-start; flex-wrap:wrap; }
  .saved-session-actions { width:100%; margin-left:0; }
  .saved-session-actions .button { flex:1; }
  .consultation-started-card { grid-template-columns:44px minmax(0,1fr); padding:18px; }
  .started-consultation-icon { width:44px; height:44px; }
  .consultation-timer { grid-column:2; justify-self:start; }
  .consultation-started-card > .button { grid-column:1 / -1; justify-self:stretch; }
  .appointment-row { grid-template-columns:45px minmax(0,1fr) 24px; }
  .appointment-row > .status, .appointment-row > .button { display:none; }
  .appointment-row.waiting-room-row > .waiting-start, .appointment-row.dashboard-row > .waiting-start { display:flex; grid-column:2; grid-row:2; justify-self:start; }
  .appointment-row .row-more { grid-column:3; grid-row:1; }
  .agenda-toolbar { overflow:auto; }
  .view-switch { margin-left:0; }
  .view-switch button { padding:9px 12px; }
  .agenda-layout { gap:10px; }
  .day-grid-header, .time-row { grid-template-columns:55px 1fr; }
  .time-row > span { padding-left:10px; }
  .slot { grid-template-columns:38px minmax(0,1fr); }
  .slot .status { display:none; }
  .patients-toolbar { flex-wrap:wrap; }
  .inner-search { width:100%; }
  .table-head { display:none; }
  .patient-table-row { grid-template-columns:1fr 26px; padding:13px; }
  .patient-table-row > *:not(.patient-cell):not(.row-more) { display:none; }
  .patient-table-row .row-more { grid-column:2; grid-row:1; }
  .patient-directory-row { grid-template-columns:1fr; }
  .patient-directory-row > .muted { display:block; grid-column:1; padding-left:44px; }
  .patient-edit-dialog { padding:18px; border-radius:18px; max-height:calc(100vh - 20px); }
  .saved-consultation-card { padding:18px; }
  .saved-consultation-heading { flex-direction:column; }
  .saved-consultation-badge { align-self:flex-start; }
  .saved-consultation-actions { flex-direction:column; align-items:stretch; }
  .history-backdrop { padding:10px; }
  .history-dialog { padding:18px; border-radius:18px; max-height:calc(100vh - 20px); }
  .history-fields { grid-template-columns:1fr; }
  .patient-edit-grid { grid-template-columns:1fr; }
  .patient-edit-grid label.full { grid-column:auto; }
  .patient-edit-actions, .patient-edit-actions > div { display:grid; grid-template-columns:1fr; }
  .patient-banner { flex-wrap:wrap; }
  .banner-actions { width:100%; margin-left:84px; margin-top:-25px; }
  .tabbar { margin-left:-5px; margin-right:-5px; grid-template-columns:repeat(2,minmax(0,1fr)); padding:0 8px; }
  .tabbar button { padding:0 9px; }
  .transcribe-card { padding:25px 14px; }
  .transcribe-card .button { min-width:220px; }
  .record-footer { flex-wrap:wrap; }
  .record-footer .button.primary { width:100%; margin-left:0; }
  .recording-strip { flex-wrap:wrap; padding:10px; }
  .timer-readouts { order:3; width:100%; }
  .timer-readout { flex:1; }
  .recording-strip .capture-mode { order:2; }
  .recording-strip .wave { order:4; }
  .recording-strip .recording-timer-inline { order:5; width:auto; }
  .recording-strip .recording-timer-inline .timer-readout { flex:none; }
  .recording-strip .recording-actions { order:6; margin-left:auto; }
  .footer-timers { width:100%; margin-right:0; }
  .capture-mode { margin-left:auto; }
  .wave { min-width:130px; order:3; flex-basis:100%; }
  .agenda-dialog-backdrop { padding:10px; }
  .agenda-dialog { padding:17px; border-radius:19px; max-height:calc(100vh - 20px); }
  .agenda-dialog-grid { grid-template-columns:1fr; gap:11px; }
  .agenda-dialog-actions, .agenda-dialog-footer { display:grid; grid-template-columns:1fr; }
  .agenda-dialog-actions .button, .agenda-dialog-footer .button { width:100%; }
  .time-options { max-height:180px; }
  .assignment-time-options { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .document-type-picker { grid-template-columns:1fr; }
  .document-editor-backdrop, .document-package-dialog-backdrop { padding:10px; }
  .document-editor-modal, .document-package-dialog { max-height:calc(100vh - 20px); border-radius:18px; }
  .document-editor-header { padding:18px; }
  .document-editor-footer { display:grid; grid-template-columns:1fr; padding:15px 18px 18px; }
  .document-editor-footer .button { width:100%; justify-content:center; }
  .document-review-note, .document-dialog-warning, .document-confirmed-copy, .document-thinking, .document-draft-field, .document-package-patient, .document-package-link, .document-package-delivery, .document-package-list { margin-left:18px; margin-right:18px; }
  .document-package-link > div { display:grid; }
  .document-package-link .button { width:100%; justify-content:center; }
  .patient-document-screen { padding:28px 14px 20px; }
  .patient-document-card { padding:22px 18px; border-radius:19px; }
  .patient-document-file { align-items:flex-start; flex-wrap:wrap; }
  .document-download-button { width:100%; justify-content:center; }
}

/* ---- Documentos para o paciente ---- */
.record-output.is-released { border-color:#bfe8d8; }
.record-output textarea[data-record-output-text] { border-bottom:1px solid #eee9ff; }
.record-output textarea[data-record-output-text]:focus { background:#fdfcff; box-shadow:inset 0 0 0 2px #eee9ff; }
.record-output-release { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 14px; border-top:1px solid #e1daf8; background:#faf8ff; }
.record-output-release.is-released { border-top-color:#c9eadc; background:#f2fbf7; }
.record-output-release small { color:var(--muted); font-size:10.5px; line-height:1.45; }
.record-output-release .button { flex:none; }
.record-output-review { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 14px; border-top:1px solid #e1daf8; background:#fff; }
.record-output-review.is-reviewed { border-top-color:#c9eadc; background:#f2fbf7; }
.record-output-review small { color:var(--muted); font-size:10.5px; line-height:1.45; }
.record-output-review .button { flex:none; }
.documents-send-bar { margin-top:16px; padding:20px; }
.documents-chip-list { display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; }
.documents-chip { display:inline-flex; align-items:center; gap:6px; padding:6px 11px; border:1px solid #c9eadc; border-radius:999px; color:#18785f; background:#effaf5; font:700 11px Manrope; }
.documents-chip svg { width:14px; height:14px; }
.documents-empty { color:var(--muted); font-size:11px; line-height:1.5; }
.documents-send-bar .questionnaire-last-status { margin-top:14px; }
.documents-send-actions { display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin-top:16px; }
.documents-send-actions .settings-hint { margin:0; }

.branding-settings-card { margin-top:16px; }
.branding-logo-row { display:flex; align-items:center; gap:16px; margin-bottom:18px; }
.branding-logo-preview { display:grid; place-items:center; width:84px; height:84px; flex:none; overflow:hidden; border:1px dashed #cfc6f3; border-radius:14px; color:var(--muted); background:#fff; font-size:11px; }
.branding-logo-preview img { max-width:100%; max-height:100%; object-fit:contain; }
.branding-logo-actions { display:grid; gap:8px; }
.branding-logo-buttons { display:flex; flex-wrap:wrap; gap:8px; }
.branding-logo-buttons label.button { cursor:pointer; }
.branding-swatches { display:flex; flex-wrap:wrap; gap:12px; padding:2px; }
.branding-swatch { width:32px; height:32px; padding:0; border:2px solid #fff; border-radius:50%; background:var(--swatch); box-shadow:0 0 0 1px rgba(16,22,88,.18); cursor:pointer; transition:transform .15s ease; }
.branding-swatch:hover { transform:scale(1.08); }
.branding-swatch.active { box-shadow:0 0 0 2px var(--swatch),0 0 0 5px rgba(116,60,255,.18); }

.patient-documents-list { display:grid; gap:18px; margin-top:20px; }
.patient-documents-group h2 { margin:0 0 8px; color:var(--ink-soft); font:800 11px Manrope; letter-spacing:.6px; text-transform:uppercase; }
.patient-document-row { display:flex; align-items:center; gap:12px; padding:12px; border:1px solid #e1daf8; border-radius:13px; background:#fff; }
.patient-document-row + .patient-document-row { margin-top:8px; }
.patient-document-row > div { display:grid; gap:2px; flex:1; min-width:0; }
.patient-document-row strong { color:var(--ink); font:700 13px Manrope; overflow-wrap:anywhere; }
.patient-document-row small { color:var(--muted); font-size:10px; }
.patient-document-icon { display:grid; place-items:center; width:38px; height:38px; flex:none; border-radius:10px; color:var(--purple); background:#f1ecff; }
.patient-document-icon svg { width:18px; height:18px; }
.patient-document-row .button { flex:none; }
.patient-documents-expiry { display:block; margin-top:16px; color:var(--muted); font-size:11px; text-align:center; }
@media (max-width:560px) {
  .record-output-release, .record-output-review { flex-direction:column; align-items:stretch; }
  .branding-logo-row { align-items:flex-start; }
}

/* Editor de layout dos documentos */
.layout-editor-card { margin-top:16px; padding:22px; }
.layout-editor-summary-card { margin-top:14px; }
.le-loading { padding:24px; color:var(--muted); font-size:13px; text-align:center; }
.le-toolbar { display:flex; align-items:flex-end; gap:14px; flex-wrap:wrap; margin:6px 0 18px; }
.le-toolbar .le-clinic-select { flex:1 1 240px; max-width:360px; }
.le-toolbar .button.primary { margin-left:auto; }
.le-dirty { align-self:center; padding:5px 10px; border-radius:999px; color:#946200; background:#fff4d6; font:700 11px Manrope; }
.le-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(320px,500px); gap:22px; align-items:start; }
.le-controls { display:grid; gap:10px; min-width:0; }
.le-preview { position:sticky; top:16px; display:grid; gap:10px; padding:14px; border:1px solid var(--line); border-radius:16px; background:#f3f1fb; min-width:0; }
.le-preview-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.le-preview-head strong { color:var(--ink); font:800 13px Manrope; }
.le-preview-head small { color:var(--muted); font-size:11px; }
.le-preview-head select { min-width:0; max-width:100%; padding:5px 8px; border:1px solid var(--line); border-radius:8px; background:#fff; color:var(--ink); font:600 11px Manrope; }
.le-status { margin-left:auto; color:var(--muted); font-size:11px; }
.le-pages { display:grid; min-height:520px; border-radius:8px; overflow:hidden; box-shadow:0 6px 22px rgba(38,32,94,.16); }
.le-pdf-frame { display:block; width:100%; height:520px; border:0; background:#fff; }
.le-error { color:var(--red); font-size:11px; line-height:1.45; }
.le-error:empty { display:none; }
.le-scope-note { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:10px 12px; border-radius:11px; color:var(--ink-soft); background:#faf8ff; border:1px solid #e1daf8; font-size:11.5px; line-height:1.5; }
.le-group { border:1px solid var(--line); border-radius:13px; background:rgba(255,255,255,.6); }
.le-group > summary { padding:12px 14px; color:var(--ink); font:800 12.5px Manrope; cursor:pointer; list-style:none; display:flex; align-items:center; justify-content:space-between; }
.le-group > summary::-webkit-details-marker { display:none; }
.le-group > summary::after { content:'+'; color:var(--muted); font-size:16px; }
.le-group[open] > summary::after { content:'–'; }
.le-group-body { display:grid; gap:14px; padding:2px 14px 16px; }
.le-field { display:grid; gap:6px; min-width:0; }
.le-field.is-disabled { opacity:.5; }
.le-label { color:var(--ink-soft); font:700 11px Manrope; }
.le-field input[type="text"], .le-field input[type="number"], .le-field select { width:100%; padding:9px 10px; border:1px solid var(--line); border-radius:9px; background:#fff; color:var(--ink); font:500 13px 'DM Sans',system-ui,sans-serif; box-sizing:border-box; }
.le-seg { display:flex; flex-wrap:wrap; gap:4px; padding:3px; border:1px solid var(--line); border-radius:10px; background:#f6f4fd; width:fit-content; max-width:100%; }
.le-seg button { padding:6px 11px; border:0; border-radius:7px; background:transparent; color:var(--ink-soft); font:700 11.5px Manrope; cursor:pointer; }
.le-seg button.active { color:var(--purple-dark); background:#fff; box-shadow:0 1px 4px rgba(38,32,94,.16); }
.le-seg button:disabled { cursor:not-allowed; }
.le-check { display:flex; align-items:center; gap:9px; color:var(--ink); font:600 12.5px Manrope; cursor:pointer; }
.le-check input { width:16px; height:16px; accent-color:var(--purple); flex:none; }
.le-check.is-disabled { opacity:.5; cursor:not-allowed; }
.le-checks { display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:8px 12px; }
.le-check.compact { font-weight:600; font-size:12px; }
.le-range { display:flex; align-items:center; gap:12px; }
.le-range input { flex:1; accent-color:var(--purple); }
.le-range output { min-width:44px; color:var(--ink-soft); font:700 12px Manrope; text-align:right; }
.le-margins { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.le-margins label { display:grid; gap:3px; }
.le-margins small { color:var(--muted); font-size:10.5px; }
.le-color-custom { position:relative; display:inline-grid; place-items:center; width:32px; height:32px; overflow:hidden; border-radius:50%; background:conic-gradient(#f14562,#ec9d15,#12b28a,#2c84ee,#743cff,#f14562); box-shadow:0 0 0 1px rgba(16,22,88,.18); cursor:pointer; }
.le-color-custom.active { box-shadow:0 0 0 2px var(--purple),0 0 0 5px rgba(116,60,255,.18); }
.le-color-custom input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.le-logo-row { display:flex; align-items:center; gap:16px; }
.le-clinic-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.le-clinic-fields .le-field:nth-child(1), .le-clinic-fields .le-field:nth-child(2) { grid-column:1 / -1; }
.le-extras { display:grid; gap:8px; }
.le-extra-row { display:grid; grid-template-columns:minmax(0,1fr) 130px 34px; gap:8px; align-items:center; }
.le-extra-row .button { padding:0; height:34px; }
.le-extras > .button { justify-self:start; }
@media (max-width:1080px) {
  .le-grid { grid-template-columns:1fr; }
  .le-preview { position:static; }
}
@media (max-width:560px) {
  .layout-editor-card { padding:16px; }
  .le-toolbar .button.primary { margin-left:0; width:100%; }
  .le-clinic-fields { grid-template-columns:1fr; }
  .le-margins { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .le-extra-row { grid-template-columns:1fr 34px; }
  .le-extra-row select { grid-column:1 / 2; }
}
html[data-theme="dark"] .le-preview { background:#171a38; }
html[data-theme="dark"] .le-group, html[data-theme="dark"] .le-seg { background:rgba(40,43,83,.5); }
html[data-theme="dark"] .le-seg button.active { background:#3a3572; color:#e7ddff; }
html[data-theme="dark"] .le-scope-note { background:rgba(40,43,83,.5); border-color:rgba(196,192,255,.16); }
html[data-theme="dark"] .le-field input[type="text"], html[data-theme="dark"] .le-field input[type="number"], html[data-theme="dark"] .le-field select, html[data-theme="dark"] .le-preview-head select { background:#20244a; color:#e3e6ff; border-color:rgba(196,192,255,.2); }
html[data-theme="dark"] .le-dirty { background:#4a3a10; color:#ffd98a; }

/* Aviso de vias da receita (controle especial) */
.documents-vias { display:flex; align-items:center; gap:12px; margin-top:14px; padding:12px 14px; border:1px solid #e1daf8; border-radius:13px; background:#faf8ff; }
.documents-vias.is-controlled { border-color:#f0d9a8; background:#fff8e8; }
.documents-vias-icon { display:grid; place-items:center; width:34px; height:34px; flex:none; border-radius:10px; color:var(--purple); background:#f1ecff; }
.documents-vias.is-controlled .documents-vias-icon { color:#946200; background:#ffefc7; }
.documents-vias-icon svg { width:17px; height:17px; }
.documents-vias-copy { display:grid; gap:3px; flex:1; min-width:0; }
.documents-vias-copy strong { color:var(--ink); font:800 12px Manrope; overflow-wrap:anywhere; }
.documents-vias-copy small { color:var(--ink-soft); font-size:11px; line-height:1.45; }
.documents-vias-warning { color:#946200 !important; font-weight:700; }
.documents-vias-select { display:grid; gap:3px; flex:none; }
.documents-vias-select span { color:var(--muted); font:700 10px Manrope; }
.documents-vias-select select { padding:7px 9px; border:1px solid var(--line); border-radius:9px; background:#fff; color:var(--ink); font:600 12px 'DM Sans',system-ui,sans-serif; }
@media (max-width:560px) { .documents-vias { flex-wrap:wrap; } .documents-vias-select { width:100%; } }
html[data-theme="dark"] .documents-vias { background:rgba(40,43,83,.5); border-color:rgba(196,192,255,.16); }
html[data-theme="dark"] .documents-vias.is-controlled { background:rgba(74,58,16,.4); border-color:rgba(240,217,168,.25); }
html[data-theme="dark"] .documents-vias-select select { background:#20244a; color:#e3e6ff; border-color:rgba(196,192,255,.2); }

/* Biblioteca de modelos personalizados */
.templates-heading { align-items:end; }
.templates-library { padding:22px; }
.templates-section-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px; }
.templates-section-heading h2 { margin:0; color:var(--ink); font:800 18px Manrope; }
.templates-section-heading p { margin:5px 0 0; color:var(--ink-soft); font-size:12px; }
.templates-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.template-card { min-width:0; display:grid; grid-template-columns:42px minmax(0,1fr) auto; gap:12px; align-items:start; padding:15px; border:1px solid var(--line); border-radius:15px; background:rgba(255,255,255,.68); transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease; }
.template-card:hover { border-color:#c9baff; box-shadow:0 10px 24px rgba(83,56,190,.1); transform:translateY(-1px); }
.template-card-icon { display:grid; place-items:center; width:42px; height:42px; border-radius:13px; color:var(--purple); background:#f0eaff; }
.template-card-icon svg { width:20px; height:20px; }
.template-card-copy { min-width:0; }
.template-card-title { display:flex; align-items:center; flex-wrap:wrap; gap:7px; }
.template-card-title h3 { margin:0; color:var(--ink); font:800 13px Manrope; }
.template-card-copy p { margin:7px 0 8px; color:var(--ink-soft); font-size:11px; line-height:1.5; }
.template-card-copy small { color:var(--muted); font-size:10px; }
.template-badge { display:inline-flex; align-items:center; padding:4px 7px; border-radius:999px; color:#6351b7; background:#f1edff; font:700 9px Manrope; }
.template-badge.custom { color:#14735e; background:#e3f6ef; }
.template-card-actions { display:flex; align-items:center; gap:5px; }
.template-card-actions .button.small { white-space:nowrap; }
.danger-icon { color:#c74d65 !important; }
.template-empty { grid-column:1 / -1; display:flex; align-items:center; gap:12px; padding:18px; border:1px dashed #d7cff5; border-radius:14px; color:var(--ink-soft); background:#fcfbff; }
.template-empty-icon { display:grid; place-items:center; width:38px; height:38px; border-radius:12px; color:var(--purple); background:#f0eaff; }
.template-empty-icon svg { width:18px; height:18px; }
.template-empty strong { display:block; color:var(--ink); font:800 12px Manrope; }
.template-empty p { margin:4px 0 0; font-size:11px; }
.template-modal-backdrop { position:fixed; inset:0; z-index:80; display:grid; place-items:center; padding:22px; background:rgba(28,21,65,.34); backdrop-filter:blur(8px); }
.template-modal { width:min(620px,100%); max-height:min(760px,calc(100vh - 44px)); overflow:auto; border:1px solid rgba(255,255,255,.85); border-radius:22px; background:var(--card); box-shadow:0 24px 70px rgba(37,22,98,.28); }
.template-modal-header { display:flex; justify-content:space-between; gap:16px; padding:22px 24px 16px; border-bottom:1px solid var(--line); }
.template-modal-header h2 { margin:5px 0 0; color:var(--ink); font:800 20px Manrope; }
.template-modal-header p { margin:5px 0 0; color:var(--ink-soft); font-size:12px; }
.template-modal form { display:grid; gap:15px; padding:20px 24px 24px; }
.template-modal label { display:grid; gap:7px; }
.template-modal label > span { color:var(--ink); font:800 11px Manrope; }
.template-modal input, .template-modal textarea { width:100%; box-sizing:border-box; border:1px solid var(--line); border-radius:11px; padding:11px 12px; color:var(--ink); background:var(--surface); font:500 12px 'DM Sans',system-ui,sans-serif; outline:none; }
.template-modal input:focus, .template-modal textarea:focus { border-color:var(--purple); box-shadow:0 0 0 3px rgba(119,86,235,.13); }
.template-modal textarea { min-height:210px; resize:vertical; line-height:1.55; }
.template-modal-footer { display:flex; justify-content:flex-end; gap:9px; padding-top:4px; }
html[data-theme="dark"] .template-card { background:rgba(32,36,74,.58); border-color:rgba(196,192,255,.16); }
html[data-theme="dark"] .template-card:hover { border-color:#6358a9; }
html[data-theme="dark"] .template-card-icon, html[data-theme="dark"] .template-empty-icon { background:#302b5b; }
html[data-theme="dark"] .template-badge { color:#d8ccff; background:#3a3572; }
html[data-theme="dark"] .template-badge.custom { color:#baf0dd; background:#1e5548; }
html[data-theme="dark"] .template-empty { border-color:rgba(196,192,255,.22); background:rgba(32,36,74,.4); }
html[data-theme="dark"] .template-modal input, html[data-theme="dark"] .template-modal textarea { background:#20244a; border-color:rgba(196,192,255,.2); color:#e3e6ff; }
@media (max-width:760px) { .templates-section-heading { display:grid; } .templates-grid { grid-template-columns:1fr; } .template-card { grid-template-columns:42px minmax(0,1fr); } .template-card-actions { grid-column:2; justify-content:flex-start; } }

/* Revisão global de contraste do tema escuro.
   Mantém as áreas coloridas da agenda com texto escuro intencionalmente,
   mas reforça textos, bordas, campos, cartões e modais do restante da aplicação. */
html[data-theme="dark"] .page-heading p,
html[data-theme="dark"] .card-heading p,
html[data-theme="dark"] .date-note,
html[data-theme="dark"] .date-note strong,
html[data-theme="dark"] .patient-cell small,
html[data-theme="dark"] .next-patient small,
html[data-theme="dark"] .quick-info p,
html[data-theme="dark"] .quick-info small,
html[data-theme="dark"] .briefing-date,
html[data-theme="dark"] .preconsultation-facts span,
html[data-theme="dark"] .preconsultation-focus ul,
html[data-theme="dark"] .preconsultation-empty-copy,
html[data-theme="dark"] .metric-card span,
html[data-theme="dark"] .metric-card small,
html[data-theme="dark"] .report-card-heading p,
html[data-theme="dark"] .report-kpi-card span,
html[data-theme="dark"] .report-kpi-card small,
html[data-theme="dark"] .report-ranking-head,
html[data-theme="dark"] .report-chart-legend,
html[data-theme="dark"] .report-empty-inline,
html[data-theme="dark"] .report-ai-source,
html[data-theme="dark"] .scale-meta,
html[data-theme="dark"] .scale-rights,
html[data-theme="dark"] .history-fields small,
html[data-theme="dark"] .history-transcript small,
html[data-theme="dark"] .document-processing-steps,
html[data-theme="dark"] .patient-document-copy,
html[data-theme="dark"] .patient-document-expiry,
html[data-theme="dark"] .patient-document-legal,
html[data-theme="dark"] .patient-document-row small {
  color: #c4cbed;
}

html[data-theme="dark"] .briefing-icon { color:#d4c8ff; background:#302b5b; }
html[data-theme="dark"] .preconsultation-focus { border-color:rgba(196,192,255,.2); background:rgba(48,43,91,.58); }
html[data-theme="dark"] .preconsultation-focus > span { color:#d4c8ff; }
html[data-theme="dark"] .preconsultation-update { border-color:#2f5c50; background:rgba(29,77,68,.4); }
html[data-theme="dark"] .preconsultation-update > span { color:#a6efd9; }
html[data-theme="dark"] .preconsultation-update li strong { color:#9aa3d0; }

html[data-theme="dark"] .inner-search,
html[data-theme="dark"] .filter-pill,
html[data-theme="dark"] .date-control,
html[data-theme="dark"] .view-switch,
html[data-theme="dark"] .calendar-nav,
html[data-theme="dark"] .table-head,
html[data-theme="dark"] .history-visit,
html[data-theme="dark"] .history-full-record,
html[data-theme="dark"] .history-transcript,
html[data-theme="dark"] .birth-date-popover,
html[data-theme="dark"] .patient-edit-dialog,
html[data-theme="dark"] .history-dialog,
html[data-theme="dark"] .waiting-action-menu,
html[data-theme="dark"] .patient-record-menu,
html[data-theme="dark"] .scale-card,
html[data-theme="dark"] .scale-recommendation,
html[data-theme="dark"] .extraction-card,
html[data-theme="dark"] .document-selected-type,
html[data-theme="dark"] .document-thinking,
html[data-theme="dark"] .document-review-note,
html[data-theme="dark"] .document-dialog-warning,
html[data-theme="dark"] .document-draft-field textarea,
html[data-theme="dark"] .document-package-patient,
html[data-theme="dark"] .document-package-list li,
html[data-theme="dark"] .patient-document-security,
html[data-theme="dark"] .patient-document-file,
html[data-theme="dark"] .patient-document-row {
  border-color: rgba(196, 192, 255, .22);
  background: #202448;
  color: var(--ink);
}

html[data-theme="dark"] .inner-search input,
html[data-theme="dark"] .filter-pill,
html[data-theme="dark"] .date-control,
html[data-theme="dark"] .view-switch button,
html[data-theme="dark"] .calendar-nav,
html[data-theme="dark"] .table-head,
html[data-theme="dark"] .history-visit,
html[data-theme="dark"] .history-full-record,
html[data-theme="dark"] .history-transcript,
html[data-theme="dark"] .birth-date-popover,
html[data-theme="dark"] .patient-edit-dialog,
html[data-theme="dark"] .history-dialog,
html[data-theme="dark"] .waiting-action-menu button,
html[data-theme="dark"] .patient-record-menu button,
html[data-theme="dark"] .scale-card,
html[data-theme="dark"] .scale-recommendation,
html[data-theme="dark"] .extraction-card,
html[data-theme="dark"] .document-selected-type,
html[data-theme="dark"] .document-thinking,
html[data-theme="dark"] .document-review-note,
html[data-theme="dark"] .document-dialog-warning,
html[data-theme="dark"] .document-draft-field textarea,
html[data-theme="dark"] .document-package-patient,
html[data-theme="dark"] .document-package-list li,
html[data-theme="dark"] .patient-document-security,
html[data-theme="dark"] .patient-document-file,
html[data-theme="dark"] .patient-document-row {
  color: #eef0ff;
}

html[data-theme="dark"] .table-head,
html[data-theme="dark"] .patient-table-row:hover,
html[data-theme="dark"] .history-full-record,
html[data-theme="dark"] .history-transcript,
html[data-theme="dark"] .scale-recommendation,
html[data-theme="dark"] .document-selected-type,
html[data-theme="dark"] .document-review-note,
html[data-theme="dark"] .document-dialog-warning,
html[data-theme="dark"] .patient-document-security {
  background: #272b55;
}

html[data-theme="dark"] .date-control button,
html[data-theme="dark"] .calendar-nav,
html[data-theme="dark"] .birth-calendar-head button,
html[data-theme="dark"] .birth-calendar-head select {
  border-color: #515783;
  background: #292d58;
  color: #ddd8ff;
}
html[data-theme="dark"] .view-switch button.active {
  background: #4a3c88;
  color: #f0eaff;
}
html[data-theme="dark"] .birth-calendar-grid button:hover,
html[data-theme="dark"] .patient-record-menu button:hover,
html[data-theme="dark"] .waiting-action-menu button:hover {
  background: #373369;
  color: #fff;
}
/* Links e botões-link em roxo escuro (--purple-dark) ficam quase ilegíveis sobre o fundo escuro dos cartões,
   porque o texto não tem um fundo claro próprio (diferente dos "badges"/chips, que mantêm fundo claro e por
   isso já são legíveis nos dois temas). */
html[data-theme="dark"] .card-heading a,
html[data-theme="dark"] .link-button,
html[data-theme="dark"] .add-reminder {
  color: #c9bfff;
}
html[data-theme="dark"] .add-reminder:hover { background: rgba(196, 192, 255, .14); }
html[data-theme="dark"] .birth-calendar-grid button.muted { color: #777fae; }

html[data-theme="dark"] .content input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] .content select,
html[data-theme="dark"] .content textarea,
html[data-theme="dark"] .profile-modal input,
html[data-theme="dark"] .profile-modal select,
html[data-theme="dark"] .profile-modal textarea,
html[data-theme="dark"] .header-popover input,
html[data-theme="dark"] .header-popover select,
html[data-theme="dark"] .header-popover textarea,
html[data-theme="dark"] .document-generator select,
html[data-theme="dark"] .scale-frequency select,
html[data-theme="dark"] .patient-document-form input {
  border-color: #565d8e;
  background: #202448;
  color: #eef0ff;
}
html[data-theme="dark"] .content input::placeholder,
html[data-theme="dark"] .content textarea::placeholder,
html[data-theme="dark"] .profile-modal input::placeholder,
html[data-theme="dark"] .profile-modal textarea::placeholder,
html[data-theme="dark"] .inner-search input::placeholder,
html[data-theme="dark"] .global-search input::placeholder {
  color: #aeb7df;
  opacity: 1;
}
html[data-theme="dark"] .document-draft-field textarea { color: #e7eaff; }
html[data-theme="dark"] .setting-field label,
html[data-theme="dark"] .profile-modal label,
html[data-theme="dark"] .document-generator label,
html[data-theme="dark"] .scale-frequency label,
html[data-theme="dark"] .patient-document-form label {
  color: #e0e4ff;
}

html[data-theme="dark"] .status.blue { color: #b7d4ff; background: #23416e; }
html[data-theme="dark"] .status.purple { color: #e0c9ff; background: #4b3471; }
html[data-theme="dark"] .status.amber { color: #ffdc91; background: #59451e; }
html[data-theme="dark"] .status.red { color: #ffb9c8; background: #5a2d47; }
html[data-theme="dark"] .status.gray { color: #d0d5f0; background: #3a4165; }
html[data-theme="dark"] .status.white { color: #d6dcf5; background: #343b63; border-color: #565d8e; }
html[data-theme="dark"] .tag { color: #e1d8ff; background: #3c3270; }
html[data-theme="dark"] .attention { color: #ffc4e2; background: #543251; }
html[data-theme="dark"] .consultation-header-timer { border-color: #615b9c; background: linear-gradient(145deg, #302b5b, #25294f); color: #e4ddff; }
html[data-theme="dark"] .consultation-header-timer span { color: #bec6e7; }

html[data-theme="dark"] .document-editor-modal,
html[data-theme="dark"] .document-package-dialog,
html[data-theme="dark"] .results-modal,
html[data-theme="dark"] .medication-catalog-modal,
html[data-theme="dark"] .template-modal {
  border-color: rgba(196, 192, 255, .24);
  background: linear-gradient(145deg, #202448, #171a38);
}
html[data-theme="dark"] .document-editor-header {
  border-bottom-color: rgba(196, 192, 255, .18);
  background: linear-gradient(135deg, #2c2958, #30275b 68%, #26345d);
}
html[data-theme="dark"] .document-editor-footer,
html[data-theme="dark"] .header-popover footer {
  border-top-color: rgba(196, 192, 255, .18);
  background: #1a1e40;
}
html[data-theme="dark"] .document-processing-steps .active { color: #d4c7ff; }
html[data-theme="dark"] .document-processing-steps .complete { color: #8de5cf; }
html[data-theme="dark"] .document-package-link input { border-color: #565d8e; background: #202448; color: #eef0ff; }
html[data-theme="dark"] .document-package-delivery { border-color: rgba(240, 217, 168, .25); color: #ffe0a0; background: #4a391c; }
html[data-theme="dark"] .document-confirmed-copy { border-color: rgba(101, 218, 177, .25); color: #a5efd8; background: #1d4a42; }
html[data-theme="dark"] .document-confirmed-copy strong { color: #baf4e2; }
html[data-theme="dark"] .patient-document-file-icon { color: #d9ccff; background: #38316d; }
html[data-theme="dark"] .patient-document-empty { color: #bec6e7; background: #272b55; }
html[data-theme="dark"] .patient-document-error p,
html[data-theme="dark"] .patient-document-loading p { color: #c4cbed; }

html[data-theme="dark"] .questionnaire-last-status.completed { color: #a6efd9; background: #1d4d44; }
html[data-theme="dark"] .template-card-copy small,
html[data-theme="dark"] .template-section-heading p,
html[data-theme="dark"] .reports-toolbar label,
html[data-theme="dark"] .reports-period-note,
html[data-theme="dark"] .birth-calendar-weekdays {
  color: #c4cbed;
}

/* Indicadores financeiros e demanda da agenda */
.report-section-label { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin:20px 0 10px; }
.report-section-label span { color:var(--ink); font:800 13px Manrope; }
.report-section-label small { color:var(--muted); font-size:10px; }
.reports-financial-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:14px; }
.financial-card { min-height:124px; }
.report-kpi-icon.purple { color:#8654f1; background:#eee5ff; }
.report-trend.positive { color:#128b70; }
.report-trend.negative { color:#bd4662; }
.report-trend.neutral { color:var(--muted); font-size:16px !important; letter-spacing:-.2px !important; }
.reports-financial-detail-grid,
.reports-demand-grid { display:grid; grid-template-columns:1.15fr .85fr; gap:14px; margin-bottom:14px; }
.report-source-list { display:grid; gap:4px; }
.report-source-row { position:relative; display:flex; align-items:center; gap:12px; padding:12px 0 12px 13px; border-bottom:1px solid var(--line); }
.report-source-row:last-child { border-bottom:0; }
.report-source-row > div { display:grid; gap:4px; min-width:0; flex:1; }
.report-source-row strong { color:var(--ink); font:800 12px Manrope; }
.report-source-row small { color:var(--ink-soft); font-size:10px; line-height:1.4; }
.report-source-row b { color:var(--ink); font:800 15px Manrope; white-space:nowrap; }
.report-source-row b.source-count { color:var(--blue); }
.source-dot { width:9px; height:9px; flex:none; border-radius:50%; background:#8c5bf2; box-shadow:0 0 0 4px rgba(140,91,242,.12); }
.source-dot.convenio { background:#3987e9; box-shadow:0 0 0 4px rgba(57,135,233,.12); }
.report-financial-note .report-stat-list > div { padding:12px 0; }
.report-ranking-meta { display:block; color:var(--muted); font-size:9px; }
.report-weekday-ranking .report-ranking-item { gap:4px; }

.agenda-billing-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; margin-top:17px; padding-top:17px; border-top:1px solid var(--line); }
.agenda-dialog-field { display:grid; gap:6px; min-width:0; }
.agenda-dialog-field > span { color:var(--ink); font:800 10px Manrope; }
.agenda-dialog-field select,
.agenda-dialog-field input { width:100%; box-sizing:border-box; height:40px; padding:0 10px; border:1px solid #ded8f3; border-radius:10px; color:var(--ink); background:#fff; font:500 12px 'DM Sans',system-ui,sans-serif; outline:0; }
.agenda-dialog-field select:focus,
.agenda-dialog-field input:focus { border-color:var(--purple); box-shadow:0 0 0 3px rgba(119,86,235,.12); }
.agenda-dialog-field small { color:var(--muted); font-size:9px; line-height:1.35; }
.agenda-value-field { grid-column:1 / -1; }
.agenda-convenio-note { grid-column:1 / -1; display:flex; align-items:flex-start; gap:8px; padding:10px 11px; border:1px solid #dce6fb; border-radius:10px; color:#4f6598; background:#f4f8ff; font-size:10px; line-height:1.4; }
.agenda-convenio-note svg { width:15px; height:15px; flex:none; color:#3987e9; }
.appointment-billing { color:var(--purple-dark) !important; font-weight:700; }
@media (max-width: 1100px) {
  .reports-financial-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 920px) {
  .reports-financial-detail-grid, .reports-demand-grid { grid-template-columns:1fr; }
}
@media (max-width: 560px) {
  .report-section-label { display:grid; gap:4px; }
  .reports-financial-grid { grid-template-columns:1fr; }
  .agenda-billing-fields { grid-template-columns:1fr; }
  .agenda-value-field, .agenda-convenio-note { grid-column:auto; }
}
html[data-theme="dark"] .report-kpi-icon.purple { color:#d7c4ff; background:#3e3474; }
html[data-theme="dark"] .report-trend.positive { color:#9ae8d1; }
html[data-theme="dark"] .report-trend.negative { color:#ffb9c8; }
html[data-theme="dark"] .report-source-row small,
html[data-theme="dark"] .report-ranking-meta,
html[data-theme="dark"] .report-section-label small { color:#c4cbed; }
html[data-theme="dark"] .agenda-billing-fields { border-top-color:rgba(196,192,255,.2); }
html[data-theme="dark"] .agenda-dialog-field > span { color:#e5e9ff; }
html[data-theme="dark"] .agenda-dialog-field select,
html[data-theme="dark"] .agenda-dialog-field input { border-color:#565d8e; background:#202448; color:#eef0ff; }
html[data-theme="dark"] .agenda-convenio-note { border-color:rgba(116,164,245,.25); color:#c5d8ff; background:#26395f; }
html[data-theme="dark"] .appointment-billing { color:#d6c8ff !important; }

/* Revisão das abas e editor único da prescrição */
.record-tab-label { min-width:0; }
.record-tab-alert { display:inline-grid; place-items:center; width:17px; height:17px; margin-left:auto; border-radius:50%; background:#d75a77; color:#fff; font:800 11px/1 Manrope; box-shadow:0 0 0 3px rgba(215,90,119,.12); }
.tabbar button.active .record-tab-alert { background:#bd4566; }
.prescription-text-editor { display:grid; gap:7px; margin-top:2px; }
.prescription-text-editor > span { color:var(--ink); font:800 11px Manrope; }
.prescription-text-editor textarea { width:100%; min-height:330px; box-sizing:border-box; resize:vertical; padding:16px; border:1px solid #ded8f3; border-radius:13px; color:var(--ink); background:linear-gradient(145deg,#fff,#fbfaff); font:500 13px/1.7 'DM Sans',system-ui,sans-serif; outline:0; white-space:pre-wrap; }
.prescription-text-editor textarea:focus { border-color:var(--purple); box-shadow:0 0 0 3px rgba(119,86,235,.12); }
.prescription-text-editor textarea:disabled { opacity:.72; cursor:wait; }
.prescription-text-editor small { color:var(--muted); font-size:10px; line-height:1.4; }
.prescription-name-mode-summary, .medication-preference-mode { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:12px; margin:0 0 17px; padding:14px 15px; border:1px solid #e1daf8; border-radius:13px; background:linear-gradient(135deg,#fbf9ff,#f5f1ff); }
.medication-preference-mode { margin-top:2px; }
.medication-library-launch { display:flex; align-items:center; gap:12px; padding:14px 15px; border:1px solid #e1daf8; border-radius:13px; background:linear-gradient(135deg,#fbf9ff,#f5f1ff); }
.medication-library-launch > .settings-icon { width:34px; height:34px; flex:none; }
.medication-library-launch > div:nth-child(2) { display:grid; gap:4px; flex:1; min-width:0; }
.medication-library-launch strong { color:var(--ink); font:800 12px Manrope; }
.medication-library-launch span { color:var(--muted); font-size:10px; line-height:1.4; }
.prescription-name-mode-values { display:flex; align-items:center; gap:8px; white-space:nowrap; }
.prescription-name-mode-values span { color:#9a96ad; font:700 10px Manrope; transition:color .2s ease; }
.prescription-name-mode-values span.is-active { color:var(--purple-dark); }
.prescription-name-mode-summary .settings-hint, .medication-preference-mode .settings-hint { grid-column:1 / -1; margin:0; }
html[data-theme="dark"] .prescription-name-mode-summary, html[data-theme="dark"] .medication-preference-mode { border-color:#4a4f7d; background:linear-gradient(135deg,#262751,#222548); }
html[data-theme="dark"] .medication-library-launch { border-color:#4a4f7d; background:linear-gradient(135deg,#262751,#222548); }
html[data-theme="dark"] .medication-library-launch strong { color:#eef0ff; }
html[data-theme="dark"] .medication-library-launch span { color:#c4cbed; }
html[data-theme="dark"] .medication-catalog-option.is-selected { border-color:#ab91ff; background:linear-gradient(135deg,#8451db,#5557d8); }
html[data-theme="dark"] .prescription-name-mode-values span { color:#9da4c9; }
html[data-theme="dark"] .prescription-name-mode-values span.is-active { color:#d7c4ff; }
@media (max-width: 760px) { .prescription-name-mode-summary, .medication-preference-mode { grid-template-columns:1fr; } .prescription-name-mode-values { justify-content:space-between; } .prescription-name-mode-summary .button, .medication-preference-mode .prescription-name-mode-toggle { justify-self:start; } .medication-library-launch { align-items:stretch; flex-direction:column; } }
html[data-theme="dark"] .record-tab-alert { background:#d86888; color:#180d20; box-shadow:0 0 0 3px rgba(216,104,136,.18); }
html[data-theme="dark"] .prescription-text-editor textarea { border-color:#565d8e; background:#202448; color:#eef0ff; }
html[data-theme="dark"] .prescription-text-editor textarea:focus { border-color:#a68cff; box-shadow:0 0 0 3px rgba(166,140,255,.2); }
html[data-theme="dark"] .prescription-text-editor small { color:#c4cbed; }
.orientation-approval { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }
.orientation-approval small { color:var(--muted); font-size:10px; line-height:1.4; }
html[data-theme="dark"] .orientation-approval { border-top-color:rgba(196,192,255,.2); }
html[data-theme="dark"] .orientation-approval small { color:#c4cbed; }
@media (max-width: 560px) { .orientation-approval { align-items:stretch; flex-direction:column; } }
/* Patrícia — painel do médico e avisos da agenda */
.patricia-settings-card { display:grid; gap:14px; margin-top:14px; }
.pat-form { display:grid; gap:14px; }
.pat-badge { display:inline-flex; align-items:center; gap:4px; margin-left:6px; padding:3px 8px; border-radius:99px; font:700 10px Manrope,'DM Sans',system-ui,sans-serif; white-space:nowrap; background:#ece6ff; color:#5a2fd0; }
.pat-badge svg { flex:none; width:11px; height:11px; position:relative; left:1px; }
.setting-field textarea { width:100%; min-height:78px; resize:vertical; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:rgba(255,255,255,.7); color:var(--ink); font:500 13px 'DM Sans',system-ui,sans-serif; line-height:1.5; }
.setting-field textarea:focus { outline:2px solid rgba(116,60,255,.35); outline-offset:1px; }
.pat-save-row { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.pat-message { font:600 12px 'DM Sans',system-ui,sans-serif; color:var(--muted); }
.pat-message.ok { color:#0b7a58; } .pat-message.bad { color:#c22346; }
.pat-link-box { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; padding:11px 14px; border:1px solid var(--line); border-radius:13px; background:var(--lavender); }
.pat-link-box code { color:var(--ink); font:700 12.5px 'DM Sans',system-ui,sans-serif; overflow-wrap:anywhere; }
.pat-link-box > div { display:flex; gap:8px; }
.pat-empty, .pat-usage { color:var(--muted); font-size:12px; line-height:1.5; }
.pat-form [hidden] { display:none !important; }
.pat-conditional { display:grid; gap:6px; }
.pat-sub { margin:4px 0 0; font:700 12px Manrope,'DM Sans',system-ui,sans-serif; color:var(--ink); }
.pat-list { display:grid; gap:8px; }
.pat-booking { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:rgba(255,255,255,.55); }
.pat-booking strong { display:block; font:700 12.5px Manrope,'DM Sans',system-ui,sans-serif; color:var(--ink); }
.pat-booking small { display:block; color:var(--muted); font-size:11.5px; line-height:1.45; }
.pat-booking small.pat-warn { color:#9a6206; }
.pat-booking.crisis { border-color:#f14562; background:#fff0f2; }
.pat-convo { border-top:1px dashed var(--line); padding-top:8px; font-size:12px; color:var(--ink-soft); }
.pat-convo summary { cursor:pointer; font:700 12px Manrope,'DM Sans',system-ui,sans-serif; color:var(--ink); }
.pat-convo p { margin:6px 0 0; line-height:1.5; overflow-wrap:anywhere; }
.pat-convo p.patient b { color:#5a2fd0; }
@keyframes pat-alert-in { from { opacity:0; transform:translateY(-12px) scale(.97); } to { opacity:1; transform:none; } }
#pat-alert-bar { position:fixed; top:16px; right:16px; z-index:1200; width:min(400px,calc(100vw - 28px)); max-height:calc(100vh - 32px); overflow:auto; display:grid; gap:10px; padding:16px; border-radius:20px; background:linear-gradient(180deg,#fff,#fbfaff); border:1px solid rgba(241,69,98,.2); box-shadow:0 26px 60px rgba(90,20,50,.22), 0 3px 10px rgba(90,20,50,.08); animation:pat-alert-in .32s cubic-bezier(.2,.8,.2,1); }
#pat-alert-bar .pat-alert-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding-bottom:2px; border-bottom:1px solid rgba(241,69,98,.14); }
#pat-alert-bar .pat-alert-head strong { display:flex; align-items:center; gap:7px; color:#c22346; font:800 13px Manrope,'DM Sans',system-ui,sans-serif; letter-spacing:.1px; }
#pat-alert-bar .pat-alert-head strong svg { width:15px; height:15px; flex:none; }
#pat-alert-bar .pat-alert-head button { border:0; background:rgba(194,35,70,.09); color:#c22346; border-radius:99px; padding:6px 12px; font:700 10.5px Manrope,'DM Sans',system-ui,sans-serif; cursor:pointer; white-space:nowrap; transition:.15s ease; }
#pat-alert-bar .pat-alert-head button:hover { background:rgba(194,35,70,.16); }
#pat-alert-bar .pat-alert { display:flex; align-items:flex-start; gap:11px; padding:12px; border-radius:14px; background:#f6f4ff; border:1px solid rgba(90,47,208,.08); transition:.15s ease; }
#pat-alert-bar .pat-alert:hover { border-color:rgba(90,47,208,.2); }
#pat-alert-bar .pat-alert.crisis { background:#fff1f3; border-color:rgba(241,69,98,.2); }
#pat-alert-bar .pat-alert.agenda { background:#fff8ec; border-color:rgba(219,139,22,.2); }
#pat-alert-bar .pat-alert-icon { flex:none; width:34px; height:34px; display:grid; place-items:center; border-radius:11px; background:#e6e0ff; color:#5a2fd0; }
#pat-alert-bar .pat-alert-icon svg { width:16px; height:16px; }
#pat-alert-bar .pat-alert.crisis .pat-alert-icon { background:#ffd6dd; color:#c22346; }
#pat-alert-bar .pat-alert.agenda .pat-alert-icon { background:#ffe9c2; color:#9a6206; }
#pat-alert-bar .pat-alert-body { flex:1; min-width:0; }
#pat-alert-bar .pat-alert strong { display:block; font:800 12.5px Manrope,'DM Sans',system-ui,sans-serif; color:#101658; }
#pat-alert-bar .pat-alert small, #pat-alert-bar .pat-more { color:#5b6299; font-size:11px; }
#pat-alert-bar .pat-more { text-align:center; padding-top:2px; }
#pat-alert-bar .pat-alert p { margin:5px 0 0; font-size:12px; line-height:1.5; color:#33397a; overflow-wrap:anywhere; }
.pat-alert-btn { display:inline-flex; align-items:center; gap:5px; margin-top:8px; margin-right:6px; padding:5px 11px; border:1px solid #d8d0ff; border-radius:99px; background:#fff; color:#5a2fd0; font:700 11px Manrope,'DM Sans',system-ui,sans-serif; cursor:pointer; align-self:flex-start; transition:.15s ease; }
.pat-alert-btn svg { width:12px; height:12px; flex:none; }
.pat-alert-btn:hover { background:#f4f0ff; border-color:#c3b6f5; }
.rem-checklist { display:grid; gap:8px; padding:12px 14px; border:1px solid #e5defc; border-radius:13px; background:linear-gradient(145deg,#fbfaff,#f4f0ff); }
.rem-check { display:flex; align-items:flex-start; gap:10px; }
.rem-check > div { display:grid; gap:2px; }
.rem-check strong { color:var(--ink); font:700 12px Manrope; }
.rem-check small { color:var(--muted); font-size:11px; line-height:1.45; }
.rem-dot { display:inline-block; width:9px; height:9px; margin-top:4px; border-radius:50%; background:#b9bcd9; flex:none; }
.rem-dot.ok { background:#15a77d; } .rem-dot.bad { background:var(--red); } .rem-dot.warn { background:var(--amber); } .rem-dot.wait { background:#8b93c9; }
.rem-toggle { display:flex; align-items:flex-start; gap:10px; cursor:pointer; }
.rem-toggle input { position:absolute; opacity:0; pointer-events:none; }
.rem-toggle > span:last-child { display:grid; gap:3px; }
.rem-toggle strong { color:var(--ink); font:700 12px Manrope; }
.rem-toggle small { color:var(--muted); font-size:11px; line-height:1.45; }
.rem-toggle input:checked + .switch-visual { background:linear-gradient(135deg,#a855f7,#5b5ce2); }
.rem-toggle input:checked + .switch-visual i { transform:translateX(17px); }
.rem-toggle input:focus-visible + .switch-visual { outline:2px solid var(--purple); outline-offset:2px; }
.rem-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.rem-setup { border:1px dashed var(--line); border-radius:13px; padding:10px 14px; color:var(--ink-soft); font-size:12px; line-height:1.55; }
.rem-setup summary { cursor:pointer; color:var(--ink); font:700 12px Manrope; }
.rem-setup ol { margin:10px 0 8px; padding-left:18px; display:grid; gap:8px; }
@media (max-width:640px) { .pat-link-box { flex-direction:column; align-items:stretch; } .rem-grid { grid-template-columns:1fr; } }
html[data-theme="dark"] .pat-badge { background:#332a6b; color:#cfc3ff; }
html[data-theme="dark"] .setting-field textarea { background:rgba(40,43,83,.5); }
html[data-theme="dark"] .pat-booking { background:rgba(40,43,83,.4); }
html[data-theme="dark"] .pat-booking.crisis { background:#4a1a2a; border-color:#ff6b83; }
html[data-theme="dark"] .pat-booking small.pat-warn { color:#f0d9a8; }
html[data-theme="dark"] .pat-message.ok { color:#7fe0bd; } html[data-theme="dark"] .pat-message.bad { color:#ff9fb4; }
html[data-theme="dark"] .pat-convo p.patient b { color:#cfc3ff; }
html[data-theme="dark"] #pat-alert-bar { background:linear-gradient(180deg,#1b1f45,#181c3d); border-color:#ff6b83; }
html[data-theme="dark"] #pat-alert-bar .pat-alert-head { border-bottom-color:rgba(255,107,131,.22); }
html[data-theme="dark"] #pat-alert-bar .pat-alert { background:#292650; border-color:rgba(207,195,255,.1); } html[data-theme="dark"] #pat-alert-bar .pat-alert.crisis { background:#4a1a2a; border-color:rgba(255,107,131,.2); } html[data-theme="dark"] #pat-alert-bar .pat-alert.agenda { background:#3a2f14; border-color:rgba(240,180,60,.2); }
html[data-theme="dark"] #pat-alert-bar .pat-alert-icon { background:#3a3670; color:#cfc3ff; } html[data-theme="dark"] #pat-alert-bar .pat-alert.crisis .pat-alert-icon { background:#5c2333; color:#ff9fb4; } html[data-theme="dark"] #pat-alert-bar .pat-alert.agenda .pat-alert-icon { background:#4a3c17; color:#f0d9a8; }
html[data-theme="dark"] #pat-alert-bar .pat-alert strong { color:#eef0ff; } html[data-theme="dark"] #pat-alert-bar .pat-alert p, html[data-theme="dark"] #pat-alert-bar .pat-alert small, html[data-theme="dark"] #pat-alert-bar .pat-more { color:#c9cff0; }
html[data-theme="dark"] #pat-alert-bar .pat-alert-head button { background:rgba(255,107,131,.14); color:#ff9fb4; }
html[data-theme="dark"] .pat-alert-btn { background:#292650; color:#cfc3ff; border-color:#4a4483; }
html[data-theme="dark"] .rem-checklist { background:rgba(40,43,83,.5); border-color:rgba(196,192,255,.16); }

/* ---- Lembretes e SMS (reminders-ui.js) ---- */
.sms-settings-note { display:flex; align-items:flex-start; gap:7px; margin:12px 0; padding:9px 10px; border:1px solid #e2dafb; border-radius:10px; color:var(--ink-soft); background:#faf8ff; font-size:11px; line-height:1.45; }
.sms-settings-note svg { width:14px; height:14px; flex:none; margin-top:1px; color:var(--purple); }
.reminders-settings-card { display:grid; gap:14px; margin-top:14px; }
.reminders-settings-card .settings-card-heading { margin-bottom:2px; }
.rem-toggle.is-disabled { opacity:.55; cursor:not-allowed; }
.rem-group { display:grid; gap:10px; padding:12px 14px; border:1px solid var(--line); border-radius:13px; }
.rem-setup code { display:inline-block; max-width:100%; padding:1px 6px; border-radius:6px; background:var(--lavender); color:var(--ink); font-size:11px; overflow-wrap:anywhere; }
.rem-badge { display:inline-flex; align-items:center; margin-left:6px; padding:3px 8px; border-radius:99px; font:700 10px Manrope; white-space:nowrap; background:#eceffd; color:#4f579d; }
.rem-badge.ok { background:#dcf6ec; color:#0b7a58; } .rem-badge.warn { background:#fff0d6; color:#9a6206; } .rem-badge.bad { background:#ffe1e8; color:#c22346; } .rem-badge.wait { background:#eceffd; color:#4f579d; }
.rem-dot.ok, .rem-dot.bad, .rem-dot.warn, .rem-dot.wait { vertical-align:middle; }
.rem-block { display:grid; gap:9px; margin:12px 0; padding:12px 14px; border:1px solid var(--line); border-radius:13px; background:rgba(255,255,255,.55); }
.rem-block-head strong { display:block; color:var(--ink); font:700 12px Manrope; }
.rem-block-head small, .rem-hint { color:var(--muted); font-size:11px; line-height:1.45; }
.rem-line { display:flex; justify-content:space-between; gap:12px; font-size:12px; color:var(--ink-soft); }
.rem-line strong { text-align:right; font:600 12px 'DM Sans',system-ui,sans-serif; color:var(--ink); }
.rem-line strong.ok { color:#0b7a58; } .rem-line strong.bad { color:#c22346; }
.rem-response { display:grid; gap:2px; padding:9px 11px; border-radius:10px; }
.rem-response strong { font:700 12px Manrope; } .rem-response small { font-size:11px; opacity:.85; }
.rem-response.ok { background:#dcf6ec; color:#0b7a58; } .rem-response.warn { background:#fff0d6; color:#9a6206; } .rem-response.bad { background:#ffe1e8; color:#c22346; }
.rem-optout { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 11px; border-radius:10px; background:#fff0d6; color:#9a6206; font-size:12px; }
.rem-actions { display:flex; flex-wrap:wrap; gap:8px; }
.rem-actions .button { flex:1 1 170px; justify-content:center; }
@media (max-width:640px) { .rem-grid { grid-template-columns:1fr; } }
html[data-theme="dark"] .rem-block { background:rgba(40,43,83,.4); }
html[data-theme="dark"] .rem-badge { background:#2b3060; color:#c3c9e8; }
html[data-theme="dark"] .rem-badge.ok, html[data-theme="dark"] .rem-response.ok { background:#123d31; color:#7fe0bd; }
html[data-theme="dark"] .rem-badge.warn, html[data-theme="dark"] .rem-response.warn, html[data-theme="dark"] .rem-optout { background:#4a3a10; color:#f0d9a8; }
html[data-theme="dark"] .rem-badge.bad, html[data-theme="dark"] .rem-response.bad { background:#4a1a2a; color:#ff9fb4; }
html[data-theme="dark"] .rem-line strong.ok { color:#7fe0bd; } html[data-theme="dark"] .rem-line strong.bad { color:#ff9fb4; }
html[data-theme="dark"] .rem-setup code { background:#292650; }
