/* Layout: a floating dark "window" (icon rail + top bar + content) on a plum-charcoal ground with fine gold rays.
   Single deliberate dark look: plum-charcoal surfaces, peach-gold gradient for emphasis. */
:root {
  --ground: #17161f;
  --shell: #1f1e2b;
  --card: #262534;
  --card-2: #2c2b3c;
  --inset: #1b1a26;
  --line: rgba(255,255,255,0.06);
  --line-2: rgba(255,255,255,0.10);
  --text: #f3efe9;
  --text-2: #c9c4cf;
  --muted: #8a8699;
  --gold: #e7b688;
  --gold-light: #f8dcbc;
  --gold-deep: #b98257;
  --on-gold: #2a1d12;
  --good: #5cc489;
  --bad: #ec6a55;
  --grad: linear-gradient(135deg, #f9e0c3 0%, #ecbd8e 52%, #d99d6c 100%);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 18px 40px -24px rgba(0,0,0,0.75);
  --font: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ground);
  color: var(--text);
  font: 400 13px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
/* Gold ray texture in two corners, like the reference frame */
body::before, body::after {
  content: ''; position: fixed; pointer-events: none; z-index: 0; width: 46vw; height: 60vh;
  background: repeating-linear-gradient(118deg, rgba(232,185,138,0.22) 0 1px, transparent 1px 13px);
}
body::before { left: 0; top: 0; -webkit-mask: radial-gradient(ellipse at 0 0, #000 0%, transparent 70%); mask: radial-gradient(ellipse at 0 0, #000 0%, transparent 70%); }
body::after { left: 0; bottom: 0; height: 30vh; background: repeating-linear-gradient(8deg, rgba(232,185,138,0.2) 0 1px, transparent 1px 12px); -webkit-mask: radial-gradient(ellipse at 0 100%, #000 0%, transparent 70%); mask: radial-gradient(ellipse at 0 100%, #000 0%, transparent 70%); }

a { color: inherit; text-decoration: none; }
svg:not(.leaflet-zoom-animated) { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
button, input, select, textarea { font-family: var(--font); color: var(--text); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
[hidden] { display: none !important; }

/* ---------- Shell ---------- */
.frame { position: relative; z-index: 1; padding: 22px; padding-block: 22px; min-height: 100vh; }
.shell {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); min-height: calc(100vh - 44px);
  background: var(--shell); border-radius: 30px; border: 1px solid var(--line);
  box-shadow: 0 40px 80px -40px rgba(0,0,0,0.8), 0 1px 0 rgba(255,255,255,0.04) inset;
  max-width: 1560px; margin: 0 auto;
}
.rail { position: sticky; top: 22px; height: calc(100vh - 44px); display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 26px 0; }
.rail-logo { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; overflow: hidden; background: var(--grad); color: var(--on-gold); font-weight: 600; font-size: 15px; box-shadow: 0 10px 24px -10px rgba(232,185,138,0.6); }
.rail-logo img { width: 100%; height: 100%; object-fit: contain; background: var(--inset); }
.rail-nav { display: flex; flex-direction: column; gap: 12px; flex: 1; align-items: center; margin-top: 26px; }
.rail-sep { width: 22px; height: 1px; background: var(--line-2); margin: 4px 0; }
.rail-foot { display: flex; flex-direction: column; gap: 12px; }
.rail-btn {
  position: relative; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px;
  background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line-2); color: var(--muted);
  box-shadow: 0 8px 18px -12px rgba(0,0,0,0.9); transition: color .15s, border-color .15s, box-shadow .15s;
}
.rail-btn:hover { color: var(--text); border-color: rgba(232,185,138,0.35); }
.rail-btn.active { color: var(--gold); border-color: rgba(232,185,138,0.75); box-shadow: 0 0 0 4px rgba(232,185,138,0.08), 0 10px 22px -12px rgba(232,185,138,0.5); }
.rail-btn.soon::after { content: ''; position: absolute; top: 7px; right: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold-deep); }
.rail-btn[data-tip]:hover::before, .rail-btn[data-tip]:focus-visible::before {
  content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); white-space: nowrap; z-index: 30;
  background: var(--card-2); border: 1px solid var(--line-2); color: var(--text); font-size: 12px; padding: 6px 10px; border-radius: 9px; box-shadow: var(--shadow);
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 26px 36px 8px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--muted); font-weight: 500; }
.brand .brand-mark { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line-2); font-size: 11px; color: var(--gold); flex-shrink: 0; }
.brand .brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.user { color: var(--text-2); font-size: 12px; margin-right: 10px; white-space: nowrap; }
.user:empty { display: none; }
.sq-btn {
  position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
  background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line-2); color: var(--text-2);
  box-shadow: 0 8px 18px -12px rgba(0,0,0,0.9);
}
.sq-btn:hover { color: var(--text); border-color: rgba(232,185,138,0.35); }
.sq-btn.pill { font-size: 11px; font-weight: 500; cursor: default; }
.sq-btn svg { width: 17px; height: 17px; }
.sq-btn .dot { position: absolute; top: 9px; right: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--card-2); }
.vsep { width: 1px; height: 26px; background: var(--line-2); margin: 0 4px; }

.view { padding: 18px 36px 48px; min-width: 0; }

/* ---------- Page header ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head > div:first-child { min-width: 0; }
.eyebrow { display: none; }
h1 { font-size: 21px; font-weight: 500; margin: 0; letter-spacing: -0.005em; text-wrap: balance; }
h3 { font-size: 14px; font-weight: 500; margin: 0; }
.stamp { display: flex; gap: 16px; margin-top: 6px; font-size: 11px; color: var(--text-2); letter-spacing: .03em; text-transform: uppercase; }
.stamp span { display: inline-flex; align-items: center; gap: 6px; }
.stamp svg { width: 12px; height: 12px; color: var(--gold); }
.sub { color: var(--muted); font-size: 12px; margin-top: 6px; max-width: 70ch; }
.head-actions, .row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-actions { justify-content: flex-end; margin-top: 16px; }
.row-actions.left { justify-content: flex-start; margin: 0 0 18px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 12px; padding: 10px 18px; cursor: pointer;
  font: 500 12px var(--font); border: 1px solid var(--line-2); color: var(--text);
  background: linear-gradient(180deg, var(--card-2), var(--card)); box-shadow: 0 8px 18px -12px rgba(0,0,0,0.9); transition: .15s;
}
.btn:hover { border-color: rgba(232,185,138,0.4); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--grad); color: var(--on-gold); border-color: transparent; font-weight: 600; box-shadow: 0 12px 26px -12px rgba(232,185,138,0.7), inset 0 1px 0 rgba(255,255,255,0.5); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.add { border-style: dashed; background: transparent; color: var(--text-2); margin-top: 14px; }
.btn.danger { background: var(--bad); color: #fff; border-color: transparent; }
.btn.sm { padding: 7px 12px; font-size: 12px; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--card), #232232); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); min-width: 0;
}
section.card { margin-bottom: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head .muted { font-size: 12px; }
.dots { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,0.04); border: 1px solid var(--line); color: var(--muted); cursor: pointer; flex-shrink: 0; }
.dots:hover { color: var(--text); }
.dots svg { width: 15px; height: 15px; }
.label { font-size: 11px; color: var(--muted); font-weight: 500; }
.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.two-one { grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr); }
.one-two { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.one-one { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* KPI tiles */
.kpi-row { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, var(--card), #232232); box-shadow: var(--shadow); min-width: 0; }
.kpi-top { display: flex; align-items: center; gap: 9px; }
.kpi-ico { width: 18px; height: 18px; color: var(--text-2); display: grid; place-items: center; }
.kpi-ico svg { width: 16px; height: 16px; }
.kpi-label { font-size: 11px; font-weight: 500; color: var(--text-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-val { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.15; overflow-wrap: anywhere; }
.kpi-foot { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip-pct { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; color: var(--text-2); }
.chip-pct i { width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid currentColor; }
.chip-pct i svg { width: 9px; height: 9px; stroke-width: 2.6; }
.chip-pct.up i { color: var(--good); }
.chip-pct.down i { color: var(--bad); }
.chip-pct.flat i { color: var(--muted); }
.kpi.hl { background: var(--grad); color: var(--on-gold); border-color: transparent; box-shadow: 0 22px 40px -22px rgba(232,185,138,0.75), inset 0 1px 0 rgba(255,255,255,0.55); }
.kpi.hl .kpi-label, .kpi.hl .kpi-ico, .kpi.hl .kpi-foot, .kpi.hl .chip-pct { color: rgba(42,29,18,0.78); }
.kpi.hl .dots { background: rgba(255,255,255,0.35); border-color: rgba(255,255,255,0.5); color: var(--on-gold); box-shadow: 0 6px 14px -8px rgba(120,70,30,0.6); }
.kpi.hl .chip-pct i { color: var(--on-gold); }
.kpi .mini-bar { margin-top: -4px; }

/* Ring (cost breakdown) */
.ring-card { display: flex; flex-direction: column; }
.ring-legend { display: flex; align-items: flex-start; gap: 10px; }
.ring-legend i { width: 7px; height: 7px; border-radius: 50%; margin-top: 10px; flex-shrink: 0; }
.ring-legend b { display: block; font-size: 20px; font-weight: 400; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.ring-legend span { font-size: 11px; font-weight: 500; color: var(--text-2); }
.viz { position: relative; }
.viz canvas { display: block; width: 100%; height: 100%; }
.ring-box { height: 270px; margin: 4px 0; }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.ring-center b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ring-center span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.vpill { position: absolute; transform: translate(-50%, -50%); background: #f3efe9; color: #26232f; font-size: 10px; font-weight: 600; padding: 5px 8px; border-radius: 9px; box-shadow: 0 6px 14px -6px rgba(0,0,0,0.7); pointer-events: none; font-variant-numeric: tabular-nums; }
.ring-more { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.ring-more span { display: inline-flex; align-items: center; gap: 6px; }
.ring-more i { width: 7px; height: 7px; border-radius: 50%; }

/* Gauges (project status) */
.select { appearance: none; background: var(--inset) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23c9c4cf'/%3E%3C/svg%3E") no-repeat right 14px center / 8px; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 36px 9px 14px; font-size: 12px; color: var(--text-2); cursor: pointer; min-width: 220px; max-width: 100%; }
.select option { background: var(--card); }
.gauges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.gauge { display: flex; flex-direction: column; min-width: 0; }
.gauge-scale { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); padding: 0 6%; font-variant-numeric: tabular-nums; }
.gauge-box { height: 190px; }
.gauge-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; margin: 18px 0 10px; }
.gauge-title i { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--muted); }
.gauge-figs { display: flex; gap: 32px; flex-wrap: wrap; }
.gauge-figs b { display: block; font-size: 20px; font-weight: 300; font-variant-numeric: tabular-nums; }
.gauge-figs span { font-size: 11px; font-weight: 500; color: var(--text-2); }
.phases { display: flex; flex-wrap: wrap; gap: 8px; }
.phase { padding: 5px 12px; border-radius: 8px; font-size: 11px; color: var(--muted); background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.phase.on { background: var(--grad); color: var(--on-gold); border-color: transparent; font-weight: 600; }
.phase.done { color: var(--text-2); border-color: rgba(232,185,138,0.3); }

.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 300px; }
.empty-overlay { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 10px; color: var(--muted); font-size: 12px; padding: 16px; }

/* Welcome / setup */
.welcome { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 26px; align-items: center; border-color: rgba(232,185,138,0.28); }
.welcome::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(118deg, rgba(232,185,138,0.07) 0 1px, transparent 1px 12px); -webkit-mask: linear-gradient(90deg, #000, transparent 55%); mask: linear-gradient(90deg, #000, transparent 55%); }
.welcome h2 { font-size: 20px; font-weight: 500; margin: 0 0 6px; text-wrap: balance; }
.welcome p { margin: 0; color: var(--muted); max-width: 48ch; }
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; position: relative; }
.step { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: var(--inset); border: 1px solid var(--line); transition: border-color .15s; }
.step:hover { border-color: rgba(232,185,138,0.45); }
.step-n { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: rgba(232,185,138,0.12); color: var(--gold); flex-shrink: 0; }
.step.done .step-n { background: rgba(92,196,137,0.15); color: var(--good); }
.step b { display: block; font-size: 12px; font-weight: 500; }
.step span { font-size: 11px; color: var(--muted); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 1px; background: var(--line-2); }
.timeline li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 11px 0 11px 24px; border-bottom: 1px dashed var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .dot { position: absolute; left: 0; top: 16px; width: 11px; height: 11px; border-radius: 50%; background: var(--shell); border: 2px solid var(--gold); }
.timeline li.now .dot { background: var(--gold); box-shadow: 0 0 0 4px rgba(232,185,138,0.18); }
.timeline li.past { opacity: .5; }
.tl-body b { display: block; font-size: 12px; font-weight: 500; }
.tl-body span { font-size: 11px; color: var(--muted); }
.tl-amt { text-align: right; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tl-amt small { color: var(--muted); font-weight: 400; }
.tl-rel { display: block; font-size: 10px; color: var(--gold); font-weight: 500; }
.empty { display: grid; place-items: center; text-align: center; gap: 10px; padding: 30px 16px; color: var(--muted); font-size: 12px; }
.empty .empty-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(232,185,138,0.08); color: var(--gold); }
.empty b { color: var(--text); font-weight: 500; font-size: 13px; }

/* Tables */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover td { background: rgba(255,255,255,0.015); }
.table tfoot td { font-weight: 600; border-bottom: 0; padding-top: 14px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .strong { font-weight: 500; }
.table .zero { color: #565366; }
.table tr.cum td { color: var(--muted); font-weight: 500; padding-top: 4px; }
.table td.empty-row { text-align: center; color: var(--muted); padding: 28px; }
.sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 10px; vertical-align: middle; }
.share { width: 190px; }
td.share { display: flex; align-items: center; gap: 10px; }
.share .bar, .mini-bar { flex: 1; height: 5px; background: rgba(255,255,255,0.06); border-radius: 99px; overflow: hidden; }
.share .bar span, .mini-bar span { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .4s; }
.share em { font-style: normal; font-size: 11px; color: var(--muted); width: 44px; text-align: right; }
.table.code td { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--text-2); }
.chip { --c: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 11px; color: var(--text-2); background: rgba(255,255,255,0.04); border: 1px solid var(--line-2); white-space: nowrap; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.tag { display: inline-block; font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: 99px; border: 1px solid rgba(232,185,138,0.3); color: var(--gold); vertical-align: middle; white-space: nowrap; }
.status { --c: var(--muted); display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-2); white-space: nowrap; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-grid label, .field-label { display: flex; flex-direction: column; gap: 7px; font-size: 11px; color: var(--muted); font-weight: 500; min-width: 0; }
.form-grid > label > input, .field { background: var(--inset); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; outline: none; font-size: 12px; width: 100%; min-width: 0; }
.form-grid > label > input:focus, .field:focus { border-color: rgba(232,185,138,0.7); }
textarea.field { resize: vertical; line-height: 1.5; }
.money-input { display: flex; align-items: center; gap: 4px; background: var(--inset); border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; }
.money-input span { color: var(--muted); font-size: 12px; }
.money-input input { background: transparent; border: 0; outline: none; width: 100%; padding: 9px 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.money-input:focus-within { border-color: rgba(232,185,138,0.7); }
.money-input.sm { max-width: 150px; margin-left: auto; }
.money-input.sm input { text-align: right; }
.form-grid .money-input.sm { max-width: none; margin: 0; }
.form-grid .money-input.sm input { text-align: left; }
.table.edit td { padding: 6px 8px; }
.cell { background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 8px 9px; width: 100%; min-width: 90px; outline: none; font-size: 12px; transition: .15s; }
td:first-child .cell { width: calc(100% - 22px); min-width: 160px; }
.cell:hover { border-color: var(--line-2); }
.cell:focus { border-color: rgba(232,185,138,0.7); background: var(--inset); }
select.cell { appearance: none; cursor: pointer; }
select.cell option { background: var(--card); }
.calc { font-weight: 600; padding-right: 10px; }
.comp-row td { background: rgba(232,185,138,0.025); }
.comp-row .branch { color: var(--gold); margin: 0 6px 0 18px; }
.comp-row td:first-child .cell { width: calc(100% - 50px); }
.actions { text-align: right; white-space: nowrap; }
.icon-btn { background: transparent; border: 1px solid transparent; color: var(--muted); border-radius: 8px; padding: 5px 8px; cursor: pointer; font: 11px var(--font); }
.icon-btn:hover { border-color: var(--line-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--bad); border-color: rgba(236,106,85,0.35); }
.sum-bar { position: sticky; bottom: 16px; z-index: 5; display: flex; gap: 28px; justify-content: flex-end; align-items: center; padding: 14px 22px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(38,37,52,0.9); backdrop-filter: blur(14px); box-shadow: 0 18px 40px -16px rgba(0,0,0,0.8); flex-wrap: wrap; }
.sum-bar div { display: flex; flex-direction: column; align-items: flex-end; }
.sum-bar span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sum-bar b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sum-bar .grand b { font-size: 20px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Data */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; min-height: 230px; border-style: dashed; border-color: rgba(232,185,138,0.3); cursor: pointer; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--gold); background: linear-gradient(180deg, rgba(232,185,138,0.06), #232232); }
.drop-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--grad); color: var(--on-gold); margin-bottom: 6px; box-shadow: 0 12px 24px -12px rgba(232,185,138,0.7); }
.drop-icon svg { width: 22px; height: 22px; }
.dl-list { display: flex; flex-direction: column; gap: 10px; }
.dl { text-align: left; background: var(--inset); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font: 12px var(--font); transition: .15s; }
.dl:hover { border-color: rgba(232,185,138,0.5); }
.dl b { font-weight: 500; }
.dl span { color: var(--muted); font-size: 11px; }
.preview { border-color: rgba(232,185,138,0.45); margin-bottom: 20px; }
.alert { background: rgba(236,106,85,0.08); border: 1px solid rgba(236,106,85,0.35); color: #f2a596; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 12px; }

/* Modules page */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 20px; }
.module-card { display: flex; flex-direction: column; gap: 12px; }
.module-card .mc-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: rgba(232,185,138,0.1); color: var(--gold); }
.module-card h3 { font-size: 15px; }
.module-card p { margin: 0; color: var(--muted); font-size: 12px; }
.module-card ul { margin: 0; padding-left: 16px; color: var(--text-2); font-size: 12px; line-height: 1.9; }
.module-card .tag { align-self: flex-start; }
.module-card.live .tag { color: var(--good); border-color: rgba(92,196,137,0.4); }

/* Settings */
.logo-field { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.logo-preview { width: 84px; height: 84px; border-radius: 20px; display: grid; place-items: center; overflow: hidden; background: var(--inset); border: 1px dashed rgba(232,185,138,0.4); color: var(--muted); font-size: 11px; text-align: center; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.danger-zone { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.dz-item { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; background: var(--inset); border: 1px solid var(--line); }
.dz-item b { font-weight: 500; font-size: 12px; }
.dz-item span { color: var(--muted); font-size: 11px; flex: 1; }
.dz-item .btn { align-self: flex-start; }

/* ---------- Company OS ---------- */
.budget-check { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 28px; align-items: center; }
.budget-check h3 { font-size: 15px; font-weight: 500; margin: 6px 0 4px; text-wrap: balance; }
.budget-check p { margin: 0; font-size: 12px; }
.budget-check.short { border-color: rgba(236,106,85,0.4); }
.budget-check.ok { border-color: rgba(92,196,137,0.35); }
.bc-figs { display: flex; gap: 24px; flex-wrap: wrap; }
.bc-figs div { display: flex; flex-direction: column; }
.bc-figs span { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.bc-figs b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bc-figs .warn b { color: var(--bad); } .bc-figs .good b { color: var(--good); }
.budget-check .btn { grid-column: 1 / -1; justify-self: start; }

.quad-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.quad { --q: var(--gold); display: flex; flex-direction: column; gap: 12px; padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, var(--card), #232232); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; min-width: 0; position: relative; overflow: hidden; }
.quad::before { content: ''; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; pointer-events: none; background: repeating-conic-gradient(from 0deg, rgba(232,185,138,0.35) 0deg 0.6deg, transparent 0.6deg 4deg); -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%); opacity: .55; }
.quad:hover { border-color: rgba(232,185,138,0.45); transform: translateY(-1px); }
.quad-top { display: flex; align-items: center; gap: 10px; color: var(--q); position: relative; }
.quad-name { font-weight: 500; color: var(--text); font-size: 14px; }
.quad-share { margin-left: auto; font-size: 11px; color: var(--muted); }
.quad-num { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; position: relative; }
.quad-meta { font-size: 11px; color: var(--muted); }
.quad-items { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.quad-items li { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px dashed var(--line); font-size: 12px; color: var(--text-2); }
.quad-items i { width: 7px; height: 7px; border-radius: 50%; }
.quad-items span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quad-items b { font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.quad-items small { color: var(--muted); font-weight: 400; }
.quad-go { margin-top: auto; padding-top: 6px; font-size: 11px; font-weight: 600; color: var(--gold); }
.quad-empty { color: var(--muted); font-size: 12px; padding: 10px 0; border-top: 1px dashed var(--line); }

.os-table .q-row td { font-weight: 500; color: var(--gold); background: rgba(232,185,138,0.04); }
.os-table small { color: var(--muted); font-weight: 400; }
.link-row { cursor: pointer; }

.os-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(440px, 100%), 1fr)); gap: 20px; margin-bottom: 14px; align-items: start; }
.os-item { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, var(--card), #232232); box-shadow: var(--shadow); min-width: 0; }
.os-item.is-done { border-color: rgba(92,196,137,0.35); }
.os-item-head { display: flex; align-items: flex-start; gap: 8px; }
.os-code { font: 600 10px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--on-gold); background: var(--grad); padding: 4px 7px; border-radius: 7px; flex-shrink: 0; margin-top: 6px; }
.os-title { font-size: 14px; font-weight: 500; flex: 1; min-width: 0 !important; width: auto !important; resize: none; overflow: hidden; line-height: 1.35; display: block; }
.status-select { --c: var(--muted); appearance: none; cursor: pointer; font: 500 11px var(--font); padding: 6px 12px 6px 24px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.04) radial-gradient(circle at 12px 50%, var(--c) 3.5px, transparent 4px); color: var(--text); flex-shrink: 0; margin-top: 4px; }
.status-select option { background: var(--card); }
.os-desc { resize: none; overflow: hidden; color: var(--text-2); line-height: 1.5; margin: -6px 0 0; }
.os-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.os-fields label, .os-cost label, .os-notes { display: flex; flex-direction: column; gap: 6px; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; min-width: 0; }
.num-field { width: 90px; text-align: right; font-variant-numeric: tabular-nums; }
.os-cost { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 14px; border-radius: 14px; background: var(--inset); border: 1px solid var(--line); }
.os-cost .money-input.sm { margin: 0; max-width: 130px; background: var(--card); }
.os-cost .field { background: var(--card); }
.os-cost .times { color: var(--muted); padding-bottom: 9px; }
.os-cost .tag { margin-bottom: 9px; }
.os-cost-total { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; }
.os-cost-total span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.os-cost-total b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.os-tasks { display: flex; flex-direction: column; gap: 8px; }
.os-tasks-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; }
.os-tasks ul { list-style: none; margin: 2px 0 0; padding: 0; }
.os-tasks li { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.os-tasks li label { display: flex; align-items: flex-start; gap: 10px; flex: 1; padding: 8px 0; cursor: pointer; font-size: 12px; color: var(--text-2); min-width: 0; }
.os-tasks li input { margin-top: 2px; accent-color: var(--gold); width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; }
.os-tasks li.done span { color: var(--muted); text-decoration: line-through; }
.os-tasks li .icon-btn { opacity: 0; }
.os-tasks li:hover .icon-btn, .os-tasks li .icon-btn:focus-visible { opacity: 1; }
.add-task { display: flex; gap: 8px; margin-top: 4px; }
.os-item-foot { display: flex; justify-content: flex-end; margin-top: -6px; }

/* ---------- Overlays ---------- */
.popover { position: fixed; z-index: 70; width: min(360px, calc(100vw - 32px)); background: var(--card-2); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 60px -20px rgba(0,0,0,0.85); padding: 8px; }
.pop-head { padding: 10px 12px; font-size: 12px; font-weight: 500; display: flex; justify-content: space-between; }
.pop-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.pop-list li a, .pop-list li > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 12px; border-radius: 10px; font-size: 12px; }
.pop-list li a:hover, .pop-list li a.sel { background: rgba(232,185,138,0.08); }
.pop-list b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-list span { color: var(--muted); font-size: 11px; }
.pop-list em { font-style: normal; font-size: 11px; color: var(--gold); text-align: right; }
.pop-empty { padding: 18px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.palette-input { width: 100%; background: var(--inset); border: 1px solid var(--line-2); border-radius: 11px; padding: 11px 14px; outline: none; font-size: 13px; margin-bottom: 6px; }
.palette-input:focus { border-color: rgba(232,185,138,0.7); }

.modal-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(10,9,14,0.6); backdrop-filter: blur(5px); }
.modal { width: min(420px, 100%); background: var(--card-2); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 24px; box-shadow: 0 30px 60px -20px rgba(0,0,0,0.85); }
.modal p { margin: 0 0 4px; font-size: 14px; line-height: 1.55; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 11px 18px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line-2); font-size: 12px; transition: .25s; z-index: 90; max-width: calc(100vw - 32px); box-shadow: 0 20px 40px -20px rgba(0,0,0,0.8); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: rgba(232,185,138,0.5); }
.toast.err { border-color: rgba(236,106,85,0.6); color: #f2a596; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .two-one, .one-two, .one-one { grid-template-columns: minmax(0, 1fr); }
  .welcome { grid-template-columns: minmax(0, 1fr); }
  .budget-check { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .frame { padding: 0; padding-block: 0; }
  .shell { grid-template-columns: minmax(0, 1fr); border-radius: 0; border: 0; min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .rail { position: fixed; z-index: 40; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); gap: 10px; background: rgba(31,30,43,0.95); backdrop-filter: blur(14px); border-top: 1px solid var(--line-2); overflow-x: auto; }
  .rail-logo { display: none; }
  .rail-nav, .rail-foot { flex-direction: row; margin: 0; flex: none; }
  .rail-sep { width: 1px; height: 22px; margin: 0 2px; align-self: center; }
  .rail-btn { width: 44px; height: 44px; flex-shrink: 0; }
  .rail-btn[data-tip]:hover::before { display: none; }
  .topbar { padding: 16px; }
  .user, .vsep, .sq-btn.pill { display: none; }
  .view { padding: 8px 16px 32px; }
  .form-grid, .os-fields, .steps, .gauges, .quad-grid { grid-template-columns: minmax(0, 1fr); }
  .gauges { gap: 18px; }
  .sum-bar { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); justify-content: space-between; gap: 14px; }
  .os-tasks li .icon-btn { opacity: 1; }
  body::before, body::after { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* KPI variant used by Company OS pages */
.kpi .label { font-size: 11px; font-weight: 500; color: var(--text-2); }
.kpi-num { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi.hl .label { color: rgba(42,29,18,0.78); }
.kpi.hl .mini-bar { background: rgba(42,29,18,0.15); }
.kpi.hl .mini-bar span { background: var(--on-gold) !important; }
.card.empty { padding: 40px 20px; }

/* ---------- Rail density (more modules) ---------- */
.rail { overflow-y: auto; scrollbar-width: none; }
.rail-nav { gap: 10px; margin-top: 18px; }
.rail-btn { width: 42px; height: 42px; border-radius: 13px; }
.rail-btn svg { width: 17px; height: 17px; }

/* ---------- Shared bits for tools ---------- */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--gold); }
.gold-link { color: var(--gold); font-weight: 500; }
.gold-link:hover { text-decoration: underline; }
.good { color: var(--good); } .warn { color: #f0b35a; } .bad { color: var(--bad); }
.kind-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; background: rgba(232,185,138,0.1); color: var(--gold); font-size: 11px; font-weight: 500; margin-right: 6px; vertical-align: middle; }
.kind-chip svg { width: 13px; height: 13px; }
.note-banner { border: 1px solid rgba(232,185,138,0.3); background: rgba(232,185,138,0.06); color: var(--text-2); padding: 12px 16px; border-radius: 12px; font-size: 12px; margin-bottom: 20px; }
.status-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 500; background: rgba(255,255,255,0.05); border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.status-pill.good { color: var(--good); border-color: rgba(92,196,137,0.4); background: rgba(92,196,137,0.08); }
.status-pill.bad { color: var(--bad); border-color: rgba(236,106,85,0.4); background: rgba(236,106,85,0.08); }
.task-open { font-size: 11px; font-weight: 500; color: var(--gold); padding: 3px 9px; border-radius: 8px; border: 1px solid rgba(232,185,138,0.3); white-space: nowrap; }
.task-open:hover { background: rgba(232,185,138,0.1); }
button[disabled] { opacity: .45; cursor: not-allowed; }

/* Registers */
.tool-table .card-head .head-actions { gap: 8px; }
.calc-cell { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; padding: 0 6px; }
.calc-cell.warn { color: #f0b35a; } .calc-cell.good { color: var(--good); } .calc-cell.bad { color: var(--bad); }
.color-cell, .link-cell { display: flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--line-2); flex-shrink: 0; vertical-align: middle; margin-right: 6px; }
.link-cell a { color: var(--gold); padding: 0 4px; }
.table.edit textarea.cell { resize: none; overflow: hidden; line-height: 1.45; min-width: 180px; }
.upcoming { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.up { flex: 0 0 auto; min-width: 170px; padding: 10px 12px; border-radius: 12px; background: var(--inset); border: 1px solid var(--line); border-left: 3px solid var(--gold); }
.up b { display: block; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.up span { font-size: 11px; color: var(--muted); }
.up.soon { border-left-color: #f0b35a; } .up.late { border-left-color: var(--bad); }
.group-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.group-chips .chip b { color: var(--text); margin-left: 2px; }
.check-note { margin-top: 10px; font-size: 12px; color: var(--text-2); }
.hygiene { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--inset); border: 1px solid var(--line); font-size: 12px; }
.hygiene ul { margin: 8px 0; padding-left: 18px; color: var(--text-2); line-height: 1.8; }
.ro-title { font-size: 12px; font-weight: 600; color: var(--gold); margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .05em; }

/* Documents */
.doc-meta { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.doc-sections { display: flex; flex-direction: column; gap: 18px; }
.doc-sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sec-n { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 600; background: rgba(232,185,138,0.12); color: var(--gold); }
.doc-text { min-height: 84px; font-size: 13px; line-height: 1.65; resize: none; overflow: hidden; }
.doc-logo { margin-bottom: 18px; padding: 22px; border-radius: 14px; background: var(--inset); border: 1px dashed rgba(232,185,138,0.3); display: grid; place-items: center; }
.doc-logo img { max-height: 140px; max-width: 100%; }
.ro-sec h4 { margin: 14px 0 4px; font-size: 13px; font-weight: 600; }
.ro-sec p { margin: 0; white-space: pre-wrap; color: var(--text-2); max-width: 75ch; }

/* Checklists */
details.card > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
details.card { margin-bottom: 14px; }
.run-title { font-weight: 500; font-size: 13px; }
.run-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 12px; margin-bottom: 14px; }
.check-items { list-style: none; margin: 0 0 14px; padding: 0; }
.check-items li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.ci-n { color: var(--muted); font-size: 11px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--inset); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg-b { border: 0; background: transparent; color: var(--muted); font: 500 11px var(--font); padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.seg-b:hover { color: var(--text); }
.seg-b.on.pass { background: var(--grad); color: var(--on-gold); }
.seg-b.on.fail { background: rgba(236,106,85,0.2); color: #f6a898; }
.seg-b.on.na { background: rgba(255,255,255,0.08); color: var(--text); }
.tpl-items { list-style: none; margin: 0; padding: 0; }
.tpl-items li { display: flex; gap: 6px; align-items: center; border-bottom: 1px solid var(--line); }

/* Flows */
.flow-name { font-size: 14px; font-weight: 500; max-width: 420px; }
.flow-diagram { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; padding: 18px; border-radius: 14px; background: var(--inset); border: 1px solid var(--line); position: relative; overflow: hidden; }
.flow-diagram::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(118deg, rgba(232,185,138,0.05) 0 1px, transparent 1px 12px); }
.flow-step { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 120px; max-width: 180px; padding: 12px 14px; border-radius: 12px; background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid rgba(232,185,138,0.28); box-shadow: 0 10px 20px -14px rgba(0,0,0,0.9); }
.flow-step b { font-size: 12px; font-weight: 500; }
.flow-step small { font-size: 10px; color: var(--muted); }
.flow-step em { font-style: normal; font-size: 10px; color: var(--gold); }
.fs-n { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 600; background: var(--grad); color: var(--on-gold); margin-bottom: 4px; }
.flow-arrow { display: grid; place-items: center; color: var(--gold); position: relative; }
.flow-arrow svg { width: 18px; height: 18px; }

/* Scorecards */
.score-table th small { display: block; color: var(--gold); font-weight: 400; }
.score-sel { min-width: 56px; text-align: center; }
.score-val { font-size: 15px; font-weight: 600; }
.score-table tr.best td { background: rgba(232,185,138,0.06); }

/* Action record */
.push-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Manual */
.manual-cover { display: flex; align-items: center; gap: 18px; padding-bottom: 20px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.manual-cover img { width: 72px; height: 72px; object-fit: contain; }
.manual-cover h2 { margin: 2px 0 0; font-size: 22px; font-weight: 500; }
.toc { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; }
.toc li { font-size: 13px; }
.toc li a { color: var(--text); margin-right: 10px; }
.toc li a:hover { color: var(--gold); }
.manual-part { padding: 22px 0; border-top: 1px dashed var(--line-2); margin-top: 18px; }
.mp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mp-head h3 { font-size: 16px; margin-right: auto; }

/* Labels */
.label-gen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; }
.label-preview { background: #fbf8f3; color: #1d1a22; border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; box-shadow: 0 20px 40px -20px rgba(0,0,0,0.8); min-height: 170px; position: relative; }
.label-preview b { font-size: 15px; font-weight: 600; }
.label-preview span { font-size: 12px; color: #5b5560; }
.label-preview .barcode { width: 100%; height: 56px; margin-top: 10px; }
.label-preview code { font-size: 12px; letter-spacing: .2em; align-self: center; }
.label-preview em { font-size: 11px; color: #8d8794; margin-top: 16px; }
.lp-logo { position: absolute; top: 12px; right: 14px; width: 44px; height: 44px; object-fit: contain; filter: invert(1) brightness(0.2); }

/* Toolkit index */
.tool-group .card-head h3 { display: flex; align-items: center; gap: 10px; }
.tool-group .os-code { margin-top: 0; }
.tg-item { padding: 12px 0; border-top: 1px dashed var(--line); }
.tg-item:first-of-type { border-top: 0; padding-top: 0; }
.tg-name { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.tg-tools { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 8px; }
.tg-tools a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--inset); border: 1px solid var(--line); transition: border-color .15s; height: 100%; }
.tg-tools a:hover { border-color: rgba(232,185,138,0.5); }
.tk-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,0.04); color: var(--muted); flex-shrink: 0; }
.tk-ico.on { background: rgba(232,185,138,0.14); color: var(--gold); }
.tk-ico svg { width: 15px; height: 15px; }
.tk-t { font-size: 12px; min-width: 0; flex: 1; }
.tk-t small { display: block; color: var(--muted); font-size: 10px; margin-top: 1px; }
.tk-done { color: var(--good); font-weight: 600; }

/* Accounting */
.acct-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; padding: 5px; border-radius: 14px; background: var(--inset); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.acct-tabs a { padding: 8px 14px; border-radius: 10px; font-size: 12px; color: var(--muted); font-weight: 500; }
.acct-tabs a:hover { color: var(--text); }
.acct-tabs a.on { background: var(--grad); color: var(--on-gold); }
.report-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.report-filters { display: flex; gap: 12px; flex-wrap: wrap; }
.report-filters .field { min-width: 150px; }
.table.report td { padding: 9px 12px; }
.table.report .rh td { font-weight: 600; color: var(--gold); padding-top: 18px; border-bottom-color: rgba(232,185,138,0.2); text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
.table.report .indent { padding-left: 26px; color: var(--text-2); }
.table.report .rt td { font-weight: 500; border-bottom-color: var(--line-2); }
.table.report .rk td { font-weight: 600; font-size: 13px; background: rgba(255,255,255,0.02); }
.table.report .rk.grand td { font-size: 14px; border-top: 1px solid rgba(232,185,138,0.4); }
.bs-check { font-size: 12px; margin-bottom: 12px; font-weight: 500; }
.editor { border-color: rgba(232,185,138,0.4); }
.uat { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 8px; }
.uat label { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--inset); border: 1px solid var(--line); font-size: 12px; cursor: pointer; }
.uat input { accent-color: var(--gold); width: 15px; height: 15px; }
.invoice-doc { width: min(720px, 100%); background: #fbf8f3; color: #1d1a22; max-height: 90vh; overflow: auto; }
.invoice-doc .table th, .invoice-doc .table td { color: #1d1a22; border-bottom-color: #e8e2da; }
.invoice-doc .table tfoot td { font-size: 15px; }
.inv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.inv-top b { display: block; font-size: 15px; margin-top: 6px; }
.inv-logo { width: 64px; height: 64px; object-fit: contain; filter: invert(1) brightness(0.2); }
.inv-meta { text-align: right; }
.inv-meta h2 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: .02em; }
.inv-meta span { color: #6b6570; }
.inv-parties { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.inv-parties span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #8d8794; }
.inv-notes { color: #5b5560; font-size: 12px; white-space: pre-wrap; }
.invoice-doc .btn.primary { color: var(--on-gold); }

@media (max-width: 1200px) { .doc-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } .label-gen { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) {
  .doc-meta { grid-template-columns: minmax(0, 1fr); }
  .check-items li { grid-template-columns: 22px minmax(0, 1fr); }
  .check-items .seg { grid-column: 2; }
  .inv-parties { grid-template-columns: 1fr; }
  .flow-step { max-width: none; flex: 1 1 100%; }
  .flow-arrow { flex: 1 1 100%; transform: rotate(90deg); height: 18px; }
}

/* Rail items must never shrink when the rail overflows (the logo was collapsing to 0px and cropping) */
.rail > *, .rail-nav > *, .rail-foot > * { flex-shrink: 0; }
.rail-logo { width: 54px; height: 54px; min-height: 54px; flex: none; padding: 5px; background: var(--inset); border: 1px solid rgba(232,185,138,0.35); }
.rail-logo:not(:has(img)) { background: var(--grad); padding: 0; }
.rail-logo img { display: block; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.brand .brand-mark { padding: 2px; }

/* ---------- Platforms ---------- */
.platform-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; margin-bottom: 20px; }
.platform-link { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(232,185,138,0.35); background: linear-gradient(135deg, rgba(232,185,138,0.12), rgba(232,185,138,0.02)); }
.platform-link span { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.platform-link b { font-weight: 500; }
.platform-link em { font-style: normal; font-size: 11px; color: var(--gold); }
.platform-link:hover { border-color: var(--gold); }
.mini-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.mini-row span { color: var(--muted); margin-right: auto; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: rgba(255,255,255,0.1); border: 1px solid var(--line-2); cursor: pointer; transition: .2s; }
.switch span::after { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: var(--text-2); transition: .2s; }
.switch input:checked + span { background: var(--grad); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(16px); background: var(--on-gold); }
.switch input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Logistics */
.stepper { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; position: relative; }
.stepper li { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; position: relative; min-width: 0; }
.stepper li::before { content: ''; position: absolute; top: 17px; left: -50%; width: 100%; height: 2px; background: var(--line-2); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper li.done::before { background: var(--gold); }
.step-dot { position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--card); color: var(--muted); font: 600 12px var(--font); cursor: pointer; }
.stepper li.done .step-dot { background: var(--grad); color: var(--on-gold); border-color: transparent; }
.stepper b { font-size: 11px; font-weight: 500; }
.stepper .field { padding: 5px 6px; font-size: 11px; max-width: 140px; }
.ship-card summary .head-actions { gap: 10px; }
.ready-list { display: flex; flex-direction: column; gap: 8px; }
.ready { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--inset); border: 1px solid var(--line); font-size: 12px; flex-wrap: wrap; }

/* Store */
.shop-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 20px; align-items: start; }
.shopfront { background: #fbf8f3; color: #1d1a22; border-radius: var(--radius); padding: 26px; min-width: 0; }
.shopfront .empty { color: #6b6570; } .shopfront .empty b { color: #1d1a22; }
.shop-hero { display: flex; align-items: center; gap: 18px; padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid #e8e2da; }
.shop-hero img { width: 72px; height: 72px; object-fit: contain; filter: invert(1) brightness(0.25); }
.shop-hero h2 { margin: 0; font-size: 24px; font-weight: 500; }
.shop-hero p { margin: 4px 0 0; color: #6b6570; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 18px; }
.product { display: flex; flex-direction: column; gap: 8px; }
.p-img { aspect-ratio: 1 / 1; max-width: 100%; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, #f3e2cd, #e2b98f); display: grid; place-items: center; }
.p-img img { width: 100%; height: 100%; object-fit: cover; }
.p-img span { font-size: 42px; font-weight: 300; color: #7a5232; }
.product h3 { font-size: 14px; font-weight: 600; margin: 4px 0 0; }
.product p { margin: 0; font-size: 12px; color: #6b6570; }
.p-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: auto; }
.p-foot b { font-size: 15px; }
.shopfront .good { color: #2f8a5a; } .shopfront .bad { color: #c2452f; }
.product .btn { justify-content: center; }
.product .btn:not(.primary) { background: #ece5db; color: #8d8794; border-color: transparent; }
.cart { position: sticky; top: 20px; }
.cart-lines { list-style: none; margin: 0; padding: 0; }
.cart-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.cart-lines span { display: block; color: var(--muted); font-size: 11px; }
.qty { display: flex; align-items: center; gap: 4px; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin: 14px 0; font-size: 12px; }
.totals dt { color: var(--muted); } .totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { font-size: 15px; font-weight: 600; color: var(--text); padding-top: 8px; border-top: 1px solid var(--line); }
.checkout { display: flex; flex-direction: column; gap: 10px; }
.checkout .btn { justify-content: center; }

/* CRM */
.rules { display: flex; flex-direction: column; gap: 8px; }
.rule { display: grid; grid-template-columns: 44px minmax(0, 1.3fr) 100px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.seg-count { font-size: 20px; font-weight: 600; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.member-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.auto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 20px; }
.auto .card-head { padding-bottom: 12px; margin-bottom: 12px; }
.msg-prev { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel { display: flex; flex-direction: column; gap: 10px; }
.f-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 40px 150px; gap: 12px; align-items: center; font-size: 12px; }
.f-bar { height: 22px; border-radius: 8px; background: rgba(255,255,255,0.04); overflow: hidden; }
.f-bar span { display: block; height: 100%; background: var(--grad); border-radius: 8px; min-width: 2px; }

/* Systems */
.sys-map { display: flex; flex-direction: column; gap: 14px; align-items: center; background: linear-gradient(180deg, var(--card), #232232); position: relative; overflow: hidden; }
.sys-map::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(118deg, rgba(232,185,138,0.05) 0 1px, transparent 1px 12px); }
.sys-nodes { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; position: relative; }
.sys-node { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: 14px; background: var(--card-2); border: 1px solid rgba(232,185,138,0.35); min-width: 170px; text-align: center; box-shadow: var(--shadow); }
.sys-node b { font-weight: 500; font-size: 13px; }
.sys-node span { font-size: 11px; color: var(--muted); }
.sys-node.hl { background: var(--grad); color: var(--on-gold); border-color: transparent; }
.sys-node.hl span { color: rgba(42,29,18,0.75); }
.sys-arrow { color: var(--gold); font-size: 20px; }
.sys-table td { vertical-align: top; }
.sys-table td:first-child { white-space: nowrap; }
.sys-table .status-pill { margin: 6px 0 4px; }
.sys-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sys-links a { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; background: var(--inset); border: 1px solid var(--line); }
.sys-links a:hover { border-color: rgba(232,185,138,0.45); }
.sys-links b { font-weight: 500; font-size: 12px; }
.sys-links span { font-size: 11px; color: var(--good); }
.sys-log { list-style: none; margin: 0; padding: 0; }
.sys-log li { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.sl-path { color: var(--gold); font-weight: 500; }
.sys-log time { color: var(--muted); font-size: 11px; white-space: nowrap; }

@media (max-width: 1200px) { .shop-layout { grid-template-columns: minmax(0, 1fr); } .cart { position: static; } }
@media (max-width: 820px) {
  .stepper { grid-auto-flow: row; grid-auto-columns: auto; }
  .stepper li { flex-direction: row; text-align: left; }
  .stepper li::before { display: none; }
  .stepper .field { max-width: none; margin-left: auto; }
  .rule { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rule > span { grid-column: 1 / -1; }
  .f-row { grid-template-columns: 100px minmax(0, 1fr) 30px; }
  .f-row > span:last-child { grid-column: 1 / -1; }
  .sys-log li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .auto .form-grid { grid-template-columns: minmax(0, 1fr) !important; }
}

/* Rail labels: rendered as a floating layer (see app.js), never clipped by the scrolling rail */
.rail-btn[data-tip]:hover::before, .rail-btn[data-tip]:focus-visible::before { content: none; display: none; }
.rail-tip { position: fixed; z-index: 95; transform: translateY(-50%); white-space: nowrap; pointer-events: none;
  background: var(--card-2); border: 1px solid rgba(232,185,138,0.35); color: var(--text); font-size: 12px; font-weight: 500;
  padding: 7px 12px; border-radius: 10px; box-shadow: 0 14px 30px -12px rgba(0,0,0,0.85); }
.rail-tip::before { content: ''; position: absolute; left: -5px; top: 50%; width: 8px; height: 8px; background: var(--card-2);
  border-left: 1px solid rgba(232,185,138,0.35); border-bottom: 1px solid rgba(232,185,138,0.35); transform: translateY(-50%) rotate(45deg); }

/* Top-bar brand: "La Villa  Company OS" */
.brand-text { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.brand-text b { font-weight: 600; color: var(--text); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .01em; }
.brand-text span { color: var(--muted); font-weight: 500; }

/* ---------- Sign-in ---------- */
body.locked .frame { display: none; }
#auth-root[hidden] { display: none; }
.auth { position: relative; z-index: 2; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-brand { position: relative; overflow: hidden; display: grid; place-items: center; padding: 48px; background: radial-gradient(circle at 30% 30%, rgba(232,185,138,0.14), transparent 60%), var(--shell); border-right: 1px solid var(--line); }
.auth-brand::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(118deg, rgba(232,185,138,0.12) 0 1px, transparent 1px 14px); -webkit-mask: radial-gradient(ellipse at 0 0, #000 0%, transparent 75%); mask: radial-gradient(ellipse at 0 0, #000 0%, transparent 75%); pointer-events: none; }
.auth-brand::after { content: ''; position: absolute; right: -140px; bottom: -140px; width: 420px; height: 420px; background: repeating-conic-gradient(from 0deg, rgba(232,185,138,0.25) 0deg 0.6deg, transparent 0.6deg 4deg); -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%); pointer-events: none; }
.auth-brand-inner { position: relative; z-index: 1; max-width: 440px; }
.auth-logo { width: 132px; height: 132px; object-fit: contain; filter: drop-shadow(0 18px 40px rgba(232,185,138,0.25)); margin-bottom: 26px; }
.auth-brand h1 { font-size: 34px; font-weight: 400; line-height: 1.15; margin: 0 0 12px; }
.auth-brand h1 b { font-weight: 600; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-brand p { color: var(--text-2); margin: 0 0 22px; max-width: 40ch; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--muted); font-size: 12px; }
.auth-points li::before { content: '◆'; color: var(--gold); margin-right: 10px; font-size: 9px; }
.auth-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px 24px; gap: 18px; }
.auth-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 34px; border-radius: 24px; background: linear-gradient(180deg, var(--card), #232232); border: 1px solid var(--line-2); box-shadow: 0 40px 80px -40px rgba(0,0,0,0.85); }
.auth-card h2 { font-size: 22px; font-weight: 500; margin: 4px 0 0; }
.auth-card > p { margin: 0; font-size: 12px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card .tag { align-self: flex-start; }
.auth-submit { justify-content: center; padding: 12px; font-size: 13px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.auth-msg { font-size: 12px; padding: 10px 12px; border-radius: 10px; }
.auth-msg.bad { background: rgba(236,106,85,0.1); border: 1px solid rgba(236,106,85,0.35); color: #f6a898; }
.auth-msg.good { background: rgba(92,196,137,0.1); border: 1px solid rgba(92,196,137,0.35); color: #9fe0bb; }
.auth-foot { font-size: 11px; color: var(--muted); margin: 0; }
.pw-wrap { position: relative; display: flex; }
.pw-wrap .field { padding-right: 42px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; }
.pw-eye:hover { color: var(--text); }
.pw-eye svg { width: 16px; height: 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); cursor: pointer; text-transform: none; letter-spacing: 0; }
.check input { accent-color: var(--gold); width: 15px; height: 15px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold); font: 500 12px var(--font); cursor: pointer; align-self: flex-start; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Account & admin ---------- */
.user-btn { display: inline-flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 99px; border: 1px solid var(--line-2); background: linear-gradient(180deg, var(--card-2), var(--card)); color: var(--text); cursor: pointer; margin-right: 6px; }
.user-btn:empty { display: none; }
.user-btn:hover { border-color: rgba(232,185,138,0.4); }
.ub-text { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.ub-text b { font-size: 12px; font-weight: 500; }
.ub-text small { font-size: 10px; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--on-gold); font-size: 11px; font-weight: 600; flex-shrink: 0; }
.u-cell { display: flex; align-items: center; gap: 10px; }
.secret { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--inset); border: 1px dashed rgba(232,185,138,0.5); }
.secret code { flex: 1; font-size: 16px; letter-spacing: .08em; color: var(--gold-light); user-select: all; overflow-wrap: anywhere; }
.perm-matrix th.r-head { min-width: 120px; }
.perm-matrix th.r-head b { display: block; color: var(--text); font-weight: 500; }
.perm-matrix td { padding: 6px 8px; }
.lvl { display: inline-block; font-size: 11px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); }
.lvl.edit, .lvl-sel.edit { color: var(--good); border-color: rgba(92,196,137,0.4); }
.lvl.view, .lvl-sel.view { color: var(--gold); border-color: rgba(232,185,138,0.4); }
.lvl-sel { border: 1px solid var(--line-2); border-radius: 99px; font-size: 11px; padding: 4px 10px; min-width: 100px; }
.ro-banner { margin-bottom: 18px; padding: 10px 14px; border-radius: 12px; font-size: 12px; color: var(--gold-light); background: rgba(232,185,138,0.08); border: 1px solid rgba(232,185,138,0.3); }
#view [disabled] { opacity: .55; cursor: not-allowed; }
label.btn.is-disabled { pointer-events: none; opacity: .45; }

@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { padding: 32px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-logo { width: 84px; height: 84px; margin-bottom: 14px; }
  .auth-brand h1 { font-size: 26px; }
  .auth-points { display: none; }
  .auth-card { padding: 24px; }
  .ub-text { display: none; }
  .user-btn { padding: 3px; margin-right: 0; }
}

/* ---------- Profile ---------- */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.gold { color: var(--gold); }
a.u-cell:hover b { color: var(--gold); }
.profile-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; position: relative; overflow: hidden; }
.profile-hero::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(118deg, rgba(232,185,138,0.06) 0 1px, transparent 1px 12px); -webkit-mask: linear-gradient(90deg, #000, transparent 50%); mask: linear-gradient(90deg, #000, transparent 50%); }
.ph-photo { display: flex; flex-direction: column; align-items: center; gap: 12px; position: relative; }
.ph-avatar { width: 136px; height: 136px; border-radius: 50%; padding: 4px; background: var(--grad); box-shadow: 0 18px 40px -16px rgba(232,185,138,0.6); }
.ph-avatar img, .ph-avatar span { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; object-fit: cover; background: var(--inset); font-size: 40px; font-weight: 500; color: var(--gold); }
.ph-photo-actions { display: flex; gap: 8px; }
.ph-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; position: relative; }
.ph-name { font-size: 18px !important; font-weight: 500; max-width: 420px; }
.ph-meta { display: flex; gap: 6px; flex-wrap: wrap; color: var(--text-2); font-size: 13px; }
.ph-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip.birthday { color: var(--gold-light); border-color: rgba(232,185,138,0.45); }
.chip.birthday::before { background: var(--gold); }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.profile-grid > .card { margin-bottom: 0; }
.profile-wide { grid-column: 1 / -1; }
@media (max-width: 1000px) { .profile-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) {
  .profile-hero { grid-template-columns: minmax(0, 1fr); text-align: left; }
  .ph-photo { align-items: flex-start; flex-direction: row; }
  .ph-avatar { width: 96px; height: 96px; }
  .profile-grid .form-grid { grid-template-columns: minmax(0, 1fr) !important; }
}

/* Language switch (EN / ES) */
.lang-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 99px; background: var(--inset); border: 1px solid var(--line-2); flex-shrink: 0; }
.lang-switch button { border: 0; background: none; color: var(--muted); font: 500 11px/1 var(--font); letter-spacing: .04em; padding: 7px 10px; border-radius: 99px; cursor: pointer; transition: color .15s, background .15s; }
.lang-switch button:hover { color: var(--text); }
.lang-switch button.on { background: var(--grad); color: var(--on-gold); }
.lang-switch.lg button { padding: 9px 16px; font-size: 12px; }
.lang-switch.auth-lang { align-self: flex-end; }
.lang-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 560px) { #lang-slot .lang-switch button { padding: 6px 7px; } }

/* PDF import preview */
.pdf-rows td { vertical-align: top; }
.pdf-rows .cell { width: 100%; min-width: 0; }
.pdf-rows td:nth-child(2) { min-width: 210px; }
.pdf-rows td:nth-child(3) .cell { min-width: 96px; text-align: right; }
.pdf-rows td:nth-child(4) { min-width: 104px; }
.pdf-rows td:nth-child(5) { min-width: 168px; }
.pdf-rows td:nth-child(6) { min-width: 136px; }
.pdf-rows tr.off td:not(:first-child) { opacity: .45; }
.pdf-rows .pdf-src { margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.pdf-unused { margin: 14px 0 4px; }
.pdf-unused summary { cursor: pointer; color: var(--text-2); font-size: 12px; }
.pdf-unused pre { max-height: 240px; overflow: auto; background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; font-size: 11px; color: var(--text-2); white-space: pre-wrap; }

/* ==========================================================================
   CRM — wallet-style overview, contact views and contact record
   ========================================================================== */
.crm-root { --tint: rgba(232,185,138,0.10); }
.crm-root .cat-pill { --c: var(--gold); display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 3px 10px; border-radius: 99px; font-size: 10.5px; font-weight: 500; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); white-space: nowrap; }
.crm-root .gold, .crm-drawer .gold { color: var(--gold); }
.crm-root .bad, .crm-drawer .bad { color: var(--bad); }

/* Hero: dark panel with a floating gold card, like the reference wallet */
.crm-hero { position: relative; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.05fr) minmax(0, 1fr); grid-template-areas: "left send right" "left feed feed"; gap: 22px 34px; margin: 76px 0 24px; padding: 34px 36px 30px; border-radius: 30px; border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255,255,255,0.045) 0 38%, transparent 38.2%),
    radial-gradient(90% 80% at 12% 100%, rgba(255,255,255,0.03) 0 45%, transparent 45.3%),
    radial-gradient(70% 120% at 100% 0%, rgba(232,185,138,0.07), transparent 60%),
    linear-gradient(160deg, #2a2938, #1d1c28 70%);
  box-shadow: 0 40px 80px -40px rgba(0,0,0,0.9), inset 0 1px 0 rgba(255,255,255,0.04); }
.ch-col { min-width: 0; }
.ch-left { grid-area: left; display: flex; flex-direction: column; gap: 34px; padding-left: 28px; }
.ch-block { position: relative; display: flex; flex-direction: column; gap: 4px; }
.ch-vlabel { position: absolute; left: -36px; top: 50%; transform: translateY(-50%) rotate(-90deg); transform-origin: center; font-size: 10px; letter-spacing: .08em; color: var(--muted); width: 0; white-space: nowrap; display: flex; justify-content: center; }
.ch-cur { font-size: 15px; color: var(--text-2); font-weight: 500; }
.ch-big { font-size: clamp(34px, 4vw, 50px); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ch-gold { color: var(--gold); font-size: 13px; font-weight: 500; }
.ch-link { font-size: 22px; font-weight: 500; color: var(--gold-light); letter-spacing: -0.01em; }
.ch-link small { font-size: 12px; color: var(--muted); font-weight: 400; }
.ch-link.sm { font-size: 13px; color: var(--gold); }
.ch-link:hover { color: var(--gold-light); filter: brightness(1.1); }

.ch-send { grid-area: send; align-self: start; margin-top: -92px; padding: 26px 26px 22px; border-radius: 24px; color: var(--on-gold); background: linear-gradient(160deg, #f6cfa3 0%, #e9b07c 48%, #d4925f 100%); box-shadow: 0 34px 60px -26px rgba(214,146,95,0.75), 0 2px 0 rgba(255,255,255,0.35) inset; position: relative; z-index: 1; }
.cs-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 16px; }
.cs-head svg { width: 18px; height: 18px; }
.cs-form { display: grid; gap: 12px; }
.cs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cs-input { width: 100%; min-width: 0; border: 0; outline: none; border-radius: 13px; padding: 13px 15px; font: 500 12px var(--font); color: var(--on-gold); background: rgba(255,255,255,0.22); box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 8px 18px -14px rgba(120,60,20,0.6); }
.cs-input::placeholder { color: rgba(42,29,18,0.55); }
.cs-input:focus { background: rgba(255,255,255,0.32); }
.cs-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0 2px; border-bottom: 1px solid rgba(42,29,18,0.15); padding-bottom: 14px; }
.cs-chip input { position: absolute; opacity: 0; pointer-events: none; }
.cs-chip span { display: inline-block; padding: 6px 13px; border-radius: 99px; border: 1px solid rgba(42,29,18,0.28); font-size: 11px; font-weight: 500; cursor: pointer; transition: .15s; }
.cs-chip input:checked + span { background: rgba(42,29,18,0.85); color: var(--gold-light); border-color: transparent; }
.cs-chip input:focus-visible + span { outline: 2px solid var(--on-gold); outline-offset: 2px; }
.cs-foot { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.cs-foot span { font-size: 10.5px; line-height: 1.4; color: rgba(42,29,18,0.7); }
.cs-btn { flex-shrink: 0; border: 0; border-radius: 13px; padding: 13px 26px; font: 600 12px var(--font); color: #fff; background: rgba(255,255,255,0.25); box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 10px 22px -12px rgba(120,60,20,0.7); cursor: pointer; transition: .15s; }
.cs-btn:hover { background: rgba(255,255,255,0.35); }

.ch-right { grid-area: right; padding-top: 4px; }
.cr-head { display: flex; align-items: center; gap: 10px; font-size: 16px; margin-bottom: 16px; }
.cr-head svg { color: var(--text-2); }
.cr-head .muted { margin-left: auto; }
.cr-tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cr-tasks li { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); }
.cr-tasks li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
.cr-tasks b { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-tasks span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-tasks em { font-style: normal; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.cr-check { width: 20px; height: 20px; flex-shrink: 0; border-radius: 7px; border: 1.5px solid rgba(232,185,138,0.55); background: transparent; cursor: pointer; transition: .15s; }
.cr-check:hover { background: var(--grad); border-color: transparent; }
.cr-empty { font-size: 12px; color: var(--muted); line-height: 1.6; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line-2); }

.ch-feed { grid-area: feed; min-width: 0; padding-top: 6px; }
.cf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.cf-head b { font-size: 16px; font-weight: 500; }
.cf-table { display: grid; gap: 8px; }
.cf-row { display: grid; grid-template-columns: minmax(70px, .8fr) minmax(86px, .9fr) minmax(80px, .8fr) minmax(0, 2.2fr); gap: 14px; align-items: center; padding: 13px 16px; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.03); font-size: 12px; cursor: pointer; transition: .15s; }
.cf-row:not(.cf-th):hover { background: rgba(255,255,255,0.055); }
.cf-th { background: none; border: 0; padding: 0 16px 2px; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); cursor: default; }
.cf-row .strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.cf-type { color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.cf-type.k-order { color: var(--gold); }
.cf-type.k-order::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.cf-who { min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.cf-who small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Contacts card: header, view switcher, tools, categories */
.crm-contacts { padding: 24px 24px 26px; }
.cc-head { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding-bottom: 0; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.cc-head h2 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -0.01em; padding-bottom: 14px; }
.cc-views { display: flex; gap: 4px; align-self: stretch; }
.cc-views button { display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: 500 12px var(--font); padding: 0 12px 14px; cursor: pointer; transition: .15s; }
.cc-views button svg { width: 15px; height: 15px; }
.cc-views button:hover { color: var(--text); }
.cc-views button.on { color: var(--text); border-bottom-color: var(--gold); }
.cc-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; padding-bottom: 12px; flex-wrap: wrap; }
.cc-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 34px; border-radius: 11px; background: var(--inset); border: 1px solid var(--line-2); color: var(--muted); }
.cc-search svg { width: 15px; height: 15px; }
.cc-search input { background: none; border: 0; outline: none; color: var(--text); font: 12px var(--font); width: 190px; min-width: 0; }
.cc-drop { position: relative; }
.btn.is-on { border-color: rgba(232,185,138,0.55); color: var(--gold-light); }
.cc-badge { font-style: normal; display: inline-grid; place-items: center; min-width: 17px; height: 17px; border-radius: 99px; font-size: 10px; font-weight: 600; background: var(--grad); color: var(--on-gold); }
.cc-menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; min-width: 200px; padding: 6px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line-2); box-shadow: 0 30px 60px -20px rgba(0,0,0,0.85); display: grid; gap: 2px; }
.cc-menu.right { left: auto; right: 0; }
.cc-menu > button { text-align: left; background: none; border: 0; border-radius: 9px; padding: 9px 11px; color: var(--text-2); font: 12px var(--font); cursor: pointer; }
.cc-menu > button:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.cc-menu > button.on { color: var(--gold); }
.cc-menu > button.danger { color: var(--bad); }
.cc-filter { min-width: 250px; padding: 14px; gap: 12px; right: 0; left: auto; }
.cc-filter label { display: grid; gap: 6px; font-size: 11px; color: var(--muted); }
.cc-cats { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.cc-cats button { --c: var(--muted); display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 11px; border: 1px solid transparent; background: none; color: var(--muted); font: 500 12px var(--font); cursor: pointer; transition: .15s; }
.cc-cats button:hover { color: var(--text); }
.cc-cats button.on { background: var(--inset); border-color: var(--line-2); color: var(--text); }
.cc-cats button i { font-style: normal; font-size: 10.5px; color: var(--muted); padding: 1px 7px; border-radius: 99px; background: rgba(255,255,255,0.05); }
.cc-cats button .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.cc-cats button svg { width: 13px; height: 13px; }
.cc-cats .cc-addcat { margin-left: auto; color: var(--text-2); }

/* Avatars */
.ct-avatar { --c: var(--gold); position: relative; width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c) 55%, #fff 10%), color-mix(in srgb, var(--c) 35%, #1d1c28)); box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px color-mix(in srgb, var(--c) 55%, transparent); }
.ct-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ct-avatar b { font-size: 14px; font-weight: 600; color: var(--on-gold); letter-spacing: .02em; }
.ct-avatar.sm { width: 38px; height: 38px; } .ct-avatar.sm b { font-size: 12px; }
.ct-avatar.xs { width: 28px; height: 28px; box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, transparent); } .ct-avatar.xs b { font-size: 10px; }
.ct-avatar.lg { width: 76px; height: 76px; box-shadow: 0 0 0 3px var(--card-2), 0 0 0 5px color-mix(in srgb, var(--c) 60%, transparent); } .ct-avatar.lg b { font-size: 22px; }
.ct-fav { position: absolute; right: -3px; bottom: -3px; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); box-shadow: 0 0 0 2px var(--card); }
.ct-fav svg { width: 10px; height: 10px; fill: var(--on-gold); stroke: var(--on-gold); }

/* Grid view (reference layout) */
.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 18px; }
.ct-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(180deg, #2b2a3b, #242332); box-shadow: 0 18px 34px -24px rgba(0,0,0,0.9); cursor: pointer; transition: transform .18s, border-color .18s, box-shadow .18s; min-width: 0; }
.ct-card:hover { transform: translateY(-3px); border-color: rgba(232,185,138,0.35); box-shadow: 0 26px 44px -26px rgba(0,0,0,0.95), 0 0 0 1px rgba(232,185,138,0.08); }
.ct-card header { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ct-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ct-id b { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-loc { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ct-loc svg { width: 12px; height: 12px; }
.ct-kebab .icon-btn { padding: 4px; }
.ct-kebab .icon-btn svg { width: 16px; height: 16px; }
.ct-lines { display: grid; gap: 9px; }
.ct-line { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-2); min-width: 0; }
.ct-line svg { width: 15px; height: 15px; color: var(--muted); }
.ct-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.18); text-underline-offset: 4px; }
a.ct-line:hover span { color: var(--gold-light); text-decoration-color: var(--gold); }
.ct-line.off span { text-decoration: none; color: var(--muted); font-style: italic; }
.ct-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 2px; }
.ct-btn { justify-content: center; padding: 10px 10px; border-radius: 12px; font-weight: 600; }
.ct-btn:hover { background: var(--grad); color: var(--on-gold); border-color: transparent; }
.ct-btn.is-off { opacity: .35; pointer-events: auto; cursor: not-allowed; }
.ct-btn.is-off:hover { background: linear-gradient(180deg, var(--card-2), var(--card)); color: var(--text); border-color: var(--line-2); }

/* List view */
.ct-list { display: grid; gap: 8px; }
.ct-row { display: grid; grid-template-columns: auto minmax(150px, 1.4fr) minmax(150px, 1fr) minmax(160px, 1.3fr) minmax(90px, .7fr) auto auto; gap: 16px; align-items: center; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,0.02); cursor: pointer; transition: .15s; }
.ct-row:hover { background: rgba(255,255,255,0.04); border-color: rgba(232,185,138,0.25); }
.ct-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ct-contact, .ct-meta { display: flex; flex-direction: column; font-size: 12px; min-width: 0; }
.ct-contact span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-meta b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ct-actions.compact { display: flex; gap: 6px; margin: 0; }
.ct-actions.compact .ct-btn { padding: 8px 10px; }
.ct-actions.compact .ct-btn span { display: none; }

/* Kanban view */
.ct-kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kb-col { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 18px; background: var(--inset); border: 1px solid var(--line); min-height: 220px; transition: border-color .15s, background .15s; }
.kb-col.over { border-color: var(--gold); background: rgba(232,185,138,0.06); }
.kb-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 6px; }
.kb-head b { font-size: 12px; font-weight: 600; }
.kb-head i { font-style: normal; font-size: 10.5px; padding: 1px 7px; border-radius: 99px; background: rgba(255,255,255,0.06); color: var(--text-2); }
.kb-head .muted { margin-left: auto; }
.kb-cards { display: grid; gap: 10px; align-content: start; flex: 1; }
.kb-card { display: grid; gap: 8px; padding: 13px; border-radius: 14px; background: linear-gradient(180deg, #2b2a3b, #252433); border: 1px solid var(--line); cursor: grab; transition: .15s; min-width: 0; }
.kb-card:hover { border-color: rgba(232,185,138,0.35); }
.kb-card.dragging { opacity: .45; }
.kb-card span.muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-top { display: flex; align-items: center; gap: 9px; min-width: 0; }
.kb-top b { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; }
.kb-task { display: inline-flex; align-items: center; gap: 3px; color: var(--gold); margin-left: auto; }
.kb-task svg { width: 13px; height: 13px; }
.kb-empty { display: grid; place-items: center; min-height: 80px; border-radius: 12px; border: 1px dashed var(--line-2); color: var(--muted); font-size: 11px; }

/* Table view */
.ct-table td { white-space: nowrap; }
.ct-table .nowrap { white-space: nowrap; }
.ct-cell { display: flex; align-items: center; gap: 10px; }
.ct-cell b { font-weight: 500; }
.th-sort { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.th-sort.on { color: var(--gold); }

/* Contact record (drawer) */
body.crm-drawer-open { overflow: hidden; }
.crm-drawer-wrap { position: fixed; inset: 0; z-index: 74; background: rgba(10,9,14,0.55); backdrop-filter: blur(4px); }
.crm-drawer-wrap.enter { animation: crmFade .18s ease; }
.crm-drawer { position: fixed; top: 12px; right: 12px; bottom: 12px; z-index: 75; width: min(540px, calc(100vw - 24px)); display: flex; flex-direction: column; border-radius: 24px; overflow: hidden; border: 1px solid var(--line-2); background: linear-gradient(180deg, #2a2939, #201f2c); box-shadow: 0 40px 90px -30px rgba(0,0,0,0.95); }
.crm-drawer.enter { animation: crmSlide .24s cubic-bezier(.2,.8,.2,1); }
@keyframes crmSlide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes crmFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .crm-drawer, .crm-drawer-wrap { animation: none; } }
.cd-top { position: relative; padding: 26px 26px 18px; background: radial-gradient(120% 120% at 100% 0%, rgba(232,185,138,0.22), transparent 55%), radial-gradient(80% 90% at 0% 0%, rgba(255,255,255,0.04) 0 45%, transparent 45.5%); border-bottom: 1px solid var(--line); }
.cd-close { position: absolute; top: 14px; right: 14px; }
.cd-close svg { width: 16px; height: 16px; }
.cd-id { display: flex; align-items: center; gap: 18px; padding-right: 30px; }
.cd-id h2 { margin: 0 0 2px; font-size: 21px; font-weight: 500; letter-spacing: -0.01em; }
.cd-id > div { min-width: 0; flex: 1; }
.cd-pills { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.cd-pills .cat-pill { --c: var(--gold); display: inline-flex; padding: 3px 10px; border-radius: 99px; font-size: 10.5px; font-weight: 500; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.cd-photo { position: relative; cursor: pointer; }
.cd-cam { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--on-gold); box-shadow: 0 0 0 3px var(--card-2); }
.cd-cam svg { width: 14px; height: 14px; }
.cd-star { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; }
.cd-star.on svg { fill: var(--gold); stroke: var(--gold); }
.cd-quick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 20px; }
.cd-q { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 11px 4px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.03); color: var(--text-2); font: 500 10.5px var(--font); cursor: pointer; transition: .15s; }
.cd-q svg { width: 17px; height: 17px; }
.cd-q:hover { background: var(--grad); color: var(--on-gold); border-color: transparent; }
.cd-q.is-off { opacity: .35; cursor: not-allowed; }
.cd-q.is-off:hover { background: rgba(255,255,255,0.03); color: var(--text-2); border-color: var(--line-2); }
.cd-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.cd-stats div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,0.18); }
.cd-stats span { font-size: 10px; color: var(--muted); }
.cd-stats b { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-tabs { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.cd-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: 500 12px var(--font); padding: 13px 10px 11px; cursor: pointer; }
.cd-tabs button.on { color: var(--text); border-bottom-color: var(--gold); }
.cd-body { flex: 1; overflow-y: auto; padding: 20px 24px 28px; }
.cd-form { grid-template-columns: 1fr 1fr; }
.cd-form .full { grid-column: 1 / -1; }
.cd-danger { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.danger-text { color: var(--bad); }
.cd-compose { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: var(--inset); border: 1px solid var(--line); }
.cd-types { display: flex; gap: 6px; flex-wrap: wrap; }
.cd-types input { position: absolute; opacity: 0; pointer-events: none; }
.cd-types span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 99px; font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); cursor: pointer; }
.cd-types svg { width: 13px; height: 13px; }
.cd-types input:checked + span { background: var(--grad); color: var(--on-gold); border-color: transparent; }
.cd-compose-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cd-compose-foot label { display: flex; align-items: center; gap: 8px; }
.cd-compose-foot .field { padding: 6px 9px; width: auto; }
.cd-sub { margin: 22px 0 10px; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cr-tasks.in-drawer li > div { cursor: default; }
.cd-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.cd-timeline::before { content: ''; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 1px; background: var(--line-2); }
.cd-timeline li { position: relative; display: flex; gap: 14px; padding: 0 0 16px; }
.cd-timeline li > div { flex: 1; min-width: 0; }
.tl-ico { position: relative; z-index: 1; width: 31px; height: 31px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line-2); color: var(--text-2); }
.tl-ico svg { width: 14px; height: 14px; }
.cd-timeline li.k-order .tl-ico, .cd-timeline li.k-stage .tl-ico { background: var(--grad); color: var(--on-gold); border-color: transparent; }
.tl-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding-top: 5px; }
.tl-top b { font-size: 12px; font-weight: 500; }
.tl-top time { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.cd-timeline p { margin: 4px 0 0; font-size: 12px; color: var(--text-2); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.cd-timeline .icon-btn { align-self: flex-start; opacity: 0; }
.cd-timeline li:hover .icon-btn { opacity: 1; }
.crm-drawer .cf-row { grid-template-columns: .9fr 1fr 1fr auto; cursor: default; }
.member-chips .chip { cursor: pointer; }

@media (max-width: 1100px) {
  .crm-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-areas: "left send" "right right" "feed feed"; }
}
@media (max-width: 720px) {
  .crm-hero { grid-template-columns: 1fr; grid-template-areas: "send" "left" "right" "feed"; padding: 22px 18px; margin-top: 30px; gap: 26px; }
  .ch-send { margin-top: -52px; }
  .ch-left { padding-left: 26px; gap: 26px; }
  .cs-row { grid-template-columns: 1fr; }
  .cf-row { grid-template-columns: 1fr 1fr; }
  .cf-row.cf-th { display: none; }
  .cc-tools { margin-left: 0; width: 100%; }
  .cc-search { flex: 1; } .cc-search input { width: 100%; }
  .cc-views { width: 100%; overflow-x: auto; }
  .cc-views button span { display: none; }
  .ct-row { grid-template-columns: auto 1fr auto; }
  .ct-row .ct-tags, .ct-row .ct-contact, .ct-row .ct-meta { display: none; }
  .cd-quick { grid-template-columns: repeat(3, 1fr); }
  .cd-stats { grid-template-columns: repeat(2, 1fr); }
  .cd-form { grid-template-columns: 1fr; }
  .cc-filter { right: auto; left: 0; }
}

/* ==========================================================================
   Logistics & Shipping
   ========================================================================== */
.lg-root .bad { color: var(--bad); } .lg-root .gold { color: var(--gold); }
.lg-grow { flex: 1; }
.lg-banner { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 20px; border-radius: 16px; border: 1px solid rgba(232,185,138,0.35); background: linear-gradient(120deg, rgba(232,185,138,0.12), transparent 70%); }
.lg-banner > svg { color: var(--gold); width: 26px; height: 26px; }
.lg-banner div { flex: 1; display: flex; flex-direction: column; } .lg-banner span { font-size: 12px; color: var(--text-2); }
.lg-welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.lg-welcome h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.lg-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lg-filters .field { width: auto; min-width: 170px; padding: 8px 12px; }
.lg-range { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; height: 36px; border-radius: 11px; background: var(--inset); border: 1px solid var(--line-2); color: var(--muted); }
.lg-range svg { width: 15px; height: 15px; }
.lg-range input { background: none; border: 0; color: var(--text); font: 12px var(--font); outline: none; width: 118px; color-scheme: dark; }
.lg-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.lg-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.lg-funnel { display: grid; gap: 4px; }
.lf-row { display: grid; grid-template-columns: 96px 1fr 40px 44px; align-items: center; gap: 14px; padding: 7px 6px; border: 0; background: none; color: var(--text-2); font: 12px var(--font); text-align: left; border-radius: 9px; cursor: pointer; }
.lf-row:hover { background: rgba(255,255,255,0.03); color: var(--text); }
.lf-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,0.06); overflow: hidden; }
.lf-bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.lf-bar i.f-Created { background: #8a8699; } .lf-bar i.f-Cancelled { background: var(--bad); } .lf-bar i.f-Delivered { background: var(--good); } .lf-bar i.f-Onhold { background: #d99d6c; }
.lf-row b { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; } .lf-row em { font-style: normal; font-size: 11px; color: var(--muted); text-align: right; }
.lg-seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--inset); border: 1px solid var(--line); }
.lg-seg button { border: 0; background: none; color: var(--muted); font: 500 11.5px var(--font); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.lg-seg button.on { background: var(--grad); color: var(--on-gold); }
.lg-chart { position: relative; height: 270px; }
.lg-chart-empty { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.lg-skus { display: grid; gap: 12px; }
.lk-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 46px; gap: 14px; align-items: center; font-size: 12px; }
.lk-row span { display: flex; flex-direction: column; overflow: hidden; } .lk-row span, .lk-row small { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.lk-row small { color: var(--muted); font-size: 10.5px; }
.lk-row i { height: 9px; border-radius: 99px; background: rgba(255,255,255,0.06); overflow: hidden; } .lk-row i b { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.lg-skus.slow .lk-row i b { background: #8a8699; }
.lk-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.lg-optabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: -6px 0 14px; }
.lg-optabs button { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: 500 12px var(--font); padding: 10px 12px; cursor: pointer; }
.lg-optabs button.on { color: var(--gold); border-bottom-color: var(--gold); }
.lg-optabs i { font-style: normal; font-size: 10.5px; padding: 1px 7px; border-radius: 99px; background: rgba(255,255,255,0.06); color: var(--text-2); }
.lg-info svg { width: 13px; height: 13px; opacity: .6; }
.lg-none { padding: 6px 2px; }

/* Shipments: list + detail (reference layout) */
.lg-ship { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 22px; align-items: start; }
.lg-list { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 12px; max-height: calc(100vh - 40px); }
.lg-searchrow { display: flex; gap: 10px; }
.lg-search { flex: 1; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border-radius: 14px; background: linear-gradient(180deg, var(--card), #232232); border: 1px solid var(--line); color: var(--muted); }
.lg-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font: 13px var(--font); }
.lg-sqbtn, .lg-round { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--card), #232232); color: var(--text-2); cursor: pointer; }
.lg-round { width: 36px; height: 36px; border-radius: 50%; }
.lg-round:hover, .lg-sqbtn:hover { border-color: rgba(232,185,138,0.45); color: var(--gold); }
.lg-round.is-on { color: var(--gold); border-color: var(--gold); }
.lg-new { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 14px; border: 1px solid rgba(232,185,138,0.45); background: rgba(232,185,138,0.05); color: var(--gold-light); font: 500 13px var(--font); cursor: pointer; transition: .15s; }
.lg-new:hover { background: rgba(232,185,138,0.12); }
.lg-new svg { width: 16px; height: 16px; }
.lg-cards { display: grid; gap: 14px; overflow-y: auto; padding: 2px 4px 4px 2px; }
.lg-card { padding: 16px; border-radius: 20px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--card), #232232); cursor: pointer; transition: border-color .15s, transform .15s; }
.lg-card:hover { border-color: rgba(232,185,138,0.3); }
.lg-card.on { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(232,185,138,0.25), 0 20px 40px -26px rgba(232,185,138,0.6); }
.lg-card header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.lg-card header b { color: var(--text); font-size: 15px; font-weight: 600; }
.lg-route { position: relative; display: grid; gap: 14px; padding: 16px; border-radius: 15px; border: 1px solid var(--line); background: rgba(0,0,0,0.12); }
.lg-card.on .lg-route { background: var(--grad); border-color: transparent; color: var(--on-gold); box-shadow: inset 0 1px 0 rgba(255,255,255,0.35); }
.lr-stop { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.lr-stop > i { width: 12px; height: 12px; margin-top: 3px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(232,185,138,0.18); }
.lr-stop.end > i { background: transparent; border: 2px solid var(--gold); }
.lr-stop:not(.end)::after { content: ''; position: absolute; left: 5.5px; top: 18px; height: calc(100% + 2px); border-left: 1.5px dashed rgba(232,185,138,0.6); }
.lg-card.on .lr-stop > i { background: var(--on-gold); box-shadow: 0 0 0 3px rgba(42,29,18,0.15); }
.lg-card.on .lr-stop.end > i { background: transparent; border-color: var(--on-gold); }
.lg-card.on .lr-stop:not(.end)::after { border-left-color: rgba(42,29,18,0.5); }
.lr-place, .lr-when { display: flex; flex-direction: column; min-width: 0; }
.lr-place b, .lr-when b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-place span, .lr-when span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-when { text-align: right; }
.lg-card.on .lr-place span, .lg-card.on .lr-when span { color: rgba(42,29,18,0.7); }
.lg-prog { height: 7px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; margin-top: 2px; }
.lg-prog span { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.lg-card.on .lg-prog { background: rgba(42,29,18,0.18); } .lg-card.on .lg-prog span { background: #2a1d12; }
.lg-type { --c: var(--gold); display: inline-flex; padding: 4px 11px; border-radius: 9px; font-size: 11px; font-weight: 500; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); white-space: nowrap; }
.lg-type.t-delivery { --c: var(--good); } .lg-type.t-transfer { --c: #a9a4c9; } .lg-type.t-pickup { --c: #f8b49a; } .lg-type.t-return { --c: #d99d6c; }
.lg-detail { min-width: 0; padding: 24px; border-radius: 24px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--card), #232232); box-shadow: var(--shadow); }
.lg-dhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.lg-dhead h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.lg-dhead h2 .muted { font-weight: 400; }
.lg-dhead .head-actions { margin-left: auto; }
.lg-dgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.lg-box { min-width: 0; }
.lg-bh { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.lg-bh h3 { margin: 0; font-size: 15px; font-weight: 500; }
.lg-bh > div { display: flex; gap: 2px; }
.lg-bh .icon-btn svg { width: 16px; height: 16px; }
.lg-overview { grid-column: span 2; }
.lg-map { position: relative; height: 340px; border-radius: 18px; overflow: hidden; background: #1a1925; border: 1px solid var(--line); }
.lg-map-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.lg-schem { width: 100%; height: 100%; }
.lg-map .leaflet-container, .lg-map.leaflet-container { background: #1a1925; font: 11px var(--font); }
.lg-map .leaflet-tile-pane { filter: invert(1) hue-rotate(200deg) saturate(.35) brightness(.78) contrast(.92); }
.lg-map .leaflet-control-zoom a { background: var(--card-2); color: var(--text); border-color: var(--line-2); }
.lg-map .leaflet-control-attribution { background: rgba(23,22,31,0.7); color: var(--muted); }
.lg-map .leaflet-control-attribution a { color: var(--text-2); }
.lg-map .leaflet-tooltip { background: var(--card-2); color: var(--text); border: 1px solid var(--line-2); box-shadow: none; }
.lg-pulse { border-radius: 50%; background: rgba(232,185,138,0.35); box-shadow: 0 0 0 0 rgba(232,185,138,0.6); animation: lgPulse 1.8s infinite; position: relative; }
.lg-pulse::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--gold-light); }
@keyframes lgPulse { 0% { box-shadow: 0 0 0 0 rgba(232,185,138,0.55); } 70% { box-shadow: 0 0 0 14px rgba(232,185,138,0); } 100% { box-shadow: 0 0 0 0 rgba(232,185,138,0); } }
@media (prefers-reduced-motion: reduce) { .lg-pulse { animation: none; } }
.lg-stopsbox { display: flex; flex-direction: column; }
.lg-stops { list-style: none; margin: 0; padding: 18px 16px; border-radius: 18px; border: 1px solid var(--line); background: rgba(0,0,0,0.12); flex: 1; display: grid; gap: 0; align-content: start; }
.lg-stops li { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 12px; padding-bottom: 20px; }
.lg-stops li.last { padding-bottom: 0; }
.lg-stops li:not(.last)::after { content: ''; position: absolute; left: 7px; top: 18px; bottom: 0; border-left: 1.5px dashed rgba(232,185,138,0.55); }
.lg-stops li.done:not(.last)::after { border-left-style: solid; border-left-color: var(--gold); }
.ls-dot { width: 15px; height: 15px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--gold); background: transparent; cursor: pointer; padding: 0; position: relative; z-index: 1; }
.lg-stops li.done .ls-dot, .lg-stops li.first .ls-dot { background: var(--gold); }
.lg-stops b { display: block; font-size: 12.5px; font-weight: 600; }
.lg-stops span { display: block; font-size: 11px; color: var(--muted); }
.lg-stops em { display: block; font-style: normal; font-size: 10.5px; color: var(--gold); margin-top: 2px; }
.lg-person { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: rgba(0,0,0,0.12); min-height: 84px; }
.lg-person > div:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lg-person b { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-person span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-av { width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 600; color: var(--on-gold); background: var(--grad); box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px rgba(232,185,138,0.5); }
.lg-av.off { background: var(--inset); color: var(--muted); box-shadow: 0 0 0 1px var(--line-2); }
.lg-av.off svg { width: 20px; height: 20px; }
.lg-av.sm { width: 28px; height: 28px; font-size: 10px; box-shadow: none; }
.lg-pact { display: flex; flex-direction: column; gap: 6px; border-left: 1px solid var(--line); padding-left: 10px; }
.lg-pbtn { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); border: 1px solid var(--line-2); }
.lg-pbtn svg { width: 16px; height: 16px; }
.lg-pbtn:hover { color: var(--on-gold); background: var(--grad); border-color: transparent; }
.lg-pbtn.is-off { opacity: .35; pointer-events: auto; cursor: not-allowed; }
.lg-notesbox { grid-row: span 2; display: flex; flex-direction: column; }
.lg-notes { flex: 1; min-height: 180px; resize: vertical; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: rgba(0,0,0,0.12); color: var(--text-2); font: 12.5px/1.65 var(--font); outline: none; }
.lg-notes:focus { border-color: rgba(232,185,138,0.45); }
.lg-dl { margin: 0; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line); background: rgba(0,0,0,0.12); display: grid; gap: 10px; }
.lg-dl div { display: flex; justify-content: space-between; gap: 12px; }
.lg-dl dt { font-size: 11.5px; color: var(--muted); } .lg-dl dd { margin: 0; font-size: 12.5px; font-weight: 500; text-align: right; }
.lg-dl dd.big { font-size: 17px; font-weight: 600; color: var(--gold-light); }
.lg-wide { grid-column: 1 / -1; padding-top: 6px; border-top: 1px solid var(--line); }

/* Orders */
.lg-otools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.lg-otools .lg-search { flex: 0 1 340px; height: 38px; border-radius: 12px; }
.lg-otools .field { width: auto; min-width: 170px; padding: 8px 12px; }
.lg-stagechips { margin-bottom: 14px; }
.lg-bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border-radius: 14px; background: rgba(232,185,138,0.08); border: 1px solid rgba(232,185,138,0.3); }
.lg-table-card { padding: 8px 14px 14px; }
.lg-orders tr.late td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.lg-oact { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.lg-chan { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; font-size: 11px; font-weight: 500; background: rgba(255,255,255,0.05); color: var(--text-2); white-space: nowrap; }
.lg-chan svg { width: 12px; height: 12px; }
.lg-chan.c-shopify { color: var(--good); background: rgba(92,196,137,0.1); } .lg-chan.c-store { color: var(--gold); background: rgba(232,185,138,0.1); } .lg-chan.c-wholesale { color: #a9a4c9; background: rgba(169,164,201,0.1); }
.lg-st.st-Onhold { color: #f0a46a; border-color: rgba(240,164,106,0.4); }
.lg-st.st-Picking, .lg-st.st-Packing { color: var(--gold); border-color: rgba(232,185,138,0.4); }
.status-pill.lg-low { color: #f0a46a; border-color: rgba(240,164,106,0.4); background: rgba(240,164,106,0.08); }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }

/* Inventory shipments (3PL portal style) */
.lg-btools { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.lg-bsearch { display: flex; align-items: center; flex: 0 1 620px; height: 46px; border-radius: 99px; overflow: hidden; border: 1.5px solid rgba(232,185,138,0.5); background: var(--inset); }
.lg-bs-ico { display: grid; place-items: center; width: 46px; height: 100%; color: var(--on-gold); background: var(--grad); }
.lg-bs-mode { height: 100%; border: 0; border-right: 1px solid var(--line-2); background: var(--card-2); color: var(--text); font: 500 12px var(--font); padding: 0 10px; outline: none; }
.lg-bsearch input { flex: 1; min-width: 0; height: 100%; padding: 0 16px; border: 0; background: none; color: var(--text); font: 14px var(--font); outline: none; }
.btn.lg-actions { background: #141320; border-color: var(--line-2); font-weight: 600; }
.lg-btable { border-radius: 20px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--card), #232232); overflow: hidden; }
.lg-boxes thead th { background: #15141e; color: var(--text); font-size: 12px; font-weight: 600; padding: 16px 14px; border-bottom: 0; }
.lg-boxes td { padding: 18px 14px; font-size: 12.5px; vertical-align: middle; }
.lg-boxid { font-size: 14px; }
.lg-bst { font-weight: 600; } .lg-bst.good { color: var(--good); } .lg-bst.bad { color: var(--bad); }
.lg-bst:not(.good):not(.bad) { color: var(--gold); }
.lg-trk { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-weight: 500; }
.lg-trk a { color: var(--gold-light); }
.lg-trk .icon-btn svg { width: 14px; height: 14px; }
.lg-dates div { white-space: nowrap; } .lg-dates span { font-weight: 600; }
.lg-pager { display: flex; justify-content: flex-end; align-items: center; gap: 16px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-2); }
.lg-pager label { display: flex; align-items: center; gap: 8px; }
.lg-pager .field { width: auto; padding: 5px 8px; }
.lg-pager .icon-btn svg { width: 16px; height: 16px; }

/* Modals for logistics forms */
.lg-modal { width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.lg-modal.wide { width: min(760px, 100%); }
.lg-mhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.lg-mhead h3 { margin: 0; }
.lg-mbody { overflow-y: auto; padding-right: 4px; flex: 1; }
.lg-fg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lg-fg .full { grid-column: 1 / -1; }
.lg-lines { display: grid; gap: 8px; }
.lg-line { display: grid; grid-template-columns: minmax(0, 2fr) minmax(70px, .8fr) minmax(80px, .9fr) auto; gap: 8px; align-items: center; }
#lg-rlines .lg-line { grid-template-columns: minmax(0, 2fr) 90px auto; }
.lg-boxcard { padding: 12px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(0,0,0,0.12); margin-bottom: 10px; display: grid; gap: 8px; }
.lg-boxcard .lg-line { grid-template-columns: minmax(0, 2fr) minmax(70px, .8fr) auto; }
.lg-bch { display: flex; justify-content: space-between; align-items: center; }
.lg-boxcard .btn.add { margin-top: 0; width: fit-content; }

/* Integrations */
.lg-shopify { position: relative; padding: 26px; border-radius: 26px; margin-bottom: 24px; border: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(90% 120% at 100% 0%, rgba(92,196,137,0.10), transparent 55%), radial-gradient(70% 90% at 0% 100%, rgba(232,185,138,0.08), transparent 60%), linear-gradient(160deg, #2a2938, #1d1c28 70%); }
.ls-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.ls-head h2 { margin: 0; font-size: 22px; font-weight: 600; }
.ls-head > div { flex: 1; display: flex; flex-direction: column; } .ls-head > div span { font-size: 12px; color: var(--text-2); }
.ls-logo { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--grad); color: var(--on-gold); box-shadow: 0 16px 30px -16px rgba(232,185,138,0.7); }
.ls-logo svg { width: 26px; height: 26px; }
.ls-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ls-step { display: flex; gap: 12px; padding: 16px; border-radius: 18px; background: rgba(0,0,0,0.18); border: 1px solid var(--line); }
.ls-step > i { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 600; background: rgba(232,185,138,0.14); color: var(--gold); }
.ls-step > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ls-step b { font-size: 13px; font-weight: 600; } .ls-step > div > span { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.ls-step .field-label { font-size: 11px; }
.ls-step .btn { width: fit-content; }
.ls-links { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; } .ls-links a { color: var(--gold); }
.ls-live { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-top: 16px; padding: 16px; border-radius: 18px; border: 1px dashed var(--line-2); }
.ls-live > div { display: flex; flex-direction: column; } .ls-live span { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.ls-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.ls-stats div { display: flex; flex-direction: column; padding: 12px 16px; border-radius: 14px; background: rgba(0,0,0,0.18); }
.ls-stats b { font-size: 18px; font-weight: 600; } .ls-stats span { font-size: 11px; color: var(--muted); }
.lg-h3 { font-size: 15px; font-weight: 500; margin: 0 0 12px; }
.lg-ints { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 14px; margin-bottom: 20px; }
.lg-int { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--card), #232232); transition: .15s; }
.lg-int:hover { border-color: rgba(232,185,138,0.35); }
.lg-int-ico { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: rgba(232,185,138,0.1); color: var(--gold); }
.lg-int > div { flex: 1; min-width: 0; display: flex; flex-direction: column; } .lg-int b { font-size: 13px; font-weight: 500; } .lg-int span { font-size: 11px; color: var(--muted); }
.lg-int em { font-style: normal; font-size: 11px; color: var(--good); white-space: nowrap; }

/* Centers & carriers */
.lg-centers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.lg-center { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: rgba(0,0,0,0.12); font-size: 12px; color: var(--text-2); }
.lg-center.on { border-color: rgba(232,185,138,0.45); }
.lgc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; } .lgc-top b { font-size: 14px; color: var(--text); font-weight: 500; margin-right: auto; }
.lg-drivers { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lg-drivers li { display: flex; align-items: center; gap: 10px; } .lg-drivers li .muted { margin-left: auto; }

@media (max-width: 1200px) { .lg-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ls-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .lg-ship { grid-template-columns: 1fr; } .lg-list { position: static; max-height: none; } .lg-cards { max-height: 420px; } .lg-dgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lg-overview { grid-column: 1 / -1; } .lg-notesbox { grid-row: auto; } }
@media (max-width: 760px) { .lg-two, .lg-dgrid, .ls-grid, .ls-live, .ls-stats, .lg-fg { grid-template-columns: 1fr; } .lg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lg-detail { padding: 16px; } .lg-filters .field, .lg-otools .field { min-width: 0; flex: 1; } .lg-map { height: 260px; } .lg-bsearch { flex: 1 1 100%; } .lf-row { grid-template-columns: 78px 1fr 30px 38px; gap: 8px; } }
.ls-step .field-label { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.ls-step .field-label .field { width: 100%; }
.ls-stats b { font-size: 16px; }
.lg-orders td { white-space: nowrap; }

/* Sign-in: "already registered" and access file */
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.btn.auth-have { width: 100%; justify-content: center; padding: 12px 18px; font-weight: 600; border-color: rgba(232,185,138,0.5); color: var(--gold-light); background: rgba(232,185,138,0.06); }
.btn.auth-have:hover { background: rgba(232,185,138,0.12); }
.auth-access { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line-2); font-size: 12px; color: var(--text-2); }
.auth-access b { color: var(--text); }
.auth-access.compact { padding: 0; border: 0; margin-top: 14px; align-items: center; }
.auth-access.compact .auth-import { background: none; border: 0; box-shadow: none; color: var(--gold); padding: 4px; }
.auth-import { width: fit-content; cursor: pointer; }
.link-btn.auth-alt { display: block; margin: 14px auto 0; color: var(--muted); font-size: 12px; }
.link-btn.auth-alt:hover { color: var(--gold); }
.modal-wrap { z-index: 90; }

/* ==========================================================================
   Dashboard — sales overview
   ========================================================================== */
.sd-switch { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 22px; border-radius: 14px; background: var(--inset); border: 1px solid var(--line); }
.sd-switch button { border: 0; background: none; color: var(--muted); font: 500 12px var(--font); padding: 8px 16px; border-radius: 10px; cursor: pointer; }
.sd-switch button.on { background: var(--grad); color: var(--on-gold); }
.sd-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.sd-head h1 { margin: 0 0 6px; font-size: clamp(28px, 3.2vw, 40px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; }
.sd-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sd-range, .sd-select { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.03); color: var(--text); font: 500 12px var(--font); }
.sd-range svg { width: 15px; height: 15px; color: var(--gold); }
.sd-range input { background: none; border: 0; color: var(--text); font: 500 12px var(--font); width: 116px; outline: none; color-scheme: dark; }
.sd-range span { color: var(--muted); }
.sd-select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; outline: none; }
.sd-select option { background: var(--card-2); }
.sd-select.sm { height: 34px; font-size: 11.5px; }
.sd-new { height: 42px; border-radius: 99px; padding: 0 20px; }
.sd-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.sd-main, .sd-side { display: grid; gap: 20px; min-width: 0; }
.sd-card { position: relative; display: block; min-width: 0; padding: 22px; border-radius: 26px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--card), #22212f); box-shadow: var(--shadow); color: var(--text); }
.sd-ch { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sd-ch h2 { margin: 2px 0 0; font-size: 21px; font-weight: 500; letter-spacing: -0.01em; }
.sd-ch-r { display: flex; gap: 8px; align-items: center; }
.sd-eyebrow { font-size: 11.5px; color: var(--muted); }
.sd-round { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); color: var(--text-2); }
.sd-round:hover { color: var(--gold); border-color: rgba(232,185,138,0.5); }
.sd-round svg { width: 15px; height: 15px; }
.sd-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 600; }
.sd-chip.sd-up { color: #0f2a1c; background: var(--good); }
.sd-chip.sd-down { color: #fff; background: var(--bad); }
.sd-none { margin: 4px 0 0; }

/* Tracking our sales */
.sd-sales { background: radial-gradient(90% 70% at 12% 0%, rgba(232,185,138,0.16), transparent 60%), radial-gradient(70% 60% at 100% 100%, rgba(185,130,87,0.18), transparent 60%), linear-gradient(180deg, #2b2938, #1f1e2b); }
.sd-tabs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sd-tabs button, .sd-viewall { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.03); color: var(--text-2); font: 500 12px var(--font); cursor: pointer; }
.sd-tabs button.on { border-color: var(--gold); color: var(--gold-light); background: rgba(232,185,138,0.1); }
.sd-viewall svg { width: 14px; height: 14px; }
.sd-salesrow { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(220px, 1fr); gap: 16px; }
.sd-chart { position: relative; min-width: 0; padding: 18px 18px 12px; border-radius: 22px; border: 1px solid var(--line); background: rgba(0,0,0,0.16); }
.sd-total { position: absolute; left: 70px; top: 16px; z-index: 2; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; min-width: 150px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(35,34,50,0.85); backdrop-filter: blur(6px); }
.sd-total span { font-size: 11px; color: var(--muted); }
.sd-total b { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sd-total div { display: flex; gap: 6px; align-items: center; } .sd-total em { font-style: normal; font-size: 10px; color: var(--muted); }
.sd-total a { position: absolute; right: 10px; top: 10px; color: var(--muted); } .sd-total a svg { width: 14px; height: 14px; }
.sd-legend { display: flex; justify-content: flex-end; gap: 16px; font-size: 11px; color: var(--text-2); margin-bottom: 10px; min-height: 18px; }
.sd-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.sd-legend .l1 { background: rgba(255,255,255,0.25); } .sd-legend .l2 { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.sd-plot { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr); height: 300px; }
.sd-y { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 26px; font-size: 10.5px; color: var(--muted); }
.sd-bars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; align-items: end; padding-left: 4px; border-left: 1px solid var(--line); }
.sd-bar { display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.sd-track { position: relative; flex: 1; width: min(14px, 70%); border-radius: 99px; background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)); display: flex; align-items: flex-end; }
.sd-track i { display: block; width: 100%; border-radius: 99px; background: linear-gradient(180deg, var(--gold-light), var(--gold) 45%, var(--gold-deep)); box-shadow: 0 0 14px -2px rgba(232,185,138,0.55); min-height: 0; transition: height .4s ease; }
.sd-dot { position: absolute; left: 50%; width: 10px; height: 10px; margin: 0 0 -5px -5px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(232,185,138,0.25), 0 0 10px var(--gold); }
.sd-bar em { height: 24px; padding-top: 8px; font-style: normal; font-size: 10px; color: var(--muted); }
.sd-bar:hover .sd-track { background: linear-gradient(180deg, rgba(232,185,138,0.18), rgba(255,255,255,0.03)); }
.sd-empty { position: absolute; inset: 0 0 26px 56px; display: grid; place-items: center; font-size: 12px; color: var(--muted); pointer-events: none; }

/* Assistant */
.sd-ai { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 20px; border-radius: 22px; border: 1px solid rgba(232,185,138,0.28); background: radial-gradient(120% 90% at 100% 0%, rgba(232,185,138,0.28), transparent 60%), radial-gradient(90% 80% at 0% 100%, rgba(185,130,87,0.25), transparent 65%), linear-gradient(180deg, #33293a, #251f2c); }
.sd-hi { font-size: 12.5px; color: var(--text-2); }
.sd-ai h3 { margin: 0 0 8px; font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.sd-asks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.sd-asks button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.04); color: var(--text-2); font: 500 11.5px var(--font); cursor: pointer; transition: .15s; }
.sd-asks button svg { width: 14px; height: 14px; }
.sd-asks button:hover { background: var(--grad); color: var(--on-gold); border-color: transparent; }
.sd-askbox { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 5px 5px 5px 16px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(0,0,0,0.22); }
.sd-askbox input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font: 12.5px var(--font); }
.sd-askbox button { width: 36px; height: 36px; flex-shrink: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--on-gold); cursor: pointer; box-shadow: 0 8px 18px -8px rgba(232,185,138,0.8); }
.sd-askbox button svg { width: 16px; height: 16px; }
.sd-ai-top { display: flex; gap: 10px; align-items: center; }
.sd-ai-top > div { display: flex; flex-direction: column; } .sd-ai-top b { font-size: 15px; font-weight: 500; } .sd-ai-top span { font-size: 11px; color: var(--muted); }
.sd-back { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); background: none; color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.sd-back svg { width: 14px; height: 14px; }
.sd-ai-body { flex: 1; font-size: 12px; color: var(--text-2); overflow-y: auto; max-height: 220px; }
.sd-ai-body p { margin: 0; line-height: 1.55; }
.sd-ans { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sd-ans li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 10px; border-radius: 12px; background: rgba(0,0,0,0.18); }
.sd-ans span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sd-ans b { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.sd-ans em { grid-column: 1 / -1; font-style: normal; font-size: 10.5px; color: var(--muted); }
.sd-ai-act { align-self: flex-start; padding: 7px 14px; border-radius: 99px; border: 0; background: var(--grad); color: var(--on-gold); font: 600 11.5px var(--font); cursor: pointer; }

/* Row 2 */
.sd-row2 { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 20px; }
.sd-big { display: flex; flex-direction: column; align-items: flex-end; font-size: 44px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; margin: 4px 0 18px; font-variant-numeric: tabular-nums; }
.sd-big span { font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.sd-split { display: flex; gap: 6px; align-items: flex-end; }
.sd-seg { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sd-seg-l { font-size: 10.5px; color: var(--text-2); padding: 0 0 30px 6px; border-left: 1px solid var(--line-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-seg i { display: block; height: 14px; border-radius: 99px; }
.t-gold { background: var(--grad); box-shadow: 0 0 14px -4px rgba(232,185,138,0.7); } .t-good { background: var(--good); } .t-muted { background: rgba(255,255,255,0.12); }
.sd-split-legend { display: flex; justify-content: space-between; margin-top: 14px; font-size: 12px; color: var(--text-2); }
.sd-split-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.sd-timebody { display: grid; grid-template-columns: minmax(110px, 0.6fr) minmax(0, 1.4fr); gap: 16px; align-items: stretch; }
.sd-grow { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.sd-grow b { font-size: 42px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.sd-grow span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.sd-grow .btn { margin-top: auto; border-radius: 99px; }
.sd-heat { display: grid; grid-template-columns: 62px repeat(7, minmax(0, 1fr)); gap: 6px; align-items: center; }
.sd-hl { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.sd-heat i { aspect-ratio: 1; border-radius: 9px; background: rgba(255,255,255,0.05); }
.sd-heat i.lv1 { background: rgba(232,185,138,0.18); } .sd-heat i.lv2 { background: rgba(232,185,138,0.38); } .sd-heat i.lv3 { background: rgba(232,185,138,0.68); } .sd-heat i.lv4 { background: var(--grad); box-shadow: 0 0 14px -3px rgba(232,185,138,0.75); }
.sd-heat em { font-style: normal; text-align: center; font-size: 10.5px; color: var(--muted); }

/* Side */
.sd-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 14px; border-radius: 26px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent); }
.sd-kpi { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 20px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--card), #22212f); color: var(--text); transition: border-color .15s, transform .15s; min-width: 0; }
.sd-kpi:hover { border-color: rgba(232,185,138,0.4); transform: translateY(-2px); }
.sd-kh { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-2); }
.sd-kh svg { width: 15px; height: 15px; color: var(--muted); }
.sd-kv { display: flex; align-items: center; gap: 12px; }
.sd-kv i { width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.05); border: 1px solid var(--line-2); color: var(--gold-light); }
.sd-kv i svg { width: 17px; height: 17px; }
.sd-kv b { font-size: clamp(24px, 2.4vw, 32px); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.sd-kf { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .sd-kf em { font-style: normal; font-size: 10px; color: var(--muted); }
.sd-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sd-docs a { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; color: var(--text); transition: background .15s; }
.sd-docs a:hover { background: rgba(255,255,255,0.04); }
.sd-docs li:nth-child(2) a { background: rgba(255,255,255,0.035); }
.sd-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--on-gold); background: var(--grad); box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px rgba(232,185,138,0.45); }
.sd-docs div { display: flex; flex-direction: column; min-width: 0; } .sd-docs b { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sd-docs div span { font-size: 11px; color: var(--muted); }
.sd-docs strong { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sd-pill { padding: 5px 12px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.sd-pill.wait { background: var(--grad); color: var(--on-gold); } .sd-pill.good { background: var(--good); color: #0f2a1c; } .sd-pill.bad { background: var(--bad); color: #fff; } .sd-pill.ship { background: rgba(169,164,201,0.2); color: #cfcaf0; }
.sd-wh { display: grid; gap: 12px; }
.sd-wh:hover { border-color: rgba(232,185,138,0.35); }
.sd-whrow { display: grid; grid-template-columns: auto minmax(60px, 1fr) auto; gap: 14px; align-items: center; }
.sd-whrow b { font-size: 13px; font-weight: 500; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-whrow.sub { grid-template-columns: 1fr 1fr; font-size: 11.5px; color: var(--muted); }
.sd-whrow.sub span { display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .sd-whrow.sub span:last-child { justify-content: flex-end; }
.sd-whrow.sub svg { width: 13px; height: 13px; }
.sd-route { position: relative; height: 2px; background: linear-gradient(90deg, var(--gold) 0 50%, transparent 50%) 0 0 / 8px 2px repeat-x; }
.sd-route::after { content: ''; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left-color: var(--gold); border-right: 0; }
.sd-route::before { content: ''; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.sd-route i { position: absolute; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--on-gold); box-shadow: 0 0 0 4px rgba(232,185,138,0.18), 0 6px 14px -6px rgba(232,185,138,0.8); }
.sd-route i svg { width: 15px; height: 15px; }

@media (max-width: 1280px) { .sd-grid { grid-template-columns: 1fr; } .sd-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .sd-kpis { grid-row: span 2; } }
@media (max-width: 980px) { .sd-salesrow, .sd-row2, .sd-side { grid-template-columns: 1fr; } .sd-kpis { grid-row: auto; } }
@media (max-width: 560px) { .sd-timebody { grid-template-columns: 1fr; } .sd-plot { height: 240px; } .sd-total { position: static; margin-bottom: 10px; } .sd-kpis { grid-template-columns: 1fr 1fr; padding: 10px; gap: 10px; } .sd-head h1 { font-size: 28px; } .sd-range input { width: 104px; } }

/* ==========================================================================
   People — hire and onboard (reference layout, platform colors)
   ========================================================================== */
.pp-root .bad { color: var(--bad); }
.pp-loading { padding: 60px 0; text-align: center; color: var(--muted); }
.pp-head { margin: 4px 0 20px; }
.pp-head h1 { margin: 0 0 6px; font-size: 28px; font-weight: 600; letter-spacing: -0.01em; }
.pp-head p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.pp-banner { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 22px; border-radius: 20px; border: 1px solid rgba(232,185,138,0.3);
  background: radial-gradient(80% 140% at 0% 50%, rgba(232,185,138,0.18), transparent 60%), radial-gradient(60% 120% at 100% 0%, rgba(169,164,201,0.14), transparent 60%), linear-gradient(180deg, var(--card), #22212f); }
.pp-bico { width: 46px; height: 46px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; background: var(--grad); color: var(--on-gold); box-shadow: 0 12px 24px -12px rgba(232,185,138,0.8); }
.pp-banner > div { flex: 1; display: flex; flex-direction: column; gap: 3px; } .pp-banner b { font-size: 14px; font-weight: 500; } .pp-banner span { font-size: 12.5px; color: var(--text-2); }
.pp-tabsbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.pp-tabs { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: -1px; }
.pp-tabs button { display: inline-flex; align-items: center; gap: 7px; padding: 12px 12px 13px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-2); font: 500 13px var(--font); cursor: pointer; }
.pp-tabs button i { font-style: normal; font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,0.07); color: var(--text-2); }
.pp-tabs button.on { color: var(--gold-light); border-bottom-color: var(--gold); }
.pp-tabs button.on i { background: var(--grad); color: var(--on-gold); }
.pp-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; padding-bottom: 8px; }
.pp-tool { border: 0; background: none; color: var(--text-2); font: 500 13px var(--font); padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.pp-tool:hover, .pp-tool.on { color: var(--gold-light); background: rgba(232,185,138,0.08); }
.pp-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: none; color: var(--text-2); border-radius: 9px; cursor: pointer; }
.pp-icon:hover { color: var(--gold); background: rgba(232,185,138,0.08); }
.pp-icon svg { width: 17px; height: 17px; }
.pp-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--inset); color: var(--muted); }
.pp-search svg { width: 15px; height: 15px; } .pp-search input { background: none; border: 0; outline: none; color: var(--text); font: 12.5px var(--font); width: 170px; }
.btn.pp-add { border-radius: 11px; padding: 9px 16px; margin-left: 6px; }
.pp-table-card { border-radius: 20px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--card), #22212f); box-shadow: var(--shadow); }
.pp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pp-table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-2); padding: 16px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pp-table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pp-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.pp-table tbody tr:last-child td { border-bottom: 0; }
.pp-table input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--gold); }
.pp-chk { width: 44px; }
.th-sort span { display: inline-block; vertical-align: -3px; } .th-sort span svg { width: 14px; height: 14px; } .th-sort span.up { transform: rotate(180deg); }
.pp-name { display: flex; align-items: center; gap: 12px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; padding: 0; font: inherit; }
.pp-name > span:not(.pp-av) { display: flex; flex-direction: column; min-width: 0; } .pp-name b { font-size: 14px; font-weight: 500; white-space: nowrap; } .pp-name small { font-size: 11px; color: var(--muted); }
.pp-name:hover b { color: var(--gold-light); }
.pp-av { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; overflow: hidden; font-size: 12.5px; font-weight: 600; color: var(--on-gold); background: var(--grad); box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px rgba(232,185,138,0.4); }
.pp-av img { width: 100%; height: 100%; object-fit: cover; } .pp-av.md { width: 56px; height: 56px; font-size: 16px; } .pp-av.lg { width: 72px; height: 72px; font-size: 21px; }
.pp-id { display: inline-flex; align-items: center; gap: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; letter-spacing: .04em; color: var(--text); }
.pp-id .icon-btn { padding: 4px; } .pp-id .icon-btn svg { width: 15px; height: 15px; }
.pp-table td:nth-child(5) { min-width: 160px; }
.pp-prog { display: inline-block; vertical-align: middle; width: 96px; height: 7px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; }
.pp-prog span { display: block; height: 100%; border-radius: 99px; }
.pp-prog .bad { background: var(--bad); } .pp-prog .mid { background: var(--grad); } .pp-prog .good { background: var(--good); }
.pp-n { font-style: normal; font-size: 12.5px; margin-left: 12px; color: var(--text); }
.pp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.pp-pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pp-pill.st-newhire, .pp-pill.st-pending, .pp-pill.st-proposed, .pp-pill.st-submitted, .pp-pill.st-open { color: var(--gold-light); border-color: rgba(232,185,138,0.35); }
.pp-pill.st-enrollment, .pp-pill.st-inprogress, .pp-pill.st-ready, .pp-pill.st-invited { color: #cfcaf0; border-color: rgba(169,164,201,0.4); }
.pp-pill.st-active, .pp-pill.st-approved, .pp-pill.st-paid, .pp-pill.st-reimbursed, .pp-pill.st-done { color: var(--good); border-color: rgba(92,196,137,0.4); }
.pp-pill.st-cancelled, .pp-pill.st-declined, .pp-pill.st-rejected { color: var(--bad); border-color: rgba(236,106,85,0.4); }
.pp-country { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; } .pp-country i { font-style: normal; font-size: 18px; line-height: 1; }
.pp-date { white-space: nowrap; color: var(--text-2); }
.pp-act { width: 56px; text-align: right; }
.pp-dots { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 0; background: none; color: var(--text-2); cursor: pointer; }
.pp-dots svg { width: 18px; height: 18px; } .pp-dots:hover, .pp-dots.on { background: rgba(232,185,138,0.12); color: var(--gold); }
.cc-menu.pp-menu { min-width: 220px; padding: 8px; }
.pp-menu > button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; font-size: 13px; color: var(--text); }
.pp-menu > button svg { width: 17px; height: 17px; color: var(--text-2); } .pp-menu > button.danger svg { color: var(--bad); }
.pp-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--line); }
.pp-pager .btn svg { width: 15px; height: 15px; }
.pp-pages { display: flex; gap: 4px; align-items: center; } .pp-pages span { color: var(--muted); padding: 0 6px; }
.pp-pages button { min-width: 36px; height: 36px; border-radius: 10px; border: 0; background: none; color: var(--text-2); font: 500 13px var(--font); cursor: pointer; }
.pp-pages button.on { background: rgba(232,185,138,0.14); color: var(--gold-light); }
/* drawer bits */
.pp-ring { display: flex; align-items: center; gap: 12px; margin-top: 16px; } .pp-ringbar { flex: 1; height: 8px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; } .pp-ringbar span { display: block; height: 100%; border-radius: 99px; } .pp-ringbar .bad { background: var(--bad); } .pp-ringbar .mid { background: var(--grad); } .pp-ringbar .good { background: var(--good); } .pp-ring b { font-size: 12px; font-weight: 600; }
.pp-quick { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
.pp-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pp-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,0.12); }
.pp-steps li.done { border-color: rgba(92,196,137,0.35); }
.pp-stepbox { width: 28px; height: 28px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center; border: 1.5px solid rgba(232,185,138,0.5); background: none; color: var(--gold); font: 600 11px var(--font); cursor: pointer; }
.pp-steps li.done .pp-stepbox { background: var(--good); border-color: transparent; color: #0f2a1c; } .pp-stepbox svg { width: 15px; height: 15px; }
.pp-steps div { display: flex; flex-direction: column; } .pp-steps b { font-size: 12.5px; font-weight: 500; } .pp-steps span { font-size: 11px; color: var(--muted); }
.pp-pay { display: grid; grid-template-columns: 1fr 120px; gap: 8px; }
/* team */
.pp-dept { margin: 22px 0 12px; font-size: 14px; font-weight: 500; } .pp-dept i { font-style: normal; font-size: 11px; color: var(--muted); margin-left: 6px; }
.pp-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 14px; }
.pp-member { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 16px 16px; border-radius: 20px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--card), #22212f); color: var(--text); text-align: center; cursor: pointer; transition: .15s; font: inherit; }
.pp-member:hover { border-color: rgba(232,185,138,0.4); transform: translateY(-2px); }
.pp-member b { font-size: 14px; font-weight: 500; margin-top: 6px; } .pp-member > span { font-size: 12px; color: var(--muted); }
.pp-mfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11.5px; } .pp-mfoot em { font-style: normal; color: var(--gold); }
/* misc */
.pp-inline { flex-direction: row !important; align-items: center; gap: 8px; } .pp-inline .field { width: 80px; }
.pp-week { font-size: 13px; font-weight: 500; }
.pp-out { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; } .pp-out li { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 12px; background: rgba(0,0,0,0.14); } .pp-out span { font-size: 11px; color: var(--muted); }
.pp-calc { background: radial-gradient(90% 80% at 100% 0%, rgba(232,185,138,0.18), transparent 60%), linear-gradient(180deg, var(--card), #22212f); }
.pp-calc-big { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; } .pp-calc-big b { font-size: 40px; font-weight: 600; letter-spacing: -0.02em; } .pp-calc-big span { color: var(--gold); font-size: 13px; }
.pp-calc-rows { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.pp-calc-rows li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 12px; background: rgba(0,0,0,0.16); font-size: 13px; }
.pp-calc-rows small { margin-left: 8px; color: var(--muted); font-size: 11px; } .pp-calc-rows b { font-variant-numeric: tabular-nums; }
.pp-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.pp-book p { font-size: 12.5px; color: var(--text-2); line-height: 1.55; min-height: 58px; }
.pp-bh { display: flex; gap: 12px; align-items: center; } .pp-bh .pp-bico { width: 40px; height: 40px; border-radius: 12px; } .pp-bh .pp-bico svg { width: 18px; height: 18px; }
.pp-bh div { display: flex; flex-direction: column; } .pp-bh b { font-size: 14px; font-weight: 500; } .pp-bh span { font-size: 11px; color: var(--muted); }
.pp-ack { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; } .pp-ack .pp-prog { flex: 1; } .pp-ack em { font-style: normal; font-size: 11px; color: var(--muted); }
.pp-doc { font-size: 13px; line-height: 1.7; color: var(--text-2); white-space: normal; }
.pp-acklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; } .pp-acklist li { display: flex; justify-content: space-between; align-items: center; }
@media (max-width: 900px) { .pp-tools { margin-left: 0; width: 100%; } .pp-search input { width: 120px; } .pp-pager { flex-wrap: wrap; justify-content: center; } }
.rail-btn.rail-logout { cursor: pointer; font: inherit; }
.rail-btn.rail-logout:hover { color: var(--bad); border-color: rgba(236,106,85,0.45); background: rgba(236,106,85,0.08); }

/* ---------- Accounting · Bank statements ---------- */
.bank-drop { min-height: 170px; margin-bottom: 20px; }
.table tr.sel-row td { background: rgba(232,185,138,0.06); }
.stmt-meta { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stmt-meta .field-label b { font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.stmt-meta .field-label b.small { font-size: 12px; font-weight: 500; color: var(--text-2); }
.cat-bars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; padding: 14px 16px; border-radius: 14px; background: var(--inset); border: 1px solid var(--line); }
.cb-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 12px; }
.cb-row span { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-row b { font-variant-numeric: tabular-nums; font-weight: 600; }
.cb-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.06); overflow: hidden; }
.cb-bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.cb-row.uncat span, .cb-row.uncat b { color: var(--bad); }
.cb-row.uncat .cb-bar i { background: var(--bad); }
.bank-table td { vertical-align: top; }
.bank-table .desc-cell { max-width: 380px; overflow-wrap: anywhere; }
.bank-table .cat-sel { min-width: 210px; }
.bank-table .cat-sel.uncat { border-color: rgba(236,106,85,0.5); color: #f6a898; }
.bank-table tr.dup-row td, .bank-table tr.off-row td { opacity: .55; }
.bank-table input[type="checkbox"] { accent-color: var(--gold); width: 15px; height: 15px; margin-top: 8px; }
@media (max-width: 1000px) { .stmt-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cat-bars { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) { .stmt-meta { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Marketing & Social Media ---------- */
.mk-icons svg, .mk-chip-p svg, .mk-plat svg, .mk-int h3 svg, .mk-checks h4 svg, .mini-row svg, .mk-accts svg { width: 14px; height: 14px; vertical-align: -2px; }
.mk-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.mk-legend .chip { cursor: pointer; font: inherit; font-size: 11px; }
.mk-legend .chip.on { border-color: var(--gold); color: var(--text); background: rgba(232,185,138,0.1); }
.mk-legend .chip b { color: var(--text); margin-left: 2px; }
.st-draft { --c: #8a8699; } .st-in_review { --c: #f0b35a; } .st-scheduled { --c: #e7b688; } .st-publishing { --c: #9fa6c9; }
.st-published { --c: var(--good); } .st-error { --c: var(--bad); } .st-archived { --c: #55526a; } .st-all { --c: var(--text-2); }
.mk-cal-label { min-width: 170px; text-align: center; }
.mk-cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.mk-cal-head span { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 0 8px; }
.mk-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mk-day { position: relative; min-height: 112px; padding: 8px 6px 26px; border-radius: 12px; background: var(--inset); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: border-color .15s, background .15s; }
.mk-cal.week .mk-day { min-height: 320px; }
.mk-day.other { opacity: .45; }
.mk-day.today { border-color: rgba(232,185,138,0.6); }
.mk-day.today .mk-day-n { background: var(--grad); color: var(--on-gold); }
.mk-day.over { border-color: var(--gold); background: rgba(232,185,138,0.08); }
.mk-day-n { font-size: 11px; font-weight: 600; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: var(--text-2); }
.mk-add { position: absolute; right: 6px; bottom: 6px; width: 20px; height: 20px; border-radius: 6px; border: 1px dashed var(--line-2); background: transparent; color: var(--muted); font-size: 12px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; }
.mk-day:hover .mk-add, .mk-add:focus-visible { opacity: 1; }
.mk-chip { --c: var(--muted); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 5px 7px; border-radius: 8px; background: var(--card-2); border: 1px solid var(--line); border-left: 3px solid var(--c); font-size: 11px; cursor: pointer; min-width: 0; }
.mk-chip[draggable="true"] { cursor: grab; }
.mk-chip.dragging { opacity: .4; }
.mk-chip:hover { border-color: rgba(232,185,138,0.45); border-left-color: var(--c); }
.mk-chip-t { color: var(--muted); font-variant-numeric: tabular-nums; }
.mk-chip-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-chip-p { display: inline-flex; gap: 2px; color: var(--muted); }
.mk-undated { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.mk-undated-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 6px; }
.mk-best { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mk-heat { border-collapse: separate; border-spacing: 3px; font-size: 10px; color: var(--muted); }
.mk-heat th { font-weight: 500; padding: 0 4px; text-align: left; white-space: nowrap; }
.mk-heat td { width: 22px; height: 20px; border-radius: 4px; background: rgba(232,185,138, calc(0.06 + var(--a) * 0.85)); }

.mk-studio { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.mk-side { display: flex; flex-direction: column; gap: 0; position: sticky; top: 16px; }
.mk-side .card { margin-bottom: 16px; }
.mk-plats { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-plat { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--inset); color: var(--text-2); cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 12px; }
.mk-plat input { display: none; }
.mk-plat.on { border-color: var(--gold); color: var(--text); background: rgba(232,185,138,0.1); }
.mk-accts { display: flex; flex-wrap: wrap; gap: 6px 16px; text-transform: none; }
.mk-toolbar { display: flex; align-items: center; gap: 4px; margin: 14px 0 6px; flex-wrap: wrap; }
.mk-body { min-height: 190px; font-size: 13px; line-height: 1.6; resize: vertical; }
.mk-meter { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.mk-read { font-weight: 600; }
.mk-read.good { color: var(--good); } .mk-read.warn { color: #f0b35a; } .mk-read.bad { color: var(--bad); }
.mk-media { display: flex; flex-wrap: wrap; gap: 8px; text-transform: none; letter-spacing: 0; }
.mk-thumb { position: relative; width: 86px; height: 86px; border-radius: 12px; overflow: hidden; background: var(--inset); border: 1px solid var(--line-2); display: grid; place-items: center; }
.mk-thumb-img, .mk-thumb-img img, .mk-thumb-img video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mk-thumb .icon-btn { position: absolute; bottom: 4px; padding: 2px 6px; background: rgba(23,22,31,0.8); }
.mk-thumb [data-mleft] { left: 4px; } .mk-thumb [data-mdel] { right: 4px; }
.mk-thumb.add { cursor: pointer; border-style: dashed; color: var(--gold); font-size: 20px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.mk-thumb.add span { font-size: 10px; color: var(--muted); }
.mk-pv-tabs { flex-wrap: wrap; margin-bottom: 14px; }
.mk-pv-wrap { display: grid; place-items: center; }
.mk-checks { margin-bottom: 12px; }
.mk-checks h4 { margin: 0 0 6px; font-size: 12px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.mk-check { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--text-2); padding: 3px 0; }
.mk-check i { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--good); }
.mk-check.warn i { background: #f0b35a; } .mk-check.bad i { background: var(--bad); } .mk-check.bad { color: #f6a898; }
.mk-ai-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mk-ai-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mk-ai-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 9px 11px; border-radius: 10px; background: var(--inset); border: 1px solid var(--line); font-size: 12px; }
.mk-ai-list small { grid-column: 1; color: var(--muted); font-size: 10px; }
.mk-ai-list .icon-btn { grid-row: 1 / span 2; grid-column: 2; }

/* Live previews — light “app” frames */
.pv { width: 100%; max-width: 340px; background: #fff; color: #111; border-radius: 16px; overflow: hidden; font: 13px/1.4 -apple-system, 'Segoe UI', Roboto, sans-serif; box-shadow: 0 24px 50px -24px rgba(0,0,0,0.8); position: relative; }
.pv img, .pv video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; }
.pv-head .muted { color: #6b6b70; }
.pv-av { width: 32px; height: 32px; border-radius: 50%; object-fit: contain; background: #1c1b26; color: #f3d3b0; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.pv-dots { margin-left: auto; color: #555; }
.pv-media { background: #eee; position: relative; }
.pv-media.sq { aspect-ratio: 1 / 1; }
.pv-media.wide { aspect-ratio: 1.91 / 1; }
.pv-ph { position: absolute; inset: 0; display: grid; place-items: center; color: #888; font-size: 12px; background: repeating-linear-gradient(45deg, #f1f1f3 0 10px, #e8e8eb 10px 20px); }
.pv-actions { display: flex; gap: 14px; padding: 9px 12px 4px; font-size: 14px; color: #222; }
.pv-actions span { margin-left: auto; }
.pv-body { padding: 4px 12px 12px; white-space: normal; word-wrap: break-word; }
.pv-more { color: #8a8a90; }
.pv-tag { color: #0b5cad; }
.pv-dots-row { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; }
.pv-dots-row i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.6); }
.pv-dots-row i.on { background: #fff; }
.pv-phone { aspect-ratio: 9 / 16; max-width: 260px; background: #111; color: #fff; }
.pv-phone > img, .pv-phone > video, .pv-phone > .pv-ph { position: absolute; inset: 0; }
.pv-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: 14px 12px; background: linear-gradient(rgba(0,0,0,0.5), transparent); }
.pv-ig-story .pv-av { outline: 2px solid #e1306c; outline-offset: 1px; }
.pv-top span { color: rgba(255,255,255,0.7); font-size: 12px; }
.pv-cap { position: absolute; left: 12px; right: 52px; bottom: 16px; font-size: 12px; text-shadow: 0 1px 3px rgba(0,0,0,0.7); }
.pv-cap .pv-tag { color: #fff; font-weight: 600; }
.pv-side { position: absolute; right: 10px; bottom: 30px; text-align: center; line-height: 2.2; font-size: 18px; }
.pv-reply { position: absolute; left: 12px; right: 12px; bottom: 14px; border: 1px solid rgba(255,255,255,0.6); border-radius: 99px; padding: 8px 14px; font-size: 12px; color: rgba(255,255,255,0.85); }
.pv-x .pv-body { font-size: 14px; padding-top: 0; }
.pv-x .pv-over { background: rgba(244,33,46,0.15); color: #b3121f; }
.pv-x .pv-media { margin: 0 12px; border-radius: 14px; overflow: hidden; }
.pv-x .pv-actions { justify-content: space-between; color: #536471; font-size: 13px; }
.pv-linkedin .pv-actions, .pv-facebook .pv-actions { border-top: 1px solid #e6e6e6; justify-content: space-around; font-size: 12px; color: #555; padding: 9px 8px; }
.pv-link { margin: 0 12px 12px; padding: 10px; border: 1px solid #e6e6e6; border-radius: 8px; font-size: 12px; }

/* Research */
.mk-own td { background: rgba(232,185,138,0.05); }
.mk-sent { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,0.06); min-width: 120px; }
.mk-sent i { display: block; height: 100%; }
.mk-sent .p { background: var(--good); } .mk-sent .u { background: #8a8699; } .mk-sent .n { background: var(--bad); }
.mk-mention { max-width: 440px; overflow-wrap: anywhere; font-size: 12px; }
.mk-sent-sel.positive { color: var(--good); } .mk-sent-sel.negative { color: #f6a898; }
.mk-persona .mk-pfield { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; font-size: 12px; }
.mk-persona .mk-pfield b { width: 100%; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; }
.mk-int code { font-size: 11px; color: var(--gold-light); overflow-wrap: anywhere; }
.mk-setup { margin: 8px 0 12px; padding-left: 18px; font-size: 12px; color: var(--text-2); line-height: 1.8; }
.mk-print-head { display: none; }

@media (max-width: 1100px) { .mk-studio { grid-template-columns: minmax(0, 1fr); } .mk-side { position: static; } }
@media (max-width: 820px) {
  .mk-cal-grid, .mk-cal-head { grid-template-columns: repeat(7, minmax(44px, 1fr)); }
  .mk-cal { overflow-x: auto; }
  .mk-cal-grid { min-width: 560px; } .mk-cal-head { min-width: 560px; }
  .mk-day { min-height: 84px; }
}
/* PDF report: the browser's “Save as PDF” prints only the report */
@media print {
  body.mk-printing .rail, body.mk-printing .topbar, body.mk-printing .mk-no-print, body.mk-printing .toast, body.mk-printing::before, body.mk-printing::after { display: none !important; }
  body.mk-printing, body.mk-printing .shell, body.mk-printing .frame { background: #fff !important; color: #111 !important; padding: 0 !important; display: block !important; box-shadow: none !important; border: 0 !important; }
  body.mk-printing .card, body.mk-printing .kpi { background: #fff !important; border: 1px solid #ddd !important; box-shadow: none !important; color: #111 !important; break-inside: avoid; }
  body.mk-printing .kpi.hl { background: #f6ead9 !important; }
  body.mk-printing .muted, body.mk-printing .kpi-foot, body.mk-printing .label { color: #555 !important; }
  body.mk-printing .mk-print-head { display: block; font-size: 16px; margin-bottom: 12px; color: #111; }
  body.mk-printing .view { padding: 0 !important; }
}
.pv img.pv-av { width: 32px; height: 32px; object-fit: contain; padding: 3px; }

/* Lead capture forms: public link + embed code per Live form */
.form-links { display: grid; gap: 12px; margin-top: 16px; }
.form-link { display: grid; gap: 8px; padding: 14px; border-radius: var(--radius-sm); background: var(--inset); border: 1px solid var(--line); }
.form-link .field { width: 100%; font-size: 12px; color: var(--text-2); }
.form-link-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.form-links-empty { margin: 14px 0 0; }
