/* GymFlow — onyx & champagne theme */
:root {
  --bg: #0b0b0d; --bg-2: #101013; --surface: #141417; --surface-2: #1a1a1e; --surface-3: #222227;
  --line: #26262c; --line-2: #33333a;
  --text: #f3efe6; --text-2: #b8b2a5; --muted: #7f7a70;
  --gold: #c9a96a; --gold-2: #e6cf9c; --gold-3: #8f7442; --gold-ink: #17130b;
  /* accent fills stay champagne in both themes; --gold* above are for text/lines */
  --fill-1: #e6cf9c; --fill-2: #c9a96a; --fill-3: #8f7442; --gold-rgb: 201, 169, 106;
  --sidebar-bg: linear-gradient(180deg, #0e0e11, #0b0b0d); --topbar-bg: rgba(11, 11, 13, .85);
  --hero-bg: linear-gradient(135deg, #16151a, #0f0f12); --login-bg: #09090b;
  --avatar-bg: radial-gradient(circle at 30% 25%, #2d2a24, #18171a); --avatar-line: #3a352a;
  --scroll-thumb: #2a2a30; --hover-line: #4a4a52; --nav-label: #5f5b53; --row-hover: rgba(255, 255, 255, .015);
  --backdrop: rgba(4, 4, 6, .7); --shadow-lg: rgba(0, 0, 0, .8); --picker: invert(.7) sepia(.4);
  --series-1: #c98500; --series-2: #3987e5;
  --good: #6cc19a; --warn: #e0b45a; --bad: #e07a6f; --info: #8fb3e0; --ice: #8fd3e0;
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 20px 40px -24px var(--shadow-lg);
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 13.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01', 'tnum'; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--fill-2); color: var(--gold-ink); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 10px; border: 2px solid var(--bg); } ::-webkit-scrollbar-track { background: transparent; }
.ic { width: 16px; height: 16px; flex: none; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); } .small { font-size: 12px; } .center { text-align: center; }
.hide, .hidden { display: none !important; }
.up { color: var(--good); } .down { color: var(--bad); } .warn-t { color: var(--warn); }
.display { font-family: var(--serif); font-weight: 500; letter-spacing: .2px; margin: 0; font-size: 30px; line-height: 1.15; }
.eyebrow { text-transform: uppercase; letter-spacing: .22em; font-size: 10.5px; color: var(--gold); font-weight: 600; }
h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: .1px; }
h4.sec { margin: 18px 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .16em; color: var(--gold); font-weight: 600; }
h4.sec:first-child { margin-top: 0; }
code { font-family: ui-monospace, 'Cascadia Code', monospace; font-size: 12px; background: var(--surface-3); border: 1px dashed var(--gold-3); color: var(--gold-2); padding: 2px 8px; border-radius: 6px; letter-spacing: .08em; }
kbd { font: 11px var(--sans); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; color: var(--muted); }

/* ---------- Layout ---------- */
#app { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: none; background: var(--sidebar-bg); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
.brand { display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; text-align: center; padding: 24px 20px 20px; border-bottom: 1px solid var(--line); }
.brand .brand-name { font-size: 22px; letter-spacing: .6px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font: 600 22px var(--serif); color: var(--gold-ink); background: linear-gradient(135deg, var(--fill-1), var(--fill-2) 55%, var(--fill-3)); box-shadow: 0 6px 20px -8px rgba(var(--gold-rgb), .6); flex: none; }
.brand-mark.lg { width: 64px; height: 64px; font-size: 38px; border-radius: 16px; }
.brand-name { font: 600 17px/1.15 var(--serif); letter-spacing: .3px; }
.brand-sub { font-size: 10px; text-transform: uppercase; letter-spacing: .2em; color: var(--muted); margin-top: 2px; }
.sidebar nav { flex: 1; overflow: auto; padding: 10px 12px 16px; }
.nav-group { margin-top: 14px; }
.nav-label { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--nav-label); padding: 0 10px 6px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--text-2); transition: background .15s, color .15s; position: relative; font-weight: 500; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.on { background: linear-gradient(90deg, rgba(var(--gold-rgb), .14), rgba(var(--gold-rgb), .02)); color: var(--gold-2); }
.nav-item.on::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--fill-2); }
.nav-item .ic { opacity: .85; }
.nav-count { margin-left: auto; font-size: 10.5px; font-weight: 600; background: var(--fill-2); color: var(--gold-ink); border-radius: 10px; padding: 0 7px; line-height: 18px; }
.nav-count:empty { display: none; }
.side-foot { border-top: 1px solid var(--line); padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.me { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 0; }
.me-name { font-weight: 600; font-size: 13px; }
.me-role { display: flex; gap: 5px; align-items: center; font-size: 11px; color: var(--gold); }
.me-role .ic { width: 12px; height: 12px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; }
.topbar { height: 64px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--topbar-bg); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; }
.crumbs h1 { margin: 0; font: 500 21px var(--serif); letter-spacing: .3px; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.back { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); color: var(--text-2); }
.back:hover { border-color: var(--gold-3); color: var(--gold); }
.today { color: var(--muted); font-size: 12px; white-space: nowrap; }
.view { flex: 1; overflow: auto; padding: 26px 28px 60px; display: flex; flex-direction: column; gap: 20px; }
.view > * { max-width: 1480px; width: 100%; flex-shrink: 0; }
.scrim { display: none; }
.only-mobile { display: none !important; }

/* ---------- Search ---------- */
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; height: 36px; color: var(--muted); transition: border-color .15s; }
.search:focus-within { border-color: var(--gold-3); }
.search input { border: 0; background: none; outline: none; flex: 1; min-width: 0; color: var(--text); height: 100%; }
.search.block { width: 100%; } .search.lg { height: 44px; font-size: 14.5px; }
.gsearch { position: relative; width: 340px; }
.gs-results { position: absolute; top: 44px; left: 0; right: 0; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 24px 50px -10px var(--shadow-lg); padding: 6px; display: none; z-index: 40; }
.gs-results.open { display: block; }
.gs-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; }
.gs-item:hover { background: var(--surface-3); }
.gs-item span { flex: 1; display: flex; flex-direction: column; } .gs-item small { color: var(--muted); }
.gs-none { padding: 12px; color: var(--muted); text-align: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); cursor: pointer; font-weight: 500; white-space: nowrap; transition: all .15s; font-size: 13px; }
.btn:hover { border-color: var(--hover-line); background: var(--surface-3); }
.btn.primary { background: linear-gradient(180deg, var(--fill-1), var(--fill-2)); color: var(--gold-ink); border-color: transparent; font-weight: 600; box-shadow: 0 8px 20px -12px rgba(var(--gold-rgb), .8); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.gold { background: transparent; border-color: var(--gold-3); color: var(--gold-2); }
.btn.gold:hover { background: rgba(var(--gold-rgb), .08); }
.btn.ghost { background: transparent; }
.btn.danger { background: color-mix(in srgb, var(--bad) 10%, transparent); border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); }
.btn.sm { height: 31px; padding: 0 12px; font-size: 12.5px; }
.btn.xs { height: 27px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn.xs .ic { width: 13px; height: 13px; }
.btn.block { width: 100%; height: 44px; font-size: 14px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; padding: 0; transition: all .15s; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-2); color: var(--text); }
.icon-btn.xs { width: 27px; height: 27px; } .icon-btn.xs .ic { width: 14px; height: 14px; }
.icon-btn.danger:hover { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.btn-row { display: flex; gap: 8px; margin-top: 14px; } .btn-row.end { justify-content: flex-end; } .btn-row.wrap { flex-wrap: wrap; }
.link { color: var(--gold); font-size: 12px; font-weight: 500; } .link:hover { color: var(--gold-2); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 0 12px; height: 28px; border-radius: 7px; cursor: pointer; color: var(--text-2); }
.seg button.on { background: var(--surface-3); color: var(--gold-2); }

/* ---------- Badges & avatars ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 20px; font-size: 11.5px; font-weight: 500; border: 1px solid; white-space: nowrap; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-good { color: var(--good); border-color: color-mix(in srgb, var(--good) 32%, transparent); background: color-mix(in srgb, var(--good) 8%, transparent); }
.b-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 32%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.b-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 32%, transparent); background: color-mix(in srgb, var(--bad) 8%, transparent); }
.b-info { color: var(--info); border-color: color-mix(in srgb, var(--info) 32%, transparent); background: color-mix(in srgb, var(--info) 8%, transparent); }
.b-ice { color: var(--ice); border-color: color-mix(in srgb, var(--ice) 32%, transparent); background: color-mix(in srgb, var(--ice) 8%, transparent); }
.b-mute { color: var(--muted); border-color: var(--line-2); background: transparent; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font: 600 12.5px var(--sans); letter-spacing: .5px; color: var(--gold-2); background: var(--avatar-bg); border: 1px solid var(--avatar-line); }
.avatar.sm { width: 32px; height: 32px; font-size: 11.5px; }
.avatar.lg { width: 46px; height: 46px; font-size: 15px; }
.avatar.xl { width: 76px; height: 76px; font: 500 28px var(--serif); border-width: 1.5px; border-color: var(--gold-3); }
.avatar.eq { color: var(--text-2); }
.pill { font-size: 11px; background: var(--surface-3); border-radius: 10px; padding: 1px 8px; margin-left: 6px; color: var(--gold-2); font-weight: 600; }
.tagx { font-size: 12px; color: var(--text-2); background: var(--surface-3); padding: 2px 8px; border-radius: 6px; }
.tick { color: var(--good); font-weight: 700; }

/* ---------- Cards / KPIs ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.inset { background: var(--bg-2); box-shadow: none; padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head.pad { padding: 16px 20px 0; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpis.col { grid-template-columns: 1fr; } .kpis.pad { padding: 16px 20px 0; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.kpi::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--line-2); }
.kpi.gold::after { background: linear-gradient(var(--fill-1), var(--fill-3)); } .kpi.good::after { background: var(--good); } .kpi.bad::after { background: var(--bad); } .kpi.warn::after { background: var(--warn); } .kpi.ice::after { background: var(--ice); }
.kpi.clickable { cursor: pointer; transition: border-color .15s, transform .15s; } .kpi.clickable:hover { border-color: var(--line-2); transform: translateY(-1px); }
.kpi-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .13em; font-weight: 600; }
.kpi-value { font: 500 28px/1.2 var(--serif); margin-top: 6px; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.gold .kpi-value { color: var(--gold-2); }
.kpi-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cols-3-2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; }
.cols-2-3 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 20px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.cols-3.pad { padding: 16px 20px; gap: 14px; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.cols-2.tight { gap: 24px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; max-width: 720px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions select, .actions input[type=date], .inline select, .inline input { height: 36px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 0 10px; outline: none; }
.inline { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 26px 28px; border-radius: 18px; border: 1px solid var(--line); background: radial-gradient(1200px 300px at 100% 0%, rgba(var(--gold-rgb), .12), transparent 60%), var(--hero-bg); position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border: 1px solid rgba(var(--gold-rgb), .18); border-radius: 50%; }
.hero::after { content: ''; position: absolute; right: 20px; top: -20px; width: 160px; height: 160px; border: 1px solid rgba(var(--gold-rgb), .12); border-radius: 50%; }
.hero .display { font-size: 36px; margin: 6px 0 4px; }
.hero p { margin: 0; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.empty { text-align: center; padding: 26px 12px; color: var(--muted); }
.empty-mark { color: var(--gold-3); font-size: 14px; margin-bottom: 6px; }
.empty p { margin: 0; color: var(--text-2); } .empty small { display: block; margin-top: 4px; }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; }
.li:last-child { border-bottom: 0; }
.li > div { display: flex; flex-direction: column; } .li small { color: var(--muted); font-size: 12px; }
.li.clickable, a.li { cursor: pointer; border-radius: 8px; } .li.clickable:hover, a.li:hover { background: var(--surface-2); }
.list.compact .li { padding: 7px 0; }
.list.pick { max-height: 52vh; overflow: auto; margin-top: 10px; }
.list.pick .li { padding: 10px; }
.feed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; }
.feed > div { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.feed .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-3); flex: none; transform: translateY(-2px); }
.feed b { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .feed small { color: var(--muted); white-space: nowrap; }
.mini-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.mini-row div { display: flex; flex-direction: column; } .mini-row small { color: var(--muted); font-size: 11.5px; } .mini-row b { font: 500 19px var(--serif); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 4px 12px 4px 5px; cursor: pointer; }
.chip:hover { border-color: var(--line-2); } .chip b { font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs.scroll { overflow-x: auto; }
.tab { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--gold-2); border-bottom-color: var(--gold); }
.tab span { font-size: 11px; background: var(--surface-3); border-radius: 10px; padding: 0 7px; }

/* ---------- Tables ---------- */
.dt-tools { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dt-tools .search { width: 280px; }
.dt-tools select { height: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; color: var(--text-2); outline: none; max-width: 200px; }
.table-scroll { overflow-x: auto; }
.table-scroll.mini { max-height: 260px; border: 1px solid var(--line); border-radius: 10px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .13em; color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--bg-2); position: sticky; top: 0; }
.tbl th.sortable { cursor: pointer; user-select: none; } .tbl th.sortable:hover { color: var(--text-2); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; } .tbl tbody tr:hover td { background: var(--row-hover); }
.tbl tr.sel td { background: rgba(var(--gold-rgb), .06); }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl.compact td, .tbl.compact th { padding: 7px 10px; }
.sub { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.sub a { color: var(--gold); }
.clip { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who > div { display: flex; flex-direction: column; min-width: 0; } .who b { font-weight: 600; white-space: nowrap; } .who small { color: var(--muted); font-size: 11.5px; }
.row-acts { white-space: nowrap; text-align: right; } .row-acts > * + *, .row-acts > .cv > * + * { margin-left: 4px; }
.dt-foot { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.pager { display: flex; align-items: center; gap: 6px; }
.tbl.avail td { vertical-align: top; } .tbl.avail .today { background: rgba(var(--gold-rgb), .05); }
.slot { display: inline-block; font-size: 11.5px; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 7px; margin: 2px 4px 2px 0; white-space: nowrap; }

/* ---------- Modal ---------- */
.modal-wrap { position: fixed; inset: 0; background: var(--backdrop); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; z-index: 100; opacity: 0; transition: opacity .16s; }
.modal-wrap.in { opacity: 1; } .modal-wrap.out { opacity: 0; }
.modal { width: 100%; max-width: 620px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 40px 80px -20px var(--shadow-lg); transform: translateY(8px) scale(.99); transition: transform .18s; }
.modal-wrap.in .modal { transform: none; }
.modal.sm { max-width: 440px; } .modal.md { max-width: 640px; } .modal.lg { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font: 500 22px var(--serif); letter-spacing: .2px; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.modal-body { padding: 18px 22px; overflow: auto; flex: 1; }
.modal-body > p { margin-top: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--bg-2); border-radius: 0 0 18px 18px; }
.modal-foot .icon-btn { margin-right: auto; border-color: var(--line-2); }

/* ---------- Forms ---------- */
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.span-2 { grid-column: span 2; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld label { font-size: 11.5px; color: var(--text-2); font-weight: 500; letter-spacing: .02em; }
.fld label em { color: var(--gold); font-style: normal; }
.fld small { color: var(--muted); font-size: 11.5px; }
.fld input, .fld select, .fld textarea { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; outline: none; transition: border-color .15s, box-shadow .15s; min-height: 38px; width: 100%; }
.fld textarea { resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--gold-3); box-shadow: 0 0 0 3px rgba(var(--gold-rgb), .1); }
.fld input[readonly] { color: var(--muted); }
.fld.invalid input, .fld.invalid select, .fld.invalid textarea { border-color: var(--bad); }
input[type=date]::-webkit-calendar-picker-indicator { filter: var(--picker); cursor: pointer; }
select option { background: var(--surface-2); }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; padding: 4px 0; }
.check input { appearance: none; width: 18px; height: 18px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--bg-2); display: grid; place-items: center; cursor: pointer; margin: 0; flex: none; }
.check input:checked { background: var(--fill-2); border-color: var(--fill-2); }
.check input:checked::after { content: ''; width: 5px; height: 9px; border: solid var(--gold-ink); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.sec-toggle { margin: 18px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); width: 100%; font-weight: 600; color: var(--gold-2); }
.price-sum { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 16px; }
.price-sum div { display: flex; justify-content: space-between; padding: 4px 0; color: var(--text-2); }
.price-sum div b { color: var(--text); font-weight: 500; }
.price-sum .tot { border-top: 1px dashed var(--line-2); border-bottom: 1px dashed var(--line-2); margin: 4px 0; padding: 8px 0; }
.price-sum .tot b { font: 500 22px var(--serif); color: var(--gold-2); }
.import-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.errs { margin: 0; padding-left: 18px; color: var(--bad); font-size: 12.5px; max-height: 180px; overflow: auto; }
.perm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 12px; margin: 10px 0; }
.alert { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9px; font-size: 12.5px; margin-top: 10px; }
.alert.warn { background: color-mix(in srgb, var(--warn) 9%, transparent); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent); }
.alert.ice { background: color-mix(in srgb, var(--ice) 9%, transparent); color: var(--ice); border: 1px solid color-mix(in srgb, var(--ice) 28%, transparent); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--surface-3); border: 1px solid var(--line-2); padding: 11px 16px; border-radius: 11px; box-shadow: 0 20px 40px -10px var(--shadow-lg); animation: tin .2s; max-width: 380px; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .3s; }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.t-danger .toast-dot { background: var(--bad); } .t-info .toast-dot { background: var(--info); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Charts ---------- */
.chart { position: relative; }
.chart svg { width: 100%; height: 230px; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; } .chart .base { stroke: var(--line-2); }
.chart .ax { fill: var(--muted); font-size: 10.5px; font-family: var(--sans); }
.chart .hit { fill: transparent; cursor: crosshair; } .chart .hit.on { fill: var(--row-hover); }
.legend { display: flex; gap: 16px; margin-bottom: 8px; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 10px; height: 10px; border-radius: 3px; }
.tip { position: absolute; pointer-events: none; opacity: 0; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; font-size: 12px; min-width: 170px; box-shadow: 0 10px 30px -6px var(--shadow-lg); transition: opacity .1s; z-index: 5; }
.tip div { display: flex; align-items: center; gap: 7px; margin-top: 4px; color: var(--text-2); } .tip i { width: 8px; height: 8px; border-radius: 2px; } .tip span { margin-left: auto; color: var(--text); font-weight: 600; padding-left: 12px; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hb { display: grid; grid-template-columns: 150px 1fr 100px; gap: 12px; align-items: center; font-size: 12.5px; }
.hb span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hb b { text-align: right; font-weight: 500; }
.hb-track { height: 8px; background: var(--bg-2); border-radius: 4px; overflow: hidden; }
.hb-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--fill-3), var(--fill-2)); border-radius: 4px; }
.hours { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 6px; }
.hours div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.hours i { width: 100%; background: linear-gradient(var(--fill-2), var(--fill-3)); border-radius: 4px 4px 0 0; min-height: 2px; }
.hours small { font-size: 10px; color: var(--muted); height: 12px; }

/* ---------- Profile ---------- */
.profile { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: radial-gradient(800px 200px at 0% 0%, rgba(var(--gold-rgb), .08), transparent 60%), var(--surface); }
.pf-main { display: flex; gap: 18px; align-items: flex-start; flex: 1; min-width: 300px; }
.pf-name { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pf-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); margin-top: 6px; font-size: 12.5px; }
.pf-meta span { display: inline-flex; align-items: center; gap: 5px; } .pf-meta .ic { width: 13px; height: 13px; }
.pf-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; max-width: 560px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv:last-child { border-bottom: 0; } .kv span { color: var(--muted); } .kv b { font-weight: 500; text-align: right; }
.note { background: var(--bg-2); border-left: 2px solid var(--gold-3); padding: 8px 12px; border-radius: 0 8px 8px 0; color: var(--text-2); margin: 10px 0 0; }
.strip { display: grid; grid-template-columns: repeat(28, 1fr); gap: 3px; margin-bottom: 10px; }
.strip i { aspect-ratio: 1; border-radius: 3px; background: var(--bg-2); border: 1px solid var(--line); }
.strip i.on { background: var(--fill-2); border-color: var(--fill-2); }
.pt { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.pt > div { display: flex; flex-direction: column; gap: 4px; } .pt small { color: var(--muted); font-size: 11.5px; }
.bar { height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden; width: 100%; }
.bar.sm { width: 90px; height: 5px; margin-bottom: 3px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--fill-3), var(--fill-1)); border-radius: 3px; }
.timeline { display: flex; flex-direction: column; gap: 0; border-left: 1px solid var(--line-2); margin-left: 4px; max-height: 320px; overflow: auto; }
.timeline > div { position: relative; padding: 0 0 12px 16px; }
.timeline > div::before { content: ''; position: absolute; left: -4px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-3); }
.timeline > div.repair::before { background: var(--bad); }
.timeline small { color: var(--muted); font-size: 11.5px; } .timeline p { margin: 2px 0 0; }

/* ---------- Reminders ---------- */
.rem-list { display: flex; flex-direction: column; }
.rem { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rem:last-child { border-bottom: 0; }
.rem > div { display: flex; flex-direction: column; } .rem small { color: var(--muted); font-size: 12px; }
.rem.done { opacity: .55; }
.rem-type { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; width: 78px; flex: none; }
.t-expiry { color: var(--warn); } .t-renewal { color: var(--bad); } .t-payment { color: var(--gold-2); } .t-lead { color: var(--info); } .t-equipment { color: var(--text-2); }

/* ---------- Plans / offers ---------- */
.plan-grid, .offer-grid, .tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.offer-grid { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.plan { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.plan::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--fill-2), transparent); opacity: .7; }
.plan.off { opacity: .55; }
.plan-top { display: flex; justify-content: space-between; }
.plan-type { font-size: 10.5px; text-transform: uppercase; letter-spacing: .18em; color: var(--gold); font-weight: 600; }
.plan h3 { font: 500 23px var(--serif); }
.plan-price { font: 500 34px var(--serif); color: var(--gold-2); }
.plan-price small { font: 400 12.5px var(--sans); color: var(--muted); margin-left: 6px; }
.plan p { margin: 0; min-height: 20px; }
.plan-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; margin: 6px 0; }
.plan-stats div { display: flex; flex-direction: column; } .plan-stats b { font-weight: 600; } .plan-stats small { color: var(--muted); font-size: 11px; }
.plan-acts { display: flex; gap: 8px; }
.offer { display: flex; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; align-items: flex-start; }
.offer.expired, .offer.inactive { opacity: .55; }
.offer-val { width: 96px; height: 96px; flex: none; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; font: 500 32px/1 var(--serif); color: var(--gold-ink); background: linear-gradient(135deg, var(--fill-1), var(--fill-2) 60%, var(--fill-3)); }
.offer-val small { font-size: 16px; } .offer-val span { font: 700 10px var(--sans); letter-spacing: .25em; margin-top: 6px; }
.offer-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; }
.offer h3 { font: 500 20px var(--serif); }
.offer p { margin: 8px 0; }
.offer-meta { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--text-2); }
.offer-acts { display: flex; flex-direction: column; gap: 4px; }

/* ---------- P&L ---------- */
.statement .st { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); color: var(--text-2); }
.statement .st b { color: var(--text); font-weight: 500; }
.statement .st-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .16em; color: var(--gold); font-weight: 600; margin: 16px 0 4px; }
.statement .st-sec:first-of-type { margin-top: 0; }
.statement .st.tot { border-bottom: 1px solid var(--line-2); color: var(--text); font-weight: 600; }
.statement .st.grand { margin-top: 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); font-weight: 600; }
.statement .st.grand b { font: 500 26px var(--serif); color: inherit; }

/* ---------- Leads board ---------- */
.board { display: grid; grid-template-columns: repeat(6, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.board .col { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; min-height: 300px; max-height: 70vh; transition: border-color .15s; }
.board .col.over { border-color: var(--gold); background: rgba(var(--gold-rgb), .04); }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 12px 8px; }
.col-head b { color: var(--muted); font-weight: 600; }
.col-body { padding: 0 8px 10px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.lead { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: grab; display: flex; flex-direction: column; gap: 3px; transition: border-color .15s; }
.lead:hover { border-color: var(--line-2); } .lead.drag { opacity: .4; }
.lead small { color: var(--muted); font-size: 11.5px; }
.fu { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-2); margin-top: 4px; }
.fu .ic { width: 12px; height: 12px; } .fu.late { color: var(--bad); } .fu.today { color: var(--warn); }

/* ---------- Trainers ---------- */
.tr-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.tr-card.inactive { opacity: .55; }
.tr-card.clickable { cursor: pointer; transition: border-color .15s, transform .15s; }
.tr-card.clickable:hover { border-color: var(--line-2); transform: translateY(-1px); }
.rank { width: 22px; text-align: center; font: 500 16px var(--serif); color: var(--gold); flex: none; }
.li > .right { align-items: flex-end; text-align: right; }
.li > .right b { font-weight: 600; }
.week .day small { margin-top: auto; }
.tr-top { display: flex; gap: 12px; align-items: center; }
.tr-top h3 { font: 500 19px var(--serif); } .tr-top small { color: var(--muted); }
.tr-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; }
.tr-stats div { display: flex; flex-direction: column; } .tr-stats b { font: 500 18px var(--serif); } .tr-stats small { color: var(--muted); font-size: 10.5px; line-height: 1.3; }
.tr-avail { display: flex; gap: 4px; align-items: center; }
.tr-avail span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; font-size: 10.5px; background: var(--bg-2); color: var(--muted); border: 1px solid var(--line); }
.tr-avail span.on { color: var(--gold-2); border-color: var(--gold-3); }
.tr-avail span.today { box-shadow: 0 0 0 2px rgba(var(--gold-rgb), .35); }
.tr-avail small { margin-left: 8px; color: var(--text-2); font-size: 11.5px; }
.tr-acts { display: flex; gap: 8px; align-items: center; } .tr-acts .icon-btn { margin-left: auto; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
.week .day { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-height: 140px; display: flex; flex-direction: column; gap: 6px; }
.week .day.today { border-color: var(--gold-3); } .week .day b { font: 500 18px var(--serif); color: var(--gold-2); }

.denied { text-align: center; padding: 80px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.denied .ic { width: 40px; height: 40px; color: var(--gold); }
.denied h2 { font: 500 26px var(--serif); margin: 0; }

/* ---------- Login ---------- */
.login { display: grid; grid-template-columns: 1.1fr 1fr; width: 100%; min-height: 100vh; }
.login-art { position: relative; overflow: hidden; display: grid; place-items: center; background: radial-gradient(800px 500px at 30% 20%, rgba(var(--gold-rgb), .18), transparent 60%), radial-gradient(600px 400px at 80% 90%, rgba(var(--gold-rgb), .08), transparent 60%), var(--login-bg); border-right: 1px solid var(--line); }
.login-art::before, .login-art::after { content: ''; position: absolute; border: 1px solid rgba(var(--gold-rgb), .14); border-radius: 50%; }
.login-art::before { width: 620px; height: 620px; } .login-art::after { width: 420px; height: 420px; border-color: rgba(var(--gold-rgb), .1); }
.login-art-inner { position: relative; z-index: 1; text-align: center; display: flex; flex-direction: column; align-items: center; }
.login-art h1 { font: 500 52px/1.05 var(--serif); margin: 24px 0 8px; letter-spacing: .5px; }
.login-art p { color: var(--gold); letter-spacing: .3em; text-transform: uppercase; font-size: 11px; margin: 0; }
.login-lines { display: flex; gap: 8px; margin-top: 30px; } .login-lines span { width: 28px; height: 2px; background: var(--gold-3); } .login-lines span:nth-child(2) { background: var(--fill-2); width: 48px; }
.login-panel { display: grid; place-items: center; padding: 30px; }
.login-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }
.login-card h2 { font: 500 36px var(--serif); margin: 0; }
.login-card p { margin: -8px 0 4px; }
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.role { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; text-align: left; transition: all .15s; }
.role .ic { width: 20px; height: 20px; color: var(--muted); margin-bottom: 4px; }
.role small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.role:hover { border-color: var(--hover-line); }
.role.on { border-color: var(--gold); background: rgba(var(--gold-rgb), .07); } .role.on .ic { color: var(--gold); }
.login-card .fld input, .login-card .fld select { height: 46px; font-size: 15px; }
.login-card #pin { letter-spacing: .5em; }
.hint { color: var(--muted); font-size: 12px; text-align: center; margin: 0 !important; } .hint b { color: var(--gold-2); }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

/* ---------- Receipt (paper) ---------- */
.receipt { border: 1px solid var(--line); background: #fbf9f4; color: #1c1a16; border-radius: 12px; padding: 28px; font-size: 13px; }
.rc-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid #e3ddcf; flex-wrap: wrap; }
.rc-brand { display: flex; gap: 12px; }
.rc-brand h2 { font: 600 22px var(--serif); margin: 0; }
.rc-brand p { margin: 2px 0 0; color: #6b655a; font-size: 11.5px; line-height: 1.5; }
.rc-title { text-align: right; display: flex; flex-direction: column; }
.rc-title span { text-transform: uppercase; letter-spacing: .2em; font-size: 10.5px; color: #8f7442; font-weight: 700; }
.rc-title b { font: 600 20px var(--serif); } .rc-title small { color: #6b655a; }
.rc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px 0; }
.rc-grid div { display: flex; flex-direction: column; } .rc-grid small { text-transform: uppercase; letter-spacing: .14em; font-size: 10px; color: #8f7442; font-weight: 600; } .rc-grid b { font-size: 15px; } .rc-grid span { color: #6b655a; font-size: 12px; }
.rc-tbl { width: 100%; border-collapse: collapse; }
.rc-tbl td { padding: 9px 0; border-bottom: 1px solid #ece7db; } .rc-tbl td:last-child { text-align: right; white-space: nowrap; }
.rc-tbl tr.mrow td { color: #6b655a; }
.rc-tbl tr.big td { font: 600 18px var(--serif); border-bottom: 2px solid #1c1a16; border-top: 2px solid #1c1a16; }
.rc-note { color: #6b655a; font-style: italic; }
.rc-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-top: 22px; color: #6b655a; font-size: 11.5px; }
.rc-foot p { margin: 0; max-width: 60%; }
.sig { border-top: 1px solid #1c1a16; padding-top: 4px; min-width: 150px; text-align: center; color: #1c1a16; }
#print-root { display: none; }
@media print {
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; }
  body.printing { background: #fff; }
  body.printing .receipt { border-radius: 0; padding: 10mm; background: #fff; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) { .cols-3 { grid-template-columns: 1fr 1fr; } .gsearch { width: 260px; } .board { grid-template-columns: repeat(6, 230px); } }
@media (max-width: 1080px) {
  .cols-3-2, .cols-2-3, .cols-2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feed { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: var(--backdrop); z-index: 25; }
  .only-mobile { display: inline-grid !important; }
  .topbar { padding: 0 16px; } .view { padding: 18px 16px 50px; }
  .gsearch, .today { display: none; }
  .cols-3 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .login { grid-template-columns: 1fr; } .login-art { min-height: 240px; } .login-art h1 { font-size: 36px; }
  .grid-form { grid-template-columns: 1fr; } .span-2 { grid-column: auto; }
  .offer-grid { grid-template-columns: 1fr; }
  .dt-tools .search { width: 100%; }
  .perm-grid { grid-template-columns: 1fr 1fr; }
  .hb { grid-template-columns: 100px 1fr 80px; }
}
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } .roles { grid-template-columns: 1fr; } .week { grid-template-columns: 1fr 1fr; } }

/* ---------- App shell extras: install, PIN screens ---------- */
.side-install { margin: 0 16px 12px; }
.lbl-row { display: flex; justify-content: space-between; align-items: baseline; }
.code-box { font: 600 24px/1.2 ui-monospace, 'Cascadia Code', monospace; letter-spacing: .12em; text-align: center; padding: 18px 12px; border: 1px dashed var(--gold-3); border-radius: 12px; background: var(--bg-2); color: var(--gold-2); margin-bottom: 12px; user-select: all; word-break: break-all; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); }
.stack.tight { gap: 10px; }
.alert .grow { min-width: 0; }
.alert .btn { flex: none; }

/* ---------- Phone & tablet ---------- */
.tabbar { display: none; }
@media (max-width: 860px) {
  /* bottom tab bar replaces the always-on sidebar */
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 22;
    background: var(--topbar-bg); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tab-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; border: 0; background: none; color: var(--muted); font: 500 10.5px var(--sans); letter-spacing: .02em; border-radius: 12px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tab-item .ic { width: 21px; height: 21px; }
  .tab-item.on { color: var(--gold-2); }
  .tab-item.on .ic { stroke-width: 2; }
  .tab-cta span { display: grid; place-items: center; width: 44px; height: 44px; margin-top: -18px; border-radius: 50%; color: var(--gold-ink); background: linear-gradient(180deg, var(--fill-1), var(--fill-2)); box-shadow: 0 8px 20px -8px rgba(var(--gold-rgb), .8); border: 3px solid var(--bg); }
  .tab-cta { color: var(--gold-2); }
  .view { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .topbar .btn[data-act="quickCheckin"] { display: none; }
  .sidebar { z-index: 40; padding-top: env(safe-area-inset-top); }
  body.nav-open .scrim { z-index: 35; }
  .topbar { padding-top: env(safe-area-inset-top); height: calc(60px + env(safe-area-inset-top)); }
  .crumbs { min-width: 0; } .crumbs h1 { font-size: 19px; overflow: hidden; text-overflow: ellipsis; }
  /* 16px inputs stop iPhone Safari zooming in on focus */
  .fld input, .fld select, .fld textarea, .search input, .dt-tools select, .actions select, .actions input[type=date], .inline select, .inline input { font-size: 16px; }
  .hero { padding: 20px; } .hero .display { font-size: 28px; }
  .hero-actions { width: 100%; } .hero-actions .btn { flex: 1; }
  .page-head .actions { width: 100%; } .page-head .actions > .btn { flex: 1; }
  .board { grid-template-columns: repeat(6, 82vw); scroll-snap-type: x mandatory; } .board .col { scroll-snap-align: start; }
  .tabs { overflow-x: auto; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
  .profile .pf-actions { justify-content: flex-start; } .pf-main { min-width: 0; flex-basis: 100%; }
  .avatar.xl { width: 60px; height: 60px; font-size: 22px; }
  .dt-tools { gap: 8px; } .dt-tools select { flex: 1; max-width: none; min-width: 140px; }
  #toasts { left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); } .toast { max-width: none; }
  .login .theme-btn { top: calc(12px + env(safe-area-inset-top)); }
}
@media (max-width: 640px) {
  /* data tables become labelled cards */
  .dt .tbl thead { display: none; }
  .dt .tbl, .dt .tbl tbody, .dt .tbl tr, .dt .tbl td { display: block; width: 100%; }
  .dt .tbl tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .dt .tbl tbody tr:hover td { background: none; }
  .dt .tbl td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 14px; text-align: right; }
  .dt .tbl td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; text-align: left; }
  .dt .tbl td:first-child { padding-bottom: 8px; text-align: left; } .dt .tbl td:first-child::before { display: none; }
  .dt .tbl td[data-label=""]::before { display: none; }
  .dt .tbl td.hide-sm { display: none; }
  .dt .tbl td.row-acts { justify-content: flex-end; padding-top: 8px; }
  .dt .tbl td .cv { min-width: 0; } .dt .tbl .clip { max-width: 62vw; }
  .dt .tbl td[colspan] { display: block; } .dt .tbl td[colspan]::before { display: none; }
  .dt-tools .search { width: 100%; }
  /* pop-ups become bottom sheets */
  .modal-wrap { padding: 0; place-items: end stretch; }
  .modal, .modal.sm, .modal.md, .modal.lg { max-width: none; width: 100%; max-height: 94vh; border-radius: 20px 20px 0 0; border-bottom: 0; transform: translateY(24px); }
  .modal-head { padding: 18px 18px 12px; } .modal-body { padding: 16px 18px; }
  .modal-foot { flex-wrap: wrap; border-radius: 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1 1 40%; }
  .modal-foot .icon-btn { flex: none; }
  .receipt { padding: 18px; } .rc-head { flex-direction: column; } .rc-title { text-align: left; }
  .import-sum { grid-template-columns: 1fr; }
  .offer { flex-direction: column; } .offer-val { width: 100%; height: 70px; flex-direction: row; gap: 8px; }
  .mini-row { grid-template-columns: 1fr 1fr 1fr; gap: 6px; } .mini-row b { font-size: 16px; }
  .feed > div { flex-wrap: wrap; } .feed b { white-space: normal; }
  .rem { padding: 12px 16px; } .rem-type { width: auto; }
  .tr-stats { grid-template-columns: repeat(2, 1fr); }
  .hb { grid-template-columns: 90px 1fr 76px; gap: 8px; }
}
/* tablets in landscape: slimmer sidebar so content gets the room */
@media (min-width: 861px) and (max-width: 1180px) {
  .sidebar { width: 216px; }
  .topbar { padding: 0 20px; } .view { padding: 22px 20px 60px; }
  .gsearch { width: 220px; }
}
/* touch screens: comfortable 40px+ tap targets */
@media (pointer: coarse) {
  .btn { min-height: 42px; } .btn.sm { min-height: 38px; } .btn.xs { min-height: 34px; padding: 0 12px; }
  .icon-btn { width: 42px; height: 42px; } .icon-btn.xs { width: 36px; height: 36px; }
  .nav-item { padding: 11px 10px; }
  .check input { width: 22px; height: 22px; }
  .chip { padding: 7px 14px 7px 7px; }
  .seg button { height: 36px; }
  kbd { display: none; }
}

/* ---------- Light theme · ivory & bronze ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f2eb; --bg-2: #efebe2; --surface: #fffdf9; --surface-2: #f9f6f0; --surface-3: #f0ebe1;
  --line: #e7e0d2; --line-2: #d9cfbd;
  --text: #1c1915; --text-2: #4c463c; --muted: #7d7567;
  --gold: #8a6a2c; --gold-2: #74561d; --gold-3: #b39457; --gold-ink: #1d160a;
  --good: #2e8559; --warn: #9e6b12; --bad: #bf4236; --info: #3567a8; --ice: #23808f;
  --sidebar-bg: linear-gradient(180deg, #fbf9f4, #f4f0e7); --topbar-bg: rgba(245, 242, 235, .88);
  --hero-bg: linear-gradient(135deg, #fffdf8, #f3eee3); --login-bg: #f7f3ea;
  --avatar-bg: radial-gradient(circle at 30% 25%, #fbf4e3, #efe5cf); --avatar-line: #dccaa0;
  --scroll-thumb: #d6cdbb; --hover-line: #c9bda6; --nav-label: #a39a89; --row-hover: rgba(138, 106, 44, .035);
  --backdrop: rgba(40, 32, 20, .32); --shadow-lg: rgba(70, 55, 30, .18); --picker: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 14px 30px -22px rgba(70, 55, 30, .35);
  --series-1: #eda100; --series-2: #2a78d6;
}
:root[data-theme="light"] .avatar { color: var(--gold-2); }
:root[data-theme="light"] .btn.primary { box-shadow: 0 8px 18px -12px rgba(138, 106, 44, .7); }
:root[data-theme="light"] .nav-item.on { background: linear-gradient(90deg, rgba(var(--gold-rgb), .2), rgba(var(--gold-rgb), .04)); }
:root[data-theme="light"] .kpi.gold .kpi-value, :root[data-theme="light"] .plan-price, :root[data-theme="light"] .price-sum .tot b { color: var(--gold-2); }
html { transition: background-color .2s; }
.theme-btn .ic { width: 17px; height: 17px; }
.login .theme-btn { position: fixed; top: 16px; right: 16px; z-index: 5; border-color: var(--line-2); background: var(--surface); }