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

:root {
  --teal-50: #F0FDFA; --teal-100: #CCFBF1; --teal-200: #99F6E4; --teal-400: #14B8A6;
  --teal-600: #0D9488; --teal-700: #0F766E; --teal-800: #115E59;
  --ink: #0B2540; --ink-2: #13335A;
  --coral: #FF6B5B; --coral-50: #FFF1EF;
  --slate-50: #F8FAFC; --slate-100: #F1F5F9; --slate-200: #E2E8F0; --slate-300: #CBD5E1;
  --slate-400: #94A3B8; --slate-500: #64748B; --slate-600: #475569; --slate-700: #334155;
  --green: #16A34A; --amber: #F59E0B; --red: #DC2626; --indigo: #6366F1; --blue: #2563EB;
  --st-agendada: #64748B; --st-confirmada: #0D9488; --st-sala: #F59E0B; --st-atencion: #6366F1;
  --st-atendida: #16A34A; --st-noasistio: #DC2626; --st-cancelada: #94A3B8;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --shadow: 0 1px 2px rgba(11,37,64,.06), 0 4px 16px rgba(11,37,64,.06);
  --shadow-lg: 0 10px 40px rgba(11,37,64,.18);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--slate-100); -webkit-font-smoothing: antialiased; }
a { color: var(--teal-700); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: 24px; font-weight: 800; } h2 { font-size: 18px; font-weight: 700; } h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--slate-500); }
.small { font-size: 12px; }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid transparent; font: 600 14px var(--font); cursor: pointer; transition: .15s; white-space: nowrap; }
.btn-primary { background: var(--teal-600); color: #fff; }
.btn-primary:hover { background: var(--teal-700); }
.btn-coral { background: var(--coral); color: #fff; }
.btn-coral:hover { filter: brightness(.95); }
.btn-ghost { background: #fff; border-color: var(--slate-200); color: var(--ink); }
.btn-ghost:hover { border-color: var(--slate-300); background: var(--slate-50); }
.btn-link { background: none; color: var(--teal-700); padding: 0 6px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 16px; border-radius: 10px; }
.btn-icon { width: 38px; padding: 0; }
.btn-danger { background: #fff; border-color: #FECACA; color: var(--red); }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--slate-600); }
.input, select.input, textarea.input { height: 38px; padding: 0 12px; border: 1px solid var(--slate-200); border-radius: var(--r-sm); font: 14px var(--font); color: var(--ink); background: #fff; width: 100%; outline: none; transition: .15s; }
textarea.input { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--teal-400); box-shadow: 0 0 0 3px var(--teal-100); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 10px; color: var(--slate-400); }
.search .input { padding-left: 36px; }
.search-results { position: absolute; top: 44px; left: 0; right: 0; background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; }
.search-results a { padding: 8px; border-radius: 8px; color: var(--ink); }
.search-results a:hover { background: var(--slate-50); }

/* ---------- Toggle ---------- */
.toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--slate-300); border-radius: 99px; cursor: pointer; transition: .2s; }
.toggle span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.toggle input:checked + span { background: var(--teal-600); }
.toggle input:checked + span::before { transform: translateX(18px); }

/* ---------- Cards / badges / tablas ---------- */
.card { background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow); padding: 18px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--slate-100); color: var(--slate-600); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.nodot::before { display: none; }
.b-teal { background: var(--teal-50); color: var(--teal-700); }
.b-coral { background: var(--coral-50); color: #D9412F; }
.b-green { background: #F0FDF4; color: var(--green); }
.b-amber { background: #FFFBEB; color: #B45309; }
.b-red { background: #FEF2F2; color: var(--red); }
.b-indigo { background: #EEF2FF; color: var(--indigo); }
.b-slate { background: var(--slate-100); color: var(--slate-600); }
.st-agendada { background: var(--slate-100); color: var(--st-agendada); }
.st-confirmada { background: var(--teal-50); color: var(--st-confirmada); }
.st-sala { background: #FFFBEB; color: #B45309; }
.st-atencion { background: #EEF2FF; color: var(--st-atencion); }
.st-atendida { background: #F0FDF4; color: var(--st-atendida); }
.st-noasistio { background: #FEF2F2; color: var(--st-noasistio); }
.st-cancelada { background: var(--slate-100); color: var(--st-cancelada); text-decoration: line-through; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--slate-500); padding: 10px 12px; border-bottom: 1px solid var(--slate-200); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--slate-50); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--teal-600); flex-shrink: 0; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.person { display: flex; align-items: center; gap: 10px; }
.person b { display: block; font-weight: 600; }

/* ---------- Layout app ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--ink); color: #C7D2E0; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 40; transition: transform .25s; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 800; font-size: 22px; letter-spacing: -1px; }
.sidebar .brand img { width: 32px; height: 32px; }
.sidebar .clinic { margin: 0 12px 12px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.06); font-size: 12px; }
.sidebar .clinic b { color: #fff; display: block; font-size: 13px; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px; }
.nav .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6B7F99; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; color: #C7D2E0; font-weight: 500; margin-bottom: 2px; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--teal-600); color: #fff; }
.nav a .count { margin-left: auto; background: var(--coral); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.sidebar .me { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.sidebar .me b { color: #fff; display: block; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: #fff; border-bottom: 1px solid var(--slate-200); display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 30; }
.topbar .search { flex: 1; max-width: 420px; }
.topbar .spacer { flex: 1; }
.topbar .menu-btn { display: none; }
.notif { position: relative; }
.notif .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); border: 2px solid #fff; }
.content { padding: 24px; flex: 1; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-h p { color: var(--slate-500); margin-top: 4px; }
.page-h .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-main { grid-template-columns: 2fr 1fr; }

.kpi .lbl { color: var(--slate-500); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.kpi .val { font-size: 28px; font-weight: 800; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 12px; font-weight: 600; }
.kpi .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 28px; margin-bottom: 10px; }
.spark i { width: 4px; min-height: 3px; border-radius: 2px; background: var(--slate-200); }
.spark i:last-child { background: var(--teal-600); }
.spark.bad i:last-child { background: var(--red); }
.now-row { display: flex; align-items: center; gap: 8px; color: var(--coral); font-size: 11px; font-weight: 700; letter-spacing: .04em; margin: 4px 0; }
.now-row::after { content: ''; flex: 1; height: 2px; background: var(--coral); }
.chip-alert { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 6px; background: #FEF2F2; color: var(--red); font-size: 11px; font-weight: 600; vertical-align: middle; }
.chip-alert svg { width: 11px; height: 11px; }
.kpi .ico { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--teal-50); color: var(--teal-700); }
.up { color: var(--green); } .down { color: var(--red); }

.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--slate-100); }
.list-item:last-child { border-bottom: 0; }
.btn-spacer { width: 90px; flex-shrink: 0; }
.list-item .time { font-weight: 700; width: 48px; font-variant-numeric: tabular-nums; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--slate-200); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font: 600 14px var(--font); color: var(--slate-500); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--teal-700); border-color: var(--teal-600); }
.seg { display: inline-flex; background: var(--slate-100); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font: 600 13px var(--font); color: var(--slate-600); cursor: pointer; }
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.alert-red { background: #FEF2F2; color: #991B1B; }
.alert-amber { background: #FFFBEB; color: #92400E; }
.alert-teal { background: var(--teal-50); color: var(--teal-800); }

/* ---------- Agenda ---------- */
.agenda-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.agenda-bar .date { font-weight: 700; font-size: 16px; min-width: 210px; }
.agenda-wrap { background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow); overflow: auto; max-height: calc(100vh - 230px); }
.agenda { display: grid; position: relative; min-width: 720px; }
.agenda .col-h { position: sticky; top: 0; background: #fff; z-index: 5; padding: 10px; border-bottom: 1px solid var(--slate-200); border-left: 1px solid var(--slate-100); display: flex; align-items: center; gap: 8px; font-weight: 600; }
.agenda .col-h .avatar { width: 28px; height: 28px; font-size: 11px; }
.agenda .col-h small { display: block; color: var(--slate-500); font-weight: 500; font-size: 11px; }
.agenda .corner { position: sticky; top: 0; left: 0; z-index: 6; background: #fff; border-bottom: 1px solid var(--slate-200); }
.agenda .hours { position: sticky; left: 0; background: #fff; z-index: 4; }
.agenda .hour { height: 64px; font-size: 11px; color: var(--slate-400); text-align: right; padding: 0 8px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.agenda .col { position: relative; border-left: 1px solid var(--slate-100); background-image: linear-gradient(var(--slate-100) 1px, transparent 1px), linear-gradient(#F8FAFC 1px, transparent 1px); background-size: 100% 64px, 100% 32px; }
.agenda .slot-click { position: absolute; left: 0; right: 0; height: 16px; cursor: pointer; }
.agenda .slot-click:hover { background: var(--teal-50); }
.agenda .block { position: absolute; left: 4px; right: 4px; border-radius: 6px; background: repeating-linear-gradient(45deg, #F1F5F9, #F1F5F9 6px, #E2E8F0 6px, #E2E8F0 12px); color: var(--slate-500); font-size: 11px; font-weight: 600; padding: 4px 8px; }
.appt { position: absolute; left: 4px; right: 4px; border-radius: 8px; padding: 5px 8px; font-size: 12px; overflow: hidden; cursor: pointer; border-left: 4px solid; background: #fff; box-shadow: 0 1px 3px rgba(11,37,64,.12); transition: .15s; z-index: 2; }
.appt:hover { box-shadow: var(--shadow-lg); z-index: 3; }
.appt.compact { padding: 2px 8px; line-height: 1.25; }
.appt.compact .small { font-size: 11px; }
.appt b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .t { font-variant-numeric: tabular-nums; color: var(--slate-500); font-size: 11px; }
.appt .tags { display: flex; gap: 4px; margin-top: 2px; }
.appt .tag { font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 4px; background: var(--slate-100); }
.appt.s-agendada { border-color: var(--st-agendada); background: #F8FAFC; }
.appt.s-confirmada { border-color: var(--st-confirmada); background: var(--teal-50); }
.appt.s-sala { border-color: var(--st-sala); background: #FFFBEB; }
.appt.s-atencion { border-color: var(--st-atencion); background: #EEF2FF; }
.appt.s-atendida { border-color: var(--st-atendida); background: #F0FDF4; }
.appt.s-noasistio { border-color: var(--st-noasistio); background: #FEF2F2; }
.appt.s-cancelada { border-color: var(--st-cancelada); opacity: .55; text-decoration: line-through; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--coral); z-index: 4; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--slate-500); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.agenda-list .list-item { padding: 12px 14px; }

/* ---------- Drawer / modal / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(11,37,64,.4); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
.modal { background: #fff; border-radius: var(--r-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-lg); animation: pop .2s; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--slate-100); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-b { padding: 20px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--slate-100); position: sticky; bottom: 0; background: #fff; }
.overlay.drawer { justify-content: flex-end; padding: 0; }
.overlay.drawer .modal { max-width: 440px; height: 100vh; max-height: 100vh; border-radius: 0; animation: slide .22s; display: flex; flex-direction: column; }
.overlay.drawer .modal-b { flex: 1; }
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; font-weight: 500; animation: pop .2s; max-width: 360px; }
.toast svg { color: var(--teal-200); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes slide { from { transform: translateX(100%); } }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--slate-500); } .kv dd { margin: 0; font-weight: 600; }
.status-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.status-steps button { border: 1px solid var(--slate-200); background: #fff; border-radius: 99px; padding: 5px 11px; font: 600 12px var(--font); cursor: pointer; color: var(--slate-600); }
.status-steps button.on { color: #fff; border-color: transparent; }

/* ---------- Kanban CRM ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.k-col { background: #E9EEF4; border-radius: var(--r-md); padding: 10px; min-height: 420px; display: flex; flex-direction: column; }
.k-col.over { outline: 2px dashed var(--teal-400); background: var(--teal-50); }
.k-col-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; font-weight: 700; }
.k-col-h .sum { font-size: 12px; color: var(--slate-500); font-weight: 600; }
.k-card { background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(11,37,64,.08); cursor: grab; }
.k-card:active { cursor: grabbing; }
.k-card.dragging { opacity: .4; }
.k-card b { display: block; margin-bottom: 4px; }
.k-card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; color: var(--slate-500); }
.src { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; }
.src-facebook { background: #E7F0FF; color: #1D4ED8; } .src-instagram { background: #FCE7F3; color: #BE185D; }
.src-google { background: #FEF3C7; color: #B45309; } .src-referido { background: #DCFCE7; color: #15803D; }
.src-tiktok { background: #F1F5F9; color: #0F172A; } .src-web { background: var(--teal-50); color: var(--teal-700); }
.src-walkin { background: #EDE9FE; color: #6D28D9; }

/* ---------- Odontograma ---------- */
.odonto { display: flex; flex-direction: column; gap: 18px; align-items: center; overflow-x: auto; padding: 8px 0; }
.odonto .arch { display: flex; gap: 18px; }
.odonto .quad { display: flex; gap: 4px; }
.tooth { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.tooth .n { font-size: 11px; font-weight: 700; color: var(--slate-500); font-variant-numeric: tabular-nums; }
.tooth svg { width: 38px; height: 38px; }
.tooth svg polygon, .tooth svg rect { fill: #fff; stroke: var(--slate-400); stroke-width: 1; transition: .1s; }
.tooth:hover svg polygon, .tooth:hover svg rect { stroke: var(--teal-600); }
.tooth svg .f.caries { fill: #FCA5A5; stroke: var(--red); }
.tooth svg .f.obturado { fill: #93C5FD; stroke: var(--blue); }
.tooth.ausente svg { opacity: .35; }
.tooth .mark { height: 14px; font-size: 10px; font-weight: 800; }
.tooth.corona svg rect.center, .tooth.corona svg polygon { stroke: var(--blue); stroke-width: 2.5; }
.tooth.endodoncia .mark { color: var(--blue); }
.tooth.implante .mark { color: var(--blue); }
.tooth.ausente .mark { color: var(--slate-700); }
.tooth.extraer .mark { color: var(--red); }
.odo-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.odo-tools button { border: 1px solid var(--slate-200); background: #fff; border-radius: 8px; padding: 6px 10px; font: 600 12px var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.odo-tools button.on { border-color: var(--teal-600); background: var(--teal-50); color: var(--teal-800); }
.odo-tools i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- WhatsApp preview ---------- */
.wa { background: #ECE5DD; border-radius: 12px; padding: 16px; min-height: 220px; background-image: radial-gradient(rgba(0,0,0,.03) 1px, transparent 1px); background-size: 12px 12px; }
.wa-bubble { background: #fff; border-radius: 0 10px 10px 10px; padding: 10px 12px; max-width: 320px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; box-shadow: 0 1px 1px rgba(0,0,0,.1); }
.wa-bubble .time { display: block; text-align: right; font-size: 10px; color: var(--slate-400); margin-top: 4px; }
.wa-btns { display: flex; flex-direction: column; gap: 4px; max-width: 320px; margin-top: 4px; }
.wa-btns span { background: #fff; border-radius: 8px; text-align: center; padding: 8px; color: #0284C7; font-weight: 600; font-size: 13px; }

/* ---------- Charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar div { width: 100%; max-width: 36px; background: linear-gradient(180deg, var(--teal-400), var(--teal-600)); border-radius: 6px 6px 2px 2px; min-height: 4px; }
.bars .bar.hl div { background: linear-gradient(180deg, #FF8A7D, var(--coral)); }
.bars .bar span { font-size: 11px; color: var(--slate-500); }
.hbar { margin-bottom: 12px; }
.hbar .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.hbar .track { height: 8px; background: var(--slate-100); border-radius: 99px; overflow: hidden; }
.hbar .track div { height: 100%; background: var(--teal-600); border-radius: 99px; }
.progress { height: 8px; background: var(--slate-100); border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; background: var(--teal-600); }

.empty { text-align: center; padding: 40px 20px; color: var(--slate-500); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) { .g-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1024px) {
  .g-main, .g-3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .topbar { padding: 0 14px; }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: 16px; }
  .scrim { position: fixed; inset: 0; background: rgba(11,37,64,.35); z-index: 35; }
}
@media (max-width: 640px) {
  .g-4, .g-2 { grid-template-columns: 1fr 1fr; }
  .row, .row-3 { grid-template-columns: 1fr; }
  .topbar .search { display: none; }
  .topbar #quickAppt span, .topbar #bookLink span { display: none; }
  .topbar #quickAppt, .topbar #bookLink { width: 38px; padding: 0; }
  .card-h { flex-wrap: wrap; }
  .list-item { gap: 8px; }
  .list-item > .avatar, .btn-spacer { display: none; }
  h1 { font-size: 20px; }
  .kpi .val { font-size: 22px; }
  .table.resp thead { display: none; }
  .table.resp tr { display: block; border-bottom: 1px solid var(--slate-200); padding: 8px 0; }
  .table.resp td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 5px 4px; }
  .table.resp td::before { content: attr(data-l); color: var(--slate-500); font-size: 12px; font-weight: 600; }
  .table.resp td.first::before { display: none; }
  .overlay.drawer .modal { max-width: 100%; }
  .page-h .actions { width: 100%; }
  .page-h .actions .btn { flex: 1; }
}
