/* Cargo Link Auto — "Ocean Light" interface.
   Font: Plus Jakarta Sans (SIL Open Font License), served from /fonts so it works offline and in
   mainland China; Chinese text uses the system's Chinese font. */
@font-face { font-family: 'Plus Jakarta Sans'; src: url(/fonts/PlusJakartaSans-var.woff2) format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; }
:root {
  --bg: #F3F6FB;
  --panel: #FFFFFF;
  --panel-2: #F7F9FC;
  --ink: #0F1B2D;
  --ink-2: #4A5A72;
  --ink-3: #5F6E85;
  --line: #E4E9F2;
  --line-2: #EDF1F7;
  --accent: #2563EB;
  --accent-strong: #1D4ED8;
  --accent-ink: #FFFFFF;
  --accent-soft: #EAF1FF;
  --side: #FFFFFF;
  --side-ink: #4A5A72;
  --side-active: #2563EB;
  --good: #047857; --good-soft: #E3F7EE;
  --warn: #B45309; --warn-soft: #FFF4DE;
  --bad: #B91C1C;  --bad-soft: #FDECEC;
  --teal: #0B7F72; --teal-soft: #E3F6F3;
  --violet: #5B3BC9; --violet-soft: #F0EBFF;
  --lock: #5F6E85; --lock-soft: #EEF2F7;
  --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 8px 24px rgba(15, 27, 45, .06);
  --shadow-lg: 0 16px 48px rgba(15, 27, 45, .18);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Plus Jakarta Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Consolas, 'Liberation Mono', monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-strong); }
.boot { padding: 40px; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }
svg.ic { width: 18px; height: 18px; flex: none; }

/* ---------- buttons & inputs */
.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: var(--radius-sm); padding: 8px 14px; cursor: pointer; line-height: 1.2; white-space: nowrap; font-weight: 600; font-size: 13.5px; box-shadow: 0 1px 2px rgba(15, 27, 45, .04); transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { border-color: #C9D3E3; background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px rgba(37, 99, 235, .25); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger { color: var(--bad); border-color: #F3C4C4; }
.btn.danger.armed { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--lock-soft); }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.btn:focus-visible, .nav a:focus-visible, tr:focus-visible, a:focus-visible { outline: 3px solid rgba(37, 99, 235, .35); outline-offset: 2px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius-sm); padding: 8px 12px; min-height: 40px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
textarea { min-height: 76px; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: var(--panel-2); color: var(--ink-2); border-style: dashed; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--accent); }
label.field { display: grid; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
label.field .req { color: var(--bad); }
.computed-val { min-height: 40px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, 1fr); background: var(--bg); }
.login-hero { position: relative; overflow: hidden; background: #1E3A8A; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.login-hero .hero-logo { width: 220px; filter: brightness(0) invert(1); }
.login-hero h2 { margin: 0; font-size: 34px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; max-width: 520px; }
.login-hero p { margin: 10px 0 0; color: #C7D7FE; font-size: 15px; max-width: 480px; }
.login-hero ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.login-hero li { display: flex; align-items: center; gap: 12px; font-weight: 600; color: #E6EDFF; }
.login-hero li span.i { width: 36px; height: 36px; border-radius: 11px; background: rgba(255, 255, 255, .12); display: flex; align-items: center; justify-content: center; }
.login-hero .watermark { position: absolute; right: -80px; bottom: -40px; width: 560px; opacity: .07; filter: brightness(0) invert(1); pointer-events: none; }
.login-side { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: min(410px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 32px; display: grid; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 34px; height: 34px; }
.brand b { font-size: 17px; letter-spacing: .2px; }
.brand small { display: block; color: var(--ink-3); font-size: 12px; }
.login-card h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.login-card .sub { margin: -8px 0 0; color: var(--ink-3); font-size: 13.5px; }
.err { color: var(--bad); background: var(--bad-soft); padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; }
.ok { color: var(--good); background: var(--good-soft); padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; }
.lang-switch { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.lang-switch button { border: 0; background: transparent; padding: 4px 11px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.lang-switch button.on { background: var(--accent); color: var(--accent-ink); }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100%; }
.side { background: var(--side); color: var(--side-ink); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 14px 14px; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 4px 8px 12px; }
.nav { display: grid; gap: 2px; }
.nav h6 { margin: 16px 12px 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 0 12px; border-radius: 12px; color: var(--side-ink); text-decoration: none; font-size: 13.5px; font-weight: 600; transition: background .15s, color .15s; }
.nav a > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.on { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .28); }
.nav a .tag { font-size: 10.5px; font-weight: 600; color: var(--ink-3); }
.nav a.on .tag { color: #DCE7FF; }
.side-foot { margin-top: auto; padding-top: 12px; display: grid; gap: 8px; }
.user-card { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: #EEF3FF; }
.user-row { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 18px; background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.user-row .who-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-row .who-text b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .who-text span { font-size: 12px; color: var(--ink-2); }
.user-card .lang-switch { display: flex; }
.user-card .lang-switch button { flex: 1; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 14px; padding: 18px 32px 12px; background: rgba(243, 246, 251, .88); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); position: sticky; top: 0; z-index: 5; }
.top .title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.top h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .sub { font-size: 13px; color: var(--ink-3); }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--accent-soft); color: var(--accent-strong); white-space: nowrap; }
.badge.admin { background: var(--ink); color: #fff; }
.menu-btn { display: none; }
.content { padding: 8px 32px 48px; display: grid; gap: 20px; align-content: start; }
.gsearch { position: relative; width: 320px; }
.gsearch .box { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--ink-3); box-shadow: 0 1px 2px rgba(15, 27, 45, .04); }
.gsearch .box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.gsearch input { border: 0; box-shadow: none !important; padding: 0; min-height: 0; background: transparent; color: var(--ink); }
.gsearch .results { position: absolute; top: 48px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; gap: 2px; max-height: 70vh; overflow-y: auto; z-index: 15; }
.gsearch .res { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.gsearch .res:hover, .gsearch .res.on { background: var(--accent-soft); }
.gsearch .res .ico { grid-row: span 2; width: 32px; height: 32px; border-radius: 9px; background: var(--bg); color: var(--accent-strong); display: flex; align-items: center; justify-content: center; }
.gsearch .res b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsearch .res small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsearch .none { padding: 12px; color: var(--ink-3); font-size: 13px; }

/* ---------- dashboard */
.hero-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.kpi-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); min-width: 0; }
.kpi-tile .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.kpi-tile .sq { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.sq.blue { background: var(--accent-soft); color: var(--accent-strong); } .sq.teal { background: var(--teal-soft); color: var(--teal); }
.sq.violet { background: var(--violet-soft); color: var(--violet); } .sq.amber { background: var(--warn-soft); color: var(--warn); }
.sq.red { background: var(--bad-soft); color: var(--bad); } .sq.green { background: var(--good-soft); color: var(--good); }
.kpi-tile .big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; overflow-wrap: anywhere; }
.kpi-tile .delta { font-size: 12.5px; color: var(--ink-3); }
.delta b.up { color: var(--good); } .delta b.down { color: var(--bad); }
.dash-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.dash-row .span2 { grid-column: span 2; }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head h4 { flex: 1; }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600; padding: 7px 10px; border-radius: 10px; box-shadow: var(--shadow-lg); transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; z-index: 3; }
.chart-tip small { display: block; color: #C7D7FE; font-weight: 500; }
.segc { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 2px; }
.segc button { border: 0; background: transparent; height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.segc button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 27, 45, .08); }
.att-row { display: flex; gap: 12px; align-items: center; padding: 6px 4px; border-radius: 12px; text-decoration: none; color: var(--ink); cursor: pointer; }
.att-row:hover { background: var(--panel-2); }
.att-row .txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.att-row .txt b { font-size: 13.5px; }
.att-row .txt span { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-row .val { font-size: 13.5px; font-weight: 800; white-space: nowrap; }
.hbars { display: grid; grid-template-columns: minmax(80px, auto) minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; font-size: 13px; }
.hbars .lab { color: var(--ink-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbars .track { height: 14px; border-radius: 4px; position: relative; }
.hbars .fill { height: 14px; border-radius: 0 4px 4px 0; background: var(--accent); min-width: 3px; }
.hbars .v { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.person-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--panel-2); cursor: pointer; text-decoration: none; color: var(--ink); }
.person-row:hover { background: var(--accent-soft); }
.person-row .txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.person-row .txt b { font-size: 13.5px; }
.person-row .txt span { font-size: 12px; color: var(--ink-2); }
.pill { font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 10px; white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.gray { background: var(--lock-soft); color: var(--ink-2); } .pill.blue { background: var(--accent-soft); color: var(--accent-strong); }
.chat-row { display: flex; gap: 10px; align-items: center; padding: 6px 4px; border-radius: 12px; cursor: pointer; color: var(--ink); text-decoration: none; }
.chat-row:hover { background: var(--panel-2); }
.chat-row .av { width: 38px; height: 38px; border-radius: 19px; background: var(--good-soft); color: var(--good); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.chat-row .txt { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.chat-row .txt b { font-size: 13.5px; }
.chat-row .txt span { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more-head { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.more-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.kpi-section h3 { margin: 0 0 10px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 13px 16px; display: grid; gap: 3px; }
.kpi .label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.kpi .value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi.good .value { color: var(--good); } .kpi.warn .value { color: var(--warn); } .kpi.bad .value { color: var(--bad); }
.kpi.neg .value { color: var(--bad); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; display: grid; gap: 12px; align-content: start; box-shadow: var(--shadow); min-width: 0; }
.card h4 { margin: 0; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card h4 .count { margin-left: auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; }
.dot.bad { background: var(--bad); }
.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini td { padding: 7px 0; border-top: 1px solid var(--line-2); }
.mini td + td { padding-left: 12px; }
.mini td { white-space: nowrap; }
.mini-wrap { overflow-x: auto; }
@media (min-width: 1100px) { .card.alerts { grid-column: span 2; } }
.mini tr { cursor: pointer; } .mini tr:hover td { color: var(--accent-strong); }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr 36px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar .track { height: 12px; background: transparent; border-radius: 4px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.bar .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.empty { color: var(--ink-3); padding: 32px; text-align: center; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- module table */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .search { flex: 1 1 220px; max-width: 380px; }
.toolbar select, .toolbar input[type=date] { width: auto; }
.toolbar .spacer { flex: 1; }
.access-note { font-size: 12.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--lock-soft); color: var(--ink-2); white-space: nowrap; text-decoration: none; }
.chip.edit { background: var(--accent-soft); color: var(--accent-strong); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { text-align: left; font-weight: 700; font-size: 12px; color: var(--ink-2); background: var(--panel-2); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; cursor: pointer; user-select: none; }
table.grid th:hover { color: var(--ink); }
table.grid th.num { text-align: right; }
table.grid th .arrow { color: var(--accent); }
table.grid td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
table.grid tbody tr { cursor: pointer; transition: background .1s; }
table.grid tbody tr:hover td { background: #F7FAFF; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tfoot td { font-weight: 800; background: var(--panel-2); border-top: 1px solid var(--line); border-bottom: 0; }
td.idcell { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.neg { color: var(--bad); }

/* ---------- drawer */
.scrim { position: fixed; inset: 0; background: rgba(15, 27, 45, .32); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(780px, 100%); background: var(--bg); z-index: 21; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); border-radius: 20px 0 0 20px; overflow: hidden; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 22px; background: var(--panel); border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 26px; display: grid; gap: 16px; align-content: start; }
.drawer-foot { display: flex; gap: 8px; align-items: center; padding: 14px 22px; background: var(--panel); border-top: 1px solid var(--line); flex-wrap: wrap; }
.drawer-foot .spacer { flex: 1; }
fieldset.group { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; }
fieldset.group legend { padding: 0 8px; font-weight: 800; font-size: 13.5px; display: flex; gap: 8px; align-items: center; }
fieldset.group .wide { grid-column: 1 / -1; }
.meta { font-size: 12px; color: var(--ink-3); }

/* ---------- admin */
.admin-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.form-card { display: grid; gap: 12px; }
.perm-module { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
.perm-module h4 { margin: 0; padding: 12px 16px; font-size: 14px; font-weight: 800; border-bottom: 1px solid var(--line-2); }
table.perm { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
table.perm th, table.perm td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); text-align: left; }
table.perm th { font-size: 12px; color: var(--ink-2); font-weight: 700; background: var(--panel-2); }
table.perm td.gname { width: 30%; }
table.perm td.gname small { display: block; color: var(--ink-3); font-size: 11.5px; white-space: normal; }
table.perm select { min-height: 32px; padding: 3px 8px; font-size: 12.5px; }
select.p-none { color: var(--ink-3); }
select.p-view { color: var(--warn); font-weight: 700; }
select.p-edit { color: var(--accent-strong); font-weight: 700; }
.sticky-save { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line); flex-wrap: wrap; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 40; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); }
.toast.bad { background: var(--bad); color: #fff; }


/* ---------- CRM, team, reports */
.nav-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; text-align: center; opacity: 1; }
.nav a .tag:has(.nav-badge) { opacity: 1; }
.users-picker { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px; background: var(--panel); }
.users-picker.disabled { background: var(--panel-2); border-style: dashed; }
.users-picker select { width: auto; min-height: 28px; padding: 2px 6px; border: 0; background: transparent; color: var(--accent-strong); box-shadow: none; }
.chip-x { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; }
.extras { display: grid; gap: 10px; }
.rsvp { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.advice-text { white-space: pre-wrap; font-weight: 500; line-height: 1.5; font-size: 12.5px; }
.myday { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.card.attention { border-color: #F5D9A8; background: var(--warn-soft); }
ul.advice { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
ul.advice li { padding: 8px 12px 8px 14px; border-left: 3px solid var(--line); background: var(--panel-2); border-radius: 0 10px 10px 0; font-size: 13px; }
ul.advice li.bad { border-color: var(--bad); } ul.advice li.warn { border-color: var(--warn); } ul.advice li.good { border-color: var(--good); }
.meter { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.meter .fill { height: 100%; background: var(--accent); } .meter .fill.good { background: var(--good); } .meter .fill.warn { background: var(--warn); } .meter .fill.bad { background: var(--bad); }
details.ad-row { border-top: 1px solid var(--line-2); padding: 6px 0; }
details.ad-row summary { cursor: pointer; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
details.ad-row .advice-text { margin: 6px 0; }
.report { border-top: 1px solid var(--line-2); padding-top: 8px; display: grid; gap: 6px; }
.report-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.report-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.pre { white-space: pre-wrap; font-size: 13px; }
@media print { .side, .top, .toolbar, .btn { display: none !important; } .shell { display: block; } .content { padding: 0; } }
/* ---------- content assistant & video studio */
.modal.wide-modal { width: min(980px, calc(100% - 24px)); }
.assistant { display: grid; gap: 12px; }
.ca-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 14px; }
.ca-form .wide { grid-column: 1 / -1; } .ca-form .wide2 { grid-column: span 2; }
.checks { display: flex; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
label.check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink); }
label.check input { width: auto; min-height: 0; }
.ca-result { display: grid; gap: 10px; }
.ca-block { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--panel); display: grid; gap: 6px; }
.ca-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ca-block .pre[dir], .pre:lang(ar) { direction: rtl; }
.studio { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 16px; align-items: start; }
.studio-left { display: grid; gap: 10px; position: sticky; top: 70px; }
.studio-stage { background: #0F1B2D; border-radius: 16px; padding: 10px; display: grid; place-items: center; }
.studio-canvas { max-width: 100%; max-height: 62vh; border-radius: 6px; background: #111; }
.studio-left input[type=range] { width: 100%; }
.studio-panel { display: grid; gap: 12px; }
.clip-list { display: grid; gap: 8px; }
.clip { display: grid; grid-template-columns: 72px 1fr auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: var(--panel); }
.clip img, .clip video { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; background: #000; }
.clip-body { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-width: 0; }
.clip-body b { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.clip-body label, .seg label { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; }
.clip-body input[type=number], .cap input[type=number], .seg input[type=number] { width: 76px; }
.clip-actions { display: grid; gap: 4px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cap-list { display: grid; gap: 6px; }
.cap { display: grid; grid-template-columns: 76px 76px 1fr auto; gap: 6px; }
.seg input[type=color] { width: 48px; padding: 2px; }
.studio-out { width: 100%; max-height: 50vh; background: #000; border-radius: 8px; }
.studio-result { display: grid; gap: 8px; }
ol.tips { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13px; }
@media (max-width: 900px) { .studio { grid-template-columns: 1fr; } .studio-left { position: static; } .ca-form .wide2 { grid-column: 1 / -1; } }
/* ---------- logo */
.brand-wrap { display: grid; gap: 4px; padding: 0 6px 8px; }
.brand-logo-box { background: #fff; border-radius: 12px; padding: 4px 6px; display: grid; place-items: center start; }
.brand-logo { max-width: 100%; max-height: 60px; display: block; }
.brand-tag { color: var(--ink-3); font-size: 11.5px; font-weight: 600; padding-left: 8px; }
.login-card .brand-wrap { max-width: 230px; }
.login-card .brand-logo-box { padding: 0; }
.login-card .brand-tag { color: var(--ink-3); }
.brand-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.brand-prev { max-width: 100%; max-height: 110px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
/* ---------- added: currencies, period bar, vehicle lines, files, import, reports */
.cur { color: var(--ink-3); font-size: 11px; font-weight: 500; }
.period-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.period-bar b { color: var(--ink-2); font-size: 12.5px; }
.period-bar select, .period-bar input { width: auto; min-height: 38px; padding: 4px 12px; font-weight: 600; }
.period-custom { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.period-custom label { display: inline-flex; gap: 6px; align-items: center; }
.note { font-size: 12.5px; color: var(--ink-2); background: var(--accent-soft); border-radius: var(--radius-sm); padding: 8px 12px; }
.drawer.wide-drawer { width: min(1040px, 100%); }
.doc-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.small { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.danger-text { color: var(--bad); }
.lines-wrap { display: grid; gap: 8px; }
.lines-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.lines-sum { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lines { display: grid; gap: 8px; }
details.line { border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
details.line > summary { list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; }
details.line > summary::-webkit-details-marker { display: none; }
details.line > summary::before { content: '▸'; color: var(--ink-3); }
details.line[open] > summary::before { content: '▾'; }
.line-title { font-weight: 800; }
.line-totals { font-size: 12px; font-variant-numeric: tabular-nums; }
.line-actions { margin-left: auto; display: inline-flex; gap: 4px; }
.line-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; padding: 4px 12px 12px; }
.line-grid textarea { min-height: 38px; font-family: var(--mono); font-size: 12.5px; }
.files { display: grid; gap: 6px; }
.file { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.file a { text-decoration: none; }
.modal { position: fixed; z-index: 25; top: 5vh; left: 50%; transform: translateX(-50%); width: min(760px, calc(100% - 24px)); max-height: 90vh; background: var(--bg); border-radius: 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.import-out { display: grid; gap: 10px; }
.import-meta { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.import-meta .field { min-width: 200px; }
.import-counts { display: flex; gap: 8px; flex-wrap: wrap; }
tr.detail > td { background: var(--panel-2); padding: 6px 12px 10px; }
tr.detail .mini td { white-space: nowrap; }
.settings-h { margin: 12px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--ink-3); border-top: 1px solid var(--line-2); padding-top: 14px; }
@media (max-width: 900px) { .line-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); } .line-grid label { grid-column: auto !important; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* ---------- sales assistant */
.sa { display: grid; gap: 12px; }
.sa-tabs { display: flex; gap: 4px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 4px; width: fit-content; max-width: 100%; box-shadow: 0 1px 2px rgba(15, 27, 45, .04); }
.sa-tab { padding: 8px 16px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: 13.5px; }
.sa-tab:hover { background: var(--bg); color: var(--ink); }
.sa-tab.on { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .25); }
.sa-card { display: grid; gap: 12px; max-width: 1040px; }
.sa-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); gap: 14px; align-items: start; }
.sa-drop { border: 1.5px dashed #C9D3E3; border-radius: 16px; padding: 12px; display: grid; gap: 8px; background: var(--panel-2); }
.sa-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.sa-shots { display: flex; flex-wrap: wrap; gap: 8px; }
.sa-shot { display: grid; gap: 4px; justify-items: center; width: 108px; text-decoration: none; }
.sa-shot img { width: 108px; height: 150px; object-fit: cover; object-position: top; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.sa-shots.small .sa-shot { width: 72px; } .sa-shots.small .sa-shot img { width: 72px; height: 100px; }
.sa-shot-btns { display: flex; gap: 2px; align-items: center; }
.sa-shot-btns .btn { padding: 0 6px; min-height: 24px; }
.sa-out, .sa-result, .sa-list { display: grid; gap: 10px; }
.sa-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sa-client { display: flex; flex-wrap: wrap; gap: 4px; }
.sa-msg { border-left: 3px solid var(--accent); }
.sa-text { font-size: 14px; unicode-bidi: plaintext; }
.sa-tr { font-size: 12.5px; color: var(--ink-2); }
.sa-alert { border-color: var(--bad); background: var(--bad-soft); }
.sa-alert ul, .sa-section ul { margin: 0; padding-left: 20px; }
.sa-section { display: grid; gap: 8px; }
.sa-section h4 { margin: 6px 0 0; }
.sa-score { display: grid; gap: 4px; max-width: 360px; }
details.sa-more summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.sa-panel { display: grid; gap: 10px; }
.sa-panel h4 { margin: 0; }
.sa-log { display: grid; gap: 10px; max-height: 58vh; overflow: auto; padding: 2px; }
.sa-log:empty { display: none; }
.sa-turn { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; display: grid; gap: 4px; max-width: 92%; }
.sa-turn.user { justify-self: end; background: var(--accent-soft); }
.sa-turn.assistant { justify-self: start; background: var(--panel); }
.sa-who { font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.sa-ask textarea { width: 100%; }
.sa-wait-msg::before { content: '⏳ '; }
@media (max-width: 900px) { .sa-grid { grid-template-columns: 1fr; } }
.sa-grid > *, .sa-card, .sa-out, .sa-result { min-width: 0; }
.sa-grid .mini td { white-space: normal; }
.sa-card > *, .sa-panel > * { min-width: 0; }
.sa-result .pre[dir], .sa-log .pre[dir], .sa-result [dir=auto], .sa-log [dir=auto] { direction: ltr; unicode-bidi: plaintext; text-align: start; }
.sa-waitlist { display: grid; gap: 6px; margin-top: 8px; }
.sa-wait-row { display: grid; gap: 2px; text-align: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; }
.sa-wait-row:hover { border-color: var(--accent); }
.sa-wait-top { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sa-result .ca-block ul, .sa-out .ca-block ul { margin: 0; padding-left: 20px; }
/* ---------- live WhatsApp chats */
.wa-log { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; padding: 12px; border-radius: 16px; background: #EFEAE2; }
.wa-log > .btn { align-self: center; margin-bottom: 6px; }
.wa-day { align-self: center; font-size: 11.5px; color: var(--ink-2); background: var(--panel); border-radius: 6px; padding: 2px 10px; margin: 6px 0; box-shadow: var(--shadow); }
.wa-msg { max-width: 78%; padding: 6px 9px 4px; border-radius: 8px; background: #fff; color: #111b21; box-shadow: 0 1px 1px rgba(0,0,0,.08); align-self: flex-start; }
.wa-msg.out { align-self: flex-end; background: #d9fdd3; }
.wa-text { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; unicode-bidi: plaintext; text-align: start; }
.wa-meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; font-size: 10.5px; color: #667781; }
.wa-star { border: 0; background: transparent; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; color: #8696a0; }
.wa-star.on { color: #d4a017; }
.wa-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #25d366; margin-right: 6px; vertical-align: middle; }
.wa-admin { display: grid; gap: 14px; max-width: 1040px; }
.wa-admin .card { display: grid; gap: 10px; }
.wa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.wa-copy { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wa-copy code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 12.5px; word-break: break-all; }
ol.wa-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.wa-script { width: 100%; font-family: var(--mono); font-size: 12px; }

/* ---------- Ocean Light: shell details */
.side-brand { padding: 0 2px 6px; }
.nav h6:first-child { margin-top: 6px; }
.nav a svg.ic { color: var(--ink-3); transition: color .15s; }
.nav a:hover svg.ic { color: var(--ink); }
.nav a.on svg.ic { color: #fff; }
.user-card a.user-row { text-decoration: none; color: var(--ink); border-radius: 12px; }
.user-card a.user-row:hover b { color: var(--accent-strong); }
.btn.icon { padding: 0; width: 40px; height: 40px; justify-content: center; flex: none; }
.btn.icon.sm { width: 34px; height: 34px; border-radius: 10px; }
.user-card .btn.icon.sm { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.user-card .btn.icon.sm:hover { background: #fff; color: var(--bad); }
.top .actions { display: flex; gap: 10px; align-items: center; flex: none; }
.side-scrim { display: none; }

/* ---------- dashboard extras */
a.kpi-tile { text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.kpi-tile:hover { border-color: #C9D3E3; transform: translateY(-1px); }
.kpi-tile .head span:first-child { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shell { background: linear-gradient(90deg, var(--side) 0 255px, var(--line) 255px 256px, transparent 256px); }
.delta b { font-weight: 800; }
.delta svg.ic { width: 13px; height: 13px; vertical-align: -2px; }
.dash-row.auto { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card-head .sub { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.card-head .titles { flex: 1; min-width: 0; display: grid; gap: 1px; }
.card-head .titles h4 { flex: none; }
a.link { font-size: 12.5px; font-weight: 700; color: var(--accent-strong); text-decoration: none; white-space: nowrap; }
a.link:hover { text-decoration: underline; }
.list { display: grid; gap: 4px; }
.list.gap8 { gap: 8px; }

/* sales-by-month columns (single series; value shown on hover, current month labelled) */
.mchart { display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: 210px auto; column-gap: 8px; }
.mchart .yax { position: relative; }
.mchart .yax span { position: absolute; right: 0; transform: translateY(-50%); font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mchart .plot { position: relative; border-bottom: 1px solid var(--line); }
.mchart .gl { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line-2); }
.mchart .cols { position: absolute; inset: 0; display: flex; }
.mchart .col { flex: 1; position: relative; display: flex; align-items: flex-end; justify-content: center; cursor: default; outline: none; }
.mchart .col:hover, .mchart .col:focus-visible { background: rgba(37, 99, 235, .05); border-radius: 8px 8px 0 0; }
.mchart .b { width: 24px; max-width: 56%; background: #5B8DEF; border-radius: 4px 4px 0 0; min-height: 2px; transition: background .15s; }
.mchart .col.cur .b { background: var(--accent-strong); }
.mchart .col:hover .b { background: var(--accent); }
.mchart .col .lbl { position: absolute; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 800; color: var(--ink); white-space: nowrap; padding-bottom: 6px; pointer-events: none; }
.mchart .xax { grid-column: 2; display: flex; }
.mchart .xax span { flex: 1; text-align: center; font-size: 12px; color: var(--ink-3); font-weight: 600; padding-top: 8px; }
.mchart .xax span.cur { color: var(--ink); font-weight: 800; }
.chart-wrap .chart-tip { top: 0; left: 0; }

/* needs attention */
details.att { border-radius: 12px; min-width: 0; }
.list > * { min-width: 0; }
details.att > summary { list-style: none; }
details.att > summary::-webkit-details-marker { display: none; }
details.att[open] { background: var(--panel-2); }
details.att .mini-wrap { padding: 0 10px 8px 56px; }
.att-row .chev { color: var(--ink-3); transition: transform .15s; }
details.att[open] .att-row .chev { transform: rotate(180deg); }
.att-row .sq { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }

/* login hero decoration */
.login-hero .deco { position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .12); pointer-events: none; }
.login-hero .deco.d1 { width: 520px; height: 520px; right: -200px; bottom: -220px; background: rgba(255, 255, 255, .04); }
.login-hero .deco.d2 { width: 300px; height: 300px; right: -60px; bottom: -80px; background: rgba(255, 255, 255, .05); }
.login-hero .deco.d3 { width: 160px; height: 160px; left: -50px; top: -60px; }
.login-hero .logo-box { position: relative; background: #fff; border-radius: 16px; padding: 10px 16px; width: fit-content; max-width: 260px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
.login-hero .logo-box img { display: block; max-width: 100%; max-height: 56px; }
.login-hero .logo-box .brand { color: var(--ink); }
.login-hero > * { position: relative; }
.login-hero .foot { font-size: 12.5px; color: #A9BEF5; }
.login-card .top-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.login-card .btn.primary { justify-content: center; padding: 12px; font-size: 14.5px; }
.login-card .brand-wrap { padding: 0; }

svg.ic.lead { width: 16px; height: 16px; vertical-align: -3px; }
h3 > svg.ic.lead, h4 > svg.ic.lead { width: 18px; height: 18px; color: var(--accent); }
.btn > svg.ic.lead { color: inherit; }
.sa-tab svg.ic.lead { margin-right: 6px; }
.myday .mini td { white-space: normal; vertical-align: top; }
.myday .mini td.muted { white-space: nowrap; }

/* ---------- phones & small tablets */
@media (max-width: 1180px) {
  .hero-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-row { grid-template-columns: minmax(0, 1fr); }
  .dash-row .span2 { grid-column: auto; }
  .gsearch { width: 240px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .side { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 30; transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .side.open + .side-scrim { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(15, 27, 45, .32); }
  .menu-btn { display: inline-flex; }
  .top { padding: 12px 16px 10px; flex-wrap: wrap; gap: 10px; }
  .top h2 { font-size: 20px; }
  .top .sub { font-size: 12px; }
  .gsearch { order: 5; width: 100%; }
  .top .actions .btn .lbl { display: none; }
  .top .actions .btn.primary { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .content { padding: 8px 16px 40px; gap: 16px; }
  .admin-grid { grid-template-columns: 1fr; }
  .hero-kpis { gap: 12px; }
  .kpi-tile { padding: 14px; border-radius: 16px; }
  .kpi-tile .big { font-size: 22px; }
  .kpi-tile .sq { width: 34px; height: 34px; border-radius: 10px; }
  .card { padding: 16px; border-radius: 16px; }
  .drawer { border-radius: 0; }
  .login-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }
  .login-hero { padding: 24px 20px; gap: 14px; }
  .login-hero h2 { font-size: 22px; }
  .login-hero p, .login-hero ul, .login-hero .foot { display: none; }
  .login-hero .logo-box { max-width: 100%; padding: 8px 12px; }
  .login-hero .logo-box img { max-height: 44px; }
  .login-side { place-items: start center; padding: 20px 16px 32px; }
  .login-card { padding: 22px; }
  .mchart { grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: 180px auto; }
  details.att .mini-wrap { padding-left: 10px; }
}
.user-top { display: flex; align-items: center; gap: 4px; }
.user-card a.user-row { flex: 1; min-width: 0; }

/* ---------- export documents & sending to the client */
.xd-status { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--bad-soft); font-size: 13px; }
.xd-status.ok { background: var(--good-soft); }
details.xd-make > summary { list-style: none; width: fit-content; }
details.xd-make > summary::-webkit-details-marker { display: none; }
details.xd-make .field { min-width: 200px; }
.send-card textarea { font-size: 13px; line-height: 1.45; unicode-bidi: plaintext; }
.send-card h4 svg.ic { color: var(--accent); }
.card h4 > svg.ic { color: var(--accent); }
.print-modal { width: min(520px, calc(100% - 24px)); }
.print-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.printer-list { display: grid; gap: 6px; }
.printer-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.printer-row.on { border-color: #A7C1F8; background: var(--accent-soft); }
.printer-row .nm { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.printer-row svg.ic { color: var(--ink-3); }
.btn.icon-only { padding: 4px 6px; }

/* ---- Users: add the team in one go */
.users-page { display: grid; gap: 18px; }
.users-page .admin-grid { grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); }
@media (max-width: 900px) { .users-page .admin-grid { grid-template-columns: 1fr; } }
.team-card { display: grid; gap: 12px; }
.team-card.ready { border-color: #BFD3FF; background: linear-gradient(180deg, #F3F7FF 0%, var(--panel) 120px); }
.team-card .card-head h4 { display: flex; align-items: center; gap: 8px; }
.team-card .card-head h4 svg.ic { color: var(--accent); }
.team-card.done .card-head h4 svg.ic { color: var(--good); }
details.team-card > summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; list-style: none; }
details.team-card > summary::-webkit-details-marker { display: none; }
details.team-card > summary svg.ic { color: var(--accent); }
details.team-card:not([open]) { gap: 0; }
.team-table { min-width: 640px; }
.team-table tbody tr { cursor: default; }
.team-table tbody tr:hover td { background: transparent; }
.team-table td { vertical-align: top; padding-top: 8px; padding-bottom: 8px; }
.team-table input, .team-table select { min-height: 36px; padding: 6px 10px; }
.team-table .tm-inc { width: 52px; text-align: center; }
.team-table .tm-inc input, .tm-owner input { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--accent); }
.team-table .tm-inc input { margin-top: 9px; }
.team-table .tm-user { font-family: var(--mono); font-size: 13px; }
.team-table .tm-access { min-width: 250px; }
.team-table .tm-accesscell { display: grid; gap: 6px; }
.team-table .tm-also { min-height: 30px; padding: 4px 10px; font-size: 12.5px; color: var(--ink-2); max-width: 250px; }
.team-table .tm-x { width: 44px; }
.tm-note { display: block; margin-top: 4px; font-size: 11.5px; }
.tm-owner { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pw-cell { font: 700 15px/1.2 var(--mono); letter-spacing: .05em; background: var(--accent-soft); color: var(--ink); padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.note.warn-note { background: var(--warn-soft); color: var(--warn); font-weight: 600; }

/* ---- My day: questions for you */
.myday .my-questions { grid-column: 1 / -1; }
.my-questions h4 { display: flex; align-items: center; gap: 8px; }
.my-questions h4 svg.ic { color: var(--warn); }
.my-questions table.mini tr { cursor: pointer; }
.my-questions table.mini td { vertical-align: top; }
.my-questions table.mini td:nth-child(2) { white-space: normal; line-height: 1.45; width: 100%; }

/* another sales person's order: seller and number of cars only */
table.grid tbody tr.limited td { color: var(--ink-3); }

/* Ask CargoLink */
.help-panel { display: grid; gap: 12px; }
.help-panel.full { max-width: 860px; }
.help-ask { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
.help-ask textarea { width: 100%; resize: vertical; font: inherit; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel); color: inherit; }
.help-answer:empty { display: none; }
.help-answer { display: grid; gap: 8px; }
.ai-answer { white-space: pre-wrap; line-height: 1.55; font-size: 14px; }
.help-sec { display: grid; gap: 6px; }
.help-sec h4, .help-mine h4 { margin: 6px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
details.guide { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); padding: 0 12px; }
details.guide > summary { cursor: pointer; padding: 10px 0; list-style: none; display: flex; gap: 8px; align-items: center; }
details.guide > summary::before { content: '▸'; color: var(--ink-3); transition: transform .15s; }
details.guide[open] > summary::before { transform: rotate(90deg); }
details.guide > summary::-webkit-details-marker { display: none; }
details.guide ol { margin: 0 0 10px; padding-left: 22px; display: grid; gap: 6px; line-height: 1.5; font-size: 14px; }
details.guide .note { margin-bottom: 10px; }
details.guide > .btn { margin-bottom: 12px; }
details.help-other > summary { cursor: pointer; color: var(--ink-2); font-weight: 600; padding: 6px 0; }
details.help-other[open] { display: grid; gap: 6px; }
.help-rules h4 { margin: 0 0 6px; }
.help-mine { display: grid; gap: 6px; }
.help-mine:empty { display: none; }
.help-q-row { border-left: 3px solid var(--accent); padding: 4px 0 4px 10px; display: grid; gap: 4px; }
.ask-btn .lbl { margin-left: 6px; }
@media (max-width: 720px) { .ask-btn .lbl { display: none; } }

/* ---- Updates (who changed what) */
.bell-btn { position: relative; }
.bell-btn .nav-badge { position: absolute; top: -5px; right: -5px; }
.upd-list { display: grid; gap: 8px; }
.upd-day { margin: 10px 0 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.upd-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.upd-item.unread { border-left: 3px solid var(--accent); background: linear-gradient(90deg, var(--accent-soft), var(--panel) 45%); cursor: pointer; }
.upd-body { min-width: 0; overflow-wrap: anywhere; }
.upd-head { line-height: 1.5; }
.upd-head a { font-weight: 700; }
.upd-time { margin-left: 6px; font-size: 12px; }
.upd-changes { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.upd-changes li { margin: 2px 0; }
.upd-changes .from { color: var(--ink-3); text-decoration: line-through; }
.upd-changes .to { color: var(--good); font-weight: 700; }
.upd-files { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; font-size: 13px; }
.upd-files .removed { text-decoration: line-through; color: var(--ink-3); }
.upd-note { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--ink); font-size: 13px; }
.upd-list.compact .upd-item { padding: 8px 10px; }
.upd-list.compact .upd-actions { display: none; }
.avatar.sm { width: 30px; height: 30px; border-radius: 15px; font-size: 11px; }
.seg { display: inline-flex; gap: 4px; }
/* ---- payment approval */
.approval-card { display: grid; gap: 8px; }
.approval-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.file-pickers { display: flex; flex-wrap: wrap; gap: 6px; }
.notes-hist { display: grid; gap: 6px; }
@media (max-width: 640px) {
  .upd-item { grid-template-columns: 26px minmax(0, 1fr); }
  .upd-actions { grid-column: 2; }
}
.upd-list.compact .upd-changes li:nth-child(n+4) { display: none; }
.pay-meta { font-size: 12px; margin-top: 2px; white-space: normal; }
.share-list { display: grid; gap: 4px; max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px; }
.share-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.share-row:hover { background: var(--accent-soft); }
.share-only { display: flex; align-items: center; gap: 6px; font-size: 13px; }
@media (max-width: 640px) { .share-row { grid-template-columns: auto minmax(0, 1fr); } .share-row .muted { grid-column: 2; } }
.btn.armed { background: var(--good); border-color: var(--good); color: #fff; }

/* ---- cloud server page and the "moved" screen */
.cloud-page { max-width: 880px; }
.cloud-url { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cloud-url a:first-child { font-size: 18px; font-weight: 700; color: var(--accent-strong); word-break: break-all; }
ul.cloud-check { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 4px; font-size: 13.5px; }
ul.cloud-check .good { color: var(--good); font-weight: 600; }
ul.cloud-check .bad { color: var(--bad); font-weight: 600; }
.cloud-days { display: flex; gap: 6px; flex-wrap: wrap; }
.cloud-log-text { max-height: 360px; overflow: auto; white-space: pre-wrap; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; margin: 0; }
.cloud-busy { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: cl-spin .8s linear infinite; flex: none; }
@keyframes cl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.moved-admin { max-width: 920px; margin: 0 auto; padding: 24px 16px 48px; display: grid; gap: 14px; }
.moved-admin .moved-card { width: 100%; max-width: none; }
.moved-h { margin: 10px 0 0; font-size: 18px; }
.moved-go { justify-content: center; word-break: break-all; font-size: 16px; }
.moved-note { display: grid; gap: 8px; }
.moved-note .btn { justify-content: center; }
.cloud-log select { width: auto; min-width: 180px; }
.moved-card .top-row { flex-wrap: wrap; }
.moved-card h1 { font-size: 22px; }
.lang-switch button { white-space: nowrap; }
