/* ═══════════════════════════════════════════════════════════════════════════
   imedi.health CRM — Base Design System
   Shared across all pages
═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset & Box Model ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design Tokens ────────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --navy:        #0c2340;
  --navy2:       #163352;
  --navy3:       #1e4268;
  --teal:        #0d8a7a;
  --teal2:       #10a897;
  --teal-light:  #e0f5f3;
  --teal-mid:    #b2e8e3;

  /* Status */
  --amber:       #f59e0b;
  --red:         #ef4444;
  --green:       #16a34a;
  --blue:        #2563eb;
  --purple:      #9333ea;

  /* Surfaces */
  --bg:          #f0f4f8;
  --card:        #ffffff;
  --border:      #e2e8f0;
  --border2:     #cbd5e1;

  /* Typography */
  --text:        #0f172a;
  --text2:       #475569;
  --text3:       #94a3b8;

  /* Layout */
  --sidebar:     220px;
  --topbar-h:    54px;

  /* Radius */
  --radius:      10px;
  --radius2:     14px;
}

/* ── Typography ───────────────────────────────────────────────────────────── */
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ── App Layout ───────────────────────────────────────────────────────────── */
.app   { display: flex; min-height: 100vh; }
.main  { margin-left: var(--sidebar); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar  { width: var(--sidebar); background: var(--navy); color: white; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; overflow: hidden; }
.sb-logo  { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sb-logo h1 { font-size: 19px; font-weight: 700; color: var(--teal2); letter-spacing: -0.5px; }
.sb-logo p  { font-size: 10px; color: rgba(255,255,255,0.3); margin-top: 1px; letter-spacing: 0.5px; text-transform: uppercase; }

.role-switch { display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.role-btn    { flex: 1; padding: 6px 4px; border-radius: 6px; border: none; font-size: 11px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.role-btn.on  { background: var(--teal); color: white; }
.role-btn.off { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.4); }
.role-who    { font-size: 10px; color: rgba(255,255,255,0.25); text-align: center; padding: 5px 12px 6px; border-bottom: 1px solid rgba(255,255,255,0.07); }

.sb-nav { flex: 1; overflow-y: auto; padding: 8px; }
.sb-nav::-webkit-scrollbar { width: 0; }
.nav-sec  { font-size: 9px; font-weight: 700; color: rgba(255,255,255,0.25); letter-spacing: 1.2px; text-transform: uppercase; padding: 12px 8px 4px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 1px; transition: all 0.12s; position: relative; text-decoration: none; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: white; }
.nav-item.on    { background: linear-gradient(135deg, var(--teal), var(--teal2)); color: white; font-weight: 600; box-shadow: 0 2px 8px rgba(13,138,122,0.4); }
.nav-item i   { font-size: 15px; flex-shrink: 0; }
.nav-badge    { margin-left: auto; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; padding: 0 4px; }
.nb-red   { background: var(--red);   color: white; }
.nb-amber { background: var(--amber); color: #1a1a1a; }
.nb-teal  { background: var(--teal);  color: white; }
.sb-foot  { padding: 10px 12px; border-top: 1px solid rgba(255,255,255,0.07); font-size: 10px; color: rgba(255,255,255,0.2); }

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.topbar       { background: white; border-bottom: 1px solid var(--border); padding: 0 24px; height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.topbar-left  { display: flex; align-items: center; gap: 12px; }
.page-title   { font-size: 15px; font-weight: 700; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ── Content Area ─────────────────────────────────────────────────────────── */
.content { padding: 20px 24px; flex: 1; }

/* ── Grid Layouts ─────────────────────────────────────────────────────────── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr;         gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr;     gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr);  gap: 14px; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card     { background: white; border-radius: var(--radius2); border: 1px solid var(--border); padding: 18px; }
.card-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title { font-size: 14px; font-weight: 700; color: var(--text); }

.stat-card { background: white; border-radius: var(--radius2); border: 1px solid var(--border); padding: 14px 18px; display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.stat-lbl  { font-size: 11px; color: var(--text2); font-weight: 500; margin-bottom: 2px; }
.stat-val  { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-sub  { font-size: 11px; color: var(--teal); margin-top: 2px; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn          { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; font-family: inherit; transition: all 0.12s; white-space: nowrap; text-decoration: none; }
.btn-primary  { background: var(--teal);  color: white; }
.btn-primary:hover { background: var(--teal2); }
.btn-outline  { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: #f8fafc; border-color: var(--border2); }
.btn-red      { background: #fef2f2; color: var(--red);   border: 1px solid #fecaca; }
.btn-amber    { background: #fffbeb; color: #92400e;      border: 1px solid #fde68a; }
.btn-navy     { background: var(--navy); color: white; }
.btn-sm  { padding: 5px 10px; font-size: 12px; }
.btn-xs  { padding: 3px 8px;  font-size: 11px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Table ────────────────────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius2); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th    { text-align: left; padding: 9px 12px; background: #f8fafc; color: var(--text2); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td    { padding: 11px 12px; border-bottom: 1px solid #f1f5f9; color: var(--text); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td      { background: #fafbfd; }

/* ── Pills / Badges ───────────────────────────────────────────────────────── */
.pill     { display: inline-flex; align-items: center; gap: 3px; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.p-green  { background: #dcfce7; color: #166534; }
.p-blue   { background: #dbeafe; color: #1e40af; }
.p-amber  { background: #fef3c7; color: #92400e; }
.p-red    { background: #fee2e2; color: #991b1b; }
.p-gray   { background: #f1f5f9; color: #475569; }
.p-teal   { background: var(--teal-light); color: #065f46; }
.p-purple { background: #f5f3ff; color: #6d28d9; }
.p-navy   { background: #e0e7ef; color: var(--navy); }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.fg   { margin-bottom: 12px; }
.flbl { display: block; font-size: 11px; font-weight: 700; color: var(--text2); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.4px; }
.fc   { width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--text); background: white; outline: none; transition: border 0.15s; font-family: inherit; }
.fc:focus         { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,138,122,0.1); }
select.fc         { cursor: pointer; }
textarea.fc       { resize: vertical; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal   { background: white; border-radius: 16px; width: 100%; max-width: 580px; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.22); }
.modal.wide { max-width: 680px; }
.mhdr { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: white; z-index: 1; border-radius: 16px 16px 0 0; }
.mbdy { padding: 18px 22px; }
.mftr { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 18px; gap: 2px; }
.tab  { padding: 9px 14px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text2); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.12s; border-radius: 6px 6px 0 0; }
.tab:hover { color: var(--text); background: #f8fafc; }
.tab.on    { color: var(--teal); border-bottom-color: var(--teal); background: var(--teal-light); }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert   { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; }
.alert i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.a-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.a-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.a-warn    { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.a-red     { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Upload Box ───────────────────────────────────────────────────────────── */
.upbox      { border: 2px dashed var(--border2); border-radius: 10px; padding: 18px; text-align: center; cursor: pointer; transition: all 0.15s; }
.upbox:hover { border-color: var(--teal); background: var(--teal-light); }
.upbox i    { font-size: 26px; color: var(--text3); display: block; margin-bottom: 4px; }
.upbox p    { font-size: 12px; color: var(--text2); }
.upbox small { font-size: 11px; color: var(--text3); }

/* ── Timeline ─────────────────────────────────────────────────────────────── */
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline  { padding-left: 22px; position: relative; }
.tl-item   { position: relative; margin-bottom: 14px; }
.tl-dot    { position: absolute; left: -22px; top: 3px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid white; box-shadow: 0 0 0 2px var(--teal); }
.tl-time   { font-size: 11px; color: var(--text3); margin-bottom: 2px; }
.tl-text   { font-size: 13px; color: var(--text); }

/* ── Visit Workflow ───────────────────────────────────────────────────────── */
.step-bar { display: flex; gap: 6px; margin: 0 22px 16px; }
.step-seg { flex: 1; height: 3px; border-radius: 2px; background: var(--border); }
.step-seg.done   { background: var(--teal); }
.step-seg.active { background: var(--amber); }
.step-lbl { font-size: 11px; color: var(--text2); padding: 0 22px 10px; font-weight: 600; }

/* ── Photo Grid ───────────────────────────────────────────────────────────── */
.pgrid  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pslot  { aspect-ratio: 1; border-radius: 8px; border: 2px dashed var(--border2); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font-size: 11px; color: var(--text2); background: #f8fafc; transition: all 0.15s; text-align: center; padding: 6px; gap: 4px; }
.pslot:hover    { border-color: var(--teal); background: var(--teal-light); color: var(--teal); }
.pslot.done     { border-style: solid; border-color: var(--teal); background: var(--teal-light); color: #065f46; }
.pslot i        { font-size: 22px; }

/* ── Timer ────────────────────────────────────────────────────────────────── */
.timer        { font-size: 52px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; letter-spacing: -2px; text-align: center; line-height: 1; }
.timer-status { font-size: 12px; color: var(--text2); text-align: center; margin-top: 6px; height: 16px; }

/* ── Signature Canvas ─────────────────────────────────────────────────────── */
.sig-canvas { border: 2px solid var(--border); border-radius: 10px; cursor: crosshair; width: 100%; height: 130px; background: white; touch-action: none; display: block; }

/* ── Progress Bar ─────────────────────────────────────────────────────────── */
.pbar  { height: 5px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.pfill { height: 100%; border-radius: 3px; background: var(--teal); transition: width 0.3s; }

/* ── Chips ────────────────────────────────────────────────────────────────── */
.chip   { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; background: var(--teal-light); color: #065f46; border-radius: 20px; font-size: 12px; font-weight: 500; }
.chip i { font-size: 13px; }

/* ── Info Rows ────────────────────────────────────────────────────────────── */
.irow      { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.irow:last-child { border-bottom: none; }
.ilbl { color: var(--text2); }
.ival { font-weight: 600; color: var(--text); }

/* ── Avatar ───────────────────────────────────────────────────────────────── */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; font-size: 12px; }

/* ── Notification Dot ─────────────────────────────────────────────────────── */
.ndot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); position: absolute; top: 2px; right: 2px; }

/* ── Section Header ───────────────────────────────────────────────────────── */
.sec-hdr { font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 10px; }

/* ── Visit Card ───────────────────────────────────────────────────────────── */
.visit-card      { background: white; border-radius: var(--radius2); border: 1px solid var(--border); padding: 16px; transition: box-shadow 0.15s; }
.visit-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

/* ── Stock Level Bar ──────────────────────────────────────────────────────── */
.stock-bar { height: 4px; background: #f1f5f9; border-radius: 2px; margin-top: 3px; overflow: hidden; }

/* ── Code ─────────────────────────────────────────────────────────────────── */
code { font-family: 'DM Mono', monospace; font-size: 11px; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; color: var(--navy2); }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: #cbd5e1; border-radius: 3px; }

/* ── Invoice ──────────────────────────────────────────────────────────────── */
.invoice-box { background: white; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.inv-head    { background: var(--navy); color: white; padding: 20px 24px; }
.inv-body    { padding: 20px 24px; }
.inv-table th { background: #f8fafc; }

/* ── Skeleton Loader ──────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 6px;
  display: block;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.skel-stat { height: 72px; border-radius: var(--radius2); }
.skel-line { height: 14px; margin-bottom: 8px; }
.skel-line.short { width: 60%; }

/* ── Notification Bell ────────────────────────────────────────────────────── */
.topbar-bell {
  position: relative; cursor: pointer;
  display: flex; align-items: center;
  color: var(--text2); font-size: 20px;
  padding: 5px; border-radius: 8px;
  transition: background 0.12s;
}
.topbar-bell:hover { background: #f1f5f9; color: var(--text); }
.bell-badge {
  display: none; position: absolute;
  top: 0; right: 0;
  min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 3px;
  background: var(--red); color: white;
  font-size: 9px; font-weight: 700;
  align-items: center; justify-content: center;
  line-height: 1;
}
.bell-badge.show { display: flex; }

/* ── Form field error state ───────────────────────────────────────────────── */
.fc.field-error { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }
.field-err { font-size: 11px; color: var(--red); margin-top: 3px; }
.form-error-banner { background:#fef2f2; color:#991b1b; border:1px solid #fecaca; border-radius:8px; padding:10px 14px; font-size:13px; margin-bottom:14px; display:none; }

/* ── Custom Select ────────────────────────────────────────────────────────── */
.cs-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 36px; padding: 7px 11px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; color: var(--text); background: white;
  cursor: pointer; user-select: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit; line-height: 1.4;
}
.cs-trigger:hover { border-color: var(--border2); }
.cs-trigger:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,138,122,0.1); }
.cs-trigger.open  { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,138,122,0.1); }
.cs-trigger.field-error { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }

.cs-val { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cs-placeholder { color: var(--text3); }
.cs-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cs-chev { font-size: 14px; color: var(--text3); flex-shrink: 0; transition: transform 0.2s; }
.cs-trigger.open .cs-chev { transform: rotate(180deg); }

.cs-panel {
  position: fixed; z-index: 9999;
  background: white; border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 14px 36px -4px rgba(0,0,0,0.14);
  overflow: hidden;
  opacity: 0; transform: translateY(-5px); pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.cs-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.cs-search { padding: 8px 8px 6px; border-bottom: 1px solid var(--border); }
.cs-search-inp {
  width: 100%; padding: 6px 10px 6px 28px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; color: var(--text); outline: none;
  font-family: inherit; background: #f8fafc;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 8px center;
  transition: border-color 0.15s;
}
.cs-search-inp:focus { border-color: var(--teal); background-color: white; }
.cs-search-inp::placeholder { color: var(--text3); }

.cs-list { max-height: 216px; overflow-y: auto; padding: 4px; }
.cs-list::-webkit-scrollbar       { width: 4px; }
.cs-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

.cs-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 7px; cursor: pointer;
  font-size: 13px; color: var(--text); transition: background 0.08s;
}
.cs-opt:hover              { background: #f8fafc; }
.cs-opt.cs-focused         { background: #f1f5f9; }
.cs-opt.selected           { background: var(--teal-light); color: var(--teal); font-weight: 600; }
.cs-opt.selected:hover     { background: #c2e8e4; }
.cs-opt-check { margin-left: auto; font-size: 13px; color: var(--teal); flex-shrink: 0; }
.cs-empty { padding: 14px 10px; color: var(--text3); font-size: 13px; text-align: center; font-style: italic; }

/* ── Custom Date Picker ───────────────────────────────────────────────────── */
.dp-trigger {
  display: flex; align-items: center; gap: 8px;
  width: 100%; min-height: 36px; padding: 7px 11px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; color: var(--text); background: white;
  cursor: pointer; user-select: none; white-space: nowrap; overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit; line-height: 1.4;
}
.dp-trigger:hover { border-color: var(--border2); }
.dp-trigger:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,138,122,0.1); }
.dp-trigger.open  { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,138,122,0.1); }
.dp-trigger.field-error { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }

.dp-icon { font-size: 15px; color: var(--text3); flex-shrink: 0; }
.dp-val  { flex: 1; }
.dp-placeholder { color: var(--text3); }
.dp-clear {
  display: flex; align-items: center; font-size: 13px; color: var(--text3);
  flex-shrink: 0; cursor: pointer; padding: 0 2px; border-radius: 4px;
  transition: color 0.12s;
}
.dp-clear:hover { color: var(--red); }

.dp-panel {
  position: fixed; z-index: 10000; width: 284px;
  background: white; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 14px 36px -4px rgba(0,0,0,0.14);
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.dp-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.dp-hdr {
  display: flex; align-items: center; gap: 4px;
  padding: 12px 12px 8px;
}
.dp-month-lbl { flex: 1; text-align: center; font-weight: 700; font-size: 14px; color: var(--text); }
.dp-nav {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--border); background: white;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text2); font-size: 14px; flex-shrink: 0;
  transition: all 0.1s;
}
.dp-nav:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-light); }

.dp-grid { padding: 0 10px; }
.dp-dow-row {
  display: grid; grid-template-columns: repeat(7, 1fr);
  padding: 4px 0 6px;
}
.dp-dow-row span {
  font-size: 10px; font-weight: 700; color: var(--text3);
  text-align: center; letter-spacing: 0.4px; text-transform: uppercase;
}

.dp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding-bottom: 4px; }
.dp-day {
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 1; border-radius: 8px;
  font-size: 13px; color: var(--text);
  border: none; background: none; font-family: inherit;
  cursor: pointer; transition: background 0.1s, color 0.1s;
  position: relative;
}
.dp-day:hover:not(.dp-sel) { background: #f1f5f9; }
.dp-other { color: var(--text3); }
.dp-other:hover { background: #f8fafc !important; }
.dp-today { font-weight: 700; color: var(--teal); }
.dp-today:not(.dp-sel)::after {
  content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--teal);
}
.dp-sel { background: var(--teal) !important; color: white !important; font-weight: 600; }
.dp-sel:hover { background: var(--teal2) !important; }

.dp-ftr {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px 12px; border-top: 1px solid var(--border); margin-top: 4px;
}
.dp-ftr-btn {
  background: none; border: none; font-size: 12px; font-weight: 600;
  cursor: pointer; padding: 5px 10px; border-radius: 6px;
  font-family: inherit; transition: all 0.1s;
}
.dp-ftr-clear { color: var(--text3); }
.dp-ftr-clear:hover { color: var(--red); background: #fef2f2; }
.dp-ftr-today { color: var(--teal); }
.dp-ftr-today:hover { background: var(--teal-light); }

/* ── Summary Bar (shared across pages) ───────────────────────────────────── */
.summary-bar { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.summary-item {
  background: white; border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px; min-width: 120px; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.summary-item[onclick] { cursor: pointer; }
.summary-item[onclick]:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: var(--teal); }
.summary-num { font-size: 32px; font-weight: 700; color: var(--navy); line-height: 1; }
.summary-lbl { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.6px; margin-top: 6px; }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0 4px; flex-wrap: wrap; gap: 8px;
}
.pagination-info { font-size: 12px; color: var(--text3); }
.pagination-btns { display: flex; gap: 4px; align-items: center; }
.pg-btn {
  min-width: 32px; height: 32px; padding: 0 10px;
  border: 1.5px solid var(--border); border-radius: 7px;
  background: white; font-size: 12px; font-weight: 600; color: var(--text2);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-family: inherit; transition: all 0.12s; line-height: 1;
}
.pg-btn:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); background: var(--teal-light); }
.pg-btn.on { background: var(--teal); color: white; border-color: var(--teal); }
.pg-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.pg-ellipsis { font-size: 12px; color: var(--text3); padding: 0 4px; }

/* ── Hamburger (hidden on desktop, shown on mobile) ───────────────────────── */
.hamburger {
  display: none;
  align-items: center; justify-content: center;
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 8px; border: none;
  background: transparent; cursor: pointer;
  color: var(--text2); font-size: 20px;
  transition: background 0.12s, color 0.12s;
  margin-right: 2px;
}
.hamburger:hover { background: #f1f5f9; color: var(--text); }

/* ── Mobile backdrop ──────────────────────────────────────────────────────── */
.mob-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 299;
}
.mob-backdrop.show { display: block; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar: 180px; }
  .grid4 { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  :root { --sidebar: 0px; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.26s ease;
    z-index: 300;
    width: 220px;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .hamburger { display: flex; }
  .content { padding: 14px 16px; }
  .topbar { padding: 0 16px; }
}
