:root {
  --ink: #0b0b0c;
  --ink-2: #3f3f46;
  --muted: #71717a;
  --line: #e4e4e7;
  --line-soft: rgba(228, 228, 231, 0.7);
  --bg: #f4f3ef;
  --bg-soft: rgba(244, 243, 239, 0.72);
  --card: #ffffff;
  --accent: #e8a317;
  --accent-2: #8c8a2b;
  --accent-soft: #fbf1d9;
  --good: #3f7d3a;
  --bad: #b3261e;
  --s1: #0b0b0c;
  --s2: #e8a317;
  --s3: #8c8a2b;
  --s4: #6b7280;
  --s5: #c2410c;
  --s6: #1f6f78;
  --s7: #a16207;
  --s8: #9ca3af;
  --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --display: 'Archivo', 'Inter', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f4f4f5; --ink-2: #d4d4d8; --muted: #a1a1aa; --line: #3a3a40; --line-soft: rgba(58, 58, 64, 0.7);
    --bg: #0e0e10; --bg-soft: rgba(14, 14, 16, 0.72); --card: #232328; --accent-soft: #3a2f14;
    --s1: #f4f4f5; --s4: #a1a1aa; --s8: #52525b;
  }
}
:root[data-theme="dark"] {
  --ink: #f4f4f5; --ink-2: #d4d4d8; --muted: #a1a1aa; --line: #3a3a40; --line-soft: rgba(58, 58, 64, 0.7);
  --bg: #0e0e10; --bg-soft: rgba(14, 14, 16, 0.72); --card: #232328; --accent-soft: #3a2f14;
  --s1: #f4f4f5; --s4: #a1a1aa; --s8: #52525b;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
body { min-height: 100vh; display: flow-root; }
.boot { padding: 48px 16px; text-align: center; color: var(--muted); }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: #0b0b0c; color: #fff; padding: 12px 16px calc(10px) ; padding-top: max(12px, env(safe-area-inset-top)); }
.top-row { display: flex; align-items: center; gap: 12px; max-width: 1200px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.mark { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--accent); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 13px; letter-spacing: .5px; color: var(--accent); flex: none; }
.brand-name { font-family: var(--display); font-weight: 800; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 12px; color: #a1a1aa; }
.icon-btn { background: transparent; border: 1px solid #3f3f46; color: #fff; border-radius: 10px; padding: 7px 10px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.icon-btn:hover { border-color: var(--accent); }
.tabs { display: flex; gap: 4px; max-width: 1200px; margin: 10px auto 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { background: transparent; border: 0; color: #a1a1aa; padding: 8px 12px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--accent); color: #0b0b0c; }

/* Period bar */
.period { max-width: 1200px; margin: 0 auto; padding: 14px 16px 4px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.period select { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; min-width: 170px; }
.range { color: var(--muted); font-size: 13px; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--ink-2); }
.pill.live { background: #e5f2e3; color: var(--good); }

main { max-width: 1200px; margin: 0 auto; padding: 8px 16px 64px; }
h2 { font-family: var(--display); font-size: 18px; margin: 26px 0 10px; letter-spacing: .2px; }
h2 small { font-family: var(--font); font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 6px; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.kpi .l { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.kpi .v { font-family: var(--display); font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .n { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.hi { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.kpi.hi .l, .kpi.hi .n { color: var(--bg-soft); }
.kpi.gold { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi .v { font-size: 20px; } }

/* Cards & grids */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-width: 0; }
.card h3 { margin: 0 0 10px; font-size: 14px; font-weight: 700; }
.card .sub { color: var(--muted); font-size: 12px; margin: -6px 0 10px; }
.empty { color: var(--muted); font-size: 13px; padding: 18px 0; text-align: center; }

/* Tables */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; }
tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--ink); }
td.neg { color: var(--bad); }
td .tag { font-size: 11px; color: var(--muted); margin-left: 4px; }
/* Table cards: no side padding, so scrolled columns can't show to the left of the sticky name column. */
.card.tbl-wrap { padding-left: 0; padding-right: 0; }
.card.tbl-wrap > h3, .card.tbl-wrap > p { padding: 0 14px; }
.card.tbl-wrap th:first-child, .card.tbl-wrap td:first-child { padding-left: 14px; }
.card.tbl-wrap th:last-child, .card.tbl-wrap td:last-child { padding-right: 14px; }
th:first-child, td:first-child { z-index: 1; box-shadow: 1px 0 0 var(--line); }

/* Charts */
.chart { width: 100%; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .val { fill: var(--ink); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.donut-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; }
@media (max-width: 420px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } }
.hbar { display: grid; grid-template-columns: minmax(90px, 140px) 1fr auto; gap: 8px; align-items: center; font-size: 13px; margin: 6px 0; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 18px; background: var(--line-soft); border-radius: 5px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--ink); border-radius: 5px; }
.hbar.gold .fill { background: var(--accent); }
.hbar .num { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 48px; text-align: right; }

/* Barbers */
.barber { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.barber:last-child { border-bottom: 0; }
.barber .nm { font-weight: 700; }
.barber .rt { font-family: var(--display); font-weight: 800; font-size: 20px; }
.progress { grid-column: 1 / -1; height: 8px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); }
.barber .meta { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }

/* Forms */
.btn { background: var(--ink); color: var(--bg); border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 700; cursor: pointer; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: .5; cursor: default; }
.field { display: grid; gap: 6px; margin: 10px 0; }
.field label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.field input, .field textarea, .field select { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.note { font-size: 13px; color: var(--ink-2); background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.err { color: var(--bad); font-size: 13px; margin-top: 8px; }
.ok { color: var(--good); font-size: 13px; margin-top: 8px; }
.log { font-size: 12px; color: var(--muted); max-height: 260px; overflow: auto; }
.log div { padding: 4px 0; border-bottom: 1px dashed var(--line); word-break: break-word; }

/* Sign in */
.signin { max-width: 380px; margin: 10vh auto; padding: 0 16px; }
.signin .card { padding: 22px; }
.signin h1 { font-family: var(--display); font-size: 22px; margin: 12px 0 4px; }
.signin p { color: var(--muted); margin: 0 0 12px; }
.signin .mark { width: 54px; height: 54px; font-size: 18px; color: var(--accent); background: #0b0b0c; }

.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: s 0.8s linear infinite; vertical-align: -2px; }
@keyframes s { to { transform: rotate(360deg); } }
@media print {
  .top, .period .seg, .icon-btn { display: none !important; }
  body { background: #fff; }
}

.top-logo { width: 40px; height: 40px; border-radius: 50%; flex: none; display: block; }
.signin-logo { width: 88px; height: 88px; border-radius: 50%; display: block; }

/* ---------- Drive In theme (charcoal, beige, red; Jost + IBM Plex Sans like driveinbarbershop.com) ---------- */
body.theme-drivein {
  --accent: #c8102e; --accent-2: #7a0a1c; --accent-soft: #f6e3e5; --bg: #f3efe8; --bg-soft: rgba(243, 239, 232, 0.72);
  --s1: #2b2b2b; --s2: #c8102e; --s3: #7a0a1c; --s4: #8a8178; --s5: #d97706; --s6: #1f6f78; --s7: #a3a3a3; --s8: #d6cfc4;
  --font: 'IBM Plex Sans', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --display: 'Jost', 'IBM Plex Sans', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  body.theme-drivein:not([data-theme="light"]) { --bg: #121110; --bg-soft: rgba(18, 17, 16, 0.72); --card: #262421; --line: #3d3934; --line-soft: rgba(61, 57, 52, 0.7); --accent-soft: #3b1a1f; --accent: #e23b55; --s1: #f4f4f5; --s8: #4a4540; }
}
body.theme-drivein[data-theme="dark"] { --ink: #f4f4f5; --ink-2: #d4d4d8; --muted: #a8a29e; --bg: #121110; --bg-soft: rgba(18, 17, 16, 0.72); --card: #262421; --line: #3d3934; --line-soft: rgba(61, 57, 52, 0.7); --accent-soft: #3b1a1f; --accent: #e23b55; --s1: #f4f4f5; --s4: #a8a29e; --s8: #4a4540; }
body[data-theme="light"] { color-scheme: light; }
body[data-theme="dark"] { color-scheme: dark; }
body.theme-drivein .top { background: #2b2b2b; }
body.theme-drivein .tab[aria-selected="true"] { background: var(--accent); color: #fff; }
body.theme-drivein .top-logo { border-radius: 9px; }
body.theme-drivein .signin-logo { border-radius: 18px; }

/* Quota bar: red under 90%, amber 90–99%, green at or over quota. */
.qbar { height: 12px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.qbar > div { height: 100%; border-radius: 999px; }
.qbar.sm { height: 7px; min-width: 70px; }
.q-red { background: #c62828; } .q-amber { background: #e0a100; } .q-green { background: #2e7d32; } .q-none { background: var(--s4); }
.qtxt-red { color: #c62828; } .qtxt-amber { color: #a87700; } .qtxt-green { color: #2e7d32; }
.headline { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; }
@media (max-width: 760px) { .headline { grid-template-columns: 1fr; } }
.big { font-family: var(--display); font-size: 38px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.preview { background: var(--ink); color: var(--bg); border-radius: 10px; padding: 9px 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.preview button { background: transparent; color: inherit; border: 1px solid currentColor; border-radius: 8px; padding: 4px 10px; cursor: pointer; font-weight: 600; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 960px) { .grid3 { grid-template-columns: 1fr; } }
.rank { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rank li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.rank li:last-child { border-bottom: 0; }
.rank li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank li b { font-variant-numeric: tabular-nums; }
.cardhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.cardhead h3 { margin: 0; }
.imgbtn { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; font-size: 12px; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.imgbtn:hover { border-color: var(--accent); }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--accent-soft); }
th.sort { cursor: pointer; user-select: none; }
th.sort[aria-sort] { color: var(--ink); }
.wn td { padding: 6px 8px; }
.wn td.green { background: #dff1df; color: #1b5e20; } .wn td.orange { background: #fde7c8; color: #8a4b00; } .wn td.red { background: #f8d4d4; color: #8e1b1b; }
@media (prefers-color-scheme: dark) { body:not([data-theme="light"]) .wn td.green { background: #1d3a1f; color: #a5d6a7; } body:not([data-theme="light"]) .wn td.orange { background: #3d2a10; color: #ffcc80; } body:not([data-theme="light"]) .wn td.red { background: #3d1515; color: #ef9a9a; } }
.wn .p { display: block; font-size: 11px; color: var(--muted); }
.person { border-bottom: 1px solid var(--line); padding: 10px 0; }
.person:last-child { border-bottom: 0; }
.person summary { display: flex; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; align-items: center; }
.person summary::-webkit-details-marker { display: none; }
.person .who { font-weight: 700; }
.person .tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.formgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; margin-top: 6px; }
@media (max-width: 760px) { .formgrid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .formgrid { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-size: 14px; }
.bar { height: 8px; background: var(--line-soft); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.bar > div { height: 100%; background: var(--accent); transition: width .3s; }
.period .seg { flex-wrap: wrap; }


/* ---------- Look and feel review (Oct 2026) ---------- */
.avatar-btn { display: flex; align-items: center; gap: 8px; background: transparent; border: 1px solid #4a4a50; color: #fff; border-radius: 999px; padding: 4px 10px 4px 4px; cursor: pointer; font-size: 13px; min-height: 40px; }
.avatar-btn .av { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.usermenu { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-width: 230px; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 30; }
.menu-l { font-size: 12px; color: var(--muted); margin: 4px 2px 6px; }
.menu-seg { display: flex; margin-bottom: 8px; }
.menu-seg button { flex: 1; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: transparent; border: 0; padding: 10px 8px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--ink); }
.menu-item:hover { background: var(--accent-soft); }
.menu-item.big { padding: 14px 10px; font-size: 16px; }
@media (max-width: 720px) { .hide-sm { display: none; } }

/* Bottom tab bar (phones) */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottomnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; background: transparent; border: 0; color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; min-height: 56px; }
.bottomnav button[aria-selected="true"] { color: var(--accent); }
main.with-bottomnav { padding-bottom: 96px; }
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--card); color: var(--ink); border-radius: 16px 16px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(0,0,0,.25); }
.sheet-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.icon-x { background: transparent; border: 0; font-size: 18px; color: var(--ink); cursor: pointer; padding: 6px 10px; }
.sheet .seg { display: flex; flex-wrap: wrap; }
.sheet select { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; color: var(--ink); }

/* Period bar */
.arrow { background: var(--card); border: 1px solid var(--line); border-radius: 10px; width: 38px; height: 38px; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink); flex: none; }
.arrow:disabled { opacity: .35; cursor: default; }
.period.compact { flex-wrap: wrap; gap: 8px; }
.picker-btn { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; height: 38px; padding: 0 12px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.period.compact .pills:empty { display: none; }
.pill.est { background: #fde7c8; color: #8a4b00; border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }
@media (prefers-color-scheme: dark) { body:not([data-theme="light"]) .pill.est { background: #4a3210; color: #ffcc80; } }
body[data-theme="dark"] .pill.est { background: #4a3210; color: #ffcc80; }

/* Overview */
.alert { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: #fde7c8; color: #6b3a00; font-weight: 700; text-decoration: none; }
.alert span { white-space: nowrap; }
@media (prefers-color-scheme: dark) { body:not([data-theme="light"]) .alert { background: #4a3210; color: #ffd699; } }
body[data-theme="dark"] .alert { background: #4a3210; color: #ffd699; }
.kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1000px) { .kpis.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .kpis.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis.five .kpi:first-child { grid-column: 1 / -1; } }
.kpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .kpis.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis.six .kpi:first-child { grid-column: 1 / -1; } }
.kpi .qbar { margin-top: 6px; }
.delta { display: block; font-size: 12px; font-weight: 600; margin-top: 4px; color: var(--muted); }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }
.kpi.hi .delta { color: var(--bg-soft); }
.kpi.hi .delta.up { color: #8fd18a; } .kpi.hi .delta.down { color: #ff9a92; }
.h2row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.h2row h2 { margin-bottom: 10px; }
.qcell { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.legend-line { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 8px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.inline-select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }

/* Top & Bottom 5, styled like the weekly slide */
.card.tb { padding: 0; overflow: hidden; }
.tb-band { display: flex; justify-content: space-between; align-items: center; background: #2b2b2b; color: #fff; padding: 10px 14px; font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .3px; }
.tb-sub { font-size: 12px; color: var(--muted); padding: 8px 14px 0; }
.tb-h { margin: 10px 14px 2px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.tb-h.tb-top { color: #2e7d32; } .tb-h.tb-bottom { color: #c62828; }
.card.tb .rank { padding: 0 14px 6px; }
.card.tb .rank:last-child { padding-bottom: 14px; }
.rank li span i { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-style: normal; font-size: 11px; font-weight: 700; margin-right: 8px; color: #fff; }
.rank.rank-top li span i { background: #2e7d32; } .rank.rank-bottom li span i { background: #c62828; }
.rank.rank-top li b { color: #2e7d32; } .rank.rank-bottom li b { color: #c62828; }
.imgbtn.light { color: #fff; border-color: #6b6b70; }

/* Scorecard */
.who-select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); min-width: 200px; flex: 1; max-width: 320px; height: 38px; }
.person-head { display: flex; gap: 12px; align-items: center; margin: 20px 0 12px; }
.ph { position: relative; display: inline-grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--ink-2); overflow: hidden; flex: none; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.ph b { font-family: var(--display); }
.quota-card { border-width: 2px; }
.qhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 4px 0 8px; flex-wrap: wrap; }
.togo { font-size: 20px; }
.togo b { font-family: var(--display); font-size: 28px; }
.small-muted { color: var(--muted); font-size: 12px; margin-top: 4px; }
.card.span2 { grid-column: 1 / -1; }
.chart .bar-met { fill: #2e7d32; } .chart .bar-miss { fill: #c62828; } .chart .bar-none { fill: var(--s4); }

/* Sales */
.kgroup { margin-top: 10px; }
.kgroup > .lbl { margin: 0 0 6px 2px; }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis.k1 { grid-template-columns: minmax(0, 1fr); max-width: 25%; }
@media (max-width: 860px) { .kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpis.k1 { max-width: 50%; } }
@media (max-width: 520px) { .kpis.k3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis.k3 .kpi:last-child { grid-column: 1 / -1; } .kpis.k1 { max-width: none; } }
.hbar .name .dot { margin-right: 6px; }

/* Weekly Numbers */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.chip.green { background: #dff1df; color: #1b5e20; } .chip.orange { background: #fde7c8; color: #8a4b00; } .chip.red { background: #f8d4d4; color: #8e1b1b; }
.chip.plain { background: var(--accent-soft); color: var(--ink-2); }
.sticky-head { max-height: 72vh; overflow: auto; }
.sticky-head thead th { position: sticky; top: 0; background: var(--card); z-index: 2; }
.sticky-head thead th:first-child { z-index: 3; }
.wn td:first-child div { white-space: nowrap; }

/* Roster */
.filters { margin: 10px 0 4px; }
.filters input[type=search] { flex: 1; min-width: 180px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
h3.grp { font-family: var(--display); font-size: 15px; margin: 18px 0 8px; }
h3.grp small { color: var(--muted); font-weight: 500; }
.who-row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.pill.acc-owner { background: var(--accent); color: #fff; }
.pill.acc-admin { background: var(--accent-2, #7a0a1c); color: #fff; }
.pill.acc-manager { background: #2b2b2b; color: #fff; }
.pill.acc-barber { background: #e4e4e7; color: #3f3f46; }
@media (prefers-color-scheme: dark) { body:not([data-theme="light"]) .pill.acc-manager { background: #4a4a50; } body:not([data-theme="light"]) .pill.acc-barber { background: #3a3a40; color: #e4e4e7; } }
body[data-theme="dark"] .pill.acc-manager { background: #4a4a50; } body[data-theme="dark"] .pill.acc-barber { background: #3a3a40; color: #e4e4e7; }
.card.bulk { margin: 10px 0; border-color: var(--accent); }

/* Settings */
.seg.sections { margin: 16px 0 12px; flex-wrap: wrap; }
.status-line { padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); margin-bottom: 10px; font-size: 14px; }
ol.steps { margin: 0 0 10px 18px; padding: 0; font-size: 14px; line-height: 1.6; }
.glossary p { margin: 6px 0; font-size: 14px; }

/* Saved pictures: logo and dates on top */
.img-head { display: flex; align-items: center; gap: 10px; background: #2b2b2b; color: #fff; padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; }
.img-head img { width: 34px; height: 34px; border-radius: 8px; }
.img-head b { display: block; font-family: var(--display); font-size: 15px; }
.img-head span { font-size: 12px; color: #d4d4d8; }

/* Bigger tap targets on phones */
@media (max-width: 720px) {
  .imgbtn { padding: 8px 12px; font-size: 13px; min-height: 36px; }
  th.sort { padding-top: 12px; padding-bottom: 12px; }
  .seg button { padding: 9px 12px; }
  .top { padding-bottom: 10px; }
}
@media print { .bottomnav, .usermenu, .arrow { display: none !important; } }
body[data-theme="dark"] .wn td.green { background: #1d3a1f; color: #a5d6a7; } body[data-theme="dark"] .wn td.orange { background: #3d2a10; color: #ffcc80; } body[data-theme="dark"] .wn td.red { background: #3d1515; color: #ef9a9a; }
/* Sign-in: Drive In red main button, spam hint, help footer */
body.theme-drivein .signin .btn:not(.secondary) { background: var(--accent); color: #fff; }
.signin .hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.signin-foot { text-align: center; font-size: 12px; margin-top: 12px; color: var(--muted); }
.signin-foot a { color: var(--muted); }
.tb-sep { border-top: 2px solid var(--line); margin: 6px 14px 0; }

/* Theme switch in the header (Lifestyle staff app) */
.top-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.theme-btn span { font-size: 15px; line-height: 1; }
@media (max-width: 420px) { .theme-btn { padding-left: 10px; padding-right: 10px; } }
.signin-theme { display: flex; justify-content: flex-end; width: 100%; max-width: 420px; margin: 0 auto 8px; }

/* ---- Payroll screen ---- */
.neg { color: var(--bad); }
.pay-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.pay-row:first-of-type { border-top: 0; }
.pay-main { min-width: 0; flex: 1 1 240px; }
.pay-check { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.pay-check li { display: flex; gap: 10px; align-items: flex-start; }
.pay-check .tick { flex: 0 0 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; border: 1.5px solid var(--line); color: var(--muted); }
.pay-check .ok-li .tick { background: var(--good); border-color: var(--good); color: #fff; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td, tr.clickable[aria-selected="true"] td { background: var(--accent-soft); }
table.detail { max-width: 520px; }
table.detail td:first-child { position: static; white-space: normal; }
table.detail tr.total td { font-weight: 800; border-top: 2px solid var(--ink); border-bottom: 0; }
table.diff td.reason { display: flex; gap: 6px; text-align: left; min-width: 280px; }
table.diff td.reason input { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color: var(--ink); }
table.diff td.reason .btn { padding: 6px 10px; }
.pay-row .btn, #payroll .row .btn { min-height: 40px; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Phase 2: barber money tile, statements, staff screens */
.money-card { margin-top: 12px; }
.money-card .big { font-size: 30px; font-weight: 800; margin: 4px 0; }
.mbar { height: 12px; background: var(--line-soft); border-radius: 999px; overflow: hidden; margin: 10px 0 6px; }
.mbar > div { height: 100%; border-radius: 999px; background: var(--accent, #C8102E); }
.stmt-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 4px; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.stmt-row:last-child { border-bottom: 0; }
.stmt-row small { color: var(--ink-2); margin-left: 6px; }
.check.big { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; }
.check.big input { margin-top: 4px; }

.collab-row { border-bottom: 1px solid var(--line); padding: 8px 2px; }
.collab-row:last-child { border-bottom: 0; }
.collab-row summary { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; cursor: pointer; list-style: none; }
.collab-row summary::-webkit-details-marker { display: none; }
.collab-row .nums { color: var(--ink-2); font-size: 13px; }
.collab-row .tbl-wrap { margin-top: 8px; }

/* Instagram tables: the first (Post) column is not pinned, so the row can be slid sideways on a phone. */
.ig-tbl th:first-child, .ig-tbl td:first-child { position: static; }
.ig-tbl td:first-child { min-width: 160px; max-width: 260px; white-space: normal; }

/* Sortable table headings (Instagram posts and collabs) */
.th-sort { all: unset; cursor: pointer; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; white-space: nowrap; }
.th-sort:hover, .th-sort[aria-sort="ascending"], .th-sort[aria-sort="descending"] { color: var(--ink); }
.th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.ig-tbl th.num, .ig-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ig-tbl tr.subrow > td { background: var(--accent-soft); padding: 6px 10px 10px; max-width: none; white-space: normal; }
.ig-tbl tr.subrow table { width: 100%; }

/* My day: week list and month calendar */
.wk-head { all: unset; cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; justify-content: space-between; width: 100%; box-sizing: border-box; font-size: 14px; }
.wk-head:focus-visible, .cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wk-tbl table { table-layout: fixed; }
.wk-tbl thead th:nth-child(1) { width: 64px; } .wk-tbl thead th:nth-child(2) { width: 34%; }
.wk-tbl td { vertical-align: top; overflow-wrap: anywhere; }
.wk-dayrow th { background: var(--accent-soft); text-align: left; font-weight: 400; text-transform: none; letter-spacing: 0; padding-top: 8px; padding-bottom: 8px; }
.wk-dayrow.is-today th { box-shadow: inset 3px 0 0 var(--accent); }
.wk-time { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.cal { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; margin-top: 4px; }
.cal th { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; padding: 2px 0; }
.cal td { padding: 0; }
.cal-day { width: 100%; min-height: 58px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; font: inherit; }
.cal-day.past { opacity: .6; }
.cal-day.has { background: var(--accent-soft); }
.cal-day.is-today { border: 2px solid var(--accent); opacity: 1; }
.cal-num { font-size: 12px; color: var(--muted); }
.cal-count { font-size: 18px; font-weight: 700; line-height: 1.1; }
.cal-hrs { font-size: 10px; color: var(--ink-2); white-space: nowrap; }
@media (max-width: 420px) { .cal { border-spacing: 2px; } .cal-day { min-height: 50px; padding: 3px 1px; } .cal-hrs { display: none; } }

/* Clients and client health */
.cl-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.cl-row:first-child { border-top: 0; padding-top: 0; }
.cl-main { min-width: 0; flex: 1; }
.cl-act { display: flex; gap: 6px; flex: none; }
.pill.bad { background: #f8d4d4; color: #8e1b1b; }
.hs.good { color: #1b7a2c; } .hs.warn { color: #a66300; } .hs.bad { color: #b3261e; }
tr.tap { cursor: pointer; }
tr.tap:hover td { background: var(--accent-soft); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.bad { background: #4a1f1f; color: #f3b4b4; } :root:not([data-theme="light"]) .hs.good { color: #7bd88f; } :root:not([data-theme="light"]) .hs.warn { color: #f0b54a; } :root:not([data-theme="light"]) .hs.bad { color: #f08a84; } }
:root[data-theme="dark"] .pill.bad { background: #4a1f1f; color: #f3b4b4; }
:root[data-theme="dark"] .hs.good { color: #7bd88f; } :root[data-theme="dark"] .hs.warn { color: #f0b54a; } :root[data-theme="dark"] .hs.bad { color: #f08a84; }
@media (max-width: 420px) { .cl-row { flex-wrap: wrap; } .cl-act { width: 100%; } .cl-act .btn { flex: 1; text-align: center; } }
