/* © TRADE COUNTRY LLP (BCRM). All rights reserved.
   BCRM cabinet: the same look as the Kerme console (Inter, local; tokens for light and dark; cards, pills,
   the accent gradient), its own mark and a teal note in the accent. CRM parts are at the end. */
@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:100 900;src:url(fonts/inter-cyrillic-ext-wght-normal.woff2) format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:100 900;src:url(fonts/inter-cyrillic-wght-normal.woff2) format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:100 900;src:url(fonts/inter-latin-ext-wght-normal.woff2) format("woff2-variations");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:100 900;src:url(fonts/inter-latin-wght-normal.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

/* D-72: lavender-grey background with soft blue-violet spots, white cards (radius 24, soft shadow, no
   border), the blue → violet accent gradient, the warm peach → orange gradient for warnings */
:root {
  --bg: #f1f1fa; --surface: #ffffff; --surface-2: #f3f3fb; --hover: #eef0fd; --ink: #14142b; --ink-2: #383856; --muted: #5b5b76; --line: #e4e4f2; --line-strong: #d0d0e6;
  --accent: #3a47e3; --accent-ink: #ffffff; --accent-soft: #e9ecff; --accent-line: #b9c0f7;
  --grad-a: #2a62f5; --grad-b: #5b3bf0; --grad: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  --warm-a: #ffe6d6; --warm-b: #fff4ec; --warm: linear-gradient(90deg, var(--warm-a), var(--warm-b)); --warm-ink: #2b1406; --spot: none;
  --spot-1: rgba(127, 149, 255, .35); --spot-2: rgba(183, 166, 255, .22); --spot-3: rgba(207, 224, 255, .45);
  --ok: #1c7547; --ok-soft: #ddf4e7; --warn: #8a4e06; --warn-soft: #fff0da; --bad: #b3261e; --bad-soft: #fde6e2;
  --role-owner: #5b3bf0; --role-master: #ff8f5c; --role-seller: #2a62f5; --role-other: #a3a0bd;
  --shadow: 0 10px 28px rgba(59, 53, 119, .07), 0 1px 4px rgba(59, 53, 119, .04);
  --shadow-pop: 0 18px 40px rgba(59, 53, 119, .18), 0 2px 8px rgba(59, 53, 119, .08);
  --radius: 24px; --radius-s: 14px;
  --side: 248px; --top: 64px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11101e; --surface: #1c1b2f; --surface-2: #25243b; --hover: #2a2843; --ink: #edecf8; --ink-2: #cfcde3; --muted: #a6a3c2; --line: #302e4a; --line-strong: #3d3a5c;
    --accent: #9da6ff; --accent-ink: #12122e; --accent-soft: #262a55; --accent-line: #3f4a9a;
    --grad-a: #2e66f6; --grad-b: #5e3ff2; --spot: none; --warm-a: #3f271b; --warm-b: #2c1f1b; --warm-ink: #ffe9dc;
    --spot-1: rgba(46, 68, 176, .55); --spot-2: rgba(85, 48, 159, .5); --spot-3: rgba(90, 42, 85, .3);
    --ok: #5dcb8f; --ok-soft: #15301f; --warn: #f1b45b; --warn-soft: #362813; --bad: #ff8b7b; --bad-soft: #3d1c19;
    --role-owner: #a699ff; --role-master: #ff9e66; --role-seller: #6f95ff; --role-other: #7d7a99;
    --shadow: 0 10px 28px rgba(0, 0, 0, .35); --shadow-pop: 0 18px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11101e; --surface: #1c1b2f; --surface-2: #25243b; --hover: #2a2843; --ink: #edecf8; --ink-2: #cfcde3; --muted: #a6a3c2; --line: #302e4a; --line-strong: #3d3a5c;
  --accent: #9da6ff; --accent-ink: #12122e; --accent-soft: #262a55; --accent-line: #3f4a9a;
  --grad-a: #2e66f6; --grad-b: #5e3ff2; --spot: none; --warm-a: #3f271b; --warm-b: #2c1f1b; --warm-ink: #ffe9dc;
  --spot-1: rgba(46, 68, 176, .55); --spot-2: rgba(85, 48, 159, .5); --spot-3: rgba(90, 42, 85, .3);
  --ok: #5dcb8f; --ok-soft: #15301f; --warn: #f1b45b; --warn-soft: #362813; --bad: #ff8b7b; --bad-soft: #3d1c19;
  --role-owner: #a699ff; --role-master: #ff9e66; --role-seller: #6f95ff; --role-other: #7d7a99;
  --shadow: 0 10px 28px rgba(0, 0, 0, .35); --shadow-pop: 0 18px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
html, body { margin: 0; color: var(--ink); }
body { background: transparent; min-height: 100vh; }
/* the spots: radial gradients (no blur) on a fixed layer of their own, so scrolling never repaints them */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; will-change: transform;
  background: var(--spot) top right / min(62vw, 900px) auto no-repeat, linear-gradient(var(--spot-3), transparent 45%),
    radial-gradient(60vw 60vw at 102% -4%, var(--spot-1), transparent 70%), radial-gradient(45vw 45vw at 62% -8%, var(--spot-2), transparent 70%),
    radial-gradient(50vw 50vw at -10% 70%, var(--spot-2), transparent 70%), radial-gradient(40vw 40vw at 105% 95%, var(--spot-3), transparent 70%); opacity: .9; }
[dir="rtl"] body::before { transform: scaleX(-1); }
.brand img, .brand .logo { filter: drop-shadow(0 4px 10px rgba(42, 98, 245, .3)); }
body { font: 400 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1 { font-size: 32px; line-height: 1.15; font-weight: 800; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 17px; line-height: 1.35; font-weight: 700; margin: 0; }
h3 { font-size: 14px; font-weight: 600; margin: 0; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; text-align: end; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boot { padding: 48px; color: var(--muted); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.s { width: 16px; height: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { flex: 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- shell ---- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.app.collapsed { --side: 64px; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(1.3) blur(12px); border-inline-end: 0; box-shadow: var(--shadow); display: flex; flex-direction: column; padding: 12px 10px; gap: 2px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 6px; margin-bottom: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.01em; white-space: nowrap; }
.brand img, .brand .logo { width: 32px; height: 32px; flex: none; }
.brand small { font-weight: 500; color: var(--muted); font-size: 13px; }
.group { font-size: 12px; font-weight: 500; color: var(--muted); padding: 14px 10px 6px; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); cursor: pointer; text-align: start; font-weight: 500; white-space: nowrap; position: relative; }
.nav:hover { background: var(--hover); color: var(--ink); }
/* the active section: the accent-gradient pill */
.nav.on { background: var(--grad); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--grad-b) 30%, transparent); }
.nav.on .icon { color: #fff; }
.nav.on .badge { background: #fff; color: var(--grad-b); }
.nav .badge { margin-inline-start: auto; }
.side .foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.app.collapsed .side .label, .app.collapsed .group, .app.collapsed .brand small, .app.collapsed .nav .badge { display: none; }
.app.collapsed .group { display: block; height: 10px; padding: 0; }
.app.collapsed .nav { justify-content: center; padding: 0; }

.top { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 0; }
.top .title { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .crumb { color: var(--muted); font-weight: 500; }
.searchbtn { display: flex; align-items: center; gap: 8px; width: min(360px, 38vw); height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); color: var(--muted); cursor: pointer; }
.searchbtn kbd { margin-inline-start: auto; }
kbd { font: 500 12px Inter, system-ui, sans-serif; color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface-2); }
.who { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 700; font-size: 14px; box-shadow: 0 0 0 3px var(--surface), var(--shadow); }
.content { padding: 24px; max-width: 1280px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pagehead p { margin-top: 4px; color: var(--muted); max-width: 72ch; }
.menu-btn { display: none; }
.scrim { display: none; }

/* ---- buttons, inputs ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap; transition: transform .12s ease-out, filter .12s; }
.btn:active:not(:disabled) { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { .btn, .btn:active { transition: none; transform: none; } }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--grad-b) 30%, transparent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.icon-only { width: 36px; padding: 0; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.sm.icon-only { width: 30px; }
.btn:disabled { opacity: .5; cursor: default; }
.seg { display: inline-flex; gap: 4px; max-width: 100%; padding: 4px; border: 0; border-radius: 999px; overflow-x: auto; background: var(--surface); box-shadow: var(--shadow); scrollbar-width: none; }
.seg button { flex: none; }
.seg button { border: 0; background: none; height: 32px; padding: 0 14px; cursor: pointer; color: var(--ink-2); font-weight: 600; border-radius: 999px; }
.seg button.on { background: var(--grad); color: #fff; }
input:not([type=checkbox]):not([type=radio]), select, textarea { height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); min-width: 0; }
textarea { height: auto; min-height: 88px; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .error { font-size: 12px; color: var(--bad); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form .wide { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + i { background: var(--grad); }
.switch input:checked + i::after { transform: translateX(16px); }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---- cards, pills ---- */
.card { background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); animation: appear .42s ease-out both; }
@keyframes appear { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } }
.card.warm { background: var(--warm); color: var(--warm-ink); }
.card > .hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 0; flex-wrap: wrap; }
.card > .hd p { color: var(--muted); font-size: 13px; }
.card > .bd { padding: 8px 20px 20px; }
.card > .bd.flush { padding: 0; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.muted { opacity: .55; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 16px; color: var(--muted); }
.empty .icon { width: 28px; height: 28px; color: var(--muted); }
.empty b { color: var(--ink); font-weight: 600; font-size: 16px; }
.empty p { max-width: 48ch; }
.empty .btn { margin-top: 6px; }
.note { display: flex; gap: 10px; padding: 14px 18px; border-radius: 20px; background: var(--accent-soft); color: var(--ink); }
.note.warn { background: var(--warm); color: var(--warm-ink); }
.note.warn .icon { color: var(--warm-ink) !important; }
.note .icon { color: var(--accent); margin-top: 2px; }
.note.warn .icon { color: var(--warn); }

/* ---- overview ---- */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.metric .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.metric .value { font-size: 34px; line-height: 1.15; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric .value .unit { font-size: 18px; color: var(--muted); font-weight: 600; margin-inline-start: 3px; letter-spacing: 0; }
.metric .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); } .delta.flat { color: var(--muted); }
.delta small { color: var(--muted); font-weight: 400; margin-inline-start: 4px; }
.spark { width: 104px; height: 34px; flex: none; overflow: visible; }
.spark path { fill: none; stroke-width: 2.4; stroke-linecap: round; }
.spark path.area { stroke: none; opacity: .18; }
.spark circle { fill: var(--grad-b); stroke: var(--surface); stroke-width: 2; animation: pop .25s ease-out .85s both; }
@keyframes pop { from { opacity: 0; } }
.ga { stop-color: var(--grad-a); } .gb { stop-color: var(--grad-b); } /* gradient stops: CSS, the console's CSP has no inline styles */
/* lines draw themselves in */
.spark path:not(.area), .chart path.line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .9s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .spark path:not(.area), .chart path.line, .spark circle { animation: none; stroke-dashoffset: 0; } }
.secondary { display: flex; flex-wrap: wrap; gap: 0; padding: 0; }
.secondary > div { flex: 1 1 140px; padding: 16px 20px; border-inline-start: 1px solid var(--line); min-width: 0; }
.secondary > div:first-child { border-inline-start: 0; }
.secondary b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.secondary span { color: var(--muted); font-size: 12px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 260px; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart .axis text { fill: var(--muted); font-size: 12px; }
.chart .hoverbar { fill: var(--hover); }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 0; border-radius: 16px; box-shadow: var(--shadow-pop); padding: 8px 10px; font-size: 13px; min-width: 150px; z-index: 5; }
.tip .t { font-weight: 600; margin-bottom: 4px; }
.tip .r { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.share { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.share .bar { width: 80px; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.share .bar i { display: block; height: 100%; background: var(--grad); border-radius: 999px; }

.meter { display: grid; gap: 6px; }
.meter .bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.meter .bar.warn i { background: var(--warn); }
.meter .bar.full i { background: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.kind { display: flex; gap: 12px; align-items: flex-start; text-align: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.kind:hover { border-color: var(--accent); }
.kind .icon { flex: none; color: var(--accent); margin-top: 2px; }
.hook { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.hook code { display: block; margin-top: 4px; }
.wrap { overflow-wrap: anywhere; word-break: break-all; }
.pad { padding: 12px 20px 16px; }
.block { display: block; }
.pre { white-space: pre-wrap; }
.sub-band { display: flex; gap: 10px; align-items: center; padding: 10px 20px; background: var(--accent-soft); color: var(--ink); font-size: 14px; flex-wrap: wrap; }
.sub-band.warn { background: var(--warn-soft); color: var(--warn); }
.sub-band.bad { background: var(--bad-soft); color: var(--bad); }
.stack.tight { gap: 6px; }
.ev audio { width: 100%; max-width: 360px; height: 36px; }

/* ---- data table ---- */
.dt { display: flex; flex-direction: column; min-width: 0; }
.dt .tools { display: flex; align-items: center; gap: 8px; padding: 16px 20px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.dt .tools .search { position: relative; flex: 1 1 220px; max-width: 360px; }
.dt .tools .search input { width: 100%; padding-inline-start: 32px; }
.dt .tools .search .icon { position: absolute; inset-inline-start: 10px; top: 9px; color: var(--muted); }
.dt .bulk { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--accent-soft); border-bottom: 1px solid var(--accent-line); flex-wrap: wrap; }
.dt .wrap { overflow: auto; max-height: min(70vh, 720px); }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { position: sticky; top: 0; z-index: 2; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
th.sort { cursor: pointer; user-select: none; }
th.sort:hover { color: var(--ink); }
th .icon { width: 14px; height: 14px; vertical-align: -2px; margin-inline-start: 2px; }
th:first-child, td:first-child { padding-inline-start: 20px; }
th:last-child, td:last-child { padding-inline-end: 20px; }
tbody tr:hover td { background: var(--hover); }
tbody tr.sel td { background: var(--accent-soft); }
tbody tr:last-child td { border-bottom: 0; }
td.cb, th.cb { width: 40px; padding-inline-end: 0; }
td.act { width: 1%; white-space: nowrap; text-align: end; }
.dt.compact th, .dt.compact td { padding-top: 5px; padding-bottom: 5px; }
.dt .pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.cell-main { font-weight: 500; }
.cell-sub { color: var(--muted); font-size: 12px; }
.clickable { cursor: pointer; }

/* ---- menus, modals, toasts, palette ---- */
.pop { position: fixed; z-index: 60; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 4px; }
.pop button { display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 10px; border: 0; background: none; border-radius: var(--radius-s); cursor: pointer; text-align: start; color: var(--ink); white-space: nowrap; }
.pop button:hover, .pop button.on { background: var(--hover); }
.pop button.danger { color: var(--bad); }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.modal-back { position: fixed; inset: 0; z-index: 70; background: rgba(10, 14, 20, .45); display: grid; place-items: start center; padding: 10vh 16px 16px; overflow-y: auto; }
.modal { width: min(560px, 100%); background: var(--surface); border-radius: 28px; box-shadow: var(--shadow-pop); border: 0; }
.modal.wide { width: min(880px, 100%); }
.modal .hd { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal .hd h2 { flex: 1; }
.modal .bd { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal .ft { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 28px 28px; flex-wrap: wrap; }
.modal pre { margin: 0; white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border-radius: var(--radius-s); padding: 10px; font: 12px/1.5 var(--mono); max-height: 50vh; overflow: auto; }
.toasts { position: fixed; inset-inline-end: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; box-shadow: var(--shadow-pop); font-weight: 500; max-width: 420px; }
.toast.bad { background: var(--bad); color: #fff; }
.palette { width: min(620px, 100%); }
.palette input { width: 100%; height: 56px !important; border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 28px 28px 0 0 !important; font-size: 16px; padding-block: 0 !important; padding-inline: 44px 16px !important; box-shadow: none !important; }
.palette .in { position: relative; }
.palette .in .icon { position: absolute; inset-inline-start: 16px; top: 17px; color: var(--muted); }
.palette .res { max-height: 56vh; overflow-y: auto; padding: 6px; }
.palette .grp { font-size: 12px; color: var(--muted); font-weight: 500; padding: 8px 10px 4px; }
.palette .it { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-s); background: none; cursor: pointer; text-align: start; color: var(--ink); }
.palette .it.on { background: var(--accent-soft); }
.palette .it .cell-sub { margin-inline-start: auto; }
.palette .foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

/* ---- login ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(420px, 100%); padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.login .brand { padding: 0; margin: 0; }
.login .err { color: var(--bad); font-size: 13px; min-height: 18px; }

/* ---- responsive: laptop 1280–1440 first; tablet and phone hide the menu ---- */
@media (max-width: 1100px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1024px) {
  .app, .app.collapsed { grid-template-columns: minmax(0, 1fr); --side: 260px; }
  .side { position: fixed; inset-inline-start: 0; top: 0; bottom: 0; width: var(--side); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-pop); }
  .app.open .side { transform: none; }
  .app.collapsed .side .label, .app.collapsed .group, .app.collapsed .brand small { display: revert; }
  .app.collapsed .nav { justify-content: flex-start; padding: 0 10px; }
  .app.open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(10, 14, 20, .35); }
  .menu-btn { display: inline-flex; }
  .collapse-btn { display: none !important; }
  .two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .top { padding: 0 12px; gap: 8px; }
  .content { padding: 16px; }
  .searchbtn { width: 36px; padding: 0; justify-content: center; }
  .searchbtn span, .searchbtn kbd, .who .name { display: none; }
  .metrics { grid-template-columns: minmax(0, 1fr); }
  .metric .value { font-size: 24px; }
  .secondary > div { flex-basis: 50%; border-inline-start: 0; border-top: 1px solid var(--line); }
  .form { grid-template-columns: minmax(0, 1fr); }
}
.col { min-width: 0; display: flex; flex-direction: column; }
.card > .hd > .row, .pagehead > .row { min-width: 0; max-width: 100%; }
.card > .hd > div:first-child { min-width: 0; }
[hidden] { display: none !important; }
.btn.menu-btn { display: none; }
@media (max-width: 1024px) { .btn.menu-btn { display: inline-flex; } }
.content > .seg { align-self: flex-start; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
.tablewrap td input { width: 100%; min-width: 96px; }
.tablewrap td .btn { white-space: nowrap; }
.row.nowrap { flex-wrap: nowrap; }

/* right to left (Arabic): the drawer comes from the right, arrows and the switch knob flip */
[dir="rtl"] .side { transform: none; }
@media (max-width: 1024px) { [dir="rtl"] .side { transform: translateX(100%); } [dir="rtl"] .app.open .side { transform: none; } }
[dir="rtl"] .switch input:checked + i::after { transform: translateX(-16px); }
[dir="rtl"] .switch i::after { left: auto; right: 2px; }
[dir="rtl"] .icon.flip, [dir="rtl"] .nav .icon.flip { transform: scaleX(-1); }

/* ---- support conversation and photos (D-74) ---- */
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; padding: 4px; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 18px; background: var(--surface-2); }
.msg.support { align-self: flex-end; background: var(--accent-soft); }
.msg .who { display: flex; gap: 8px; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.msg p { white-space: pre-wrap; word-break: break-word; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.thumb { width: 88px; height: 88px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: zoom-in; background: var(--surface); box-shadow: var(--shadow); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(5, 6, 12, .92); display: flex; flex-direction: column; color: #fff; }
.lightbox .btn.ghost { color: #fff; }
.lightbox .btn.ghost:hover { background: rgba(255, 255, 255, .12); }
.lb-top { display: flex; align-items: center; gap: 6px; padding: 10px 14px; }
.lb-count { font-weight: 600; }
.lb-stage { flex: 1; display: grid; place-items: center; overflow: auto; padding: 8px 56px 24px; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 8px; transition: transform .2s ease-out; cursor: zoom-in; transform-origin: center; }
.lb-stage img.zoomed { cursor: zoom-out; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lb-nav.prev { inset-inline-start: 10px; } .lb-nav.next { inset-inline-end: 10px; }
@media (prefers-reduced-motion: reduce) { .lb-stage img { transition: none; } }
@media (max-width: 640px) { .lb-stage { padding: 8px 8px 24px; } .msg { max-width: 95%; } }


/* ================= BCRM ================= */
:root { --grad-a: #1b8f9e; --grad-b: #2a62f5; --accent: #1f5fd6; --accent-soft: #e5f0ff; --teal: #1fa3a3; }
:root[data-theme="dark"] { --grad-a: #1b8f9e; --grad-b: #3a6cf6; --accent: #8fb3ff; --accent-soft: #1f2d52; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --grad-a: #1b8f9e; --grad-b: #3a6cf6; --accent: #8fb3ff; --accent-soft: #1f2d52; } }
.logo { width: 32px; height: 32px; flex: none; }
.side .company { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 0 12px; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 600; text-align: start; }
.side .company .label { flex: 1; min-width: 0; }
.side .company:hover { background: var(--hover); }
.app.collapsed .side .company { justify-content: center; }
.sync { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; max-width: 260px; }
.sync .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync.ok { color: var(--ok); } .sync.warn { color: var(--warn); background: var(--warn-soft); } .sync.bad { color: var(--bad); background: var(--bad-soft); }
.support-banner { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 8px 16px; background: var(--warm); color: var(--warm-ink); font-weight: 600; font-size: 13px; }
.note { align-items: flex-start; }
.note > span { min-width: 0; }
select.big { height: 44px; font-size: 20px; font-weight: 800; border: 0; background: transparent; padding-inline: 0 28px; max-width: 100%; }
.seg button { display: inline-flex; align-items: center; gap: 6px; }
.seg button .icon { width: 16px; height: 16px; }
.seg button.on .icon { color: #fff; }

/* filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .search { position: relative; flex: 1 1 220px; max-width: 360px; }
.filters .search input { width: 100%; padding-inline-start: 34px; border-radius: 999px; }
.filters .search .icon { position: absolute; inset-inline-start: 12px; top: 12px; color: var(--muted); }
.filters select { border-radius: 999px; max-width: 220px; }

/* the board */
.board { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 16px; scroll-snap-type: x proximity; min-height: 360px; align-items: flex-start; }
.column { flex: 0 0 280px; max-width: 280px; display: flex; flex-direction: column; gap: 10px; background: color-mix(in srgb, var(--surface) 55%, transparent); border-radius: 22px; padding: 10px; scroll-snap-align: start; min-height: 240px; transition: background .12s, box-shadow .12s; }
.column.over, .zone.over { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent-line); }
.colhead { display: flex; flex-direction: column; gap: 2px; padding: 4px 6px 2px; position: relative; }
.colhead .bar { display: block; height: 4px; border-radius: 999px; margin-bottom: 8px; }
.colhead b { font-size: 14px; }
.count { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; box-shadow: var(--shadow); }
.count.late { background: var(--bad); color: #fff; } .count.today { background: var(--accent); color: var(--accent-ink); }
.column .add { align-self: stretch; justify-content: flex-start; border: 1px dashed var(--line-strong); }
.cards { display: flex; flex-direction: column; gap: 8px; }
.cards .none { padding: 12px 6px; text-align: center; }
.deal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; border: 1px solid transparent; min-width: 0; }
.deal:hover { border-color: var(--accent-line); }
.deal:focus-visible { outline: 2px solid var(--accent); }
.deal.dragging { opacity: .45; }
.deal .move { margin-inline-end: -6px; }
.deal .meta { font-size: 12px; color: var(--muted); }
.deal .sum { font-weight: 700; color: var(--ink-2); }
.deal .late { color: var(--bad); display: inline-flex; }
.mini-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: none; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.zones { position: sticky; bottom: 12px; display: flex; gap: 12px; z-index: 5; }
.zone { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); font-weight: 600; cursor: pointer; border: 2px dashed transparent; }
.zone.won { color: var(--ok); } .zone.lost { color: var(--muted); }
body.dragging-on .zone { border-color: currentColor; }

/* stage pills, the stage bar */
.pill.stage .sw { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.pill.stage.won { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.stage.lost { color: var(--muted); }
.stagebar { display: flex; gap: 4px; overflow-x: auto; padding: 4px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); scrollbar-width: thin; }
.stagebar button { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-weight: 600; cursor: pointer; white-space: nowrap; }
.stagebar button:hover:not(:disabled) { background: var(--hover); }
.stagebar button.on { background: var(--st, var(--grad-b)); color: #fff; }
.stagebar button.on.won { background: var(--ok); } .stagebar button.on.lost { background: var(--muted); }
.stagebar button.won:not(.on) { color: var(--ok); } .stagebar button.lost:not(.on) { color: var(--muted); }
.stagebar button:disabled { cursor: default; }

/* the deal card */
.dealhead { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.dealhead h1 { font-size: 28px; overflow-wrap: anywhere; }
.dealgrid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dealgrid .form { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.field input, .field select { width: 100%; }
.phones { display: flex; flex-direction: column; gap: 6px; }
.phones .row input { flex: 1; min-width: 0; }
.phones > .btn { align-self: flex-start; }
.notebox textarea { width: 100%; }
.notebox .actions { margin-top: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ev { display: flex; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.ev:last-child { border-bottom: 0; }
.evicon { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--muted); }
.ev.note .evicon { background: var(--accent-soft); color: var(--accent); }
.ev.warn .evicon { background: var(--warn-soft); color: var(--warn); }
.ev.done .evicon { color: var(--ok); }
.evtext { white-space: pre-wrap; overflow-wrap: anywhere; }
.dupes { border-radius: 16px; background: var(--warn-soft); color: var(--ink); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.dupes p { display: flex; gap: 6px; align-items: center; }
.dupe { border-top: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); padding-top: 8px; }
.dupe .grow { min-width: 0; overflow-wrap: anywhere; }
.picklist { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.pick { padding: 8px; border-radius: 12px; align-items: flex-start; }
.pick:hover { background: var(--hover); }
.pick span { overflow-wrap: anywhere; }

/* tasks */
.tgroup > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 16px 20px; cursor: pointer; }
.tgroup > summary::-webkit-details-marker { display: none; }
.tlist { display: flex; flex-direction: column; padding: 0 12px 12px; }
.trow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 14px; min-width: 0; }
.trow:hover { background: var(--hover); }
.trow > .task { flex: 1; }
.task { display: flex; align-items: center; gap: 10px; min-width: 0; }
.task .grow { min-width: 0; }
.task.done b { text-decoration: line-through; color: var(--muted); }
.task.late .xs { color: var(--bad); }
.task .dealname { max-width: 180px; display: inline-block; }
.task input[type=checkbox] { width: 18px; height: 18px; }

/* report */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.frow { display: grid; grid-template-columns: minmax(90px, 200px) minmax(0, 1fr) 88px; gap: 12px; align-items: center; }
.fbar { position: relative; height: 30px; background: var(--surface-2); border-radius: 10px; overflow: hidden; }
.fbar i { display: block; height: 100%; background: var(--grad); border-radius: 10px; opacity: .85; }
.fbar span { position: absolute; inset-inline-start: 10px; top: 5px; font-weight: 700; color: var(--ink); text-shadow: 0 0 6px var(--surface); }
.fconv { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--ink-2); justify-content: flex-end; }
.tablewrap.flat { border: 0; border-radius: 0; }
.tablewrap table td.num, .tablewrap table th.num { text-align: end; }

/* settings */
table.stages input:not([type=color]) { min-width: 120px; }
table.stages input.narrow { width: 80px; min-width: 64px; }
table.stages input[type=color] { width: 40px; height: 32px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
table.stages .auto { max-width: 260px; display: inline-block; }
.editlist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.editlist li { display: flex; gap: 6px; align-items: center; }
.editlist li input { flex: 1; min-width: 0; }
.row.nowrap > input { flex: 1; min-width: 0; }

/* read-only (support) */
.ro .deal { cursor: pointer; }

/* phones and tablets */
@media (max-width: 1024px) { .dealgrid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .column { flex-basis: 82vw; max-width: 82vw; }
  .dealhead h1 { font-size: 22px; }
  .dealhead > .row { width: 100%; }
  .sync .label { display: none; }
  .sync { padding: 0 8px; }
  .frow { grid-template-columns: minmax(70px, 110px) minmax(0, 1fr) 64px; gap: 8px; }
  .filters select { max-width: 100%; flex: 1 1 140px; }
  .filters .search { max-width: none; flex-basis: 100%; }
  .zones { bottom: 8px; }
  .top .who .name, .top .btn .name { display: none; }
  .task .dealname { max-width: 110px; }
  .modal-back { padding: 0; place-items: stretch; }
  .modal { width: 100%; min-height: 100%; border-radius: 0; }
  .modal .ft { border-radius: 0; }
}

/* print / PDF: the report without the menu */
@media print {
  .side, .top, .support-banner, .pagehead .row, .toasts { display: none !important; }
  .app { display: block; } .content { max-width: none; padding: 0; }
  body::before { display: none; } html, body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; animation: none; }
}
a.btn { text-decoration: none; }
main:focus { outline: none; }
.ev.task-ev { padding-inline-start: 4px; }
