/* UrSmile Clinic Hub — styles */
:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e6eaf1;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 0; }
code { background: #eef2f7; padding: 1px 6px; border-radius: 6px; font-size: .85em; }

/* ── App shell ── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 244px; flex-shrink: 0; background: #0f172a; color: #cbd5e1;
  display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand-mark { font-size: 1.6rem; }
.brand-mark.big { font-size: 2.6rem; }
.brand-name { font-weight: 700; color: #fff; line-height: 1.1; display: flex; flex-direction: column; }
.brand-name small { font-weight: 500; color: #94a3b8; font-size: .72rem; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { color: #cbd5e1; padding: 9px 12px; border-radius: 9px; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.sidebar nav a:hover { background: #1e293b; text-decoration: none; color: #fff; }
.sidebar nav a.active { background: var(--brand); color: #fff; }
.sidebar nav a span { width: 18px; text-align: center; }
.nav-sep { color: #64748b; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; padding: 16px 12px 6px; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid #1e293b; }
.user { display: flex; align-items: center; gap: 10px; color: #e2e8f0; padding: 6px 8px; border-radius: 9px; }
.user:hover { background: #1e293b; text-decoration: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.user-meta { display: flex; flex-direction: column; line-height: 1.1; }
.user-meta small { color: #94a3b8; font-size: .72rem; text-transform: capitalize; }
.logout { margin-top: 8px; width: 100%; background: transparent; border: 1px solid #334155; color: #cbd5e1; padding: 7px; border-radius: 9px; cursor: pointer; }
.logout:hover { background: #1e293b; }

.content { flex: 1; padding: 28px 34px; max-width: 1200px; margin: 0 auto; width: 100%; }

/* ── Page head ── */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.back { font-size: .85rem; color: var(--muted); display: inline-block; margin-bottom: 6px; }
.head-actions { display: flex; gap: 8px; }

/* ── Cards ── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 20px; }
.card.narrow { max-width: 640px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── Mobile top bar + slide-in nav (hidden on desktop) ── */
.topbar { display: none; }
.nav-toggle-cb { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
  /* top bar */
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 40;
    background: #0f172a; color: #fff; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
  }
  .hamburger { font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 2px 6px; user-select: none; }
  .topbar-brand { font-weight: 700; }
  /* off-canvas sidebar */
  .app { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 250px; z-index: 50;
    transform: translateX(-100%); transition: transform .22s ease; overflow-y: auto;
  }
  .nav-toggle-cb:checked ~ .app .sidebar { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.5); }
  .nav-toggle-cb:checked ~ .app .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 45; background: rgba(15,23,42,.5);
  }
  .content { padding: 18px 15px; max-width: 100%; }
  /* comfortable tap targets + no horizontal overflow */
  .sidebar nav a { padding: 12px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .table { font-size: .9rem; }
  /* let wide tables (matrices, logs) scroll sideways inside their card */
  .card { overflow-x: auto; }
  .kpi-grid { grid-template-columns: 1fr; }
}

/* ── Stats ── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
@media (max-width: 720px){ .stat-grid { grid-template-columns: repeat(2,1fr); } }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat-num { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-label { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.stat-overdue { border-top: 3px solid var(--red); } .stat-overdue .stat-num { color: var(--red); }
.stat-due_soon { border-top: 3px solid var(--amber); } .stat-due_soon .stat-num { color: var(--amber); }
.stat-upcoming { border-top: 3px solid var(--green); } .stat-upcoming .stat-num { color: var(--green); }

/* ── Tables ── */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 12px; border-bottom: 2px solid var(--line); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafbfe; }
.sub { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.capitalize { text-transform: capitalize; }
.link-strong { font-weight: 600; color: var(--ink); }
.link-strong:hover { color: var(--brand); }

/* ── Badges ── */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.badge-overdue { background: #fee2e2; color: #b91c1c; }
.badge-due_soon { background: #fef3c7; color: #b45309; }
.badge-upcoming { background: #dcfce7; color: #15803d; }
.badge-snoozed { background: #e0e7ff; color: #4338ca; }
.badge-unknown { background: #e5e7eb; color: #4b5563; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.dot-overdue { background: var(--red); } .dot-due_soon { background: var(--amber); } .dot-upcoming { background: var(--green); } .dot-snoozed { background: #6366f1; } .dot-unknown { background: #9ca3af; }

/* ── Frequency band nav + snooze ── */
.band-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.band-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 600; color: var(--ink); box-shadow: var(--shadow); }
.band-chip:hover { background: #eef2f7; text-decoration: none; }
.chip-count { background: #eef2f7; color: var(--muted); border-radius: 999px; padding: 0 8px; font-size: .78rem; }
.chip-over { background: #fee2e2; color: #b91c1c; border-radius: 999px; padding: 0 8px; font-size: .78rem; font-weight: 700; }
.actions-cell { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.snooze-menu { position: relative; display: inline-block; }
.snooze-menu > summary { list-style: none; cursor: pointer; }
.snooze-menu > summary::-webkit-details-marker { display: none; }
.snooze-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(15,23,42,.15); padding: 6px; min-width: 130px; display: flex; flex-direction: column; gap: 2px; }
.snooze-pop button { width: 100%; text-align: left; background: transparent; border: none; padding: 8px 12px; border-radius: 7px; cursor: pointer; font: inherit; color: var(--ink); }
.snooze-pop button:hover { background: #eef2f7; }
.snooze-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* ── Buttons ── */
.btn { display: inline-block; background: #eef2f7; color: var(--ink); border: 1px solid transparent; padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: .88rem; cursor: pointer; }
.btn:hover { background: #e2e8f0; text-decoration: none; }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-ghost:hover { background: #f1f5f9; }
.btn-ghost.danger, .danger { color: var(--red); }
.btn-block { width: 100%; }
.inline { display: inline; }
.push-right { margin-left: auto; }

/* ── Forms ── */
.stack { display: flex; flex-direction: column; gap: 14px; }
label { font-size: .82rem; font-weight: 600; color: #334155; display: flex; flex-direction: column; gap: 5px; }
input, select, textarea { font: inherit; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
input:disabled { background: #f1f5f9; color: var(--muted); }
.row { display: flex; gap: 14px; }
.row > label { flex: 1; }
.row .grow { flex: 2; }
label.checkbox { flex-direction: row; align-items: center; gap: 8px; }
label.checkbox input { width: auto; }
label.checkbox.small { font-size: .78rem; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.filters { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
.filters select { width: auto; min-width: 180px; }

/* ── Definition lists ── */
.deflist { display: grid; grid-template-columns: 150px 1fr; gap: 8px 12px; margin: 0; }
.deflist dt { color: var(--muted); font-size: .85rem; }
.deflist dd { margin: 0; }

/* ── Quick links / lists ── */
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ql { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: var(--ink); font-weight: 600; }
.ql:hover { background: #eef2f7; text-decoration: none; }
.ql b { font-size: 1.2rem; display: block; }
.ql-red b { color: var(--red); }
.tick-list { list-style: none; padding: 0; margin: 0; }
.tick-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.tick-list li:last-child { border-bottom: none; }
.info-list { margin: 0; padding-left: 18px; }
.info-list li { margin-bottom: 8px; }

/* ── Empty & flash ── */
.empty { text-align: center; padding: 32px; color: var(--muted); }
.empty.small { padding: 16px; }
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-info { background: #dbeafe; color: #1e40af; }

/* ── Workflow ── */
.workflow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.wf-steps { margin: 8px 0 0; padding-left: 20px; }
.wf-steps li { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.wf-steps li:last-child { border-bottom: none; }
.wf-steps a { font-weight: 600; }
.no-link { color: var(--muted); }
.link-rows { display: flex; flex-direction: column; gap: 8px; }
.link-row { display: flex; gap: 8px; align-items: center; }
.link-edit { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; align-items: center; }
.link-edit input { flex: 1; min-width: 120px; }
.link-edit .w-order { flex: 0 0 64px; min-width: 64px; }
.link-edit.add { background: #f8fafc; padding: 10px; border-radius: 10px; border: 1px dashed var(--line); }
.row-sub { margin: -2px 0 10px 2px; }

/* ── Login ── */
body.plain { background: linear-gradient(135deg, #1e3a8a, #2563eb); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { background: #fff; padding: 32px; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.25); width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.login-brand { text-align: center; margin-bottom: 6px; }
.login-brand h1 { margin: 8px 0 2px; }
.login-brand p { color: var(--muted); margin: 0; font-size: .88rem; }
.login-hint { text-align: center; color: var(--muted); font-size: .8rem; margin: 4px 0 0; }

/* ── Study club / events ── */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 18px; }
.event-card { display: block; color: var(--ink); position: relative; }
.event-card:hover { text-decoration: none; transform: translateY(-1px); transition: transform .1s; }
.event-card h2 { margin: 10px 0 4px; font-size: 1.1rem; }
.event-date-chip { display: inline-flex; flex-direction: column; background: #eef2ff; color: #3730a3; border-radius: 10px; padding: 6px 12px; font-weight: 700; line-height: 1.2; }
.ed-wd { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }
.ed-d { font-size: .95rem; } .ed-t { font-size: .74rem; font-weight: 500; }
.event-prog { height: 7px; background: #eef2f7; border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.event-prog-bar { height: 100%; border-radius: 999px; background: var(--primary); }
.event-prog-bar.pc-green { background: #16a34a; } .event-prog-bar.pc-amber { background: #f59e0b; } .event-prog-bar.pc-red { background: #dc2626; }
.check-btn { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--line); background: #fff; cursor: pointer; color: #fff; font-weight: 800; line-height: 1; }
.check-btn.checked { background: #16a34a; border-color: #16a34a; }
.row-done td { opacity: .55; }
.row-done .check-btn { opacity: 1; }
.cal-event .cal-ev-dot { background: #db2777; } .cal-ev.cal-event { background: #fce7f3; }
.cal-eventtask .cal-ev-dot { background: #c026d3; }
.cal-expiry .cal-ev-dot { background: #ea580c; } .cal-ev.cal-expiry { background: #fff7ed; }

/* ── Patient-privacy guidance note ── */
.pii-note { background: #fefce8; border: 1px solid #fde047; border-radius: 10px; padding: 10px 16px; margin-bottom: 16px; font-size: .9rem; color: #713f12; }

/* ── To-do (Google Tasks) ── */
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo { display: flex; align-items: baseline; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.todo:last-child { border-bottom: none; }
.todo-check { color: var(--muted); font-weight: 700; }
.todo-done .todo-check { color: #16a34a; }
.todo-done .todo-title { text-decoration: line-through; color: var(--muted); }
.todo-body { flex: 1; display: flex; flex-direction: column; }
.todo-title { font-weight: 500; }
.todo-notes { color: var(--muted); font-size: .82rem; white-space: pre-wrap; }
.todo-due { color: var(--amber); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.text-red { color: var(--red); }

/* ── Forms & misc ── */
.form-card { display: block; color: var(--ink); }
.form-card:hover { text-decoration: none; transform: translateY(-1px); transition: transform .1s; }
.form-card h2 { margin: 0 0 6px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: normal; font-size: .86rem; }
.req { color: var(--red); }

/* ── Training matrix ── */
.matrix-wrap { overflow-x: auto; padding: 0; }
.matrix { border-collapse: collapse; width: 100%; font-size: .84rem; }
.matrix th, .matrix td { border: 1px solid var(--line); padding: 8px 10px; text-align: center; white-space: nowrap; }
.matrix thead th { background: #f6f8fc; position: sticky; top: 0; z-index: 2; }
.matrix .mx-staff { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; min-width: 190px; }
.matrix thead .mx-staff { z-index: 3; background: #eef2f7; }
.matrix .mx-topic span { display: block; font-weight: 600; max-width: 120px; white-space: normal; }
.matrix .mx-topic em { color: var(--muted); font-style: normal; font-size: .72rem; }
.mx-cell { font-weight: 600; }
.tc-ok { background: #dcfce7; color: #166534; } .tc-soon { background: #fef3c7; color: #92400e; }
.tc-due { background: #fee2e2; color: #b91c1c; } .tc-na { background: #f1f5f9; color: #94a3b8; }
.pc { display: inline-block; font-weight: 800; padding: 3px 10px; border-radius: 999px; font-size: .8rem; }
.pc-green { background: #dcfce7; color: #166534; } .pc-amber { background: #fef3c7; color: #92400e; } .pc-red { background: #fee2e2; color: #b91c1c; }

/* ── Detail list (equipment etc.) ── */
.detail-list { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 4px 0; }
.detail-list dt { color: var(--muted); font-weight: 600; }
.detail-list dd { margin: 0; }

/* ── Audit forms ── */
.audit-qs { display: flex; flex-direction: column; gap: 14px; }
.audit-q { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.audit-q:last-child { border-bottom: none; }
.audit-q-text { font-weight: 600; margin-bottom: 8px; }
.audit-opts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.audit-opts .opt { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 12px; cursor: pointer; font-size: .86rem; }
.audit-opts .opt:has(input:checked).opt-yes { background: #dcfce7; border-color: #86efac; }
.audit-opts .opt:has(input:checked).opt-partial { background: #fef3c7; border-color: #fcd34d; }
.audit-opts .opt:has(input:checked).opt-no { background: #fee2e2; border-color: #fca5a5; }
.audit-opts .opt:has(input:checked).opt-na { background: #e5e7eb; border-color: #cbd5e1; }
.audit-comment, .audit-action { width: 100%; margin-top: 4px; }
.audit-score { text-align: center; padding: 8px 18px; border-radius: 12px; }
.audit-score span { display: block; font-size: 1.8rem; font-weight: 800; line-height: 1; }
.audit-score small { text-transform: uppercase; font-size: .68rem; letter-spacing: .04em; }
.audit-score.pc-green { background: #dcfce7; color: #166534; } .audit-score.pc-amber { background: #fef3c7; color: #92400e; } .audit-score.pc-red { background: #fee2e2; color: #b91c1c; }

/* ── KPI cards (dashboard) ── */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.kpi { display: flex; align-items: center; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); color: var(--ink); }
.kpi:hover { text-decoration: none; transform: translateY(-1px); transition: transform .1s; }
.kpi-ring { --pct: 0; --c: #2563eb; width: 74px; height: 74px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: radial-gradient(closest-side, #fff 74%, transparent 75% 100%), conic-gradient(var(--c) calc(var(--pct) * 1%), #eef2f7 0); }
.kpi-ring span { font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.kpi-title { font-weight: 700; }
.kpi-sub { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.kpi-green .kpi-ring { --c: #16a34a; } .kpi-amber .kpi-ring { --c: #f59e0b; } .kpi-red .kpi-ring { --c: #dc2626; }
@media (max-width: 720px){ .kpi-grid { grid-template-columns: 1fr; } }

/* ── Calendar ── */
.cal-toolbar { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-nav { display: flex; gap: 6px; }
.cal-month { margin: 0; flex: 1; }
.cal-legend { display: flex; gap: 14px; color: var(--muted); font-size: .82rem; }
.cal-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }
.lg-task { background: #2563eb; } .lg-policy { background: #7c3aed; } .lg-renewal { background: #0891b2; }
.cal-card { padding: 0; overflow: hidden; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-head-row { background: #f6f8fc; border-bottom: 1px solid var(--line); }
.cal-dow { padding: 8px 10px; font-weight: 700; font-size: .78rem; color: var(--muted); text-align: left; }
.cal-cell { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; overflow: hidden; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-out { background: #fafbfc; }
.cal-out .cal-daynum { color: #cbd5e1; }
.cal-today { background: #eff6ff; }
.cal-today .cal-daynum { background: var(--primary); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: inline-grid; place-items: center; }
.cal-daynum { font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.cal-ev { display: flex; align-items: center; gap: 5px; font-size: .74rem; padding: 2px 5px; border-radius: 5px; margin-bottom: 2px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #eff3f9; }
.cal-ev:hover { text-decoration: none; filter: brightness(.96); }
.cal-ev-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: #2563eb; }
.cal-task .cal-ev-dot { background: #2563eb; } .cal-policy .cal-ev-dot { background: #7c3aed; } .cal-renewal .cal-ev-dot { background: #0891b2; }
.cal-ev.ev-overdue { background: #fee2e2; } .cal-ev.ev-overdue .cal-ev-dot { background: #dc2626; }
.cal-ev.ev-due_soon { background: #fef3c7; }
.cal-more { font-size: .72rem; color: var(--muted); padding-left: 5px; }
@media (max-width: 720px){ .cal-ev { font-size: 0; padding: 3px; } .cal-ev-dot { width: 8px; height: 8px; } .cal-cell { min-height: 60px; } }

/* ── Resources hub ── */
.res-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.res-toolbar #resSearch { flex: 1; padding: 11px 14px; font-size: 1rem; }
.res-buttons { display: flex; gap: 8px; }
.resources { padding: 10px 14px; }
.rfolder { border-bottom: 1px solid var(--line); }
.rfolder:last-child { border-bottom: none; }
.rfolder > summary { cursor: pointer; padding: 9px 6px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; list-style: none; border-radius: 8px; }
.rfolder > summary::-webkit-details-marker { display: none; }
.rfolder > summary:hover { background: #f6f8fc; }
.rfolder > summary::before { content: '▸'; color: var(--muted); margin-right: 8px; transition: transform .15s; display: inline-block; }
.rfolder[open] > summary::before { transform: rotate(90deg); }
.rname { flex: 1; }
.rcount { background: #eef2f7; color: var(--muted); font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.rbody { padding: 2px 0 8px 22px; border-left: 2px solid #eef2f7; margin-left: 10px; }
.rlink { display: flex; align-items: baseline; gap: 10px; padding: 6px 8px; border-radius: 7px; color: var(--ink); }
.rlink:hover { background: #f1f5f9; text-decoration: none; }
.rlink-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rlink-host { color: var(--muted); font-size: .74rem; background: #f1f5f9; padding: 1px 7px; border-radius: 6px; flex-shrink: 0; }

/* ── Error ── */
.error-page { text-align: center; padding: 60px 20px; }
.error-mark { font-size: 3rem; }

/* ── Campaigns & promotions ── */
.section-label { font-size: 1rem; margin: 1.4rem 0 .6rem; color: var(--muted); font-weight: 600; }
.cmp-card { display: block; }
.cmp-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.cmp-badge { color: #fff; font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; letter-spacing: .02em; }
.cmp-ai { font-size: .72rem; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .82rem; }
.kv dd { margin: 0; font-size: .9rem; }
.stat-row { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-n { font-size: 1.5rem; font-weight: 700; }
.stat-l { color: var(--muted); font-size: .78rem; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid #f1f5f9; }
.checklist li.done .chk-label { text-decoration: line-through; color: var(--muted); }
.chk-form { margin: 0; }
.chk-box { background: none; border: none; font-size: 1.25rem; cursor: pointer; line-height: 1; padding: 0; color: var(--accent, #2563eb); }
.chk-label { flex: 1; }
.chk-del { margin: 0 0 0 auto; }
.btn-x { background: none; border: none; color: #cbd5e1; cursor: pointer; font-size: .9rem; }
.btn-x:hover { color: #ef4444; }

/* ── Document viewer ── */
.doc-actions { display: flex; gap: .5rem; align-items: center; }
.doc-frame-card { padding: 0; overflow: hidden; }
.doc-frame { width: 100%; height: 78vh; border: 0; display: block; background: #f8fafc; }
@media (max-width: 640px) { .doc-frame { height: 60vh; } }

/* ── Global search ── */
.global-search { display: flex; gap: .5rem; margin: 0 0 1.25rem; }
.global-search input { flex: 1; padding: .6rem .9rem; border: 1px solid #e2e8f0; border-radius: 10px;
  font-size: .92rem; background: #fff; }
.global-search input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.global-search button { border: 1px solid #e2e8f0; background: #fff; border-radius: 10px; padding: 0 .9rem;
  cursor: pointer; font-size: .95rem; }
.global-search button:hover { background: #f8fafc; }
.search-form { display: flex; gap: .5rem; }
.search-form input { flex: 1; padding: .6rem .9rem; border: 1px solid #e2e8f0; border-radius: 10px; font-size: .95rem; }

/* ── Practice logo ── */
.brand-logo { width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
  vertical-align: middle; background: #fff; flex-shrink: 0; }
.brand-logo-lg { width: 38px; height: 38px; }
.brand-mark { display: inline-flex; align-items: center; }

/* ── Rota ── */
.rota-nav { display: flex; gap: .4rem; }
.rota-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .6rem; margin-bottom: 1.25rem; }
.rota-day { padding: .7rem; min-height: 120px; }
.rota-day.is-today { border: 2px solid #2563eb; }
.rota-day-head { display: flex; flex-direction: column; margin-bottom: .5rem; }
.rota-shift { position: relative; background: #f8fafc; border-radius: 8px; padding: .45rem .55rem; margin-bottom: .4rem; }
.rota-who { font-weight: 600; font-size: .85rem; }
.rota-del { position: absolute; top: 2px; right: 4px; margin: 0; }
.rota-empty { text-align: center; padding: .8rem 0; }
@media (max-width: 900px) { .rota-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .rota-grid { grid-template-columns: 1fr; } }

/* ── My day ── */
.myday-shift h2 { margin: 0 0 .3rem; font-size: 1.05rem; }
.myday-times { font-size: 1.3rem; font-weight: 700; margin: .2rem 0; }

/* ── Login logo ── */
.login-logo { width: 100%; max-width: 280px; height: auto; display: block; margin: 0 auto .5rem; }

/* ── SOPs ── */
.sop-steps { margin: 0; padding-left: 1.3rem; }
.sop-steps li { padding: .3rem 0; }
.sop-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }
.sop-video iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 10px; background: #0f172a; }
.sop-video-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .25rem; }
.sop-video-foot form { margin: 0; }
.checkline { display: flex; align-items: center; gap: .5rem; }
.checkline input { width: auto; }

/* ── Deployment check ── */
.diag-alert h2 { margin: 0 0 .4rem; font-size: 1.1rem; }
.diag-alert p { margin: .25rem 0; }
.diag-good { border-left: 4px solid #16a34a; }
.diag-bad { border-left: 4px solid #dc2626; background: #fef2f2; }
.diag-yes { color: #16a34a; font-weight: 600; font-size: .85rem; }
.diag-no { color: #dc2626; font-weight: 700; font-size: .85rem; }
.diag-warn { color: #94a3b8; font-size: .85rem; }

/* ── Time clock ── */
.clock-card { text-align: center; padding: 1.4rem; }
.clock-state { font-size: 1.15rem; margin: 0 0 .8rem; }
.clock-btn { font-size: 1.05rem; padding: .7rem 2.2rem; }
.row-today { background: #eff6ff; }
.ts-shift { color: #94a3b8; }
.timesheet-table th, .timesheet-table td { vertical-align: top; }
.myday-clock { display: flex; align-items: center; gap: .7rem; margin-top: .7rem; }

/* ── To-do board (one column per staff list) ── */
.todo-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .9rem; align-items: start; }
.todo-col { margin: 0; }
.todo-col .todo-list { max-height: 65vh; overflow-y: auto; }
.todo-check { background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0 2px; }
.todo-check:hover { color: #2563eb; }
@media (max-width: 640px) { .todo-board { grid-template-columns: 1fr; } }
