/* Clesana Partnerportal – Klickdummy
   Layout: feste Petrol-Navigation links, fluider Arbeitsbereich rechts; Karten nur dort, wo ein Objekt eine Grenze braucht. */
:root {
  --bg: #F1F4F4;
  --surface: #FFFFFF;
  --surface-2: #F7F9F9;
  --sunken: #E9EEEE;
  --line: #DEE5E6;
  --line-2: #C9D3D5;
  --fg: #0E1C22;
  --fg-2: #33454C;
  --muted: #62747B;
  --accent: #0A7C76;
  --accent-hover: #086661;
  --accent-soft: #E0F1EE;
  --accent-fg: #FFFFFF;
  --side: #0D2B2F;
  --side-2: #143A3F;
  --side-active: #1B4A50;
  --side-fg: #CFE1E1;
  --side-muted: #7E9FA1;
  --side-strong: #FFFFFF;
  --side-accent: #5FD3C6;
  --ok: #1F7F4C;
  --ok-soft: #E1F2E8;
  --warn: #A86300;
  --warn-soft: #FBEFD9;
  --danger: #BE3A2B;
  --danger-soft: #FBE6E2;
  --info: #2462A6;
  --info-soft: #E3EDF8;
  --gold: #9C7016;
  --gold-soft: #F6EDD6;
  --premium: #2F3A47;
  --premium-soft: #E4E9EF;
  --tl1: 91%;
  --tl2: 82%;
  --tfg: 28%;
  --backdrop: rgba(6, 18, 21, .46);
  --shadow: 0 1px 2px rgba(14, 28, 34, .05), 0 6px 18px rgba(14, 28, 34, .05);
  --shadow-lg: 0 18px 50px rgba(14, 28, 34, .22);
  --f-display: "Bricolage Grotesque", "Onest", system-ui, sans-serif;
  --f-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r-sm: 7px;
  --r: 10px;
  --r-lg: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1215; --surface: #101B1F; --surface-2: #142227; --sunken: #0C171A; --line: #1F3036; --line-2: #2B4047;
    --fg: #E3ECEE; --fg-2: #BACACE; --muted: #85999F;
    --accent: #36BDB0; --accent-hover: #52CFC3; --accent-soft: #10332F; --accent-fg: #05211E;
    --side: #071A1D; --side-2: #0E272B; --side-active: #163A3E; --side-fg: #C3D8D9; --side-muted: #6C8E91; --side-strong: #FFFFFF; --side-accent: #5FD3C6;
    --ok: #4CC07D; --ok-soft: #11301F; --warn: #E2A33B; --warn-soft: #33250E; --danger: #EF6E5E; --danger-soft: #391814; --info: #6AA5E9; --info-soft: #12243A;
    --gold: #D8AD55; --gold-soft: #31270E; --premium: #B9C5D2; --premium-soft: #212B35;
    --tl1: 22%; --tl2: 15%; --tfg: 76%;
    --backdrop: rgba(0, 0, 0, .6);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
    --shadow-lg: 0 18px 50px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A1215; --surface: #101B1F; --surface-2: #142227; --sunken: #0C171A; --line: #1F3036; --line-2: #2B4047;
  --fg: #E3ECEE; --fg-2: #BACACE; --muted: #85999F;
  --accent: #36BDB0; --accent-hover: #52CFC3; --accent-soft: #10332F; --accent-fg: #05211E;
  --side: #071A1D; --side-2: #0E272B; --side-active: #163A3E; --side-fg: #C3D8D9; --side-muted: #6C8E91; --side-strong: #FFFFFF; --side-accent: #5FD3C6;
  --ok: #4CC07D; --ok-soft: #11301F; --warn: #E2A33B; --warn-soft: #33250E; --danger: #EF6E5E; --danger-soft: #391814; --info: #6AA5E9; --info-soft: #12243A;
  --gold: #D8AD55; --gold-soft: #31270E; --premium: #B9C5D2; --premium-soft: #212B35;
  --tl1: 22%; --tl2: 15%; --tfg: 76%;
  --backdrop: rgba(0, 0, 0, .6);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0; letter-spacing: -.012em; text-wrap: balance; color: var(--fg); }
h1 { font-size: 28px; font-weight: 700; line-height: 1.15; }
h2 { font-size: 17px; font-weight: 650; line-height: 1.3; }
h3 { font-size: 15px; font-weight: 600; line-height: 1.35; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--f-mono); font-size: .92em; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 15px; height: 15px; }
.ic.lg { width: 22px; height: 22px; }
.ic.fill { fill: currentColor; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--side) 256px, var(--bg) 256px); }
.side { position: sticky; top: 0; height: 100vh; background: var(--side); color: var(--side-fg); display: flex; flex-direction: column; padding: 18px 14px 14px; overflow-y: auto; z-index: 70; }
.brand { display: flex; align-items: baseline; gap: 9px; padding: 2px 10px 16px; }
.logo { font-family: var(--f-display); font-weight: 700; font-size: 23px; letter-spacing: -.035em; color: var(--side-strong); }
.logo i { font-style: normal; color: var(--side-accent); }
.brand-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--side-muted); font-weight: 600; }
.dealer-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 11px; background: var(--side-2); margin-bottom: 6px; text-decoration: none; color: inherit; }
.dealer-chip:hover { text-decoration: none; background: var(--side-active); }
.dealer-chip .av { background: var(--side-accent); color: var(--side); }
.dealer-chip b { display: block; color: var(--side-strong); font-size: 13px; font-weight: 600; line-height: 1.25; }
.dealer-chip span { font-size: 11.5px; color: var(--side-muted); }
.nav-group { margin-top: 16px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--side-muted); padding: 0 10px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--side-fg); font-weight: 500; font-size: 13.5px; text-decoration: none; }
.nav a:hover { background: var(--side-2); color: var(--side-strong); }
.nav a.active { background: var(--side-active); color: var(--side-strong); }
.nav a.active .ic { color: var(--side-accent); }
.nav .count { margin-left: auto; background: var(--side-accent); color: var(--side); font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; line-height: 19px; }
.nav .count.danger { background: var(--danger); color: #fff; }
.nav .dotn { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--side-accent); }
.side-foot { margin-top: auto; padding-top: 16px; }
.credit { margin-top: 12px; padding: 10px; border: 1px dashed var(--side-active); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; }
.credit-logo { display: block; background: #FFFFFF; border-radius: 8px; padding: 8px 10px; }
.credit-logo img { display: block; width: 100%; max-width: 150px; height: auto; margin: 0 auto; }
.credit p { font-size: 11px; line-height: 1.45; color: var(--side-muted); }
.credit p a { color: var(--side-fg); text-decoration: underline; text-underline-offset: 2px; }
.credit .credit-copy { color: var(--side-muted); opacity: .8; }
.demo-tag { margin-top: 10px; font-size: 11px; color: var(--side-muted); padding: 8px 10px; border: 1px dashed var(--side-active); border-radius: 8px; line-height: 1.4; }

.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; display: flex; align-items: center; gap: 10px; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 480px; min-width: 0; }
.search .ic { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.search input { width: 100%; height: 38px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 0 12px 0 36px; }
.search input::placeholder { color: var(--muted); }
.search kbd { position: absolute; right: 9px; top: 9px; font: 11px var(--f-mono); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; background: var(--surface-2); }
.qres { position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 70vh; overflow: auto; z-index: 40; }
.qres h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 4px; font-family: var(--f-body); font-weight: 600; }
.qres button { display: flex; width: 100%; text-align: left; gap: 10px; align-items: center; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; }
.qres button:hover { background: var(--sunken); }
.qres .empty { padding: 14px; color: var(--muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.bell { position: relative; }
.bell .badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg); }
.notif-pop { position: absolute; right: 0; top: 46px; width: min(380px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; z-index: 45; }
.notif-pop header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 420px; overflow: auto; }
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.notif .ni { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--sunken); color: var(--accent); flex: none; }
.notif b { display: block; font-size: 13px; font-weight: 600; }
.notif span { font-size: 12.5px; color: var(--muted); }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.user-btn .uname { font-size: 13px; font-weight: 550; }
.main { padding: 28px 28px 64px; max-width: 1380px; width: 100%; margin: 0 auto; }
.scrim { display: none; }

/* ---------- Primitives ---------- */
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 12.5px; flex: none; background: var(--accent-soft); color: var(--accent); letter-spacing: .02em; }
.av.sm { width: 26px; height: 26px; font-size: 10.5px; }
.av.lg { width: 56px; height: 56px; font-size: 18px; }
.av.xl { width: 72px; height: 72px; font-size: 22px; }
.av[data-c="1"] { background: var(--info-soft); color: var(--info); }
.av[data-c="2"] { background: var(--gold-soft); color: var(--gold); }
.av[data-c="3"] { background: var(--ok-soft); color: var(--ok); }
.av[data-c="4"] { background: var(--danger-soft); color: var(--danger); }
.av[data-c="5"] { background: var(--premium-soft); color: var(--premium); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--fg); font-weight: 550; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--sunken); }
.btn.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn.soft:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent) 12%); }
.btn.danger { color: var(--danger); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 36px; padding: 0; }
.btn.icon.sm { width: 30px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--sunken); color: var(--muted); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.outline { background: transparent; border: 1px solid var(--line-2); color: var(--fg-2); }
.tier { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.tier.premium { background: var(--premium-soft); color: var(--premium); }
.tier.gold { background: var(--gold-soft); color: var(--gold); }
.tier.basis { background: var(--sunken); color: var(--muted); }
.tier.watch { background: var(--danger-soft); color: var(--danger); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card.flush .card-head { padding: 18px 20px 0; }
.section-gap { margin-top: 18px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.lede { color: var(--muted); margin-top: 6px; max-width: 68ch; }
.lede b { color: var(--fg); font-weight: 600; }

.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.split-r { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kpi .k-label { font-size: 12.5px; color: var(--muted); font-weight: 550; display: flex; align-items: center; gap: 7px; }
.kpi .k-label .ic { color: var(--accent); }
.kpi .k-val { font-family: var(--f-display); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.2; }
.kpi .k-val small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.kpi .k-sub { font-size: 12.5px; color: var(--muted); }
.kpi .k-sub .up { color: var(--ok); font-weight: 600; }
.kpi .k-sub .down { color: var(--danger); font-weight: 600; }

.bar { height: 8px; background: var(--sunken); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .4s; }
.bar.warn > i { background: var(--warn); }
.bar.thin { height: 5px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: 18px; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 12px; font-weight: 550; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs button:hover { color: var(--fg); }
.tabs button.on { color: var(--fg); border-color: var(--accent); }
.tabs .n { font-size: 11px; font-weight: 700; background: var(--sunken); color: var(--muted); border-radius: 99px; padding: 0 7px; line-height: 18px; }
.tabs button.on .n { background: var(--accent-soft); color: var(--accent); }

.seg { display: inline-flex; background: var(--sunken); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 7px; font-weight: 550; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--surface); height: 30px; padding: 0 12px; border-radius: 99px; font-size: 12.5px; font-weight: 550; cursor: pointer; color: var(--fg-2); display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--muted); }
.chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip .x { margin-left: 2px; opacity: .6; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lbl { font-size: 12.5px; font-weight: 600; color: var(--fg-2); }
.hint { font-size: 12px; color: var(--muted); }
.input, .field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), .field select, .field textarea, select.input {
  height: 38px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); padding: 0 11px; width: 100%; min-width: 0;
}
.field textarea { height: auto; padding: 10px 11px; min-height: 92px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); outline-offset: 0; }
.field input[readonly] { background: var(--surface-2); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.span2 { grid-column: 1 / -1; }
.input-group { display: flex; gap: 8px; }
.input-group > :first-child { flex: 1; min-width: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; cursor: pointer; line-height: 1.45; }
.check input { margin-top: 2px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
input[type="range"] { accent-color: var(--accent); width: 100%; }
input[type="range"]:disabled { accent-color: var(--line-2); filter: grayscale(1); opacity: .55; cursor: not-allowed; }
.range-row:has(input:disabled) output { color: var(--muted); }
.file-drop { border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 16px; display: flex; align-items: center; gap: 12px; color: var(--muted); cursor: pointer; background: var(--surface-2); }
.file-drop:hover { border-color: var(--accent); color: var(--fg); }
.file-drop input { display: none; }

.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 99px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.setting { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .s-txt { min-width: 0; }
.setting .s-txt b { display: block; font-weight: 600; }
.setting .s-txt span { font-size: 12.5px; color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: var(--surface-2); }
.t td.r, .t th.r { text-align: right; }
.t tr.unassigned td { background: color-mix(in srgb, var(--danger-soft) 55%, transparent); }
.t tr.unassigned td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.t tr.unassigned.click:hover td { background: var(--danger-soft); }
.kcard.unassigned { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); box-shadow: inset 3px 0 0 var(--danger); }
.assign-alert { background: var(--danger-soft); border-radius: 12px; padding: 14px; margin: -4px -8px 0; }
.assign-alert h3 { color: var(--danger) !important; }
.assign-msg { display: flex; gap: 6px; align-items: center; color: var(--danger); font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--muted); }

/* Lists */
.list { display: flex; flex-direction: column; }
.li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 10px; border-radius: 10px; cursor: pointer; text-align: left; border: 0; background: none; width: 100%; }
.li:hover { background: var(--surface-2); }
.li + .li { border-top: 1px solid var(--line); border-radius: 0; }
.li:hover + .li, .li + .li:hover { border-radius: 0; }
.li-title { font-weight: 600; display: flex; gap: 8px; align-items: center; min-width: 0; }
.li-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 1px; }
.li-meta > * + *::before { content: "·"; margin-right: 10px; color: var(--line-2); }
.li-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .ic { width: 34px; height: 34px; color: var(--line-2); margin-bottom: 8px; }
.empty-state b { display: block; color: var(--fg); font-weight: 600; margin-bottom: 2px; }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: 12px; background: var(--accent-soft); color: var(--fg); }
.callout .ic { color: var(--accent); margin-top: 1px; }
.callout.warn { background: var(--warn-soft); }
.callout.warn .ic { color: var(--warn); }
.callout.danger { background: var(--danger-soft); }
.callout.danger .ic { color: var(--danger); }
.callout .grow b { font-weight: 600; }
.callout p { font-size: 13px; color: var(--fg-2); }

dl.kv { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 13.5px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Dashboard ---------- */
.dash-top { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; }
.score-card { grid-row: span 2; background: var(--side); color: var(--side-fg); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden; isolation: isolate; text-decoration: none; }
.score-card:hover { text-decoration: none; }
.score-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--side-accent) 22%, transparent), transparent 46%),
  repeating-radial-gradient(circle at 100% 0%, transparent 0 22px, color-mix(in srgb, var(--side-accent) 7%, transparent) 22px 23px); }
.score-card h2 { color: var(--side-strong); }
.score-card .sc-top { display: flex; gap: 20px; align-items: center; }
.score-card .sc-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--side-muted); font-weight: 600; }
.score-card .sc-next { font-size: 13px; color: var(--side-fg); }
.score-card .sc-next b { color: var(--side-strong); }
.score-card .bar { background: color-mix(in srgb, var(--side-fg) 16%, transparent); }
.score-card .bar > i { background: var(--side-accent); }
.score-card .sc-parts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.score-card .sc-part { font-size: 11px; color: var(--side-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-card .sc-part b { display: block; font-size: 16px; font-family: var(--f-display); color: var(--side-strong); font-variant-numeric: tabular-nums; }
.score-card .tier { background: color-mix(in srgb, var(--side-strong) 12%, transparent); color: var(--side-strong); }
.score-card .tier.gold { background: color-mix(in srgb, #D8AD55 25%, transparent); color: #F3D58E; }
.score-card .tier.premium { background: color-mix(in srgb, #fff 18%, transparent); color: #fff; }
.ring { position: relative; flex: none; }
.ring svg { display: block; transform: rotate(-90deg); }
.ring .rv { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .rv b { font-family: var(--f-display); font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; display: block; }
.ring .rv span { font-size: 11px; opacity: .7; }
.score-card .ring .rv b { color: var(--side-strong); }
.ring .track { stroke: color-mix(in srgb, var(--side-fg) 16%, transparent); }
.ring .val { stroke: var(--side-accent); transition: stroke-dashoffset .8s ease; }
.ring.light .track { stroke: var(--sunken); }
.ring.light .val { stroke: var(--accent); }

.sla { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.sla.ok { color: var(--ok); }
.sla.warn { color: var(--warn); }
.sla.danger { color: var(--danger); }

.todo { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.todo:last-child { border-bottom: 0; padding-bottom: 0; }
.todo:first-child { padding-top: 0; }
.todo .ti { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.todo .ti.warn { background: var(--warn-soft); color: var(--warn); }
.todo .ti.info { background: var(--info-soft); color: var(--info); }
.todo b { font-weight: 600; display: block; font-size: 13.5px; }
.todo p { font-size: 12.5px; color: var(--muted); }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--f-body); }
.chart .b-lead { fill: color-mix(in srgb, var(--accent) 28%, var(--sunken)); }
.chart .b-win { fill: var(--accent); }
.chart .area { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart .pt-end { fill: var(--accent); stroke: var(--surface); stroke-width: 3; }
.chart .thr { stroke-dasharray: 4 4; stroke-width: 1.2; }
.chart .thr.p { stroke: var(--premium); }
.chart .thr.g { stroke: var(--gold); }
.chart .thr-l { font-size: 10.5px; font-weight: 600; font-family: var(--f-body); }
.chart .thr-l.p { fill: var(--premium); }
.chart .thr-l.g { fill: var(--gold); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.contact-mini { display: flex; gap: 12px; align-items: center; }
.contact-mini b { display: block; font-weight: 600; }

/* ---------- Leads ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search-inline { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .search-inline .ic { position: absolute; left: 10px; top: 10px; color: var(--muted); }
.search-inline input { padding-left: 34px !important; }
.lead-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.col { background: var(--sunken); border-radius: 13px; padding: 10px; min-height: 340px; display: flex; flex-direction: column; gap: 8px; transition: outline-color .15s; outline: 2px dashed transparent; outline-offset: -2px; }
.col.over { outline-color: var(--accent); background: var(--accent-soft); }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 6px; font-weight: 650; font-size: 13px; }
.col-head .n { color: var(--muted); font-weight: 600; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: grab; display: flex; flex-direction: column; gap: 7px; text-align: left; width: 100%; box-shadow: 0 1px 1px rgba(0,0,0,.03); }
.kcard:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.kcard.dragging { opacity: .45; }
.kcard .k1 { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.kcard b { font-weight: 600; font-size: 13.5px; }
.kcard .k2 { font-size: 12px; color: var(--muted); }
.col .hint { text-align: center; padding: 8px; }

.drawer-scrim { position: fixed; inset: 0; background: var(--backdrop); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 49; }
.drawer-scrim.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(580px, 100%); background: var(--surface); box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .26s cubic-bezier(.2,.8,.2,1); z-index: 50; display: flex; flex-direction: column; visibility: hidden; }
.drawer.open { transform: none; visibility: visible; }
.dr-head { padding: calc(18px + env(safe-area-inset-top, 0px)) 22px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.dr-head h2 { font-size: 22px; margin: 2px 0 3px; }
.dr-id { font-size: 12px; color: var(--muted); }
.dr-sub { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.dr-body { padding: 18px 22px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; }
.dr-sec h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-family: var(--f-body); font-weight: 600; margin-bottom: 10px; }
.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.stepper div { font-size: 11.5px; font-weight: 600; color: var(--muted); padding-top: 8px; border-top: 3px solid var(--sunken); }
.stepper div.done { border-color: var(--accent); color: var(--fg); }
.stepper div.cur { border-color: var(--accent); color: var(--accent); }
.stepper.lost div.done { border-color: var(--muted); }
.quote { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 13.5px; line-height: 1.6; color: var(--fg-2); position: relative; }
.contact-box { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cbtn { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; cursor: pointer; min-width: 0; }
.cbtn:hover { border-color: var(--accent); }
.cbtn .ic { color: var(--accent); }
.cbtn span { display: block; font-size: 11.5px; color: var(--muted); }
.cbtn b { display: block; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl { list-style: none; padding: 0; margin: 0; }
.tl li { position: relative; padding: 0 0 14px 24px; font-size: 13px; }
.tl li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--accent); background: var(--surface); z-index: 1; }
.tl li::after { content: ""; position: absolute; left: 8.5px; top: 14px; bottom: 0; width: 1px; background: var(--line-2); }
.tl li:last-child::after { display: none; }
.tl li.note::before { border-color: var(--gold); }
.tl li.sys::before { border-color: var(--muted); }
.tl .tl-meta { font-size: 11.5px; color: var(--muted); }
.stars { display: inline-flex; gap: 1px; color: var(--gold); }
.stars .off { color: var(--line-2); }
.fb { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }

/* ---------- Modal / Toast ---------- */
.modal-back { position: fixed; inset: 0; background: var(--backdrop); display: grid; place-items: center; padding: 16px; z-index: 60; animation: fade .15s ease; }
.modal { background: var(--surface); border-radius: 16px; width: min(560px, 100%); max-height: calc(100% - 24px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.modal.wide { width: min(880px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-head p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.modal-body { padding: 18px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal form { display: contents; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.toasts { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; z-index: 80; max-width: calc(100vw - 36px); }
.toast { background: var(--fg); color: var(--bg); border-radius: 11px; padding: 11px 14px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: pop .2s ease; max-width: 420px; }
.toast .ic { color: var(--side-accent); }
.toast b { font-weight: 600; }

.scanbox { position: relative; height: 150px; border-radius: 12px; background: #0B1A1D; overflow: hidden; display: grid; place-items: center; color: #9FC9C4; font-size: 12.5px; }
.scanbox .frame { position: absolute; inset: 26px 60px; border: 2px solid rgba(95, 211, 198, .8); border-radius: 10px; }
.scanbox .bars { display: flex; gap: 3px; height: 54px; opacity: .85; }
.scanbox .bars i { width: 3px; background: #E8F4F2; }
.scanbox .bars i:nth-child(3n) { width: 1.5px; }
.scanbox .bars i:nth-child(4n) { width: 5px; }
.scanbox .laser { position: absolute; left: 60px; right: 60px; height: 2px; background: #FF5A4E; box-shadow: 0 0 10px #FF5A4E; top: 50%; animation: laser 1.1s ease-in-out infinite alternate; }
@keyframes laser { from { top: 32%; } to { top: 68%; } }

/* ---------- Score ---------- */
.tier-ladder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tl-step { border: 1px solid var(--line); border-radius: 13px; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); position: relative; }
.tl-step.cur { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tl-step .range { font-family: var(--f-display); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tl-step ul { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--fg-2); display: flex; flex-direction: column; gap: 3px; }
.tl-step .here { position: absolute; top: -10px; right: 12px; background: var(--accent); color: var(--accent-fg); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; }
.part { display: grid; grid-template-columns: minmax(0, 1fr) 54px; gap: 6px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.part:last-child { border-bottom: 0; }
.part .p-name { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.part .p-w { font-size: 11px; color: var(--muted); font-weight: 600; background: var(--sunken); border-radius: 5px; padding: 1px 6px; }
.part .p-val { font-family: var(--f-display); font-weight: 700; font-size: 20px; text-align: right; font-variant-numeric: tabular-nums; }
.part .p-metric { font-size: 12.5px; color: var(--muted); grid-column: 1 / -1; }
.part .p-tip { font-size: 12.5px; color: var(--accent); grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; }
.part .bar { grid-column: 1 / -1; }
.score-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 26px; align-items: center; }
.rank { text-align: right; }
.rank b { font-family: var(--f-display); font-size: 30px; font-weight: 700; display: block; line-height: 1.1; }
.rules { display: flex; flex-direction: column; }
.rules details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.rules details:last-child { border-bottom: 0; }
.rules summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.rules summary::-webkit-details-marker { display: none; }
.rules summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 18px; line-height: 1; }
.rules details[open] summary::after { content: "–"; }
.rules details p { margin-top: 8px; color: var(--fg-2); font-size: 13.5px; max-width: 70ch; }

/* ---------- Media ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.mcard { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.mcard:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.mcard.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.thumb { aspect-ratio: 16 / 10; display: grid; place-items: center; position: relative; background: linear-gradient(140deg, hsl(var(--h) 34% var(--tl1)), hsl(var(--h) 28% var(--tl2))); color: hsl(var(--h) 38% var(--tfg)); max-width: 100%; }
.thumb svg.prod { width: 34%; height: auto; fill: currentColor; opacity: .85; }
.thumb .ic { width: 34px; height: 34px; stroke-width: 1.4; }
.thumb .fmt { position: absolute; left: 10px; top: 10px; background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--fg); font-size: 10.5px; font-weight: 700; letter-spacing: .05em; border-radius: 5px; padding: 2px 7px; }
.thumb .dur { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; border-radius: 5px; padding: 1px 6px; font-family: var(--f-mono); }
.mcard .mbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.mcard .mtitle { font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.mcard .mmeta { font-size: 12px; color: var(--muted); }
.mcard .mfoot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; }
.mcard .msel { position: absolute; right: 10px; top: 10px; }
.mcard .msel input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.selbar { position: sticky; bottom: 16px; margin-top: 16px; background: var(--fg); color: var(--bg); border-radius: 12px; padding: 10px 12px 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: var(--shadow-lg); z-index: 5; }
.selbar .btn { background: var(--bg); color: var(--fg); border-color: var(--bg); }

/* ---------- Vehicles ---------- */
.veh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.vcard { border: 1px solid var(--line); background: var(--surface); border-radius: 13px; padding: 16px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; text-align: left; width: 100%; }
.vcard:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.vcard .vmake { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.vcard h3 { font-size: 16px; }
.vcard .vfacts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; font-size: 12px; color: var(--muted); }
.vcard .vfacts b { display: block; color: var(--fg); font-size: 13px; font-weight: 600; }
.photo-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo { aspect-ratio: 4 / 3; border-radius: 10px; background: linear-gradient(140deg, hsl(var(--h) 22% var(--tl1)), hsl(var(--h) 18% var(--tl2))); display: grid; place-items: center; color: hsl(var(--h) 20% var(--tfg)); font-size: 11px; position: relative; max-width: 100%; }
.photo span { position: absolute; left: 8px; bottom: 6px; font-size: 10.5px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }

/* ---------- Academy ---------- */
.cert { display: flex; gap: 20px; align-items: center; background: var(--side); color: var(--side-fg); border-radius: var(--r-lg); padding: 22px 24px; position: relative; overflow: hidden; isolation: isolate; }
.cert::before { content: ""; position: absolute; inset: 0; z-index: -1; background: repeating-radial-gradient(circle at 100% 50%, transparent 0 18px, color-mix(in srgb, var(--side-accent) 8%, transparent) 18px 19px); }
.cert h2 { color: var(--side-strong); font-size: 20px; }
.seal { width: 74px; height: 74px; border-radius: 50%; border: 2px solid var(--side-accent); display: grid; place-items: center; color: var(--side-accent); flex: none; position: relative; }
.seal::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--side-accent) 60%, transparent); }
.seal .ic { width: 30px; height: 30px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.course { border: 1px solid var(--line); border-radius: 13px; padding: 18px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.course .c-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.course p { font-size: 13px; color: var(--muted); }
.course .c-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 4px; }
.lesson { display: flex; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); width: 100%; text-align: left; }
.lesson:hover { border-color: var(--accent); }
.lesson .lc { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; color: var(--accent-fg); }
.lesson.done .lc { background: var(--accent); border-color: var(--accent); }
.lesson .lc .ic { width: 14px; height: 14px; stroke-width: 3; }
.player { aspect-ratio: 16 / 9; border-radius: 12px; background: linear-gradient(140deg, #0D2B2F, #15464C); display: grid; place-items: center; color: #CFE1E1; position: relative; overflow: hidden; max-width: 100%; }
.player .ic { width: 56px; height: 56px; stroke-width: 1.2; }
.player .pbar { position: absolute; left: 14px; right: 14px; bottom: 12px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.2); }
.player .pbar i { display: block; height: 100%; width: 38%; background: #5FD3C6; border-radius: inherit; }
.date-tile { width: 52px; flex: none; text-align: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.date-tile span { display: block; background: var(--accent); color: var(--accent-fg); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 0; }
.date-tile b { display: block; font-family: var(--f-display); font-size: 20px; padding: 3px 0 4px; }

/* ---------- Marketing ---------- */
.cobrand { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 22px; align-items: start; }
.flyer-stage { background: var(--sunken); border-radius: 14px; padding: 26px; display: grid; place-items: center; min-height: 420px; }
.flyer { width: 100%; max-width: 340px; aspect-ratio: 148 / 210; background: #F4F7F6; color: #0E1C22; border-radius: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.18); display: flex; flex-direction: column; overflow: hidden; font-family: var(--f-body); }
.flyer.square { aspect-ratio: 1 / 1; max-width: 380px; }
.flyer.wide { aspect-ratio: 16 / 9; max-width: 520px; }
.flyer .f-img { flex: 1.15; background: linear-gradient(150deg, #0D2B2F 0%, #15535A 60%, #2A8C86 100%); position: relative; display: grid; place-items: center; color: rgba(255,255,255,.9); min-height: 0; }
.flyer.v-light .f-img { background: linear-gradient(150deg, #DDEFEB 0%, #BFE2DC 100%); color: #0A7C76; }
.flyer.v-sand .f-img { background: linear-gradient(150deg, #E9DFCB 0%, #CDBB97 100%); color: #5A4720; }
.flyer .f-img svg { width: 30%; fill: currentColor; opacity: .9; }
.flyer .f-brand { position: absolute; left: 7%; top: 6%; font-family: var(--f-display); font-weight: 700; font-size: clamp(12px, 3.6cqw, 18px); letter-spacing: -.03em; color: #fff; }
.flyer.v-light .f-brand, .flyer.v-sand .f-brand { color: #0E1C22; }
.flyer .f-txt { padding: 7% 7% 4%; display: flex; flex-direction: column; gap: 6px; }
.flyer .f-h { font-family: var(--f-display); font-weight: 700; font-size: 21px; line-height: 1.1; letter-spacing: -.02em; color: #0E1C22; }
.flyer .f-s { font-size: 11.5px; color: #3A4B52; line-height: 1.45; }
.flyer .f-dealer { margin-top: auto; border-top: 1px solid #D5DFDF; padding: 4% 7%; display: flex; gap: 10px; align-items: center; background: #FFFFFF; }
.flyer .f-logo { width: 34px; height: 34px; border-radius: 8px; background: #0A7C76; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.flyer .f-dealer b { display: block; font-size: 11.5px; color: #0E1C22; }
.flyer .f-dealer span { display: block; font-size: 10px; color: #5A6B71; }
.flyer.wide { flex-direction: row; }
.flyer.wide .f-img { flex: 1; }
.flyer.wide .f-right { flex: 1; display: flex; flex-direction: column; }
.tpl-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tpl-pick button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: 12px; font-weight: 550; }
.tpl-pick button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tpl-pick i { width: 100%; height: 32px; border-radius: 6px; display: block; }
.budget { display: flex; flex-direction: column; gap: 10px; }
.budget .b-nums { display: flex; justify-content: space-between; align-items: baseline; }
.budget .b-nums b { font-family: var(--f-display); font-size: 26px; font-weight: 700; }

/* ---------- Profile ---------- */
.prev-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.prev-bar { display: flex; gap: 6px; align-items: center; padding: 9px 12px; background: var(--sunken); border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.prev-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); display: inline-block; }
.prev-bar .url { margin-left: 8px; background: var(--surface); border-radius: 6px; padding: 2px 10px; font-family: var(--f-mono); font-size: 11px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prev-map { height: 130px; background:
  linear-gradient(0deg, transparent 48%, color-mix(in srgb, var(--accent) 18%, transparent) 48% 52%, transparent 52%),
  linear-gradient(90deg, transparent 30%, color-mix(in srgb, var(--muted) 16%, transparent) 30% 32%, transparent 32%),
  linear-gradient(35deg, transparent 60%, color-mix(in srgb, var(--muted) 14%, transparent) 60% 62%, transparent 62%),
  var(--surface-2); position: relative; }
.prev-map .mpin { position: absolute; left: 46%; top: 30%; color: var(--accent); }
.prev-map .mpin .ic { width: 30px; height: 30px; fill: var(--accent); stroke: var(--surface); }
.prev-in { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.prev-in .badges { display: flex; gap: 6px; flex-wrap: wrap; }
.hours { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 10px; font-size: 12.5px; }
.hours span:nth-child(odd) { color: var(--muted); font-weight: 600; }
.hours-edit { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px 10px; align-items: center; }
.hours-edit span { font-weight: 600; color: var(--muted); font-size: 12.5px; }
.photos-edit { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.photos-edit .photo { aspect-ratio: 1; }
.photos-edit label { aspect-ratio: 1; border: 1.5px dashed var(--line-2); border-radius: 10px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.photos-edit label:hover { border-color: var(--accent); color: var(--accent); }
.photos-edit input { display: none; }

/* ---------- Wholesale / Contacts ---------- */
.ws-card { display: flex; flex-direction: column; gap: 12px; }
.ws-card .ws-logo { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; color: #fff; flex: none; }
.avail { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.avail i { width: 8px; height: 8px; border-radius: 50%; }
.avail.ok i { background: var(--ok); }
.avail.warn i { background: var(--warn); }
.avail.danger i { background: var(--danger); }
.person-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; }
.person-hero h2 { font-size: 22px; }
.copy-line { display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 12px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.copy-line .ic { color: var(--accent); }
.copy-line .v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; user-select: all; }
.slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.slot-day { display: flex; flex-direction: column; gap: 6px; }
.slot-day > b { font-size: 12px; text-align: center; color: var(--muted); font-weight: 600; }
.slot { border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; height: 32px; font-size: 12.5px; font-weight: 550; cursor: pointer; font-variant-numeric: tabular-nums; }
.slot:hover { border-color: var(--accent); }
.slot.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.slot[disabled] { opacity: .35; cursor: not-allowed; text-decoration: line-through; }

/* ---------- News ---------- */
.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.news { border: 1px solid var(--line); background: var(--surface); border-radius: 13px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; text-align: left; width: 100%; padding: 0; }
.news:hover { box-shadow: var(--shadow); border-color: var(--line-2); }
.news .n-img { height: 120px; background: linear-gradient(140deg, hsl(var(--h) 34% var(--tl1)), hsl(var(--h) 28% var(--tl2))); color: hsl(var(--h) 38% var(--tfg)); display: grid; place-items: center; }
.news .n-img .ic { width: 34px; height: 34px; stroke-width: 1.4; }
.news .n-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.news .n-body p { color: var(--muted); font-size: 13px; }
.news.unread h3::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 2px; }

/* ---------- Settings ---------- */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.snav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px; }
.snav button { display: flex; gap: 10px; align-items: center; border: 0; background: none; padding: 9px 12px; border-radius: 9px; cursor: pointer; text-align: left; color: var(--fg-2); font-weight: 550; }
.snav button:hover { background: var(--sunken); }
.snav button.on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.snav button.on .ic { color: var(--accent); }
.matrix th:not(:first-child), .matrix td:not(:first-child) { text-align: center; width: 90px; }
.matrix input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.iban { font-family: var(--f-mono); font-size: 15px; letter-spacing: .04em; }
.plz-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.range-row { display: flex; gap: 14px; align-items: center; }
.range-row output { font-family: var(--f-display); font-weight: 700; font-size: 18px; min-width: 70px; text-align: right; font-variant-numeric: tabular-nums; }
.radius-vis { height: 150px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); position: relative; overflow: hidden; }
.radius-vis .circle { position: absolute; left: 50%; top: 50%; border-radius: 50%; background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1.5px solid var(--accent); transform: translate(-50%, -50%); transition: width .2s, height .2s; }
.radius-vis .center { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); transform: translate(-50%, -50%); box-shadow: 0 0 0 4px var(--surface); }
.radius-vis .dot { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .55; }
.radius-vis .dot.in { background: var(--accent); opacity: 1; }
.radius-vis .lab { position: absolute; font-size: 10.5px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .dash-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-card { grid-column: 1 / -1; grid-row: auto; }
  .split, .split-r { grid-template-columns: minmax(0, 1fr); }
  .tier-ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cobrand { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 276px; transform: translateX(-100%); transition: transform .25s ease; padding-top: calc(18px + env(safe-area-inset-top, 0px)); }
  body.nav-open .side { transform: none; box-shadow: var(--shadow-lg); }
  .scrim { display: block; position: fixed; inset: 0; background: var(--backdrop); z-index: 65; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .top .menu-btn { display: inline-flex; }
  .app { background: var(--bg); }
  .top { padding: 10px 16px; }
  .main { padding: 20px 16px 64px; }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .snav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .snav button { white-space: nowrap; }
  .g3 { grid-template-columns: minmax(0, 1fr); }
  .score-hero { grid-template-columns: auto minmax(0, 1fr); }
  .score-hero .rank { grid-column: 1 / -1; text-align: left; }
  .user-btn .uname, .search kbd, .hide-md { display: none; }
}
@media (max-width: 640px) {
  h1 { font-size: 23px; }
  .dash-top, .g2, .g4, .tier-ladder { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .score-card .sc-parts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .contact-box { grid-template-columns: minmax(0, 1fr); }
  .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .person-hero { grid-template-columns: minmax(0, 1fr); }
  .hide-sm { display: none; }
  .modal-back { padding: 0; place-items: end stretch; }
  .modal, .modal.wide { width: 100%; max-height: 92%; border-radius: 16px 16px 0 0; }
  .photos-edit { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .top .btn-sim span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body.compact .card { padding: 15px; }
body.compact .t td { padding: 8px 12px; }
body.compact .li { padding: 8px 10px; }
body.compact .main { padding-top: 20px; }
