/* Slimlab OS — DRAFT design system
   Ohabai conventions: warm neutrals, ONE per-client accent (Slimlab = spa teal),
   tile-based home, Apple-clean + Notion-warmth, light mode, mobile-first. */

:root {
  /* Slimlab CI — Navy + Champagne Gold + warm neutrals (from brand guideline) */
  --navy:      #0B1D3A;   /* SlimLab Navy — primary brand / ink / primary buttons */
  --navy-600:  #16294D;
  --gold:      #B88746;   /* Champagne Gold — accent / secondary buttons */
  --gold-700:  #9C7038;
  --gold-100:  #F1E7D6;
  --gold-50:   #FAF5EC;

  /* warm neutrals from CI (ivory cream / warm sand / stone) */
  --bg:        #F7F2EB;   /* Ivory Cream */
  --surface:   #FFFFFF;
  --surface-2: #F1EBE0;   /* warm sand */
  --border:    #E5DDCF;   /* warm grey-beige */
  --ink:       #0B1D3A;   /* navy as primary ink */
  --ink-2:     #4A5468;
  --ink-3:     #8A8475;

  /* accent ramp = Champagne Gold (highlights, active, progress, links) */
  --accent:      #B88746;
  --accent-700:  #9C7038;
  --accent-100:  #F1E7D6;
  --accent-50:   #FAF5EC;

  /* semantic */
  --success: #10B981;
  --warning: #F59E0B;
  --danger:  #EF4444;
  --info:    #3B82F6;

  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-pill: 999px;
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:24px; --sp-6:32px;
  --shadow-sm: 0 1px 2px rgba(11,29,58,.06), 0 1px 3px rgba(11,29,58,.04);
  --shadow-md: 0 4px 16px rgba(11,29,58,.10);
  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* global UI scale — screens only (print/A4 receipts stay exact) */
@media screen { html { zoom: 1.08; } }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
  padding: 8px 16px;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 15px; flex: none; }
.brand .dot { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--navy), var(--gold)); }
.brand .wordmark { font-weight: 700; letter-spacing: .14em; color: var(--navy); }
.brand .os { font-size: 10px; font-weight: 700; letter-spacing: .14em; color: var(--gold-700); background: var(--gold-50); border:1px solid var(--gold-100); padding: 2px 6px; border-radius: 6px; }
/* links take the middle space and shrink/scroll instead of wrapping to a 2nd row */
.nav-links { display: flex; gap: 1px; margin-left: 4px; flex: 1 1 auto; min-width: 0;
  overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  padding: 6px 9px; border-radius: var(--r-pill); color: var(--ink-2); white-space: nowrap;
  font-weight: 500; font-size: 13px; transition: all .12s ease;
}
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.nav-links a.active { background: var(--navy); color: #fff; }
.nav-links a .badge { background: var(--danger); color:#fff; border-radius: var(--r-pill); font-size: 11px; padding: 0 6px; margin-left: 5px; }

/* branch switcher */
.branch-switch { display:flex; gap:4px; background: var(--surface-2); padding:3px; border-radius: var(--r-pill); flex: none; }
.branch-switch a { font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: var(--r-pill); color: var(--ink-2); white-space: nowrap; }
.branch-switch a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 18px 20px 60px; }
.wrap.wide { max-width: none; padding: 14px 18px 16px; }
.wrap.roomy { max-width: 1560px; padding: 18px 30px 60px; }  /* fuller than default, still readable */
.page-head { display:flex; align-items:flex-end; justify-content:space-between; margin-bottom: 18px; gap: 16px; }
.page-head h1 { font-size: 26px; letter-spacing: -.02em; margin: 0; }
.page-head .sub { color: var(--ink-3); font-size: 14px; margin-top: 2px; }

/* ---------- tiles (home) ---------- */
.tiles { display:grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
@media (min-width: 720px){ .tiles { grid-template-columns: repeat(3,1fr);} }
@media (min-width: 1000px){ .tiles { grid-template-columns: repeat(4,1fr);} }
.tile {
  background: var(--surface); border:1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .12s ease;
  display:flex; flex-direction:column; gap: 10px; min-height: 116px;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tile .ico { width: 38px; height: 38px; border-radius: 11px; display:grid; place-items:center; font-size: 19px; background: var(--accent-100); }
.tile h3 { margin:0; font-size: 15px; }
.tile p { margin:0; color: var(--ink-3); font-size: 13px; }
.tile .big { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }

/* stat row */
.stats { display:grid; grid-template-columns: repeat(2,1fr); gap:14px; margin-bottom: 22px; }
@media(min-width:720px){ .stats{ grid-template-columns: repeat(4,1fr);} }
.stat { background: var(--surface); border:1px solid var(--border); border-radius: var(--r-md); padding: 16px; box-shadow: var(--shadow-sm); }
.stat .label { color: var(--ink-3); font-size: 12px; font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing:-.02em; margin-top: 4px; }
.stat .value small { font-size: 14px; color: var(--ink-3); font-weight:500; }

/* ---------- cards / generic ---------- */
.card { background: var(--surface); border:1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card .card-head { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight:600; display:flex; justify-content:space-between; align-items:center; }
.card .card-body { padding: 8px 0; }

/* tags / badges */
.tag { display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:600; padding: 3px 9px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); }
.tag.dot::before { content:""; width:7px; height:7px; border-radius:50%; background: currentColor; }
.tag.green { background:#E7F8EF; color:#0B8043;} .tag.amber{background:#FEF4E2;color:#B7791F;}
.tag.red{background:#FDECEC;color:#C53030;} .tag.blue{background:#E8F1FD;color:#2563EB;}
.tag.teal{background:var(--accent-100);color:var(--accent-700);} .tag.grey{background:var(--surface-2);color:var(--ink-3);}

.chan { font-size:11px; font-weight:700; padding:2px 7px; border-radius:6px; }
.chan.wa { background:#E7F8EF; color:#128C7E; } .chan.ig{ background:#FCE7F3; color:#C13584; }

.avatar { width: 30px; height:30px; border-radius:50%; display:grid; place-items:center; color:#fff; font-size:12px; font-weight:700; flex:none; }

/* tables */
table.tbl { width:100%; border-collapse: collapse; }
table.tbl th { text-align:left; font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-3); font-weight:600; padding: 10px 18px; }
table.tbl th.right { text-align:right; }  /* keep numeric headers over their values (.right beats th default) */
table.tbl td { padding: 12px 18px; border-top:1px solid var(--border); font-size:14px; }
table.tbl tr:hover td { background: var(--accent-50); }

/* buttons */
.btn { display:inline-flex; align-items:center; gap:7px; font-family:var(--font); font-size:14px; font-weight:600; padding: 9px 16px; border-radius: var(--r-pill); border:1px solid var(--border); background: var(--surface); color: var(--ink); cursor:pointer; transition: all .12s; white-space:nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--navy); color:#fff; border-color: var(--navy); }  /* brand: primary = navy */
.btn.primary:hover { background: var(--navy-600); }
.btn.gold { background: var(--gold); color:#fff; border-color: var(--gold); }     /* brand: secondary = gold */
.btn.gold:hover { background: var(--gold-700); }
.btn.sm { padding: 6px 12px; font-size:13px; }

/* ---------- appointment book ---------- */
.book { display:grid; gap:0; background: var(--surface); border:1px solid var(--border); border-radius: var(--r-lg); overflow:hidden; box-shadow: var(--shadow-sm); }
.book-head { display:grid; border-bottom:1px solid var(--border); background: var(--surface-2); }
.book-head .col-h { padding: 12px 10px; font-weight:600; font-size:13px; display:flex; align-items:center; gap:8px; border-left:1px solid var(--border); }
.book-head .col-h:first-child{ border-left:none; }
.book-grid { position: relative; }
.book-row { display:grid; border-top:1px solid var(--surface-2); min-height: 56px; }
.book-row .time { font-size:12px; color:var(--ink-3); padding:6px 8px; text-align:right; }
.book-cell { border-left:1px solid var(--surface-2); position:relative; padding:3px; }
.appt { border-radius: 8px; padding: 6px 8px; font-size:12px; color:#fff; height:100%; box-shadow: var(--shadow-sm); cursor:pointer; }
.appt .t { font-weight:700; } .appt .c { opacity:.95; }
.appt.consult { background: var(--ink-3) !important; }

/* ---------- brain & inbox ---------- */
.split { display:grid; grid-template-columns: 320px 1fr; gap:18px; }
@media(max-width: 860px){ .split{ grid-template-columns: 1fr; } }

/* fitpage — a page that fills the viewport exactly: body is a viewport-tall
   flex column so the wrap gets whatever is left under the nav (no magic pixel
   offsets — immune to nav height and browser page-zoom, unlike 100vh); the
   page's grid then flexes and its panes scroll internally. Used by Brain + Inbox. */
html:has(body.fitpage) { height:100%; }
body.fitpage { height:100%; overflow:hidden; display:flex; flex-direction:column; }
body.fitpage .nav { flex:0 0 auto; }
body.fitpage main.wrap { flex:1 1 auto; min-height:0; display:flex; flex-direction:column; overflow:hidden;
  width:100%; }  /* .wrap's margin:0 auto would otherwise shrink-to-fit a flex child */

/* inbox: thread list + conversation, reply box pinned */
.inbox-grid { display:grid; grid-template-columns: 340px 1fr; grid-template-rows: minmax(0, 1fr);
  gap:18px; flex:1 1 auto; min-height:0; }
.inbox-list { overflow-y:auto; min-height:0; }
.inbox-convo { display:flex; flex-direction:column; min-height:0; }
.inbox-convo .chat-scroll { flex:1; min-height:0; max-height:none; }

/* brain — chat sessions layout */
.brain-grid { display:grid; grid-template-columns: 260px 1fr; grid-template-rows: minmax(0, 1fr);
  gap:18px; flex:1 1 auto; min-height:0; }
@media(max-width: 860px){
  body.fitpage { height:auto; overflow:visible; display:block; }
  body.fitpage main.wrap { overflow:visible; }
  .brain-grid, .inbox-grid { grid-template-columns: 1fr; grid-template-rows:auto; min-height:460px; }
}
.brain-sidebar { display:flex; flex-direction:column; overflow:hidden; min-height:0; }
.brain-chats { flex:1 1 auto; min-height:0; overflow-y:auto; border-top:1px solid var(--border); }
.brain-grid .inbox-convo { display:flex; flex-direction:column; min-height:0; }
.brain-grid .inbox-convo .chat-scroll { flex:1; min-height:0; max-height:none; }

/* markdown in brain replies */
.body.md > :first-child { margin-top:0; } .body.md > :last-child { margin-bottom:0; }
.body.md h2,.body.md h3,.body.md h4,.body.md h5 { margin:10px 0 6px; font-size:15px; }
.body.md p { margin:8px 0; } .body.md ul,.body.md ol { margin:6px 0 6px 18px; } .body.md li { margin:2px 0; }
.body.md blockquote { margin:8px 0; padding:6px 12px; border-left:3px solid var(--gold); background:var(--gold-50); border-radius:6px; }
.body.md hr { border:none; border-top:1px solid var(--border); margin:10px 0; }
.body.md code { background:var(--surface-2); padding:1px 5px; border-radius:5px; font-size:12.5px; }
.body.md table.mdt { border-collapse:collapse; width:100%; margin:8px 0; font-size:13px; }
.body.md table.mdt th { text-align:left; background:var(--surface-2); padding:6px 9px; }
.body.md table.mdt td { border-top:1px solid var(--border); padding:6px 9px; }
.thread-item { padding: 12px 16px; border-bottom:1px solid var(--border); cursor:pointer; display:flex; gap:10px; align-items:flex-start; }
.thread-item:hover { background: var(--accent-50); }
.thread-item.active { background: var(--accent-100); }
.bubble { max-width: 75%; padding: 9px 13px; border-radius: 14px; font-size:14px; margin-bottom:8px; }
.bubble.in { background: var(--surface-2); border-bottom-left-radius:4px; }
.bubble.out { background: var(--accent); color:#fff; margin-left:auto; border-bottom-right-radius:4px; }
.chat-scroll { padding: 18px; min-height: 380px; max-height: 520px; overflow-y:auto; display:flex; flex-direction:column; }

/* brain */
.brain-msg { display:flex; gap:12px; margin-bottom:18px; }
.brain-msg .who { width:34px; height:34px; border-radius:10px; display:grid; place-items:center; flex:none; font-size:17px; }
.brain-msg.ai .who { background: linear-gradient(135deg,var(--accent),var(--accent-700)); }
.brain-msg .body { background: var(--surface); border:1px solid var(--border); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-sm); }
.action-card { border:1px solid var(--accent); border-radius: var(--r-md); overflow:hidden; margin-top:10px; }
.action-card .ah { background: var(--accent-50); padding: 8px 14px; font-size:13px; font-weight:600; color: var(--accent-700); border-bottom:1px solid var(--accent-100); }
.action-card .ab { padding: 12px 14px; font-size:14px; }
.action-card .af { padding: 10px 14px; display:flex; gap:8px; border-top:1px solid var(--border); }

.muted { color: var(--ink-3); }
.right { text-align:right; }
.flex { display:flex; align-items:center; gap:10px; }
.between { display:flex; align-items:center; justify-content:space-between; }
.draft-banner { background: #FEF4E2; color:#92610A; text-align:center; font-size:12.5px; font-weight:600; padding:6px; }
.progress { height:6px; background: var(--surface-2); border-radius:99px; overflow:hidden; }
.progress > span { display:block; height:100%; background: var(--accent); }

/* ---------- manage console (tab shell + guard-error banner) ---------- */
.manage-tabs { display:flex; gap:4px; margin:-4px 0 20px; border-bottom:1.5px solid var(--border); }
.manage-tabs a { padding:9px 14px; font-size:13.5px; font-weight:600; color:var(--ink-2); text-decoration:none; border-bottom:2px solid transparent; margin-bottom:-1.5px; }
.manage-tabs a:hover { color:var(--ink); }
.manage-tabs a.active { color:var(--accent-700); border-bottom-color:var(--accent); }
.banner-err { background:#FDECEC; color:#C53030; border:1px solid #F5C6C6; border-radius:var(--r-md); padding:10px 14px; font-size:13.5px; font-weight:600; margin:0 0 16px; }

/* invoice line-item grid — compact cells so small numeric inputs stay legible
   (default .inp padding left 0px of content in the 74px Qty column) */
#lineTbl td { padding: 8px 6px; }
#lineTbl .inp { padding: 8px 8px; }
#lineTbl input[name="qty[]"] { text-align: center; padding: 8px 4px; }
#lineTbl input[type=number]::-webkit-outer-spin-button,
#lineTbl input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#lineTbl input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.floor-hint { font-size: 11px; font-weight: 600; color: var(--danger); margin-top: 3px; white-space: nowrap; }

/* session popup — read-only appointment details */
.sess-info { border: 1px solid var(--border); border-radius: var(--r-md); padding: 2px 14px; margin: 14px 0 16px; }
.sess-info .between { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.sess-info .between:last-child { border-bottom: none; }

/* flash messages (session-based, one-shot) */
.flash { border-radius:var(--r-md); padding:11px 15px; font-size:13.5px; font-weight:600; margin:0 0 16px; }
.flash-ok  { background:#E7F8EF; color:#0B8043; border:1px solid #BBE9CF; }
.flash-err { background:#FDECEC; color:#C53030; border:1px solid #F5C6C6; }

/* ---------- home hub (compact launcher tiles) ---------- */
.section-label { font-size:11.5px; font-weight:700; letter-spacing:.08em; color:var(--ink-3); margin: 14px 0 10px; }
.hub-grid { display:grid; grid-template-columns: repeat(2,1fr); gap:13px; }
@media (min-width:1080px){ .hub-grid { grid-template-columns: repeat(4,1fr); } }
/* fill variant — comfortable medium cards, full width (not floor-to-ceiling) */
.hub-grid.fill { gap:16px; }
.hub-grid.fill .hub-tile { min-height:248px; padding:20px 22px; }
/* roomy home: tiles grow with the viewport but cap at a comfortable
   height (clamp), footers pinned to each tile's base */
.wrap.roomy .hub-grid.fill { grid-auto-rows: clamp(248px, calc((100vh - 250px) / 2), 300px); }
.wrap.roomy .hub-grid.fill .hub-tile { min-height: 0; }
.wrap.roomy .hub-grid.fill .hub-tile .foot { margin-top: auto; }
.hub-grid.fill .ico { width:42px; height:42px; border-radius:12px; }
.hub-grid.fill .ico svg { width:22px; height:22px; }
.hub-grid.fill .cat { margin-top:14px; }
.hub-grid.fill h3 { font-size:18px; margin:4px 0 6px; }
.hub-grid.fill p { font-size:13px; -webkit-line-clamp:2; }
.hub-tile {
  display:flex; flex-direction:column;
  background:var(--surface); border:1px solid var(--border); border-radius:15px;
  padding:15px 16px; box-shadow:var(--shadow-sm); transition:transform .12s ease, box-shadow .12s ease;
}
.hub-tile:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); }
.hub-tile .ico { width:36px; height:36px; border-radius:10px; background:var(--navy); color:#fff; display:grid; place-items:center; }
.hub-tile .ico svg { width:20px; height:20px; }
.hub-tile .ico.gold { background:var(--gold); }
.hub-tile .cat { margin-top:12px; font-size:10.5px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:var(--ink-3); }
.hub-tile h3 { margin:3px 0 4px; font-size:16.5px; letter-spacing:-.01em; }
.hub-tile p { margin:0; color:var(--ink-2); font-size:12px; line-height:1.4;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:33px; }
.hub-tile .foot { margin-top:12px; padding-top:10px; border-top:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.hub-tile .foot .stat { font-size:12px; color:var(--ink-3); }
.hub-tile .foot .stat b { color:var(--ink); }
.hub-tile .foot .open { font-size:12.5px; font-weight:600; color:var(--gold-700); }
.hub-tile.soon { opacity:.72; }
.hub-tile.soon .ico { background:var(--surface-2); color:var(--ink-3); }
.hub-tile.soon .foot .open { color:var(--ink-3); }

/* ---------- modals + forms ---------- */
.modal-overlay { position:fixed; inset:0; background:rgba(11,29,58,.45); display:none; align-items:flex-start; justify-content:center; z-index:100; padding:56px 16px; overflow-y:auto; }
.modal-overlay.open { display:flex; }
.modal { background:var(--surface); border-radius:var(--r-lg); width:100%; max-width:460px; box-shadow:0 24px 64px rgba(11,29,58,.32); overflow:hidden; }
.modal-head { padding:17px 20px; border-bottom:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; }
.modal-head h3 { margin:0; font-size:17px; }
.modal-body { padding:18px 20px; }
.modal-foot { padding:14px 20px; border-top:1px solid var(--border); display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
.modal-x { cursor:pointer; color:var(--ink-3); font-size:22px; line-height:1; background:none; border:none; padding:0; }
.modal-x:hover { color:var(--ink); }
.field { margin-bottom:13px; }
.field label { display:block; font-size:12px; font-weight:600; color:var(--ink-2); margin-bottom:5px; }
.inp { width:100%; font-family:var(--font); font-size:14px; padding:9px 12px; border:1px solid var(--border); border-radius:var(--r-sm); background:var(--surface); color:var(--ink); }
.inp:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--gold-50); }
.row2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.reset-btn { background:none; border:1px solid var(--border); color:var(--ink-3); font-size:12.5px; font-weight:600; padding:6px 12px; border-radius:var(--r-pill); cursor:pointer; font-family:var(--font); }
.reset-btn:hover { color:var(--danger); border-color:var(--danger); }

/* invoice A4 sheet */
.a4-wrap { display:flex; justify-content:center; }
.a4 { width:210mm; min-height:297mm; background:#fff; box-shadow:var(--shadow-md);
  border:1px solid var(--border); border-radius:6px; padding:18mm 16mm;
  display:flex; flex-direction:column; }
.a4 table.tbl th { font-size:10.5px; padding:8px 12px; white-space:nowrap; }
.a4 table.tbl td { font-size:12.5px; padding:8px 12px; white-space:nowrap; }
.a4 .sig { margin-top:auto; padding-top:96px; }
.a4 .sig-line { border-top:1px solid var(--ink-3); width:260px; }

@media print {
  .nav, .draft-banner, .noprint, .fab { display:none !important; }
  body { background:#fff; }
  .wrap, .wrap.wide { max-width:none !important; padding:0 !important; margin:0 !important; }
  .a4-wrap { display:block; }
  /* full-page min-height keeps the flex layout identical to screen — the
     signature stays pinned to the page bottom (296mm: 1mm safety vs a
     blank second page); very long invoices still flow to page 2 */
  .a4 { width:auto; min-height:296mm; box-shadow:none; border:none; border-radius:0; padding:18mm 16mm; margin:0; transform:none !important; }
  .a4-wrap { height:auto !important; }
  @page { size:A4; margin:0; }
}

/* user chip (nav) */
.user-chip { display:flex; align-items:center; gap:8px; flex:none; }
.user-chip .user-meta { display:flex; flex-direction:column; line-height:1.15; }
.user-chip .user-meta b { font-size:13px; } .user-chip .user-meta .muted { font-size:11px; }
.user-chip .logout { margin-left:6px; font-size:12.5px; font-weight:600; color:var(--ink-3); border:1px solid var(--border); padding:6px 11px; border-radius:var(--r-pill); }
.user-chip .logout:hover { color:var(--danger); border-color:var(--danger); }

/* auth screens */
.auth-wrap { min-height:100vh; display:grid; place-items:center; padding:24px; }
.auth-card { width:100%; max-width:380px; background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); box-shadow:var(--shadow-md); padding:30px 28px; }
.auth-card .brand { display:flex; justify-content:center; margin-bottom:6px; }
.auth-card .wordmark { font-weight:700; letter-spacing:.16em; color:var(--navy); font-size:22px; }
.auth-sub { text-align:center; color:var(--ink-3); font-size:13px; margin-bottom:22px; }
.auth-err { background:#FDECEC; color:#C53030; font-size:13px; padding:9px 12px; border-radius:var(--r-sm); margin-bottom:14px; display:none; }
.auth-foot { text-align:center; font-size:13px; color:var(--ink-3); margin-top:16px; }

/* editable treatment rows */
.treat-row { display:flex; align-items:center; gap:10px; padding:10px 16px; border-top:1px solid var(--border); }
.treat-row:first-child { border-top:none; }
.treat-head { font-size:11.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--ink-3); padding:11px 16px; }
.treat-edit { display:flex; align-items:center; gap:10px; flex:1; }
.treat-edit .inp { padding:7px 10px; font-size:13.5px; }
.swatch { width:14px; height:14px; border-radius:4px; flex:none; }

/* floating Brain button */
.fab { position:fixed; right:24px; bottom:24px; width:54px; height:54px; border-radius:50%;
  background:var(--navy); color:#fff; display:grid; place-items:center; font-size:22px;
  box-shadow:var(--shadow-md); z-index:60; transition:transform .12s ease, background .12s ease; }
.fab:hover { transform:scale(1.06); background:var(--navy-600); }

/* appointment book — week view */
.wk-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:10px; }
.wk-col { background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md); overflow:hidden; box-shadow:var(--shadow-sm); min-height:200px; }
.wk-head { padding:9px 10px; font-size:12.5px; font-weight:600; border-bottom:1px solid var(--border); background:var(--surface-2); text-align:center; }
.wk-head.today { background:var(--navy); } .wk-head.today a { color:#fff; }
.wk-body { padding:6px; display:flex; flex-direction:column; gap:6px; }
.wk-appt { background:var(--surface-2); border-radius:7px; padding:6px 8px; cursor:pointer; }
.wk-appt:hover { background:var(--accent-50); }

/* appointment book — month view */
.mo-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:8px; margin-bottom:8px; }
.mo-dow { margin-bottom:6px; }
.mo-dow-cell { font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--ink-3); text-align:center; }
.mo-cell { background:var(--surface); border:1px solid var(--border); border-radius:var(--r-sm); min-height:84px; padding:8px; box-shadow:var(--shadow-sm); display:flex; flex-direction:column; gap:6px; transition:transform .1s; }
.mo-cell:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); }
.mo-cell.dim { opacity:.4; } .mo-cell.today { border-color:var(--navy); border-width:2px; }
.mo-date { font-size:13px; font-weight:600; }
.mo-count { font-size:11.5px; font-weight:600; color:var(--gold-700); background:var(--gold-50); border-radius:var(--r-pill); padding:2px 8px; align-self:flex-start; }

/* ── financial statements (Accounts A3) ─────────────────────────────────── */
.stmt { width:100%; border-collapse:collapse; }
.stmt td { padding:7px 20px; font-size:14px; }
.stmt .num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.stmt .ln td { padding-left:34px; color:var(--ink-2); }
.stmt tr.sec td { padding-top:18px; padding-bottom:2px; color:var(--ink-3); font-size:11.5px;
  font-weight:700; text-transform:uppercase; letter-spacing:.05em; }
.stmt tr.tot td { border-top:1px solid var(--border); font-weight:600; }
.stmt tr.big td { border-top:2px solid var(--ink); font-size:15px; font-weight:700; }
.stmt tr.net td { border-top:2px solid var(--gold); border-bottom:3px double var(--gold);
  font-size:16px; font-weight:700; }
.stmt .neg { color:var(--danger); }
.stmt-note { color:var(--ink-3); font-size:12.5px; margin:10px 2px 0; }
@media print {
  .nav, .page-head .flex, .btn, .flash { display:none !important; }
  .wrap { max-width:100% !important; }
  .card { box-shadow:none !important; border:none !important; }
  .page-head { margin-bottom:8px; }
}
