/* Voice Desk — minimal Swiss style, RTL, light + dark */
:root {
  --bg: #f8fafc; --surface: #ffffff; --surface-2: #f1f5f9; --text: #0f172a; --muted: #475569;
  --border: #e2e8f0; --primary: #2563eb; --primary-hover: #1d4ed8; --on-primary: #ffffff;
  --primary-soft: #eff6ff; --success: #047857; --success-soft: #ecfdf5; --danger: #dc2626;
  --danger-soft: #fef2f2; --warning: #b45309; --warning-soft: #fffbeb; --flash: #fef3c7;
  --ring: rgba(37, 99, 235, .35); --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --radius: 10px; --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120; --surface: #111827; --surface-2: #1e293b; --text: #e2e8f0; --muted: #94a3b8;
    --border: #243045; --primary: #3b82f6; --primary-hover: #60a5fa; --primary-soft: rgba(59, 130, 246, .14);
    --success: #34d399; --success-soft: rgba(16, 185, 129, .14); --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, .14); --warning: #fbbf24; --warning-soft: rgba(251, 191, 36, .14);
    --flash: rgba(251, 191, 36, .22); --ring: rgba(96, 165, 250, .45); --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); line-height: 1.6;
  font-family: Vazirmatn, Tahoma, sans-serif; font-size: 15px; font-feature-settings: "ss01";
}
h1 { font-size: 1.25rem; margin: 0; font-weight: 700; }
h2 { font-size: .95rem; margin: 0 0 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
a { color: var(--primary); }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-lg { width: 40px; height: 40px; stroke-width: 1.5; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 8px; top: -40px; background: var(--primary); color: var(--on-primary); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { top: 8px; }
kbd { font-family: inherit; font-size: .75rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface-2); color: var(--muted); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100dvh; }
.sidebar { background: var(--surface); border-inline-end: 1px solid var(--border); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 4px 12px 16px; color: var(--primary); }
.sidebar a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--muted); text-decoration: none; transition: background .2s var(--ease), color .2s var(--ease); }
.sidebar a:hover { background: var(--surface-2); color: var(--text); }
.sidebar a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
main { padding: 20px 24px 32px; min-width: 0; outline: none; max-width: 1400px; width: 100%; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; height: auto; padding: 8px 12px; overflow-x: auto; border-inline-end: 0; border-bottom: 1px solid var(--border); z-index: 10; }
  .brand { display: none; }
  .sidebar a { white-space: nowrap; }
  main { padding: 16px; }
}

/* ---------- cards / buttons / fields ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 8px; font: inherit; font-weight: 500; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; transition: background .2s var(--ease), border-color .2s var(--ease), transform .1s; touch-action: manipulation; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary kbd { background: transparent; color: inherit; border-color: rgba(255, 255, 255, .4); }
.btn[disabled] { opacity: .5; cursor: progress; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: .8rem; }

fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { font-weight: 600; font-size: .85rem; color: var(--muted); margin-bottom: 12px; padding: 0; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: .85rem; font-weight: 500; }
.req { color: var(--danger); }
input, textarea, select {
  font: inherit; font-size: 1rem; color: var(--text); background: var(--surface); width: 100%;
  border: 1px solid var(--border); border-radius: 8px; min-height: 44px; padding: 8px 12px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .8s var(--ease);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
input[aria-invalid="true"] { border-color: var(--danger); }
input.flash, textarea.flash { background-color: var(--flash); transition: none; }
.field-error { color: var(--danger); font-size: .8rem; min-height: 0; }
.field-error:empty { display: none; }
.hint { color: var(--muted); font-size: .8rem; margin: 0; }
.form-error { display: flex; gap: 8px; align-items: center; background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: 8px; margin: 0 0 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--border); }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr; } .actions .btn { flex: 1; } }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .85rem; font-weight: 500; }
.chip .icon { width: 14px; height: 14px; }
.chip-ok { background: var(--success-soft); color: var(--success); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge-open { background: var(--warning-soft); color: var(--warning); }
.badge-closed { background: var(--success-soft); color: var(--success); }

/* ---------- voice bar ---------- */
.voicebar { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; box-shadow: var(--shadow); position: sticky; top: 12px; z-index: 20; flex-wrap: wrap; }
.mic-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; position: relative; transition: background .2s var(--ease), color .2s var(--ease), transform .15s var(--ease); touch-action: none; }
.mic-btn .icon { width: 24px; height: 24px; }
.mic-btn:hover { background: var(--primary); color: var(--on-primary); }
.voicebar[data-state="rec"] .mic-btn { background: var(--danger); color: #fff; transform: scale(1.06); }
.voicebar[data-state="rec"] .mic-btn::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--danger); animation: ring 1.2s var(--ease) infinite; }
.voicebar[data-state="busy"] .mic-btn { background: var(--warning-soft); color: var(--warning); }
@keyframes ring { from { opacity: .8; transform: scale(.9); } to { opacity: 0; transform: scale(1.25); } }
.voice-text { flex: 1; min-width: 200px; }
.voice-state { font-weight: 600; }
.voicebar[data-state="rec"] .voice-state { color: var(--danger); }
.voicebar[data-state="busy"] .voice-state { color: var(--warning); }
.voice-heard { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-type { flex: 0 1 340px; min-width: 220px; }
@media (max-width: 700px) { .voice-type { flex-basis: 100%; } .voicebar { position: static; } }

/* ---------- desk ---------- */
.desk-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .desk-grid { grid-template-columns: 1fr; } }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.title-row { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; }
.avatar.known { background: var(--primary-soft); color: var(--primary); }
.side { display: flex; flex-direction: column; gap: 16px; }
.results { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.results li { counter-increment: r; }
.results button { width: 100%; display: flex; align-items: center; gap: 12px; text-align: start; padding: 10px; min-height: 48px; border: 1px solid transparent; border-radius: 8px; background: none; font: inherit; color: var(--text); cursor: pointer; transition: background .15s var(--ease); }
.results button::before { content: counter(r, persian); width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.results button:hover { background: var(--surface-2); }
.results small { display: block; color: var(--muted); }
.timeline, .log { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow: auto; }
.timeline li { padding: 10px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.timeline li:last-child, .log li:last-child { border-bottom: 0; }
.timeline .meta { color: var(--muted); font-size: .8rem; grid-column: 1; }
.timeline .desc { color: var(--muted); font-size: .85rem; grid-column: 1 / -1; }
.timeline .badge { cursor: pointer; border: 0; font-family: inherit; }
.log li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.log li .icon { width: 16px; height: 16px; margin-top: 4px; color: var(--success); }
.log li.bad .icon { color: var(--danger); }
.log li.bad { color: var(--danger); }
.empty { color: var(--muted); font-size: .9rem; padding: 8px 0; display: block !important; border: 0 !important; }
.help { margin-top: 16px; }
.help summary { cursor: pointer; font-weight: 600; min-height: 24px; }
.cmds { margin: 12px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; }
.cmds dt { font-weight: 600; } .cmds dd { margin: 0; color: var(--muted); }
@media (max-width: 700px) { .cmds { grid-template-columns: 1fr; } .cmds dd { margin-bottom: 8px; } }

/* ---------- cases page ---------- */
.page-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 16px; }
.page-head p { margin: 4px 0 0; }
.filters { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; padding: 16px; }
.filters .grow { flex: 1; min-width: 220px; }
.filters select { min-width: 140px; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-inline-start: 38px; }
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th { text-align: start; font-size: .8rem; font-weight: 600; color: var(--muted); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr { transition: background .15s var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.row-link { font-weight: 600; text-decoration: none; }
.row-link:hover { text-decoration: underline; }
.clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; max-width: 360px; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-state p { margin: 0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 16px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); animation: toast-in .25s var(--ease); }
.toast.error .icon { color: #fca5a5; }
.toast.ok .icon { color: #6ee7b7; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

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

/* ---------- auth / operator ---------- */
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--border); }
.me-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.me-name strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me form { margin: 0; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-sm .icon { width: 16px; height: 16px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
.icon-btn:hover { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 900px) { .me { margin: 0 0 0 0; margin-inline-start: auto; border: 0; padding: 0; } .me-name { display: none; } }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-size: .9rem; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); }
body.auth { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 400px; padding: 32px 28px; }
.auth-card h1 { margin-top: 8px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.auth-brand { padding: 0; }
.input-pass { position: relative; }
.input-pass input { padding-inline-end: 72px; }
.pass-toggle { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); min-height: 36px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--primary); font: inherit; font-size: .85rem; cursor: pointer; }
.input-pass input[dir="ltr"] { text-align: left; }
.btn-block { width: 100%; }
.link-state { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); margin-inline-start: auto; }
.link-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.link-state[data-up="true"]::before { background: var(--success); }
.engine { display: flex; gap: 8px; flex-wrap: wrap; }
.engine select { width: auto; min-width: 0; font-size: .85rem; padding-block: 6px; }
@media (max-width: 700px) { .engine { flex-basis: 100%; } .engine select { flex: 1; } }

/* ---------- reports ---------- */
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.segmented a { padding: 0 14px; min-height: 40px; display: grid; place-items: center; color: var(--muted); text-decoration: none; font-size: .9rem; }
.segmented a + a { border-inline-start: 1px solid var(--border); }
.segmented a[aria-current] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; text-decoration: none; color: var(--text); }
.kpi-label { color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: 6px; }
.kpi-label .icon { width: 16px; height: 16px; color: var(--warning); }
.kpi-value { font-size: 2rem; font-weight: 600; line-height: 1.2; }
.kpi-link:hover { border-color: var(--primary); }
.chart-card { margin-bottom: 16px; }
.colchart { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 200px auto; column-gap: 8px; }
.colchart-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: .75rem; color: var(--muted); text-align: end; transform: translateY(-.5em); height: calc(100% + 1em); }
.colchart-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--border); }
.colchart-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.colchart-grid i { border-top: 1px solid var(--border); opacity: .6; }
.colchart-grid i:last-child { border: 0; }
.col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; cursor: default; }
.col-bar { width: min(24px, 70%); min-height: 0; background: var(--primary); border-radius: 4px 4px 0 0; position: relative; transition: opacity .15s var(--ease); }
.col-label { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: .75rem; color: var(--text); padding-bottom: 2px; white-space: nowrap; }
.colchart-plot:hover .col-bar { opacity: .45; }
.colchart-plot .col:hover .col-bar, .col:focus-visible .col-bar { opacity: 1; }
.col:focus-visible { box-shadow: inset 0 0 0 2px var(--ring); border-radius: 4px; }
.col-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 6px 16px rgba(0, 0, 0, .12); border-radius: 8px; padding: 6px 10px; font-size: .8rem; white-space: nowrap; display: none; z-index: 5; flex-direction: column; text-align: center; }
.col-tip strong { font-size: .95rem; }
.col:hover .col-tip, .col:focus-visible .col-tip { display: flex; }
.colchart-x { grid-column: 2; display: flex; gap: 2px; font-size: .72rem; color: var(--muted); padding-top: 6px; }
.colchart-x span { flex: 1; text-align: center; white-space: nowrap; overflow: visible; }
.table-toggle { margin-top: 12px; }
.table-toggle summary { cursor: pointer; color: var(--primary); font-size: .9rem; min-height: 24px; }
.table.compact { min-width: 0; margin-top: 8px; }
.table.compact td, .table.compact th { padding: 6px 12px; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; align-items: center; gap: 10px; border-radius: 6px; outline: none; }
.hbars li:focus-visible { box-shadow: 0 0 0 2px var(--ring); }
.hbar-label { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 16px; display: flex; }
.hbar { height: 100%; min-width: 2px; background: var(--primary); border-radius: 4px 0 0 4px; }
.hbar-value { font-size: .85rem; color: var(--text); min-width: 2ch; text-align: start; }
.hbars li:hover .hbar { opacity: .8; }
.followup-at { display: flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--warning); margin-top: 2px; }
.followup-at .icon { width: 13px; height: 13px; }

/* ---------- guided mode / undo / follow-ups ---------- */
.guided-toggle { font-size: .85rem; }
.guide-hint { font-size: .85rem; font-weight: 600; color: var(--primary); }
.guide-hint:empty { display: none; }
.field.expected input, .field.expected select, .field.expected textarea { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.field.expected label { color: var(--primary); }
.field.expected label::after { content: " ← بگویید"; font-weight: 400; font-size: .75rem; }
.followups { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.followups button { width: 100%; text-align: start; display: grid; gap: 2px; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; background: none; font: inherit; color: var(--text); cursor: pointer; transition: background .15s var(--ease); }
.followups button:hover { background: var(--surface-2); }
.followups span { font-size: .85rem; color: var(--muted); }
.followups small { display: flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); }
.followups small .icon { width: 13px; height: 13px; }
.followups .overdue small { color: var(--warning); }
.timeline .followup-at { grid-column: 1 / -1; }
select { appearance: auto; }

/* ---------- Jalali date picker ---------- */
.jdate { position: relative; display: flex; gap: 6px; }
.jdate-btn { flex: 1; min-height: 44px; text-align: start; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color .2s var(--ease), background-color .8s var(--ease); }
.jdate-btn.empty { color: var(--muted); }
.jdate-btn:hover { border-color: var(--primary); }
.jdate-btn.flash { background-color: var(--flash); transition: none; }
.field.expected .jdate-btn { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.jdate-clear { width: 44px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 1.2rem; cursor: pointer; }
.jdate-clear:hover { color: var(--danger); border-color: var(--danger); }
.jdate-pop { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 30; width: 300px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); padding: 12px; }
.jdate-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.jdate-head button { width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 1.3rem; cursor: pointer; }
.jdate-head button:hover { background: var(--surface-2); }
.jdate-quick { display: flex; gap: 6px; margin-bottom: 8px; }
.jdate-quick button { flex: 1; min-height: 32px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; }
.jdate-quick button:hover { border-color: var(--primary); color: var(--primary); }
.jdate-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.jdate-wd { text-align: center; font-size: .75rem; color: var(--muted); padding: 4px 0; }
.jdate-grid button { aspect-ratio: 1; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; }
.jdate-grid button:hover { background: var(--surface-2); }
.jdate-grid button.past { color: var(--muted); }
.jdate-grid button.today { box-shadow: inset 0 0 0 1px var(--primary); color: var(--primary); font-weight: 600; }
.jdate-grid button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.jdate-time { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .85rem; color: var(--muted); }
.jdate-time input { width: auto; min-height: 36px; }

/* ---------- customer pages ---------- */
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.page-head .title-row h1 { margin: 0; }
.kpi-sm { font-size: 1.15rem; padding-top: 8px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.timeline.full { max-height: none; }
.timeline li form { margin: 0; grid-column: 2; grid-row: 1; }
.filters .jdate { min-width: 170px; }
.filters .jdate-pop { inset-inline-start: auto; inset-inline-end: 0; }
#customer-link { display: inline-block; margin-top: 2px; }
#customer-link[hidden] { display: none; }

.notify-btn[aria-pressed="true"] { color: var(--primary); background: var(--primary-soft); }
.notify-btn[aria-pressed="true"]:hover { color: var(--primary); background: var(--primary-soft); }
#category-hint { color: var(--primary); }
