:root {
  font-family: Arial, 'Segoe UI', sans-serif;
  color: #152937;
  background: #f5f7f8;
  font-size: 16px;
  line-height: 1.5;
  --navy: #102638;
  --navy-2: #19374a;
  --ink: #152937;
  --muted: #506673;
  --line: #e0e7e9;
  --teal: #086b62;
  --teal-dark: #06554e;
  --mint: #e2f3ee;
  --surface: #fff;
  --red: #a03336;
  --amber: #805318;
  --radius: 13px;
  --shadow: 0 1px 2px #0e283309, 0 3px 12px #10263806;
  --workspace-canvas:#f5f3f4;
  --workspace-divider:#e6dfe2;
  --workspace-selection:#f7e9ee;
  --workspace-accent:#842139;
  --workspace-shadow:0 1px 2px #33121c08, 0 8px 24px #33121c07;
  --workspace-hero:radial-gradient(ellipse at 13% -15%, #ab5b71 0, transparent 52%),
    linear-gradient(118deg, #552034 2%, #75324a 44%, #381826 100%);
  --workspace-hero-lines:radial-gradient(ellipse 79% 148% at -7% 138%, transparent 70%, #ffd1de26 70.4%, transparent 71.1%),
    radial-gradient(ellipse 80% 156% at -18% 138%, transparent 72%, #ffd1de15 72.4%, transparent 73.1%);
  --workspace-hero-shadow:0 2px 4px #38152320, 0 14px 32px #3e162a26;
}

/* Marketing workspace: contact data only, isolated from clinical details. */
.crm-page { display:grid; gap:20px; text-align:right; }
.crm-page .page-heading { margin:0; }
.crm-hint { color:var(--muted); font-size:13px; line-height:1.65; }
.crm-period { padding:18px; display:grid; gap:12px; }
.crm-range { display:flex; flex-wrap:wrap; gap:12px; align-items:end; }
.crm-range .field { flex:1 1 190px; max-width:260px; }
.crm-page .field > span { font-size:13px; font-weight:700; }
.crm-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.crm-metrics > div { padding:17px; display:grid; align-content:start; gap:7px; }
.crm-metrics strong { font-size:30px; line-height:1.25; }
.crm-metrics small { color:var(--muted); font-size:12px; }
.crm-entry-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-items:start; }
.crm-disclosure > summary { padding:17px 18px; cursor:pointer; font-weight:700; }
.crm-form { padding:0 18px 18px; display:grid; gap:15px; }
.crm-form > .btn { justify-self:start; }
.crm-form details > summary { cursor:pointer; color:var(--teal); font-weight:700; }
.crm-subform { margin-block:12px; }
.crm-table-scroll { overflow-x:auto; border-radius:var(--radius); }
.crm-table { width:100%; border-collapse:collapse; min-width:640px; font-size:14px; }
.crm-table caption { text-align:right; padding:18px; font-weight:700; font-size:18px; }
.crm-table th,.crm-table td { text-align:right; padding:12px 16px; border-block-start:1px solid var(--line); vertical-align:top; }
.crm-table thead { background:#f5f7f8; }
.crm-table tbody th { font-weight:600; max-width:240px; overflow-wrap:anywhere; }
.crm-table th span,.crm-table small { display:block; color:var(--muted); font-size:12px; font-weight:400; }
.crm-lead-list { display:grid; }
.crm-lead { padding:18px; border-block-start:1px solid var(--line); display:grid; gap:12px; }
.crm-lead header { display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.crm-lead h3 { font-size:17px; overflow-wrap:anywhere; }
.crm-lead header p { color:var(--muted); font-size:13px; margin-block-start:4px; }
.crm-badge { display:inline-flex; align-items:center; align-self:start; background:#f2f4f6; border:1px solid var(--line); border-radius:20px; padding:5px 11px; font-size:12px; font-weight:700; }
.crm-positive { background:#e8f5ee; color:#246843; border-color:#c9e5d4; }
.crm-lead-edit { display:flex; flex-wrap:wrap; gap:12px; align-items:end; }
.crm-lead-edit .field { flex:1 1 180px; max-width:280px; }
.crm-link-summary { font-size:13px; font-weight:700; }
.crm-linker { padding:16px; border:1px solid #d7e2e5; background:#f8fafb; border-radius:10px; display:grid; gap:12px; }
.crm-linker .crm-form { padding:0; }
.crm-search { display:flex; align-items:end; flex-wrap:wrap; gap:10px; }
.crm-search .field { flex:1 1 220px; }
.crm-search-results { display:grid; gap:8px; }
.crm-search-results .btn { justify-content:start; white-space:normal; text-align:right; }
.crm-cost-list { padding:0 18px 18px; display:grid; gap:12px; }
.crm-cost-list > div { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:8px; font-size:13px; }
.crm-events { margin:0; padding-inline-start:20px; font-size:13px; display:grid; gap:8px; }
.crm-empty { padding:18px; color:var(--muted); font-size:14px; }
.crm-loading { color:var(--muted); font-size:14px; }
.crm-error { padding:12px; background:#fff0f0; color:#96383d; border-radius:8px; }
@media(max-width:1000px) { .crm-entry-grid { grid-template-columns:1fr; } .crm-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:540px) {
  .crm-page { gap:15px; }
  .crm-metrics { gap:8px; }
  .crm-metrics > div { padding:12px; }
  .crm-metrics strong { font-size:25px; }
  .crm-metrics > div > span { font-size:13px; }
  .crm-page .form-grid { grid-template-columns:1fr; }
  .crm-range .field,.crm-lead-edit .field { max-width:none; }
  .crm-lead,.crm-period { padding:14px; }
  .crm-linker { padding:12px; }
  .crm-form { padding-inline:14px; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #16a497; outline-offset: 3px; }
a { color: var(--teal); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; }
input, select, textarea { width: 100%; min-width: 0; }
textarea { resize: vertical; min-height: 106px; line-height: 1.6; }
input[type='checkbox'], input[type='radio'] { width: 1.15em; height: 1.15em; flex: 0 0 auto; accent-color: var(--teal); }
input[type='date'], input[type='time'] { min-height: 43px; }
svg { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
bdi, .number { font-variant-numeric: tabular-nums; }

.skip-link { position: fixed; z-index: 6; inset-block-start: 8px; inset-inline-start: 8px; padding: 8px 14px; background: white; transform: translateY(-160%); border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }
.shell { min-height: 100vh; display: grid; grid-template-columns: 235px minmax(0, 1fr); }
.sidebar { background: var(--navy); color: #e8f0f5; min-width: 0; }
.sidebar-content { height: 100dvh; min-height: 440px; position: sticky; top: 0; display: flex; flex-direction: column; padding: 29px 17px 19px; }
.brand { color: inherit; display: inline-flex; align-items: center; gap: 11px; text-align: start; padding: 0; border: 0; background: transparent; text-decoration: none; }
.sidebar .brand { padding-inline: 9px; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-title { font-size: 20px; font-weight: 800; letter-spacing: -.035em; white-space: nowrap; }
.brand-context { display: block; color: #b7c9d4; font-size: 12px; font-weight: 400; line-height: 1.3; }
.sidebar-nav { margin-block-start: 48px; display: grid; gap: 5px; }
.nav-title { font-size: 12px; color: #a7bdca; margin: 0 12px 5px; font-weight: 700; }
.nav-link { text-align: start; color: #d1dce4; background: transparent; border: 1px solid transparent; min-height: 44px; border-radius: 8px; padding: 9px 12px; display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 600; }
.nav-link[aria-current='page'] { color: #c9f4e8; background: #1e4350; border-color: #285263; }
.nav-link:hover { background: #1a3a4c; color: #fff; }
.nav-count { margin-inline-start: auto; font-weight: 700; min-width: 23px; text-align: center; background: #315366; border-radius: 9px; font-size: 12px; padding-inline: 5px; }
.sidebar-footer { margin-block-start: auto; }
.user-slot { display: flex; align-items: center; gap: 10px; margin-block-start: 14px; padding-block-start: 15px; border-block-start: 1px solid #315064; }
.user-mark { display: grid; place-items: center; height: 35px; width: 35px; flex: 0 0 auto; border-radius: 10px; color: #c7f1e6; background: #28505c; font-size: 13px; font-weight: 800; }
.user-name { display: block; color: #edf4f8; font-weight: 700; font-size: 14px; }
.user-role { display: block; color: #b7c9d4; font-size: 12px; }
.role-switch { display: flex; gap: 8px; align-items: center; border: 0; background: transparent; color: #bfced8; padding: 8px; margin-inline-start: auto; border-radius: 8px; }
.role-switch:hover { background: #1c3b4f; color: white; }
.role-switch svg { width: 18px; height: 18px; }
.demo-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #416172; border-radius: 6px; padding: 4px 8px; color: #d0dfe7; font-size: 11px; font-weight: 700; }
.demo-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #71d9be; }

.shell-main { min-width: 0; }
.topbar { position: sticky; inset-block-start: 0; z-index: 3; min-height: 70px; padding: 12px clamp(18px, 3vw, 45px); display: flex; flex-wrap: wrap; gap: 14px; align-items: center; border-block-end: 1px solid var(--line); background: #fff; }
.topbar .date-group { margin-inline-start: auto; }
.date-group { display: flex; align-items: center; gap: 7px; }
.date-input { max-width: 151px; }
.content { max-width: 1480px; margin-inline: auto; padding: 31px clamp(18px, 3vw, 45px) 36px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 13px; flex-wrap: wrap; margin-block-end: 23px; }
.page-heading h1 { font-size: clamp(29px, 3vw, 37px); letter-spacing: -.035em; font-weight: 800; }
.page-heading p { color: var(--muted); margin-block-start: 6px; }
.calendar-caption { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 15px; }
.calendar-caption svg { width: 16px; height: 16px; }
.breadcrumb { display: flex; align-items: center; gap: 9px; margin-block-end: 17px; color: var(--muted); font-size: 14px; }
.breadcrumb svg { width: 14px; height: 14px; }
.breadcrumb button { background: none; padding: 0; border: 0; color: var(--teal); font-weight: 700; }
.breadcrumb button:hover { text-decoration: underline; }
.demo-note { margin-block-start: 20px; display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); }
.demo-note svg { width: 16px; height: 16px; margin-block-start: 2px; }

.btn { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 40px; padding: 6px 13px; border: 1px solid #cfdbdf; background: #fff; border-radius: 8px; color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: #9bb4bc; background: #f4f8f8; }
.btn-primary { border-color: var(--teal); background: var(--teal); color: white; }
.btn-primary:hover:not(:disabled) { border-color: var(--teal-dark); background: var(--teal-dark); }
.btn-soft { border-color: #cae8df; background: #ebf6f2; color: var(--teal-dark); }
.btn-soft:hover:not(:disabled) { border-color: #a6d5c9; background: #e4f3ee; }
.btn-danger { color: var(--red); }
.btn-icon { width: 40px; padding-inline: 0; }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-small { min-height: 34px; padding: 4px 9px; font-size: 13px; }
.btn svg { width: 17px; height: 17px; }
.btn.btn-quick { position:relative; inline-size:44px; min-inline-size:44px; block-size:44px; min-block-size:44px; padding:0; flex-shrink:0; }
.btn-quick svg { width:22px; height:22px; }
.quick-label { display:none; }
.btn-quick:focus-visible::after {
  content:attr(title); position:absolute; z-index:4; inset-block-start:calc(100% + 5px); inset-inline-end:0;
  inline-size:max-content; max-inline-size:180px; white-space:normal; text-align:start;
  background:#243136; color:#fff; border-radius:6px; padding:5px 9px; font-size:12px; pointer-events:none;
}
.btn.btn-whatsapp { color:#166143; background:#f0faf5; border-color:#b9dec9; }
.btn.btn-whatsapp:hover:not(:disabled) { background:#dff4e8; border-color:#82bd9d; }
@media (max-width:720px), (pointer:coarse) {
  .btn.btn-quick { inline-size:auto; block-size:auto; max-inline-size:100%; padding:5px 8px; }
  .btn-quick svg { flex-shrink:0; width:18px; height:18px; }
  .btn-quick .quick-label { display:inline; font-size:12px; line-height:1.3; white-space:normal; }
  .btn-quick:focus-visible::after { content:none; }
}
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.btn-row.end { justify-content: flex-end; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-block-end: 23px; }
.metric { display: grid; grid-template-columns: 39px minmax(0, 1fr); gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; background: var(--surface); box-shadow: var(--shadow); }
.metric-icon { display: grid; place-items: center; height: 39px; width: 39px; border-radius: 10px; }
.tone-blue { background: #e8f0fa; color: #2f6194; }
.tone-green { background: #e0f3eb; color: #186758; }
.tone-amber { background: #fbf0dd; color: #805318; }
.tone-plum { background: #f0ecf7; color: #694a85; }
.metric-number { font-size: 24px; line-height: 1; font-weight: 800; margin-block-end: 4px; }
.metric-label { font-size: 13px; color: var(--muted); font-weight: 600; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 16px 18px; }
.panel-head h2, .card h2 { font-size: 19px; letter-spacing: -.02em; font-weight: 800; }
.panel-head p { color: var(--muted); font-size: 13px; margin-block-start: 4px; }
.panel-count { border: 1px solid #e1e8eb; padding: 3px 8px; border-radius: 7px; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.card { padding: 18px; }
.card h2 + p { margin-block-start: 6px; }
.card > .field, .card > .btn-row, .card > .info-box, .card > .records, .card > .textarea-and-actions, .card > .check, .card > .data-list, .card > .form-grid, .card > details, .card > .media-area { margin-block-start: 13px; }
.stack { display: grid; gap: 15px; align-content: start; min-width: 0; }
.work-columns { display: grid; grid-template-columns: minmax(240px, .85fr) minmax(0, 1.5fr); align-items: start; gap: 16px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: start; font-size: 14px; }
th, td { text-align: start; padding: 11px 14px; border-block-start: 1px solid #e8edef; vertical-align: middle; }
th { background: #f5f8f9; color: #4f6571; font-size: 12px; font-weight: 700; white-space: nowrap; }
th:first-child, td:first-child { padding-inline-start: 18px; }
th:last-child, td:last-child { padding-inline-end: 18px; }
tbody tr:hover td { background: #fbfdfd; }
.cell-time { font-weight: 800; font-size: 15px; }
.cell-muted, .muted, .subtext { color: var(--muted); }
.subtext { font-size: 13px; }
.cell-meta { display: block; font-size: 12px; color: var(--muted); margin-block-start: 2px; }
.patient-link { display: inline-flex; align-items: center; gap: 8px; border: 0; padding: 0; background: none; text-align: start; color: var(--ink); font-weight: 700; }
.patient-link:hover .patient-name { color: var(--teal); text-decoration: underline; }
.agenda-patient-line { display:flex; flex-wrap:wrap; align-items:center; gap:3px 8px; min-width:0; }
.reception-payment { font-size:12px; line-height:1.3; }
.action-cell { width: 1%; white-space: nowrap; }
.row-actions { display: flex; gap: 5px; justify-content: flex-end; }
.pill { width: fit-content; max-width: 100%; display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 2px 8px; font-size: 12px; line-height: 1.75; font-weight: 700; white-space: nowrap; }
.pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-blue { background: #e8f0fa; color: #2d5d8a; }
.pill-green { background: #e0f3e9; color: #13674b; }
.pill-teal { background: #dcf0ee; color: #07645d; }
.pill-plum { background: #efe9f6; color: #61437d; }
.pill-amber { background: #fcf0d9; color: #805013; }
.pill-red { background: #f8e8e8; color: #92363c; }
.pill-gray { background: #edf1f3; color: #4d6370; }
.empty { text-align: center; padding: 35px 14px; color: var(--muted); }
.empty svg { margin-block-end: 7px; }
.empty strong { display: block; color: var(--ink); font-size: 16px; }
.loading { padding: 24px 16px; color: var(--muted); }

.field { display: grid; gap: 6px; min-width: 0; }
.field label, .field-label { font-size: 14px; font-weight: 700; }
.control { background: #fff; padding: 8px 10px; border: 1px solid #cbd8dc; border-radius: 8px; min-height: 40px; }
.control::placeholder { color: #627681; opacity: 1; }
.topbar .control { font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
.intake-form { margin-block-start: 13px; }
.intake-form textarea { min-height: 72px; }
details.panel > .card { margin-block-start: 11px; padding: 0; border: 0; box-shadow: none; }
.dialog-error-global { margin-block-start: 13px; }
.check { display: flex; gap: 7px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { margin: 3px 0 0; }
.info-box { display: flex; gap: 8px; align-items: flex-start; color: #355963; background: #eff6f7; border: 1px solid #dbe9eb; border-radius: 9px; padding: 9px 10px; font-size: 13px; overflow-wrap: anywhere; }
.info-box svg { width: 16px; height: 16px; margin-block-start: 2px; }
.info-box.warning { color: #72501c; background: #fff8e9; border-color: #f0e2c2; }
.info-box.success { color: #155c46; background: #ebf6f0; border-color: #cce8d8; }
.data-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 12px; margin: 0; font-size: 14px; }
.data-list dt { color: var(--muted); }
.data-list dd { margin: 0; overflow-wrap: anywhere; }
.records { display: grid; gap: 9px; }
.record { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; overflow-wrap: anywhere; }
.record .btn-row { margin-block-start: 9px; }
.record summary { cursor: pointer; font-weight: 700; }
.record summary + p { margin-block-start: 6px; }
.past-visit-record { display: grid; gap: 4px; justify-items: start; }
.past-visit-record .btn { margin-block-start: 5px; }
.clinical-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-block-start: 10px; font-size: 15px; line-height: 1.65; }
.clinical-input { min-height: 145px; }
.draft-input { min-height: 250px; }
.media-area { display: grid; gap: 10px; }
.media-area audio, .record audio { width: 100%; height: 40px; margin-block-start: 6px; }
.recording-live { color: var(--red); font-weight: 700; font-size: 14px; }
.recording-live::before { content: ''; display: inline-block; background: var(--red); width: 8px; height: 8px; margin-inline-end: 6px; border-radius: 50%; }

.notice { position: fixed; z-index: 4; inset-block-end: 20px; inset-inline-end: 20px; max-width: calc(100% - 40px); display: flex; align-items: center; gap: 10px; background: #173949; border: 1px solid #315463; border-radius: 10px; color: #fff; padding: 10px 13px; box-shadow: 0 10px 38px #122c4338; }
.notice.error { background: #822d34; border-color: #8e3940; }
.notice button { padding: 1px; background: transparent; border: 0; color: inherit; margin-inline-start: 9px; }
.notice button svg { width: 17px; height: 17px; }
dialog { border: 1px solid #dce6e9; border-radius: 15px; width: min(540px, calc(100% - 24px)); max-height: calc(100dvh - 34px); padding: 0; background: #fff; color: var(--ink); box-shadow: 0 18px 70px #10263845; }
dialog::backdrop { background: #10263880; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px 13px; border-block-end: 1px solid var(--line); }
.dialog-header h2 { font-size: 23px; padding-block-start: 5px; }
.dialog-body { padding: 17px 20px 20px; }
.dialog-body form { display: grid; margin-block-start: 0; gap: 14px; }
.dialog-body > .btn-row, .dialog-body .form-grid + .form-grid { margin-block-start: 14px; }

.appointment-details { display:grid; gap:14px; }
.appointment-facts { gap:6px 16px; padding:13px 15px; border:1px solid #ece7e9; border-radius:10px; background:#faf8f9; }
.appointment-facts .pill { padding:0; background:none; color:inherit; white-space:normal; line-height:inherit; }
.appointment-facts .pill::before { display:none; }
.appointment-link-warning { padding-inline-start:10px; border-inline-start:2px solid #a97783; color:#53484c; font-size:14px; }
.appointment-main-actions .btn { min-height:44px; }
.appointment-main-actions .btn-whatsapp, .appointment-main-actions .btn-whatsapp:hover:not(:disabled) {
  color:var(--ink); background:white; border-color:#e1dadd;
}
.appointment-main-actions .btn-whatsapp:hover:not(:disabled) { background:#f7f2f4; }
.appointment-action-groups { border-block-end:1px solid #ece7e9; }
.appointment-action-group > summary {
  display:list-item; padding:11px 4px; min-height:44px; border-block-start:1px solid #ece7e9; font-weight:700; cursor:pointer;
}
.appointment-action-group > summary::marker { color:#807178; }
.appointment-action-list { display:grid; padding-block-end:8px; }
.appointment-action-list .btn {
  justify-content:flex-start; inline-size:100%; min-height:44px; block-size:auto; padding:7px 15px;
  border-color:transparent; background:white; font-weight:600; text-align:start; white-space:normal;
}
.appointment-action-list .btn:hover:not(:disabled) { background:#f7f2f4; border-color:transparent; }
.appointment-action-list .quick-label { display:inline; font-size:inherit; }
.appointment-action-list .btn-quick:focus-visible::after { content:none; }
.dialog-error { background: #fbecec; border: 1px solid #f5d5d8; color: #8d3036; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.segmented { display: flex; gap: 10px; flex-wrap: wrap; }
.segmented .check { align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.segmented .check:has(input:checked) { border-color: #acd6ca; background: #edf7f3; }
.segmented .check input { margin: 0; }

.login-layout { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(ellipse at 90% 5%, #d9efea, transparent 52%), #f2f6f7; }
.login-card { width: min(100%, 620px); border: 1px solid #deeaec; border-radius: 18px; background: white; padding: clamp(20px, 5vw, 36px); box-shadow: 0 10px 48px #193c4c0b; }
.entry-brand { display: grid; justify-items: start; gap: 10px; margin-block-end: 13px; }
.product-logo { display: block; width: clamp(110px, 24vw, 138px); height: auto; }
@media (prefers-reduced-motion: no-preference) {
  .entry-brand .product-logo, .brand .brand-mark { animation:doc-tor-logo-breathe 10s ease-in-out infinite; }
}
@keyframes doc-tor-logo-breathe {
  0%, 24%, 100% { transform:none; }
  12% { transform:translateY(-2px) scale(1.025); }
}
.entry-clinic { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.login-card h1 { font-size: clamp(27px, 5vw, 35px); letter-spacing: -.035em; }
.login-card > p, .login-card .info-box { margin-block-start: 9px; }
.pilot-login { width: min(100%, 470px); }
.pilot-login form { margin-block: 20px 14px; }
.pilot-label { display: inline-block; padding: 4px 9px; margin-block-end: 13px; border: 1px solid #dfcd9f; border-radius: 6px; background: #fff8e9; color: #72501c; font-size: 13px; font-weight: 700; }
.identity-confirm { padding: 10px; border: 1px solid #cadfd9; border-radius: 8px; background: #f4faf8; }
.consent-notice { margin-block: 10px; }
.consent-notice p { margin-block-start: 8px; }
.login-roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-block: 17px 18px; }
.login-role { display: grid; gap: 8px; align-content: start; text-align: start; padding: 13px 12px; border: 1px solid #d9e5e8; border-radius: 11px; background: #fff; }
.login-role:hover { border-color: #63a89a; background: #f4faf8; }
.login-role strong { font-size: 16px; }
.login-role small { color: var(--muted); font-size: 13px; }

@media (max-width: 1120px) {
  .shell { grid-template-columns: 200px minmax(0, 1fr); }
  .sidebar-content { padding-inline: 12px; }
  th, td { padding-inline: 10px; }
  .metric { padding-inline: 10px; }
}

@media (max-width: 920px) {
  .shell { grid-template-columns: 164px minmax(0, 1fr); }
  .sidebar-content { padding-inline: 8px; }
  .sidebar .brand { padding-inline: 3px; gap: 7px; }
  .sidebar .brand-title { font-size: 17px; }
  .sidebar .brand-mark { width: 33px; height: 33px; }
  .topbar { column-gap: 8px; }
  .topbar .date-group { margin-inline-start: 0; }
  .topbar .patient-search { flex: 1 1 200px; }
  .work-columns { grid-template-columns: 1fr; }
  .metric-grid { gap: 8px; }
  .metric { grid-template-columns: 31px minmax(0, 1fr); gap: 7px; }
  .metric-icon { width: 31px; height: 31px; }
  .metric-icon svg { width: 17px; height: 17px; }
  .agenda .col-service { display: none; }
}

@media (max-width: 720px) {
  .shell { display: block; }
  .sidebar-content { height: auto; min-height: 0; position: static; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 13px 7px; }
  .sidebar .brand-context { display: none; }
  .sidebar .brand-title { font-size: 18px; }
  .sidebar-nav { grid-row: 2; grid-column: 1 / -1; margin: 0; display: flex; gap: 4px; overflow-x: auto; padding: 1px 1px 3px; }
  .nav-title { display: none; }
  .nav-link { white-space: nowrap; padding: 5px 7px; min-height: 36px; font-size: 13px; gap: 5px; }
  .nav-link svg { width: 15px; height: 15px; }
  .nav-count { min-width: 16px; padding-inline: 3px; font-size: 11px; }
  .sidebar-footer { margin: 0; }
  .sidebar-footer .demo-chip, .user-mark { display: none; }
  .user-slot { padding: 0; margin: 0; border: 0; gap: 2px; }
  .user-name { display: none; }
  .user-role { font-size: 13px; }
  .role-switch { min-height: 36px; padding: 5px; }
  .topbar { padding: 9px 13px; gap: 8px; }
  .topbar .date-group { flex: 1 1 auto; }
  .topbar .date-group .btn { min-height: 37px; }
  .topbar .date-group .btn-icon { width: 34px; }
  .topbar .date-group .date-input { min-height: 37px; max-width: 137px; padding: 4px 5px; }
  .topbar .patient-search { width: 100%; flex-basis: 100%; }
  .topbar .btn-primary { padding-inline: 9px; min-height: 37px; }
  .content { padding: 21px 13px 28px; }
  .page-heading { margin-block-end: 15px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-block-end: 14px; }
  .metric { padding: 9px; }
  .metric-number { font-size: 21px; }
  .panel-head { padding: 13px; }
  .table-wrap:not(.agenda-wrap) table { min-width: 560px; }
}

@media (max-width: 420px) {
  .topbar .date-group { gap: 4px; }
  .topbar .date-group .btn-icon { width: 28px; }
  .topbar .date-group .date-input { max-width: 119px; }
  .topbar .date-today { padding-inline: 7px; }
  .login-roles { grid-template-columns: 1fr; }
  .login-role { grid-template-columns: 39px minmax(0, 1fr); gap: 3px 10px; align-items: center; }
  .login-role .metric-icon { grid-row: 1 / 3; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Yonai clinic workspace: local brand assets and role-independent navigation. */
@font-face { font-family: Assistant; src: url('/assistant.ttf') format('truetype'); font-style: normal; font-weight: 200 800; font-display: swap; }
:root {
  font-family: Assistant, Arial, sans-serif; color: #211d22; background: #f5f4f5;
  --ink:#211d22; --muted:#625a60; --line:#e5dfe1; --teal:#a42641; --teal-dark:#76192e;
  --shadow:0 3px 12px #3e172205; --radius:15px;
}
:focus-visible { outline-color:#a42641; }
.brand, .sidebar .brand { padding-inline:0; }
.clinic-mark { object-fit:contain; flex:none; }
.brand-title { font-size:23px; font-weight:800; color:var(--navy); line-height:1.1; }
.brand-context, .sidebar .brand-context { color:#72656a; margin-top:4px; font-weight:600; }
.shell { background:var(--workspace-canvas); }
.workspace-menu-toggle { display:none; }
.sidebar-navigation { display:flex; flex:1; flex-direction:column; min-height:0; }
.sidebar-nav { min-height:0; overflow:auto; }
.sidebar { color:var(--ink); background:#fbf9fa; border-inline-end:1px solid var(--workspace-divider); }
.sidebar-content { padding-inline:15px; }
.sidebar-nav { margin-block-start:34px; gap:4px; }
.nav-title,.user-role { color:#74656b; }
.nav-link { color:#51454b; text-decoration:none; border-radius:10px; min-height:42px; }
.nav-link svg { width:18px; height:18px; opacity:.85; }
.nav-link:hover, .role-switch:hover { background:#f8f1f3; color:#811c34; }
.nav-link[aria-current] { color:var(--workspace-accent); background:var(--workspace-selection); border-color:#ecd6df; }
.nav-count,.user-mark { color:#841c34; background:#f6e6eb; }
.user-name { color:var(--ink); }
.user-slot { border-color:var(--line); }
.role-switch { color:#76646b; }
.role-switch > span { display:none; }
.demo-chip { border-color:var(--line); color:#6e565e; }
.demo-chip::before { background:#a42641; }
.btn-primary { border-radius:24px; padding-inline:18px; }
.btn-soft, .btn-soft:hover:not(:disabled) { background:#fbecf0; color:#821c34; border-color:#efd3dc; }
.topbar { background:#fffdfeef; border-color:var(--workspace-divider); box-shadow:0 2px 9px #33121c07; backdrop-filter:blur(16px); }
.topbar:empty { display:none; }
.topbar .patient-search-field { border-color:var(--workspace-divider); background:#f7f3f5; border-radius:11px; }
.topbar .date-group { padding:3px; border:1px solid var(--workspace-divider); background:#f7f3f5; border-radius:11px; }
.topbar .date-group .btn, .topbar .date-input { min-height:35px; border-color:transparent; background:transparent; }
.topbar .date-group .btn:hover, .topbar .date-input:hover { background:var(--workspace-selection); }
.topbar .date-group .date-today { color:var(--workspace-accent); }
:is(.day-cover, .page-heading, .entry-banner) {
  position:relative; isolation:isolate; color:#fff9fb; background:var(--workspace-hero); border:1px solid #5a2639;
  box-shadow:var(--workspace-hero-shadow);
}
:is(.day-cover, .page-heading, .entry-banner)::before {
  content:''; position:absolute; z-index:-1; inset:0; border-radius:inherit; pointer-events:none;
  background:var(--workspace-hero-lines);
}
.page-heading { align-items:center; padding:clamp(19px,3vw,34px); border-radius:20px; }
.page-heading h1 { line-height:1.1; font-size:clamp(31px,3.8vw,49px); }
.page-heading p { color:#f8dce4; }
.page-heading .btn, .page-heading .crm-badge { border-color:#ffffff4f; background:#ffffff16; color:white; }
.page-heading .btn:hover:not(:disabled) { border-color:#ffffff95; background:#ffffff30; }
.page-heading .btn-primary, .page-heading .btn-primary:hover:not(:disabled) { border-color:#fff; background:#fff5f7; color:#64253c; }
.page-heading .btn:focus-visible { outline-color:white; }
.page-heading .visit-meta > span + span { border-inline-start-color:#f4cad570; }
.shell .panel { border-color:var(--workspace-divider); border-radius:16px; box-shadow:var(--workspace-shadow); }
.shell .panel th { background:#f9f6f7; color:#5a5054; }
.shell .crm-metrics strong { color:#77283f; font-variant-numeric:tabular-nums; }
.shell .crm-page > section.panel:not(.crm-period, .crm-leads, :has(.crm-table)) { padding:18px; }
.dialog-header { background:#fbf7f9; border-block-end-color:var(--workspace-divider); }
dialog { border-color:var(--workspace-divider); }
dialog::backdrop { background:#24142086; }
.day-cover {
  position:relative; isolation:isolate; display:grid; grid-template-columns:minmax(0,1fr) minmax(260px, .92fr);
  align-items:center; gap:20px clamp(22px, 4vw, 68px); min-height:186px; padding:24px clamp(22px, 3.6vw, 50px);
  margin-block-end:21px; border:1px solid #5a2639; border-radius:23px; color:#fff9fb;
}
.cover-title { min-width:0; }
.day-cover h1 { font-size:clamp(36px,4.15vw,60px); font-weight:800; line-height:1.06; letter-spacing:-.045em; }
.day-cover .calendar-caption { margin-block-start:12px; color:#f8dce4; font-size:clamp(14px,1.5vw,17px); font-weight:650; }
.day-cover .calendar-caption svg { flex:none; opacity:.82; }
.week-nav {
  display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; width:100%; max-width:440px;
  justify-self:end; padding:6px; border:1px solid #ffffff40; border-radius:18px; background:#32121f44;
  box-shadow:inset 0 1px #ffffff29, 0 9px 22px #32121f39; backdrop-filter:blur(18px);
}
.week-nav button {
  min-width:0; min-height:56px; border:1px solid transparent; padding:4px 0; border-radius:12px;
  background:none; color:#fff0f4; display:grid; grid-auto-rows:min-content; align-content:center; justify-items:center; line-height:1.12;
}
.week-nav button:hover { background:#ffffff1c; }
.week-nav button:focus-visible { outline:2px solid #fff; outline-offset:2px; }
.week-nav button[aria-current=date], .week-nav button[aria-current=date]:hover {
  color:#64253c; background:#fff5f7; border-color:#fff; box-shadow:0 3px 10px #30122042;
}
.week-nav small { font-size:13px; }
.week-nav b { font-size:23px; font-variant-numeric:tabular-nums; }
.week-marker { width:5px; height:5px; border-radius:50%; margin-top:3px; }
.week-marker.has-appointments { background:currentColor; }
.agenda-branch { display:flex; align-items:center; gap:.5rem; font-size:.9rem; white-space:nowrap; }
.agenda-branch .control { min-height:34px; padding-block:3px; }
.metric-grid { gap:10px; margin-bottom:18px; }
.metric { border-radius:13px; }
.metric-label { font-size:14px; }
.metric-number { font-size:26px; }
.panel-head h2 { font-size:23px; }
.agenda-panel { border-color:var(--workspace-divider); border-radius:17px; box-shadow:var(--workspace-shadow); }
.agenda-filters { display:flex; gap:3px; flex-wrap:wrap; margin:0 18px 14px; padding:4px; width:fit-content; max-width:calc(100% - 36px); border:1px solid var(--workspace-divider); border-radius:11px; background:#f7f3f5; }
.agenda-filters button { display:inline-flex; gap:5px; align-items:center; padding:5px 10px; min-height:34px; font-size:14px; font-weight:650; background:transparent; border:1px solid transparent; border-radius:7px; color:#51454b; }
.agenda-filters button:hover { border-color:#c99ca8; }
.agenda-filters button[aria-pressed=true] { color:var(--workspace-accent); background:white; border-color:#ead5dd; box-shadow:0 1px 2px #54212c12; }
.agenda-filters b { font-size:12px; opacity:.86; }
.agenda-mobile-filter, .agenda-mobile-list { display:none; }
.empty-action { text-align:center; padding-bottom:22px; }
.agenda {
  --agenda-rule:#ece7e9;
  --agenda-gutter:18px;
  --agenda-action-width:7.25rem;
  --agenda-more-size:40px;
}
.agenda :is(th, td) { padding-inline:var(--agenda-gutter); text-align:start; border-block-start-color:var(--agenda-rule); }
.agenda th { background:#faf8f9; color:#60565a; }
.agenda tbody tr:hover td { background:#fcfafb; }
.agenda-status-label { display:inline-flex; align-items:center; gap:4px; }
.agenda-status-caption { display:none; }
.agenda-status-caption.is-standalone { display:flex; width:fit-content; font-size:13px; color:#60565a; }
.agenda-status-button {
  display:inline-grid; place-items:center; width:24px; height:24px; margin-block:-4px;
  padding:0; border:0; border-radius:50%; color:#6d6065; background:transparent;
  anchor-name:--agenda-status-button;
}
.agenda-status-button:hover { color:var(--workspace-accent); background:#f1e8eb; }
.agenda-status-button svg { width:16px; height:16px; }
.agenda-status-help {
  position:fixed; box-sizing:border-box; width:min(340px, calc(100vw - 24px)); max-height:calc(100dvh - 24px);
  padding:15px; overflow:auto; color:var(--ink); background:var(--surface); border:1px solid var(--workspace-divider);
  border-radius:12px; box-shadow:0 12px 32px #41212d22;
}
.agenda-status-help h3 { margin:0 0 10px; font-size:16px; }
.agenda-status-help .data-list { gap:8px 12px; grid-template-columns:max-content minmax(0, 1fr); }
.agenda-status-help dt { color:#554c50; font-weight:700; }
@supports (position-area: block-end) {
  .agenda-status-help {
    position-anchor:--agenda-status-button; position-area:block-end span-inline-end;
    inset:auto; margin:0; position-try-fallbacks:flip-block, flip-inline, flip-block flip-inline;
  }
}
@media (max-width:720px) {
  .agenda-status-caption, .agenda-status-caption.is-standalone {
    display:flex; width:fit-content; font-size:13px; color:#60565a;
  }
  .agenda-status-caption .agenda-status-button { width:44px; height:44px; margin-block:0; }
  .agenda thead .agenda-status-button { display:none; }
  @supports (position-area: block-end) {
    .agenda-status-help { position-area:none; inset-inline:0; inset-block-start:anchor(bottom); margin-inline:auto; position-try-fallbacks:flip-block; }
  }
}
.agenda .cell-time { font-size:18px; }
.agenda .patient-name { font-size:16px; }
.agenda .cell-time > bdi { font-variant-numeric:tabular-nums; white-space:nowrap; }
.agenda .pill { padding:0; border-radius:0; background:none; color:#554c50; font-weight:650; white-space:normal; line-height:1.45; }
.agenda .pill::before { display:none; }
.agenda tr:is([data-status="arrived"], [data-status="in-progress"]) .cell-status .pill { color:var(--workspace-accent); font-weight:750; }
.agenda .row-actions { display:grid; grid-template-columns:var(--agenda-action-width) var(--agenda-more-size); gap:6px; }
.agenda .row-actions .btn {
  inline-size:100%; min-height:var(--agenda-more-size); padding:4px 8px; border-radius:8px;
  background:white; border-color:#e1dadd; color:var(--ink); white-space:normal; line-height:1.25;
}
.agenda .row-actions .btn:hover:not(:disabled) { background:#f7f2f4; border-color:#cdb5bd; color:var(--workspace-accent); }
.agenda .row-actions .btn-icon { padding:0; }
.agenda th:last-child .subtext { color:inherit; font-size:inherit; }
.compact-service { display:none; }
.patient-link { color:var(--ink); }
.login-layout { background:radial-gradient(ellipse at 88% 5%, #ead5de, transparent 53%), var(--workspace-canvas); }
.login-card { border-color:var(--workspace-divider); box-shadow:0 14px 48px #44263816; }
.demo-entry .login-card, .pilot-login { overflow:hidden; padding:0; border-radius:23px; }
.demo-entry .login-card { max-width:760px; width:100%; }
.pilot-login { width:min(100%, 520px); }
.entry-banner {
  display:grid; grid-template-columns:minmax(0,1fr) auto; align-content:center; align-items:center; gap:5px 18px;
  padding:25px clamp(18px, 4vw, 38px); border:0; box-shadow:none;
}
.entry-banner .entry-brand { grid-column:2; grid-row:1 / 3; justify-items:center; margin:0; gap:7px; }
.entry-banner .product-logo {
  width:clamp(66px,12vw,94px); padding:7px; border:1px solid white; border-radius:16px; background:#fff9fb;
  box-shadow:0 4px 16px #35172336;
}
.entry-banner .entry-clinic { color:#fff0f4; font-size:12px; gap:4px; }
.entry-banner .clinic-mark { width:19px; height:19px; }
.entry-banner h1 { font-size:clamp(28px,4.6vw,46px); line-height:1.1; align-self:end; }
.entry-banner p { color:#f8dce4; font-size:16px; align-self:start; }
.entry-body { padding:clamp(19px,4vw,29px); }
.entry-body .pilot-label { margin-block-end:0; }
.entry-body .help-link + .help-link { margin-inline-start:14px; }
.demo-entry .login-roles { margin:24px; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); }
.demo-entry .info-box { margin:0 24px 24px; }
.demo-entry .login-card > .info-box { background:#faf7f8; border-color:#eae0e5; color:#56454f; }
.login-role { border-radius:14px; border-color:var(--workspace-divider); }
.login-role:hover { background:#fff8fa; border-color:#ba8794; }
.login-role strong { font-size:19px; }
.login-role small { font-size:15px; }
.login-role .metric-icon { background:#f9ecf0; color:#91223b; }
@media(max-width:920px) {
  .compact-service { display:block; color:var(--muted); font-size:12px; }
  .agenda .cell-patient .cell-meta { display:none; }
}
@media(max-width:720px) {
  .sidebar { position:relative; z-index:4; border-inline-end:0; border-block-end:1px solid var(--workspace-divider); }
  .sidebar-content { border-block-start:3px solid var(--workspace-accent); padding:5px 13px; }
  .sidebar .brand-context { display:block; font-size:11px; }
  .workspace-menu-toggle {
    display:inline-flex; min-height:44px; color:var(--workspace-accent); border-color:#e7d6dd; background:#fff;
  }
  .workspace-menu-toggle[aria-expanded=true] { background:var(--workspace-selection); }
  .sidebar-navigation { position:absolute; inset-block-start:100%; inset-inline:12px; display:none; padding:7px 10px; }
  .workspace-menu-toggle[aria-expanded=true] + .sidebar-navigation {
    display:flex; gap:6px; max-height:calc(100dvh - 66px); overflow:auto; overscroll-behavior:contain;
    background:#fffafc; border:1px solid var(--workspace-divider); border-radius:14px; box-shadow:var(--workspace-hero-shadow);
  }
  .sidebar-navigation .sidebar-nav { display:grid; flex:none; margin:0; gap:3px; overflow:visible; }
  .sidebar-navigation .nav-link { min-height:44px; gap:9px; padding-inline:10px; font-size:15px; }
  .sidebar-navigation .nav-link svg { width:18px; height:18px; }
  .sidebar-navigation .sidebar-footer { max-width:none; padding:4px 10px; display:grid; gap:2px; border-block-start:1px solid var(--workspace-divider); }
  .sidebar-navigation .user-slot { display:flex; gap:8px; justify-content:space-between; width:100%; }
  .sidebar-navigation .user-name { display:block; }
  .sidebar-navigation .role-switch { display:inline-flex; align-items:center; gap:5px; min-height:44px; flex:none; white-space:nowrap; }
  .sidebar-navigation .role-switch > span { display:inline; font-size:12px; }
  .page-heading { align-items:flex-start; gap:12px; padding:18px; border-radius:16px; }
  .page-heading .btn { min-height:44px; }
  .topbar { padding:6px 12px; gap:6px; }
  .topbar .date-group { flex:0 1 auto; margin-inline-end:auto; padding-block:0; }
  .topbar .date-group .btn, .topbar .date-input { min-height:44px; }
  .topbar .patient-search { flex:1 0 100%; }
  .topbar .patient-search-submit { min-height:44px; }
  .topbar .btn-quick { min-block-size:44px; }
  .day-cover { grid-template-columns:minmax(0,1fr); gap:10px; min-height:0; padding:14px 14px 11px; margin-block-end:12px; border-radius:17px; }
  .day-cover h1 { font-size:clamp(31px, 8.6vw, 42px); }
  .day-cover .calendar-caption { margin-block-start:5px; }
  .week-nav { justify-self:start; gap:3px; max-width:none; padding:3px; border-radius:12px; }
  .week-nav button { min-height:44px; border-radius:8px; }
  .week-nav b { font-size:18px; }
  .agenda-head { flex-wrap:wrap; gap:3px 8px; padding:5px 12px; }
  .agenda-head h2 { font-size:21px; }
  .agenda-meta { gap:4px; flex:1; justify-content:flex-end; }
  .agenda-meta .panel-count {
    position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap;
  }
  .agenda-meta .agenda-branch { flex-wrap:wrap; max-width:100%; }
  .agenda-meta .agenda-branch .control { min-height:44px; max-width:100%; }
  .agenda-filters, .agenda-wrap, .agenda-status-text { display:none; }
  .agenda-mobile-filter.control {
    display:block; inline-size:auto; max-inline-size:min(46vw, 184px); min-height:44px;
    padding-block:4px; padding-inline:7px; background:#f7f3f5; border-color:var(--workspace-divider); font-size:14px;
  }
  .agenda-mobile-list { display:block; padding:0; margin:0; list-style:none; }
  .agenda-mobile-row {
    display:flex; gap:8px; align-items:center; padding-inline-end:10px;
    border-block-start:1px solid #ece7e9;
  }
  .agenda-mobile-details {
    display:grid; flex:1; grid-template-columns:43px minmax(0,1fr) 13px; align-items:center; gap:5px 7px;
    min-width:0; min-height:70px; padding:8px 10px 8px 0; border:0; border-radius:0; background:transparent;
    color:var(--ink); text-align:start;
  }
  .agenda-mobile-details:hover { background:#fbf6f8; }
  .agenda-mobile-details:focus-visible { outline-offset:-2px; }
  .agenda-mobile-time, .agenda-mobile-copy { display:grid; min-width:0; align-content:start; gap:2px; }
  .agenda-mobile-time { align-self:start; gap:1px; font-variant-numeric:tabular-nums; }
  .agenda-mobile-time strong { font-size:17px; line-height:1.16; }
  .agenda-mobile-name { font-size:16px; line-height:1.22; overflow-wrap:anywhere; }
  .agenda-mobile-details small { color:#62565b; font-size:13px; line-height:1.22; }
  .agenda-mobile-service { overflow-wrap:anywhere; }
  .agenda-mobile-state { display:flex; flex-wrap:wrap; gap:1px 6px; color:#62565b; font-size:12px; line-height:1.3; }
  .agenda-mobile-state span + span { border-inline-start:1px solid #ded6da; padding-inline-start:6px; }
  .agenda-mobile-row:is([data-status="arrived"], [data-status="in-progress"]) .agenda-mobile-state span:first-child {
    color:var(--workspace-accent); font-weight:750;
  }
  .agenda-mobile-details svg { width:13px; height:13px; color:#77636c; }
  .agenda-mobile-row .agenda-mobile-primary {
    flex:none; width:92px; min-height:44px; padding:4px 6px; color:#6c263d; background:#f9f0f3;
    border:1px solid #e8d5dc; border-radius:9px; text-align:center; white-space:normal; line-height:1.2;
  }
  .agenda-mobile-row .agenda-mobile-primary:hover:not(:disabled) { background:#f4e5eb; border-color:#ceacba; }
  .content { padding-top:10px; }
  #dialog { width:calc(100% - 20px); max-height:calc(100dvh - 20px); scroll-padding-block-start:58px; overscroll-behavior:contain; }
  #dialog .dialog-header {
    position:sticky; z-index:1; inset-block-start:0; align-items:center; padding:4px 12px;
  }
  #dialog .dialog-header h2 { padding:0; font-size:21px; }
  #dialog .dialog-header .btn { min-inline-size:44px; min-height:44px; }
  #dialog .dialog-body:has(.appointment-details) { padding:10px 12px 12px; }
  .appointment-details { gap:9px; }
  .appointment-facts { padding:9px 11px; gap:4px 10px; }
  .appointment-main-actions { gap:7px; }
  .appointment-main-actions .btn { max-inline-size:100%; }
  .appointment-action-group > summary { padding-block:9px; }
  .metric-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
  .metric { display:block; position:relative; padding:9px; }
  .metric .metric-icon { position:absolute; inset-inline-end:7px; top:8px; width:25px; height:25px; }
  .metric-label { font-size:13px; line-height:1.2; }
  .metric-number { font-size:23px; }
}
@media(max-width:520px) {
  .metric .metric-icon { display:none; }
  .demo-entry { align-items:start; padding:clamp(13px, 4vh, 27px) 12px; }
  .entry-banner { padding:15px 15px 17px; gap:4px 10px; }
  .entry-banner h1 { font-size:clamp(25px, 7.2vw, 32px); }
  .entry-banner p { font-size:14px; }
  .demo-entry .login-roles { margin:12px; grid-template-columns:1fr; gap:7px; }
  .demo-entry .info-box { margin:0 12px 10px; }
  .demo-entry .login-role { grid-template-columns:36px minmax(0,1fr); gap:1px 8px; min-height:62px; padding:7px 10px; align-items:center; }
  .demo-entry .login-role .metric-icon { grid-row:1 / 3; width:36px; height:36px; }
  .demo-entry .login-role strong { font-size:18px; line-height:1.22; }
  .demo-entry .login-role small { font-size:14px; line-height:1.3; }
  .demo-entry .login-card .help-link { min-height:44px; margin:0 13px 3px; }
}
@media(max-width:420px) {
  .topbar .date-group [data-action="previous-date"], .topbar .date-group [data-action="next-date"] { display:none; }
  .topbar .date-group .date-input { max-width:128px; }
}
@media(max-width:360px) {
  .agenda-head { padding-inline:8px; }
  .agenda-mobile-filter.control { max-inline-size:119px; }
}
.help-link { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; color: #81213b; font-weight: 650; text-decoration: none; }
.help-link:hover, .help-link:focus-visible { text-decoration: underline; }
.help-link svg { width: 18px; height: 18px; }
.sidebar-footer > .help-link { display: flex; width: fit-content; }
.demo-entry .help-link { margin: -8px 24px 16px; }
.daily-stats { color: var(--muted); margin-block: 14px; }
.daily-stats summary, .visit-context > summary { cursor: pointer; font-weight: 650; padding-block: 6px; }
.daily-stats[open] summary, .visit-context[open] > summary { margin-block-end: 10px; }
.visit-work { display: grid; gap: 12px; max-width: 1060px; }
.visit-identity { max-width:1060px; margin-block-end:12px; }
.visit-identity .page-heading { margin:0; padding:17px 18px; border-radius:16px; }
.visit-identity .page-heading h1 { padding:0; border:0; font-size:clamp(27px,2.5vw,35px); }
.visit-identity .page-heading p { margin-block-start:8px; }
.visit-meta { display:flex; flex-wrap:wrap; gap:4px 10px; align-items:center; font-size:14px; }
.visit-meta > span + span { border-inline-start:1px solid #e4cfd6; padding-inline-start:10px; }
.visit-context { padding:6px 15px; }
.visit-context > summary { display:flex; gap:8px; align-items:center; list-style:none; min-height:39px; }
.visit-context > summary::-webkit-details-marker { display:none; }
.visit-context > summary svg { width:18px; height:18px; flex:none; color:#872741; }
.visit-context > summary svg:last-child { margin-inline-start:auto; }
.visit-context[open] > summary svg:last-child { transform:rotate(-90deg); }
.visit-sheet { min-width:0; }
.visit-sheet h2 { display:flex; align-items:center; gap:9px; }
.visit-section-icon { display:grid; place-items:center; width:32px; height:32px; flex:none; border-radius:9px; background:#f8edf1; color:#8b2941; }
.visit-section-icon svg { width:18px; height:18px; }
.visit-sheet-draft { border-color:#e7ccd5; }
.visit-sheet-signed .visit-section-icon { background:#e6f2eb; color:#24614c; }
.visit-sheet-signed .clinical-text { padding:13px 15px; border-radius:9px; background:#f9f8f9; }
.visit-editor, .visit-context { min-width: 0; }
.visit-work { grid-template-columns: minmax(0, 1fr); }
.page-heading > div { min-inline-size: 0; max-inline-size: 100%; }
.page-heading h1, .page-heading p { overflow-wrap: anywhere; }
.draft-toolbar { position: sticky; inset-block-start: 8px; z-index: 2; padding: 8px 12px; }
.draft-save-status { color: var(--muted); font-size: 14px; }
.draft-save-status[data-state="dirty"] { color: #805018; }
.draft-save-status[data-state="saved"] { color: #22634d; }
.booking-time-feedback { color: #8d3036; font-size: 14px; overflow-wrap: anywhere; }
#time[aria-invalid="true"] { border-color: #ad4951; }
.allergy-note { margin: 0; padding: 8px 12px; border-inline-start: 3px solid #ae7234; background: #fff7eb; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: dialog-enter 150ms ease-out; }
  .draft-save-status[data-state="saved"] { animation: draft-saved 240ms ease-out; }
  .btn { transition: background-color 120ms ease-out, border-color 120ms ease-out; }
  .visit-context > summary svg:last-child { transition:transform 140ms ease-out; }
}
@media (min-width:1100px) {
  .visit-form { grid-template-columns:minmax(0,1fr) minmax(0,1.05fr); align-items:start; }
  .visit-form .draft-toolbar { grid-column:1 / -1; }
}
@keyframes dialog-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes draft-saved {
  from { background-color: #dcefe6; }
  to { background-color: transparent; }
}
@media(max-width:720px) {
  .sidebar-footer { display: flex; align-items: center; gap: 6px; }
  .sidebar-footer > .help-link { font-size: 14px; }
}
@media(max-width:460px) {
  .sidebar-footer { gap: 2px; flex-wrap: wrap; justify-content: flex-end; max-width: 132px; }
  .sidebar-footer .user-role { font-size: 12px; }
}

.whatsapp-history {
  display: grid;
  gap: .5rem;
  max-height: min(45vh, 24rem);
  overflow: auto;
  margin-block: .75rem;
  padding: .25rem;
}
.whatsapp-message { width: fit-content; max-width: min(90%, 32rem); }
.whatsapp-message[data-direction="out"] { margin-inline-start: auto; background: var(--surface-soft, #eef7f3); }
.whatsapp-message p { white-space: pre-wrap; overflow-wrap: anywhere; margin-block: .25rem 0; }
.crm-chat { margin-top: 16px; padding: 16px; border: 1px solid #bacfc6; border-radius: 14px; background: #f7fbf9; }
.crm-chat h4 { margin: 0; }
.crm-chat .btn-row { flex-wrap: wrap; gap: 8px; }
.crm-chat-messages { list-style: none; padding: 0; display: grid; gap: 10px; max-height: 460px; overflow-y: auto; }
.crm-chat-messages li { padding: 12px; border-radius: 12px; background: #fff; overflow-wrap: anywhere; }
.crm-chat-messages .crm-chat-out { background: #e6f3ed; margin-inline-start: 20px; }
.crm-chat-messages .crm-chat-in { margin-inline-end: 20px; }
.crm-chat-messages p { white-space: pre-wrap; margin: 6px 0; }
.crm-chat-messages small { color: #52685e; }
.crm-chat textarea { width: 100%; min-height: 90px; resize: vertical; font: inherit; box-sizing: border-box; }

#summary-page{max-width:850px;margin:32px auto;padding:24px;text-align:right} .summary-patient-content{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.8} #summary-page input{max-width:100%} @media print{#summary-page button,#summary-page form,#notice{display:none!important}}
