/* Brightwork Dental Command Center (concept). Built by Summit Oak AI.
   Light theme from the concept site: teal #2E9DA8 family, Fraunces + Inter. */

:root {
  /* Light theme matched to the Brightwork Dental concept site (portfolio/brightwork-dental/css/style.css) */
  --bg: #F5FAFB;            /* site --bg-2 (page off-white) */
  --bg-2: #F5FAFB;          /* sunken panels inside white cards */
  --mint: #EAF6F6;          /* site --mint */
  --surface: #FFFFFF;       /* site --bg */
  --surface-2: #F5FAFB;
  --line: rgba(46, 157, 168, 0.18);   /* site --hairline */
  --line-2: rgba(46, 157, 168, 0.30);
  --text: #1F3A44;          /* site --text */
  --text-2: #4B5F66;        /* between site --text and --text-dim */
  --text-3: #5E7178;        /* site --text-dim (5.1:1 on white) */
  --teal: #2E9DA8;          /* site --primary (fills, icons, rules) */
  --teal-deep: #237B84;     /* site --primary-deep (buttons, accent text, 5:1) */
  --teal-soft: #237B84;     /* accent text on light */
  --teal-wash: rgba(46, 157, 168, 0.10);
  --ok: #1E7A4C;
  --warn: #8A5A00;
  --bad: #B23B2A;
  --shadow: 0 18px 40px -28px rgba(31, 58, 68, 0.35); /* site card shadow */
  --radius: 18px;           /* site --radius */
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --head: "Fraunces", Georgia, serif;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --topbar-h: 60px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 85% -10%, rgba(46, 157, 168, 0.08), transparent 60%);
  color: var(--text);
  font-family: var(--ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
}
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
svg { display: block; }
.num { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--teal-soft); outline-offset: 2px; border-radius: 8px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--surface-2); padding: 8px 12px; border-radius: 8px; color: var(--text); }
.skip:focus { left: 12px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.brand-word { font-family: var(--head); font-weight: 400; font-size: 19px; letter-spacing: -0.01em; white-space: nowrap; }
.brand-word span { color: var(--teal-soft); }
.brand-sep { width: 1px; height: 18px; background: var(--line-2); }
.brand-app { color: var(--text-2); font-weight: 500; font-size: 13px; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 14px; flex: none; }
.today { color: var(--text-2); font-size: 13px; white-space: nowrap; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(30, 122, 76, 0.6); animation: pulse 2.2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(30, 122, 76, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(30, 122, 76, 0); }
  100% { box-shadow: 0 0 0 0 rgba(30, 122, 76, 0); }
}
.pill-concept { font-size: 11.5px; font-weight: 500; color: var(--text-2); padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 999px; white-space: nowrap; }

/* ---------- Shell ---------- */
.shell { flex: 1; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidenav {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
}
.nav-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px;
  background: none; border: 0; border-radius: 10px;
  color: var(--text-2); font-weight: 500; text-align: left; cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.nav-btn svg, .tab-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav-btn:hover { background: rgba(31, 58, 68, 0.04); color: var(--text); }
.nav-btn[aria-current="page"] { background: var(--teal-wash); color: var(--text); }
.nav-btn[aria-current="page"] svg { color: var(--teal-soft); }
.sidenav-foot { margin-top: auto; display: grid; gap: 12px; padding: 12px; font-size: 12px; color: var(--text-3); }
.sync { display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-top: 6px; flex: none; }
.built strong { color: var(--text-2); font-weight: 500; }

.main { padding: 28px 32px 48px; min-width: 0; outline: none; }
.view { animation: viewIn 0.45s var(--ease); }
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; margin-bottom: 22px; }
.eyebrow { font-size: 12px; font-weight: 500; color: var(--teal-soft); letter-spacing: 0.02em; margin-bottom: 6px; }
h1 { font-family: var(--head); font-weight: 300; font-size: clamp(28px, 3vw, 36px); letter-spacing: -0.015em; line-height: 1.1; }
.view-sub { color: var(--text-2); max-width: 46ch; }
.muted { color: var(--text-3); font-size: 12.5px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head h2 { font-size: 14px; font-weight: 600; letter-spacing: -0.005em; }
.card-head--sub { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); margin-bottom: 8px; }
.link-btn { background: none; border: 0; color: var(--teal-soft); font-size: 12.5px; font-weight: 500; cursor: pointer; padding: 4px 2px; }
.link-btn:hover { text-decoration: underline; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  display: flex; flex-direction: column; gap: 6px;
  text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 16px 14px; min-width: 0;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.kpi:hover { border-color: var(--line-2); transform: translateY(-1px); }
.kpi-label { font-size: 12px; color: var(--text-2); font-weight: 500; line-height: 1.3; min-height: 2.6em; }
.kpi .spark { margin-bottom: 3px; }
.kpi-val { font-family: var(--head); font-weight: 400; font-size: 32px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums lining-nums; }
.kpi-val small { font-family: var(--ui); font-size: 14px; color: var(--text-3); margin-left: 2px; letter-spacing: 0; }
.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 2px; }
.kpi-note { font-size: 11.5px; color: var(--text-3); line-height: 1.3; }
.spark { width: 64px; height: 24px; flex: none; }
.spark path.l { fill: none; stroke: var(--teal-soft); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.spark path.a { fill: url(#sparkFill); stroke: none; }

.flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0% { background-color: rgba(46, 157, 168, 0.16); } 100% { background-color: transparent; } }
.kpi.flash { animation: kpiFlash 1.6s var(--ease); }
@keyframes kpiFlash { 0% { border-color: rgba(46, 157, 168, 0.6); box-shadow: 0 0 0 3px rgba(46, 157, 168, 0.08); } 100% { border-color: var(--line); box-shadow: none; } }

/* ---------- Overview grid ---------- */
.ov-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
.util-chart { display: grid; gap: 10px; }
.util-row { display: grid; grid-template-columns: 128px minmax(0, 1fr) 44px; align-items: center; gap: 12px; font-size: 12.5px; }
.util-row .who { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.util-row .who b { color: var(--text); font-weight: 500; }
.util-track { display: block; height: 8px; border-radius: 99px; background: rgba(31, 58, 68, 0.05); overflow: hidden; }
.util-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--teal), var(--teal-soft)); transition: width 0.8s var(--ease); }
.util-row .pct { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }

.upnext li + li { border-top: 1px solid var(--line); }
.row-btn {
  width: 100%; display: grid; grid-template-columns: 62px 10px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 11px 6px; background: none; border: 0; border-radius: 8px; text-align: left; cursor: pointer;
}
.row-btn:hover { background: rgba(31, 58, 68, 0.03); }
.row-btn .t { color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 12.5px; white-space: nowrap; }
.row-btn .dot { width: 8px; height: 8px; border-radius: 50%; }
.row-btn .main-t { min-width: 0; }
.row-btn .main-t b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-btn .main-t span { color: var(--text-3); font-size: 12px; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; padding: 3px 9px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { color: var(--ok); background: rgba(30, 122, 76, 0.09); }
.chip.warn { color: var(--warn); background: rgba(196, 132, 20, 0.12); }
.chip.bad { color: var(--bad); background: rgba(178, 59, 42, 0.1); }
.chip.info { color: var(--teal-soft); background: var(--teal-wash); }
.chip.dim { color: var(--text-3); background: rgba(31, 58, 68, 0.05); }

.feed-card { display: flex; flex-direction: column; }
.feed { display: grid; gap: 2px; max-height: 560px; overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.feed li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 10px 8px; border-radius: 10px; }
.feed .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(31, 58, 68, 0.04); color: var(--text-2); }
.feed .ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.feed .ic.teal { color: var(--teal-soft); background: var(--teal-wash); }
.feed p { color: var(--text); font-size: 13px; line-height: 1.45; }
.feed time { display: block; color: var(--text-3); font-size: 11.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.feed li.new { animation: feedIn 0.6s var(--ease), flash 2s var(--ease); }
@keyframes feedIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Schedule ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend .gap-key { width: 14px; height: 10px; border: 1px dashed var(--teal-soft); background: transparent; }
.sched-card { padding: 0; overflow: hidden; }
.sched-scroll { overflow-x: auto; }
.sched { --hour: 76px; display: grid; grid-template-columns: 58px repeat(5, minmax(132px, 1fr)); min-width: 760px; }
.sched-colhead { position: relative; padding: 14px 12px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.sched-colhead b { display: block; font-weight: 600; font-size: 13px; }
.sched-colhead span { color: var(--text-3); font-size: 12px; }
.sched-corner { border-bottom: 1px solid var(--line); }
.sched-times { position: relative; }
.sched-times div { height: var(--hour); padding: 0 8px; font-size: 11px; color: var(--text-3); text-align: right; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.sched-times div:first-child { transform: translateY(4px); }
.sched-col { position: relative; border-left: 1px solid var(--line); height: calc(var(--hour) * 9);
  background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% var(--hour); }
.lunch { position: absolute; left: 0; right: 0; display: grid; place-items: center; font-size: 11px; color: var(--text-3);
  background: repeating-linear-gradient(135deg, rgba(31, 58, 68, 0.025) 0 6px, transparent 6px 12px); }
.appt {
  position: absolute; left: 5px; right: 5px;
  display: flex; flex-direction: column; justify-content: flex-start; gap: 1px;
  padding: 6px 9px; border-radius: 9px; border: 0; cursor: pointer; text-align: left; overflow: hidden;
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
  box-shadow: inset 3px 0 0 var(--c);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.appt:hover { background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.appt b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt span { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .st { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; }
.appt .st.unconfirmed { background: var(--warn); }
.appt .st.confirmed { background: var(--ok); }
.appt .st.inchair { background: var(--teal-soft); box-shadow: 0 0 0 3px rgba(46, 157, 168, 0.2); }
.appt.done { opacity: 0.55; }
.appt.short { flex-direction: row; align-items: center; gap: 6px; padding-top: 4px; padding-bottom: 4px; }
.gap {
  position: absolute; left: 5px; right: 5px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px;
  border: 1px dashed rgba(46, 157, 168, 0.55); border-radius: 9px; background: rgba(46, 157, 168, 0.05);
  color: var(--teal-soft); cursor: pointer; font-size: 12px; font-weight: 500;
  transition: background 0.2s var(--ease);
}
.gap:hover { background: rgba(46, 157, 168, 0.12); }
.gap span { color: var(--text-2); font-weight: 400; font-size: 11px; }
.gap.short { flex-direction: row; gap: 6px; }
.nowline { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px solid var(--bad); z-index: 3; pointer-events: none; }
.nowline::before { content: ""; position: absolute; left: -4px; top: -4.5px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.nowtag { position: absolute; right: 6px; top: -9px; font-size: 10px; color: var(--bad); font-weight: 600; z-index: 3; pointer-events: none; font-variant-numeric: tabular-nums; }

/* ---------- Pipeline ---------- */
.pipe-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat-val { font-family: var(--head); font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums lining-nums; }
.stat-val small { font-family: var(--ui); font-size: 13px; color: var(--text-3); margin-left: 3px; }
.stat-label { color: var(--text-2); font-size: 12px; margin-top: 4px; }
.board-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px 6px; scroll-snap-type: x proximity; }
.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; min-width: 1060px; }
.col { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; scroll-snap-align: start; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; }
.col-head h3 { font-size: 13px; font-weight: 600; }
.col-head .n { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.col-bar { height: 3px; border-radius: 3px; background: rgba(31, 58, 68, 0.06); margin: 0 4px 12px; overflow: hidden; }
.col-bar i { display: block; height: 100%; background: var(--teal-soft); opacity: 0.8; }
.col-list { display: grid; gap: 8px; }
.pcard { width: 100%; text-align: left; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 6px; transition: border-color 0.2s var(--ease), transform 0.2s var(--ease); }
.pcard:hover { border-color: var(--line-2); transform: translateY(-1px); }
.pcard b { font-weight: 600; font-size: 13px; }
.pcard .int { color: var(--text-2); font-size: 12.5px; }
.pcard .meta { display: flex; justify-content: space-between; gap: 8px; color: var(--text-3); font-size: 11.5px; }

/* ---------- Recall ---------- */
.recall-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; margin-bottom: 16px; }
.recall-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.recall-stats .stat { display: flex; flex-direction: column; justify-content: space-between; }
.bars { width: 100%; height: 150px; overflow: visible; }
.bars rect.b { fill: rgba(46, 157, 168, 0.28); }
.bars rect.b.cur { fill: var(--teal-soft); }
.bars text { fill: var(--text-3); font-size: 10.5px; font-family: var(--ui); }
.bars text.v { fill: var(--text-2); }
.bars line { stroke: var(--line); }
.seq-key { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: var(--text-3); }
.recall-list { display: grid; }
.rrow {
  width: 100%; display: grid; grid-template-columns: minmax(130px, 1.2fr) minmax(110px, 1fr) minmax(150px, 1.3fr) minmax(130px, 1fr);
  align-items: center; gap: 12px; padding: 12px 8px; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; cursor: pointer; border-radius: 0;
}
.rrow:first-child { border-top: 0; }
.rrow:hover { background: rgba(31, 58, 68, 0.025); }
.rrow b { font-weight: 500; display: block; }
.rrow .sub { color: var(--text-3); font-size: 12px; }
.steps { display: flex; align-items: center; gap: 5px; }
.steps i { width: 26px; height: 6px; border-radius: 3px; background: rgba(31, 58, 68, 0.08); }
.steps i.on { background: var(--teal-soft); }
.steps i.booked { background: var(--ok); }
.steps em { font-style: normal; font-size: 11.5px; color: var(--text-3); margin-left: 6px; white-space: nowrap; }
.rrow .end { justify-self: end; }

/* ---------- Drawer ---------- */
.drawer {
  margin: 0 0 0 auto; height: 100%; max-height: 100%; width: min(440px, 100%); max-width: 100%;
  padding: 0; border: 0; border-left: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text);
}
.drawer[open] { animation: drawerIn 0.35s var(--ease); }
@keyframes drawerIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer::backdrop { background: rgba(31, 58, 68, 0.28); }
.drawer-inner { display: flex; flex-direction: column; height: 100%; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-family: var(--head); font-weight: 400; font-size: 24px; letter-spacing: -0.01em; line-height: 1.15; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; flex: none; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-btn:hover { background: var(--surface-2); }
.drawer-body { padding: 18px 22px 28px; overflow-y: auto; display: grid; gap: 18px; align-content: start; }
.dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 9px 14px; font-size: 13px; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; }
.d-sec h3 { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: 0.02em; margin-bottom: 10px; }
.timeline { display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--teal-soft); }
.timeline li::after { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline li.pending::before { background: transparent; border: 1px solid var(--text-3); }
.timeline small { display: block; color: var(--text-3); font-size: 11.5px; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text-2); font-size: 13px; }
.match { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.match + .match { margin-top: 8px; }
.match b { display: block; font-weight: 500; }
.match span { color: var(--text-3); font-size: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 0; background: var(--teal-deep); color: #fff; font-weight: 600; font-size: 13px; cursor: pointer; transition: background 0.2s var(--ease); }
.btn:hover { background: #1D6A72; }
.btn.ghost { background: transparent; border: 1px solid var(--line-2); color: var(--text); }

/* ---------- Mobile tab bar ---------- */
.tabbar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .ov-grid, .recall-top { grid-template-columns: minmax(0, 1fr); }
  .shell { grid-template-columns: 76px minmax(0, 1fr); }
  .nav-btn { justify-content: center; padding: 12px; }
  .nav-btn span, .sidenav-foot { display: none; }
  .main { padding: 24px 22px 40px; }
}
@media (max-width: 900px) {
  .today { display: none; }
  .pipe-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidenav { display: none; }
  .main { padding: 20px 16px 28px; }
  .topbar { padding: 0 16px; }
  .brand-sep, .brand-app { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: sticky; bottom: 0; z-index: 20;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .tab-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; background: none; border: 0; border-radius: 10px; color: var(--text-3); font-size: 11px; font-weight: 500; cursor: pointer; }
  .tab-btn[aria-current="page"] { color: var(--text); }
  .tab-btn[aria-current="page"] svg { color: var(--teal-soft); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-val { font-size: 28px; }
  .card { padding: 16px; }
  .util-row { grid-template-columns: 96px minmax(0, 1fr) 40px; }
  .row-btn { grid-template-columns: 58px 8px minmax(0, 1fr) auto; gap: 10px; padding: 11px 2px; }
  .row-btn .t { font-size: 12px; }
  .rrow { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .rrow .c-due { display: none; }
  .rrow .c-steps { grid-column: 1 / -1; grid-row: 2; }
  .rrow .end { grid-column: 2; grid-row: 1; }
  .seq-key { display: none; }
}
@media (max-width: 420px) {
  .pill-concept { font-size: 10.5px; padding: 4px 8px; }
  .brand-word { font-size: 17px; }
  .topbar-right { gap: 10px; }
  .live { font-size: 0; gap: 0; }
  .recall-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl { grid-template-columns: 100px minmax(0, 1fr); }
}
@media (max-width: 360px) {
  .brand-word span { display: none; }
}


/* ---------- Round 2: sources, badge ---------- */
.nav-btn, .tab-btn { position: relative; }
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--teal-deep); color: #fff; font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.badge[hidden] { display: none; }
.tab-btn .badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.side-src p { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.side-src ul { display: grid; gap: 6px; }
.side-src li { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.side-src li .sync-dot { margin-top: 0; }
.side-src li em { margin-left: auto; font-style: normal; color: var(--text-3); font-variant-numeric: tabular-nums; }
.src-card { margin-bottom: 16px; padding: 16px 20px; }
.src-card .card-head { margin-bottom: 10px; }
.sources { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.src { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 4px 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.src-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-top: 6px; box-shadow: 0 0 0 3px rgba(30, 122, 76, 0.12); }
.src-main b { display: block; font-weight: 600; font-size: 13px; }
.src-main span { display: block; color: var(--text-3); font-size: 11.5px; line-height: 1.35; }
.src-sync { grid-column: 2; color: var(--teal-soft); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* ---------- Financials ---------- */
.fin-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.fin-stat { display: flex; flex-direction: column; gap: 6px; }
.fin-stat .stat-label { margin: 0; min-height: 2.6em; font-weight: 500; }
.fin-stat .stat-val { font-size: 26px; }
.fin-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.fin-block { margin-bottom: 16px; }
.pc { width: 100%; height: 190px; overflow: visible; }
.pc line { stroke: var(--line); }
.pc text { fill: var(--text-3); font-size: 10.5px; font-family: var(--ui); }
.pc rect.prod { fill: rgba(46, 157, 168, 0.22); }
.pc path.coll { fill: none; stroke: var(--teal-soft); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pc .coll-dot { fill: var(--bg-2); stroke: var(--teal-soft); stroke-width: 2; }
.pc-key { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.pc-key span { display: inline-flex; align-items: center; gap: 6px; }
.pc-key i { width: 10px; height: 10px; border-radius: 3px; }
.k-prod { background: rgba(46, 157, 168, 0.3); }
.k-coll { background: transparent; border: 2px solid var(--teal-soft); border-radius: 50% !important; }
.util-chart.svc .util-row { grid-template-columns: 150px minmax(0, 1fr) 70px; }
.svc-total { display: flex; justify-content: space-between; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; }
.svc-total b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.amt { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.aging { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.age-col { display: grid; gap: 6px; align-content: start; }
.age-head { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); margin-bottom: 2px; }
.age-head span { color: var(--text-2); font-size: 12px; }
.age-head b { font-family: var(--head); font-weight: 400; font-size: 20px; grid-row: span 2; align-self: center; font-variant-numeric: tabular-nums lining-nums; }
.age-head em { font-style: normal; color: var(--text-3); font-size: 11.5px; }
.age-col.late .age-head { border-color: rgba(178, 59, 42, 0.35); }
.age-col.late .age-head b { color: var(--bad); }
.inv, .crow, .erow { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; background: none; border: 0; border-radius: 10px; text-align: left; cursor: pointer; }
.inv:hover, .crow:hover, .erow:hover { background: rgba(31, 58, 68, 0.035); }
.inv > span:first-child, .crow > span:first-child, .erow > span:first-child { min-width: 0; flex: 1; }
.inv b, .crow b, .erow b { display: block; font-weight: 500; font-size: 13px; }
.inv span span, .crow span span, .erow span span { display: block; color: var(--text-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.inv .chip { font-size: 10.5px; padding: 1px 7px; }
.claims, .expenses { display: grid; }
.crow, .erow { border-top: 1px solid var(--line); border-radius: 0; padding: 11px 6px; }
.claims .crow:first-child, .expenses .erow:first-child { border-top: 0; }
.crow { display: grid; grid-template-columns: minmax(0, 1fr) 70px 190px 70px; }
.crow .chip { justify-self: start; }
.crow .c-days { color: var(--text-2); font-size: 12.5px; }
.crow .amt { justify-self: end; }
.erow { display: grid; grid-template-columns: minmax(0, 1fr) auto 84px; }
.erow .amt { justify-self: end; }
.rec-track { height: 6px; border-radius: 6px; background: rgba(31, 58, 68, 0.06); overflow: hidden; margin: -4px 0 10px; }
.rec-track span { display: block; height: 100%; background: var(--ok); border-radius: 6px; transition: width 0.8s var(--ease); }
#recSummary b { color: var(--text); font-weight: 600; }
.jobs { display: grid; }
.jrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.jrow:first-child { border-top: 0; padding-top: 0; }
.jrow b { display: block; font-weight: 500; font-size: 13px; }
.jrow > span:first-child span { color: var(--text-3); font-size: 11.5px; }
.j-fig { color: var(--text-2); font-variant-numeric: tabular-nums; }
.jrow > span:first-child { grid-row: span 2; }
.j-m { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 40px; align-items: center; gap: 10px; }
.j-m b { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Inbox ---------- */
.inbox-card { padding: 6px; }
.inbox { display: grid; }
.conv { width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; cursor: pointer; border-radius: 0; }
.conv:first-child { border-top: 0; }
.conv:hover { background: rgba(31, 58, 68, 0.03); }
.conv.unread { background: rgba(46, 157, 168, 0.06); }
.ch { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(31, 58, 68, 0.05); color: var(--text-2); }
.ch svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.conv.unread .ch { color: var(--teal-soft); background: var(--teal-wash); }
.conv-main { min-width: 0; display: grid; gap: 3px; }
.conv-top { display: flex; align-items: center; gap: 8px; }
.conv-top b { font-weight: 500; }
.conv.unread .conv-top b { font-weight: 700; }
.tag { font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 6px; }
.conv-top time { margin-left: auto; color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.conv-last { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.unread .conv-last { color: var(--text); }
.conv-link { color: var(--text-3); font-size: 11.5px; }
.conv-end { display: flex; align-items: center; gap: 8px; padding-top: 2px; }
.udot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-soft); }
.thread { display: grid; gap: 10px; }
.msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.msg p { line-height: 1.45; }
.msg small { display: block; margin-top: 4px; color: var(--text-3); font-size: 11px; }
.msg.us, .msg.auto { justify-self: end; background: rgba(46, 157, 168, 0.14); border-color: rgba(46, 157, 168, 0.2); }
.msg.auto { background: rgba(31, 58, 68, 0.04); border-style: dashed; border-color: var(--line-2); }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn[disabled] { opacity: 0.45; cursor: default; }

@media (max-width: 1280px) {
  .fin-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sources { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .fin-grid { grid-template-columns: minmax(0, 1fr); }
  .aging { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-btn .badge { position: absolute; top: 4px; right: 8px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  .crow { grid-template-columns: minmax(0, 1fr) auto 70px; }
  .crow .c-days { display: none; }
}
@media (max-width: 768px) {
  .tabbar { grid-template-columns: repeat(6, 1fr); padding-left: 2px; padding-right: 2px; }
  .tab-btn { font-size: 10.5px; padding: 7px 0; }
  .fin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .fin-stat .stat-val { font-size: 22px; }
  .sources { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .src { grid-template-columns: 8px minmax(0, 1fr) auto; padding: 9px 12px; }
  .src-sync { grid-column: 3; grid-row: 1; white-space: nowrap; }
  .aging { grid-template-columns: minmax(0, 1fr); }
  .util-chart.svc .util-row { grid-template-columns: 112px minmax(0, 1fr) 62px; }
  .crow { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .crow .chip { grid-column: 1; grid-row: 2; }
  .crow .amt { grid-column: 2; grid-row: 1 / span 2; }
  .erow { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .erow .chip { grid-column: 1; grid-row: 2; justify-self: start; }
  .erow .amt { grid-column: 2; grid-row: 1 / span 2; }
  .conv { grid-template-columns: 30px minmax(0, 1fr); padding: 12px 10px; gap: 10px; }
  .ch { width: 30px; height: 30px; }
  .conv-end { grid-column: 2; padding-top: 0; }
  .pc-key { gap: 10px; }
}


/* ---------- Round 3 ---------- */
.closed-note { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; background: rgba(196, 132, 20, 0.12); color: var(--warn); font-size: 12px; font-weight: 500; }
.closed-note::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.gap.gap-past { cursor: default; border-color: var(--line-2); background: transparent; color: var(--text-3); }
.gap.gap-past:hover { background: transparent; }
.card-head > div .muted { display: block; margin-top: 2px; }
.carriers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.carrier { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.carrier b { display: block; font-weight: 500; font-size: 12.5px; }
.carrier span span { display: block; color: var(--text-3); font-size: 11.5px; }
.sub-h { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: 0.02em; margin: 0 0 4px; }
@media (max-width: 1280px) { .carriers { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 768px) { .carriers { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

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

/* ---------- Light theme surfaces (round 5), matched to the concept site ---------- */
body { background-image: radial-gradient(1100px 520px at 88% -12%, rgba(111, 203, 210, 0.22), transparent 62%); }
.topbar { box-shadow: 0 1px 0 var(--line); border-bottom: 0; }
.card, .kpi, .stat { box-shadow: var(--shadow); }
.kpi:hover, .pcard:hover { box-shadow: 0 22px 44px -26px rgba(31, 58, 68, 0.4); }
.sidenav { border-right-color: var(--line); background: rgba(255, 255, 255, 0.55); }
.nav-btn[aria-current="page"] { background: var(--mint); color: var(--text); }
.nav-btn[aria-current="page"] svg, .tab-btn[aria-current="page"] svg { color: var(--teal); }
.col { background: var(--mint); border-color: var(--line); }
.pcard { box-shadow: 0 10px 24px -20px rgba(31, 58, 68, 0.35); }
.chip.info { color: #1D6A72; background: rgba(46, 157, 168, 0.12); }
.chip.ok { background: rgba(30, 122, 76, 0.10); }
.chip.dim { color: var(--text-3); background: rgba(31, 58, 68, 0.06); }
.feed .ic.teal { color: #1D6A72; }
.drawer { background: var(--surface); border-left: 1px solid var(--line); box-shadow: -24px 0 60px -30px rgba(31, 58, 68, 0.35); }
.drawer-head { background: linear-gradient(180deg, #FFFFFF, var(--bg)); }
.icon-btn { background: var(--surface); border-color: var(--line-2); }
.icon-btn:hover { background: var(--mint); }
.note, .match { background: var(--bg); }
.msg { background: var(--surface); border-color: var(--line); }
.msg.us { background: var(--mint); border-color: var(--line-2); }
.msg.auto { background: var(--bg); }
.btn.ghost { color: var(--text); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--mint); }
.appt { background: color-mix(in srgb, var(--c) 12%, #FFFFFF); }
.appt:hover { background: color-mix(in srgb, var(--c) 20%, #FFFFFF); }
.appt span { color: var(--text-2); }
.appt.done { opacity: 0.6; }
.gap { background: rgba(46, 157, 168, 0.05); border-color: rgba(46, 157, 168, 0.55); }
.sched-card { background: var(--surface); }
.util-track, .rec-track { background: rgba(31, 58, 68, 0.07); }
.pc rect.prod { fill: rgba(46, 157, 168, 0.22); }
.pc path.coll { stroke: var(--teal-deep); }
.pc .coll-dot { fill: #FFFFFF; stroke: var(--teal-deep); }
.pc line, .bars line { stroke: rgba(31, 58, 68, 0.10); }
.pc text, .bars text { fill: var(--text-3); }
.bars text.v { fill: var(--text-2); }
.bars rect.b { fill: rgba(46, 157, 168, 0.28); }
.bars rect.b.cur { fill: var(--teal); }
.k-prod { background: rgba(46, 157, 168, 0.3); }
.k-coll { border-color: var(--teal-deep); }
.steps i { background: rgba(31, 58, 68, 0.10); }
.steps i.on { background: var(--teal); }
.steps i.booked { background: #2F9E62; }
.rec-track span { background: #2F9E62; }
.spark path.l { stroke: var(--teal); }
.conv.unread { background: rgba(46, 157, 168, 0.06); }
.conv.unread .ch { color: #1D6A72; background: var(--teal-wash); }
.udot { background: var(--teal); }
.tag { border-color: var(--line-2); color: var(--text-3); }
.age-col.late .age-head { border-color: rgba(178, 59, 42, 0.35); }
.closed-note { background: rgba(196, 132, 20, 0.12); color: var(--warn); }
.pill-concept { background: var(--surface); border-color: var(--line-2); color: var(--text-2); }
.src { background: var(--bg); }
.lunch { background: repeating-linear-gradient(135deg, rgba(31, 58, 68, 0.04) 0 6px, transparent 6px 12px); }
.badge { background: var(--teal-deep); }
:focus-visible { outline-color: var(--teal-deep); }
.tabbar { box-shadow: 0 -1px 0 var(--line); border-top: 0; }
