/* themes - all tokens. Custix (default, teal), Custix Night, Dusk, Graphite via data-theme. --hl = amber highlight.
   The layout is XelovaHorizon's; the colours are Custix's own. */
:root {
  --bg: #f3f8f7; --panel: #ffffff; --panel-2: #f7fbfa; --ink: #0f2a28; --ink-2: #33504c; --muted: #62807a;
  --line: #dbe8e5; --line-2: #c1d5d1;
  --accent: #0f766e; --accent-hover: #115e59; --accent-soft: #ccf0ea; --accent-softer: #effaf8; --accent-ink: #ffffff;
  --hl: #f59e0b; --hl-ink: #b45309; --hl-soft: #fef3c7;
  --danger: #dc2626; --danger-soft: #fee2e2; --warn: #b45309; --warn-soft: #fef3c7;
  --ok: #15803d; --ok-soft: #dcfce7; --info: #0369a1; --info-soft: #e0f2fe; --neutral-soft: #ebf3f1;
  /* sidebar */
  --side: linear-gradient(180deg, #0a3532 0%, #115e59 100%); --side-ink: #c2e5df; --side-hover: rgba(255,255,255,.07); --side-active: rgba(245,158,11,.15);
  --side-head: #ffffff; --side-strong: #dbf2ee; --side-muted: #8cc0b7; --side-line: rgba(255,255,255,.1); --side-field: rgba(255,255,255,.06);
  --side-on: #fbbf24;
  --shadow-sm: 0 1px 2px rgba(15,42,40,.05);
  --shadow: 0 2px 6px rgba(15,42,40,.06), 0 1px 2px rgba(15,42,40,.04);
  --shadow-lg: 0 18px 44px rgba(15,42,40,.18);
  --overlay: rgba(10,40,37,.5);
  --radius: 14px; --radius-sm: 9px; --gutter: 24px;
  --font: "Plus Jakarta Sans", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mark-a: #0f766e; --mark-b: #f59e0b;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #061413; --panel: #0d1f1d; --panel-2: #0a1917; --ink: #e3f0ee; --ink-2: #c0d6d2; --muted: #88a5a0;
    --line: #183532; --line-2: #274b47;
    --accent: #2dd4bf; --accent-hover: #5eead4; --accent-soft: rgba(45,212,191,.2); --accent-softer: rgba(45,212,191,.08); --accent-ink: #04201d;
    --hl: #fbbf24; --hl-ink: #fcd34d; --hl-soft: rgba(251,191,36,.14);
    --danger: #f87171; --danger-soft: rgba(248,113,113,.16); --warn: #fbbf24; --warn-soft: rgba(251,191,36,.14);
    --ok: #4ade80; --ok-soft: rgba(74,222,128,.14); --info: #60a5fa; --info-soft: rgba(96,165,250,.15); --neutral-soft: #132b28;
    --side: linear-gradient(180deg, #04110f 0%, #0a2421 100%); --side-ink: #b2d1cb; --side-hover: rgba(255,255,255,.06); --side-active: rgba(251,191,36,.12);
    --side-head: #ffffff; --side-strong: #d5ebe7; --side-muted: #7ea39c; --side-line: rgba(255,255,255,.08); --side-field: rgba(255,255,255,.05);
    --shadow-sm: none; --shadow: 0 1px 2px rgba(0,0,0,.45); --shadow-lg: 0 18px 44px rgba(0,0,0,.6); --overlay: rgba(0,0,0,.62);
    --mark-a: #14b8a6; --mark-b: #fbbf24;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #061413; --panel: #0d1f1d; --panel-2: #0a1917; --ink: #e3f0ee; --ink-2: #c0d6d2; --muted: #88a5a0;
  --line: #183532; --line-2: #274b47;
  --accent: #2dd4bf; --accent-hover: #5eead4; --accent-soft: rgba(45,212,191,.2); --accent-softer: rgba(45,212,191,.08); --accent-ink: #04201d;
  --hl: #fbbf24; --hl-ink: #fcd34d; --hl-soft: rgba(251,191,36,.14);
  --danger: #f87171; --danger-soft: rgba(248,113,113,.16); --warn: #fbbf24; --warn-soft: rgba(251,191,36,.14);
  --ok: #4ade80; --ok-soft: rgba(74,222,128,.14); --info: #60a5fa; --info-soft: rgba(96,165,250,.15); --neutral-soft: #132b28;
  --side: linear-gradient(180deg, #04110f 0%, #0a2421 100%); --side-ink: #b2d1cb; --side-hover: rgba(255,255,255,.06); --side-active: rgba(251,191,36,.12);
  --side-head: #ffffff; --side-strong: #d5ebe7; --side-muted: #7ea39c; --side-line: rgba(255,255,255,.08); --side-field: rgba(255,255,255,.05);
  --shadow-sm: none; --shadow: 0 1px 2px rgba(0,0,0,.45); --shadow-lg: 0 18px 44px rgba(0,0,0,.6); --overlay: rgba(0,0,0,.62);
  --mark-a: #14b8a6; --mark-b: #fbbf24;
  color-scheme: dark;
}

/* Dusk: sand page, navy sidebar, amber, DM Sans */
:root[data-theme="dusk"] {
  --bg: #f8f4ec; --panel: #fffdf8; --panel-2: #fbf7ef; --ink: #1d1a2e; --ink-2: #463f58; --muted: #81788f;
  --line: #ebe2d2; --line-2: #ddd0b9;
  --accent: #d97706; --accent-hover: #b45309; --accent-soft: #fde9c8; --accent-softer: #fff6e6; --accent-ink: #ffffff;
  --hl: #d97706; --hl-ink: #b45309; --hl-soft: #fde9c8;
  --danger: #b91c1c; --danger-soft: #fde2e2; --warn: #a16207; --warn-soft: #fdf1c7;
  --ok: #3f7d20; --ok-soft: #e4f2d6; --info: #1e40af; --info-soft: #dfe7fb; --neutral-soft: #f2ebdf;
  --side: linear-gradient(180deg, #1b2347 0%, #2a2f5c 100%); --side-ink: #c5c8e4; --side-hover: rgba(255,255,255,.07); --side-active: rgba(251,191,36,.15);
  --side-head: #ffffff; --side-strong: #e2e3f3; --side-muted: #9599c2; --side-line: rgba(255,255,255,.1); --side-field: rgba(255,255,255,.06);
  --shadow-sm: 0 1px 2px rgba(60,40,20,.06); --shadow: 0 2px 8px rgba(60,40,20,.07), 0 1px 2px rgba(60,40,20,.05);
  --shadow-lg: 0 18px 44px rgba(60,40,20,.18); --overlay: rgba(29,26,46,.5);
  --radius: 18px; --radius-sm: 12px;
  --font: "DM Sans", Inter, system-ui, sans-serif;
  --mark-a: #2a2f5c; --mark-b: #f59e0b;
  color-scheme: light;
}

/* Graphite: neutral charcoal, teal, square-ish, IBM Plex Sans */
:root[data-theme="graphite"] {
  --bg: #121416; --panel: #1b1e21; --panel-2: #171a1d; --ink: #eceef0; --ink-2: #c9cdd2; --muted: #969ca5;
  --line: #2b3035; --line-2: #3b4148;
  --accent: #2dd4bf; --accent-hover: #5eead4; --accent-soft: rgba(45,212,191,.2); --accent-softer: rgba(45,212,191,.08); --accent-ink: #06231f;
  --hl: #fbbf24; --hl-ink: #fcd34d; --hl-soft: rgba(251,191,36,.14);
  --danger: #f87171; --danger-soft: rgba(248,113,113,.16); --warn: #fbbf24; --warn-soft: rgba(251,191,36,.14);
  --ok: #4ade80; --ok-soft: rgba(74,222,128,.14); --info: #7dd3fc; --info-soft: rgba(125,211,252,.14); --neutral-soft: #24282d;
  --side: linear-gradient(180deg, #0b0c0e 0%, #15181b 100%); --side-ink: #b9bec6; --side-hover: rgba(255,255,255,.06); --side-active: rgba(45,212,191,.14);
  --side-head: #ffffff; --side-strong: #dfe2e6; --side-muted: #818892; --side-line: rgba(255,255,255,.08); --side-field: rgba(255,255,255,.05);
  --side-on: #5eead4;
  --shadow-sm: none; --shadow: 0 1px 2px rgba(0,0,0,.5); --shadow-lg: 0 18px 44px rgba(0,0,0,.65); --overlay: rgba(0,0,0,.66);
  --radius: 10px; --radius-sm: 7px;
  --font: "IBM Plex Sans", Inter, system-ui, sans-serif;
  --mark-a: #0f766e; --mark-b: #2dd4bf;
  color-scheme: dark;
}

/* theme picker */
.theme-list { display: grid; gap: 2px; min-width: 230px; }
.theme-opt { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; color: var(--ink); }
.theme-opt:hover, .theme-opt:focus-visible { background: var(--neutral-soft); }
.theme-opt small { display: block; color: var(--muted); font-size: 12px; }
.theme-opt .sw { width: 30px; height: 22px; border-radius: 6px; flex-shrink: 0; border: 1px solid rgba(0,0,0,.12); display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.theme-opt .sw i { display: block; }
.theme-opt .tick { margin-inline-start: auto; color: var(--accent); visibility: hidden; }
.theme-opt.on .tick { visibility: visible; }
.theme-opt.on { font-weight: 600; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--danger); }
.ico { flex-shrink: 0; vertical-align: middle; }
kbd { font: 600 11px/1 Inter, sans-serif; padding: 3px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); background: var(--panel); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* progress / loading */
.progress { position: fixed; top: 0; inset-inline-start: 0; inset-inline-end: 0; height: 3px; z-index: 100; overflow: hidden; opacity: 0; transition: opacity .2s; pointer-events: none; }
body.loading .progress { opacity: 1; }
.progress::before { content: ""; position: absolute; inset: 0; width: 40%; background: var(--accent); animation: slide 1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.loading-state { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 40px 0; justify-content: center; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
body.saving .btn.primary { opacity: .65; pointer-events: none; cursor: progress; }

/* login */
.login { min-height: 100%; display: grid; grid-template-columns: 1.3fr 1fr; }
/* sign-in screen: same navy and amber in every theme, so the tokens are set here */
.login { --panel: #0b2e2b; --panel-2: #072220; --ink: #e6f3f1; --ink-2: #c4e3dd; --muted: #9cc7bf; --line: #1d4a45; --line-2: #1d4a45;
  --accent: #0f766e; --accent-hover: #14b8a6; --accent-soft: rgba(251,191,36,.2); --accent-ink: #fff; --danger: #fca5a5;
  color: var(--ink); color-scheme: dark; }
.login input { background: var(--panel-2); color: var(--ink); padding: 11px 13px; }
.login input:focus { border-color: #fbbf24; }
.login .brand { color: var(--ink); } .login .brand b, .login .pw-toggle, .login .lang-links a { color: #fbbf24; }
.login .btn.primary { position: relative; overflow: hidden; }
.login .btn.primary::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; pointer-events: none; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: ls-shine 3.5s 1.5s infinite; }
.login-foot { margin: 6px 0 0; text-align: center; direction: ltr; font-size: 12px; color: var(--muted); }
.login-scene { position: relative; overflow: hidden; min-height: 100vh; background: radial-gradient(80% 42% at 62% 100%, rgba(251,191,36,.6), rgba(245,158,11,.2) 55%, transparent 75%), linear-gradient(#072220, #0a3532 50%, #115e59); }
.ls-city { position: absolute; left: 0; bottom: 120px; width: 3600px; height: 150px; fill: #072220; opacity: .85; animation: ls-pan 60s linear infinite; }
.ls-road { position: absolute; inset-inline: 0; bottom: 0; height: 120px; direction: ltr; background: linear-gradient(#232b45, #141a30); border-top: 3px solid #fbbf24; }
.ls-road i { position: absolute; left: 0; right: 0; }
.ls-poles { top: -46px; height: 46px; background: repeating-linear-gradient(90deg, rgba(219,229,251,.35) 0 3px, transparent 3px 240px); animation: ls-poles 1.6s linear infinite; }
.ls-lane { top: 58px; height: 4px; background: repeating-linear-gradient(90deg, #dbf2ee 0 34px, transparent 34px 80px); animation: ls-lane .5s linear infinite; }
.ls-truck { position: absolute; left: 12%; bottom: 8px; width: 300px; height: 100px; overflow: visible; animation: ls-bob .5s ease-in-out infinite alternate; }
.ls-van { position: absolute; left: 0; bottom: 74px; width: 90px; height: 44px; animation: ls-pass 9s linear infinite; }
.ls-wheel { animation: ls-spin .5s linear infinite; }
.ls-copy { position: absolute; inset-inline-start: 8%; top: 12%; max-width: 420px; }
.ls-copy > * { opacity: 0; animation: ls-rise .8s forwards; }
.ls-copy h2 { margin: 0; font-size: clamp(26px, 3.2vw, 40px); line-height: 1.15; color: #fff; }
.ls-copy h2 span { color: #fbbf24; }
.ls-copy p { margin: 10px 0 0; color: #c4e3dd; font-size: 15px; animation-delay: .25s; }
.ls-doc { position: absolute; inset-inline-end: 10%; top: 16%; width: 190px; padding: 14px; border-radius: 10px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px); animation: ls-float 5s ease-in-out infinite; }
.ls-doc h4 { margin: 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #c4e3dd; }
.ls-way { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; font-weight: 600; color: #fff; }
.ls-track { position: relative; height: 4px; margin: 10px 0 8px; border-radius: 2px; background: rgba(255,255,255,.2); }
.ls-track i { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 100%; border-radius: 2px; background: #fbbf24; transform-origin: left; animation: ls-go 8s linear infinite both; }
:root[dir=rtl] .ls-track i { transform-origin: right; }
.ls-stamp { position: absolute; inset-inline-end: -14px; bottom: -14px; padding: 4px 10px; border: 2px solid #fbbf24; border-radius: 6px; color: #fbbf24; font-weight: 800; font-size: 12px;
  letter-spacing: .1em; text-transform: uppercase; animation: ls-stamp 8s linear infinite both; }
/* how the scene arrives: road, city, truck, then the card fills and stamps */
.ls-road { animation: ls-up .7s cubic-bezier(.22,.8,.24,1) .1s both; }
.ls-city { animation: ls-pan 60s linear infinite, ls-up .8s .3s both; }
.ls-truck { animation: ls-bob .5s ease-in-out infinite alternate, ls-drive 1s cubic-bezier(.2,.8,.3,1) .5s both; }
.ls-doc { animation: ls-float 5s ease-in-out infinite, ls-up .7s .2s both; }
.ls-track i { animation: ls-go 1.2s ease .4s both; }
.ls-stamp { animation: ls-stamp .35s 1.6s cubic-bezier(.2,1.6,.4,1) both; }
.splash { position: fixed; inset-block: 0; inset-inline-start: 0; width: 100%; z-index: 1000; background: #072220; transition: opacity .3s, width .7s var(--slide), height .7s var(--slide); --slide: cubic-bezier(.22,.8,.24,1); }
.splash.out { opacity: 0; pointer-events: none; }
.splash.shrink { width: calc(100% * 1.3 / 2.3); pointer-events: none; }
.login.slide { overflow: hidden; }
.login.slide .login-panel { animation: ls-slide .7s cubic-bezier(.22,.8,.24,1) both; }
:root[dir=rtl] .login.slide .login-panel { animation-name: ls-slide-r; }
.splash .login-scene { height: 100%; min-height: 0; }
@keyframes ls-pan { to { transform: translateX(-1200px); } }
@keyframes ls-poles { to { background-position: -243px 0; } }
@keyframes ls-lane { to { background-position: -80px 0; } }
@keyframes ls-bob { to { transform: translateY(-2px); } }
@keyframes ls-pass { from { transform: translateX(-120px); } to { transform: translateX(1500px); } }
@keyframes ls-spin { to { transform: rotate(-360deg); } }
@keyframes ls-float { 50% { transform: translateY(-12px); } }
@keyframes ls-rise { from { transform: translateY(16px); } to { transform: none; opacity: 1; } }
@keyframes ls-go { from { transform: scaleX(0); } }
@keyframes ls-stamp { from { opacity: 0; transform: rotate(-14deg) scale(2.4); } to { opacity: 1; transform: rotate(-14deg) scale(1); } }
@keyframes ls-up { from { translate: 0 60px; opacity: 0; } }
@keyframes ls-drive { from { translate: -480px 0; } }
@keyframes ls-slide { from { translate: 100% 0; } }
@keyframes ls-slide-r { from { translate: -100% 0; } }
@keyframes ls-shine { 30%, 100% { left: 130%; } }
@media (min-width: 1001px) and (max-width: 1240px) { .ls-doc { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .login *, .login *::after { animation-duration: .01s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
}
.login-panel { display: grid; place-items: center; padding: 32px 16px; background: var(--panel); }
.login-card { width: min(380px, 100%); display: grid; gap: 16px; }
.login-card h1 { margin: 0; font-size: 26px; }
.login-panel .login-card { opacity: 0; animation: ls-rise .8s .4s forwards; }
.login-card > p { margin: -10px 0 6px; }
.pw { position: relative; }
.pw input { padding-inline-end: 64px; }
.pw-toggle { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 6px; font-size: 12px; }
.err { color: var(--danger); min-height: 1.2em; margin: 0; font-weight: 500; }

/* brand */
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; color: var(--ink); }
.brand b { color: var(--hl); font-weight: 800; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 16px;
  background: #0f766e; color: #fff; box-shadow: 0 4px 10px rgba(15, 118, 110, .3); }  /* the Custix teal in every theme */
.brand .mark svg { width: 100%; height: 100%; display: block; border-radius: 10px; }
.brand.big { font-size: 22px; }
.brand.light { color: #fff; }
.brand.light b { color: #fbbf24; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 256px; background: var(--side); color: var(--side-ink); border-inline-end: 1px solid var(--side-line); position: sticky; top: 0; height: 100vh;
  overflow-y: auto; flex-shrink: 0; display: flex; flex-direction: column; scrollbar-width: thin;
  --ease: cubic-bezier(.22, .8, .24, 1);
  transition: margin-inline-start .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease), visibility 0s; }
/* collapsed icon rail (hidden or unpinned); hover expands it over the page */
.side-edge { display: none; }
@media (min-width: 1001px) {
  .shell:is(.side-hidden, .side-float) .main { margin-inline-start: 68px; }
  .shell:is(.side-hidden, .side-float) .sidebar { position: fixed; inset-inline-start: 0; top: 0; z-index: 40; width: 68px; overflow-x: hidden; white-space: nowrap;
    transition: width .22s var(--ease), box-shadow .22s var(--ease); }
  .shell:is(.side-hidden, .side-float) .sidebar:is(:hover, .peek) { width: 256px; box-shadow: var(--shadow-lg); transition-delay: .15s; }
  .shell:is(.side-hidden, .side-float) .sidebar:not(:hover):not(.peek) :is(.brand > span:last-child, .side-pin, .side-search > span,
    .side-search kbd, .nav-head span, .nav-head .ico:last-child, .links, .side-foot) { display: none; }
  .shell:is(.side-hidden, .side-float) .sidebar:not(:hover):not(.peek) .side-head { padding: 18px 0 14px; justify-content: center; }
  .shell:is(.side-hidden, .side-float) .sidebar:not(:hover):not(.peek) .brand { flex: none; }
.brand .mark { flex-shrink: 0; }
  .shell:is(.side-hidden, .side-float) .sidebar:not(:hover):not(.peek) .side-search { justify-content: center; padding: 8px 0; }
  .shell:is(.side-hidden, .side-float) .sidebar:not(:hover):not(.peek) .nav-head { justify-content: center; padding: 10px 0; }
  .shell:is(.side-hidden, .side-float) .sidebar:not(:hover):not(.peek) .nav-group.has-active > .nav-head { background: var(--side-active); }
  /* the rail expands with every group shut, or saved-open ones would push the items under the cursor */
  .shell:is(.side-hidden, .side-float) .nav-group:not(.hov) .links { display: none; }
  .shell:is(.side-hidden, .side-float) .nav-group:not(.hov) .nav-head .ico:last-child { transform: rotate(-90deg); }
}
.side-head { padding: 18px 12px 14px 18px; display: flex; align-items: center; gap: 8px; }
.side-head .brand { flex: 1; min-width: 0; }
.side-pin { border: 0; background: transparent; color: var(--side-muted); width: 30px; height: 30px; border-radius: var(--radius-sm); cursor: pointer;
  display: grid; place-items: center; flex-shrink: 0; transition: transform .25s var(--ease, ease), color .15s, background .15s; transform: rotate(45deg); }
.side-pin:hover { background: var(--side-hover); color: var(--side-head); }
.side-pin.on { color: var(--side-on, var(--hl)); transform: none; }
.side-pin:focus-visible { outline: 2px solid var(--accent); }
@media (prefers-reduced-motion: reduce) { .sidebar, .side-pin { transition: none !important; } }
.side-search { margin: 0 12px 10px; display: flex; align-items: center; gap: 8px; width: calc(100% - 24px); padding: 8px 10px; border: 1px solid var(--side-line);
  border-radius: var(--radius-sm); background: var(--side-field); color: var(--side-muted); cursor: pointer; font: inherit; }
.side-search:hover { border-color: var(--side-muted); }
.sidebar .brand { color: var(--side-head); }
.side-search kbd { color: var(--side-muted); border-color: var(--side-line); background: transparent; }
.side-search span { flex: 1; text-align: start; }
#nav { padding: 4px 10px 12px; display: grid; gap: 2px; }
.nav-head { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--side-strong); font-weight: 600; font-size: 13.5px; }
.nav-head:hover { background: var(--side-hover); }
.nav-head:focus-visible { outline: 2px solid var(--accent); }
.nav-head span { flex: 1; }
.nav-head .ico:last-child { color: var(--side-muted); transition: transform .15s; }
.nav-group.collapsed:not(.hov) .nav-head .ico:last-child { transform: rotate(-90deg); }
.nav-group.has-active > .nav-head { color: var(--side-on, var(--hl)); }
.links { display: grid; gap: 1px; padding: 2px 0 6px; margin-inline-start: 19px; border-inline-start: 1px solid var(--side-line); }
.nav-group.collapsed:not(.hov) .links { display: none; }
.links a { display: block; padding-block: 6px; padding-inline: 14px 10px; margin-inline-start: -1px; color: var(--side-ink); border-inline-start: 2px solid transparent; border-radius: 0 6px 6px 0; font-size: 13.5px; }
.links a:hover { background: var(--side-hover); color: var(--side-head); }
.links a.active { background: var(--side-active); color: var(--side-on, var(--hl)); border-inline-start-color: var(--hl); font-weight: 600; }
/* menu item pins: on hover/focus, always (dimmed) when pinned */
.nav-item { position: relative; }
.nav-item a { padding-inline-end: 30px; }
.nav-pin { all: unset; box-sizing: border-box; position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%) rotate(45deg); width: 24px; height: 24px; border-radius: 6px;
  display: grid; place-items: center; color: var(--side-muted); cursor: pointer; opacity: 0; transition: opacity .12s, transform .15s, color .12s; }
.nav-item:hover .nav-pin, .nav-pin:focus-visible { opacity: 1; }
.nav-pin:hover { background: var(--side-hover); color: var(--side-head); }
.nav-pin:focus-visible { outline: 2px solid var(--accent); }
.nav-item.is-pinned .nav-pin { opacity: .75; transform: translateY(-50%); color: var(--side-on, var(--hl)); }
@media (hover: none) { .nav-pin { opacity: .55; } }
.side-foot { margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--side-line); font-size: 12px; color: var(--side-muted); display: grid; gap: 4px; }
.side-foot b { color: var(--side-strong); font-size: 13px; }
/* customer logo on a white chip so dark logos survive dark menus */
.side-foot .co-logo { max-width: 150px; max-height: 40px; object-fit: contain; justify-self: start; background: #fff; border-radius: 6px; padding: 4px 6px; margin-bottom: 4px; }
.logo-set { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.logo-set p { margin: 4px 0 10px; max-width: 560px; }
.logo-box { flex: 0 0 180px; height: 90px; display: grid; place-items: center; border: 1px dashed var(--line-2); border-radius: var(--radius);
  background: #fff; padding: 8px; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
@media (max-width: 640px) { .logo-set { flex-direction: column; align-items: flex-start; } .logo-box { flex-basis: auto; width: 100%; } }
.backdrop { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 0 var(--gutter); position: sticky; top: 0; z-index: 15; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }
.search-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); border-radius: var(--radius-sm);
  padding: 7px 10px; min-width: 240px; cursor: pointer; font: inherit; }
.search-btn span { flex: 1; text-align: start; }
.search-btn:hover { border-color: var(--line-2); }
.icon-btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); border-radius: var(--radius-sm); width: 38px; height: 38px;
  cursor: pointer; display: grid; place-items: center; flex-shrink: 0; }
.icon-btn:hover { background: var(--side-hover); }
.menu-wrap { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px;
  padding: 4px 10px 4px 4px; cursor: pointer; font: inherit; font-weight: 600; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12px; }
.dropdown { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 220px; overflow: hidden; padding: 6px; z-index: 30; }
.dropdown a, .dropdown button.item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; color: var(--ink); border-radius: 6px; font: inherit; }
.dropdown a:hover { background: var(--side-hover); color: var(--ink); }
.dropdown a .ico { color: var(--muted); }
.drop-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: grid; gap: 2px; }
.drop-head small { color: var(--muted); }
/* user menu: small section headings, rule before Log out, scrolls on short screens */
.theme-drop { min-width: min(272px, calc(100vw - 24px)); max-height: calc(100dvh - 76px); overflow-y: auto; } .theme-drop .theme-list { padding: 0 4px 4px; }
@media (max-width: 560px) { .theme-drop { position: fixed; top: 64px; inset-inline: 12px; min-width: 0; } }  /* phone: full width */
#userDrop { min-width: 272px; max-height: calc(100dvh - 76px); overflow-y: auto; scrollbar-width: thin; }
.drop-sec { margin-top: 6px; padding: 10px 10px 4px; border-top: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.drop-sep { margin: 6px 0; border-top: 1px solid var(--line); }
#themeDrop .theme-list { min-width: 0; }
#themeDrop .theme-opt { width: 100%; padding: 8px 10px; }
#themeDrop .theme-opt .sw { width: 34px; height: 24px; border-radius: 7px; }
#themeDrop .theme-opt.on > span:nth-child(2) { font-weight: 700; }
#themeDrop .theme-opt .tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--accent); padding: 2px; }
.view { padding: var(--gutter); max-width: 1480px; width: 100%; margin: 0 auto; }
/* bottom bar */
.site-bar { position: sticky; bottom: 0; margin-top: auto; z-index: 5; height: 24px; display: flex; align-items: center; justify-content: center;
  background: var(--panel); border-top: 1px solid var(--line); font-size: 12px; }
.site-bar a, .site-bar > span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; }
.site-bar a:hover { color: var(--accent); }
.site-bar b { font-weight: 600; color: var(--ink-2); }
.site-bar a:hover b { color: inherit; }
/* floating bars + toasts sit above it */
.shell:has(.site-bar:not(.hidden)) :is(.save-bar, .rec-bar) { bottom: 36px; }
.save-bar, .rec-bar { margin-inline-end: 70px; }  /* clear of the chat bubble */
body:has(.site-bar:not(.hidden)) .toast { bottom: 40px; }

/* page header */
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; margin: 0; letter-spacing: -.01em; }
.page-head .sub { color: var(--muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-head .sub .badge { margin: 0; }

/* cards / grids */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; }
.card h3 { margin: 0 0 14px; font-size: 15px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }  /* heading buttons wrap on phones */
.card h3 .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.card + .card { margin-top: 16px; }
.step { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; }
.grid { display: grid; gap: 16px; }
.grid > .card + .card { margin-top: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.section-label { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); font-weight: 700; margin: 28px 0 12px; }
.section-label .spacer { flex: 1; }

/* kpi tiles */
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); display: grid; gap: 6px; align-content: start; }
.kpi .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi .kico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--kbg, var(--accent-soft)); color: var(--kc, var(--accent)); }
.kpi .value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .value small { font-size: 12px; color: var(--muted); font-weight: 500; margin-inline-start: 4px; letter-spacing: 0; }
.kpi .foot { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi a.foot { color: var(--accent); font-weight: 600; }
.trend { font-weight: 700; padding: 1px 6px; border-radius: 999px; font-size: 12px; }
.trend.up { background: var(--ok-soft); color: var(--ok); }
.trend.down { background: var(--danger-soft); color: var(--danger); }
.chart-box { position: relative; height: 280px; }

/* greeting + quick actions */
.hello h1 { font-size: 26px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.quick-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); font-weight: 600; transition: border-color .15s, transform .15s, box-shadow .15s; }
.quick-tile:hover { border-color: var(--accent); color: var(--ink); box-shadow: var(--shadow); transform: translateY(-1px); }
.quick-tile .qi { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-softer); color: var(--accent); }
.quick-tile small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }

/* segmented control */
.seg { display: inline-flex; background: var(--neutral-soft); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button, .seg a { border: 0; background: none; font: inherit; font-weight: 600; font-size: 13px; color: var(--muted); padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.seg .on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-2); background: var(--panel); padding: 8px 14px;
  border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--ink); white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--side-hover); color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--side-hover); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.lg { padding: 11px 18px; font-size: 15px; }
.btn.wide { width: 100%; }
.btn.icon-only { padding: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* forms */
input, select, textarea { font: inherit; font-size: 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--panel);
  color: var(--ink); width: 100%; min-width: 0; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, select:disabled, textarea:disabled { background: var(--panel-2); color: var(--muted); cursor: not-allowed; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); padding: 0; box-shadow: none; }
textarea { min-height: 72px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 18px; align-items: start; }
.form-grid label, .field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.form-grid .span2 { grid-column: span 2; } .form-grid .span4 { grid-column: 1 / -1; }
.req { color: var(--danger); }
.help { font-weight: 400; color: var(--muted); font-size: 12px; }
.help.warn-text { color: var(--warn); font-weight: 500; } .help.warn-text a { color: inherit; text-decoration: underline; }
.checkbox { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; cursor: pointer; align-self: end; padding-bottom: 9px; }
.checkbox input { width: 16px; }

/* filter bar */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); }
.filters label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 150px; }
.filters .checkbox { color: var(--ink-2); }
.filters .grow { flex: 1; min-width: 200px; }
.filters > .btn.primary { margin-inline-start: auto; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.chip-btn { border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-2); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12.5px;
  font-weight: 500; cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.search-field { position: relative; }
.search-field .ico { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field input { padding-inline-start: 34px; }
.filters label.search-field { display: block; }
.filters .search-field .ico { top: auto; bottom: 10px; transform: none; }

/* callouts */
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--ink-2); margin: 0 0 16px; }
.callout .ico { color: var(--info); margin-top: 1px; }
.callout.warn { background: var(--warn-soft); } .callout.warn .ico { color: var(--warn); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--neutral-soft); color: var(--ink-2); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--info-soft); color: var(--info); }

/* tables */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); max-height: calc(100vh - 250px); }
.card .table-wrap { border-radius: var(--radius-sm); }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
th { background: var(--panel-2); font-size: 12px; font-weight: 600; color: var(--muted); position: sticky; top: 0; z-index: 1; white-space: nowrap; user-select: none; }
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--ink); }
th .sort { display: inline-block; width: 10px; margin-inline-start: 4px; color: var(--accent); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--accent-softer); }
tr.clickable { cursor: pointer; }
tr.st-h td { background: var(--neutral-soft); font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
tr.st-sub td { font-weight: 600; border-top: 1px solid var(--line-2); }
tr.st-party td { color: var(--ink-2); font-size: 13px; padding-top: 5px; padding-bottom: 5px; }
tr.st-total td { font-weight: 700; background: var(--accent-softer); border-top: 2px solid var(--accent); }
tr.st-note td { color: var(--muted); font-style: italic; }
tfoot td { font-weight: 700; background: var(--panel-2); position: sticky; bottom: 0; border-top: 1px solid var(--line-2); border-bottom: 0; }
.table-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12.5px; margin: 8px 2px 0; }
.empty { display: grid; justify-items: center; gap: 6px; padding: 40px 16px; color: var(--muted); text-align: center; }
.empty .ico { color: var(--line-2); }
.empty b { color: var(--ink-2); font-size: 14px; }
td.nw { white-space: nowrap; }
td.empty-cell:hover, tr:hover td.empty-cell { background: var(--panel) !important; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; text-transform: capitalize; white-space: nowrap;
  background: var(--neutral-soft); color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
/* trips / vehicles */
.b-booked { background: var(--neutral-soft); color: var(--ink-2); } .b-in_transit, .b-on_trip { background: var(--info-soft); color: var(--info); }
.b-delivered { background: var(--ok-soft); color: var(--ok); } .b-billed { background: var(--accent-soft); color: var(--accent); }
.b-unbilled, .b-maintenance, .b-due { background: var(--hl-soft); color: var(--hl-ink); } .b-hired { background: var(--neutral-soft); color: var(--muted); }
.b-expired { background: var(--danger-soft); color: var(--danger); } .b-advance { background: var(--info-soft); color: var(--info); }
.b-return { background: var(--ok-soft); color: var(--ok); }
.b-posted, .b-accepted, .b-invoiced { background: var(--ok-soft); color: var(--ok); }
.b-cancelled, .b-rejected, .b-inactive { background: var(--danger-soft); color: var(--danger); }
.b-draft, .b-sent { background: var(--neutral-soft); color: var(--muted); }

/* line editors */
.lines th, .lines td { padding: 6px; }
.lines td { vertical-align: top; }
.lines tbody tr:hover td { background: transparent; }
.lines input, .lines select, .lines .combo-input { padding: 7px 8px; }
.lines .combo-input { padding-inline-end: 26px; }
.lines .amt { padding-top: 14px; font-weight: 600; }
.party-cell { display: flex; gap: 4px; }
.party-cell > :first-child { width: 110px; flex-shrink: 0; }
.add-line { margin-top: 10px; }
.totals { display: grid; grid-template-columns: auto 150px; gap: 8px 24px; justify-content: end; margin-top: 16px; font-variant-numeric: tabular-nums; }
.totals .grand { font-size: 18px; font-weight: 700; }
.totals .sep { grid-column: 1 / -1; border-top: 1px dashed var(--line-2); }

/* sticky save bar */
.save-bar { position: sticky; bottom: 12px; margin-top: 16px; z-index: 5; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.save-bar .sum { display: flex; gap: 22px; flex-wrap: wrap; }
.save-bar .sum div { display: grid; font-size: 12px; color: var(--muted); }
.save-bar .sum b { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.save-bar .sum .big b { font-size: 20px; color: var(--accent); }
.save-bar .kbd-hint { color: var(--muted); font-size: 12px; }

/* modal, palette, toast */
.modal, .palette { position: fixed; inset: 0; background: var(--overlay); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .12s; }
.palette { place-items: start center; padding-top: 12vh; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.99); } }
.modal-card { background: var(--panel); border-radius: 16px; width: min(780px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .15s; }
.modal-card.sm { width: min(440px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.modal-head h2 { margin: 0; font-size: 17px; flex: 1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.modal-body { padding: 20px 22px; }
.modal-body > p:first-child { margin-top: 0; }
/* customise dashboard rows */
.dash-pick { display: grid; gap: 6px; }
.dash-row { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.dash-row label { flex: 1; display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; min-width: 0; }
.modal-foot .spacer { flex: 1; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--panel-2); position: sticky; bottom: 0; }
.confirm { display: flex; gap: 14px; padding: 22px; }
.confirm h2 { margin: 2px 0 6px; font-size: 17px; }
.confirm p { margin: 0; }
.confirm-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--info-soft); color: var(--info); flex-shrink: 0; }
.confirm-icon.danger { background: var(--danger-soft); color: var(--danger); }

.palette-card { width: min(620px, 100%); background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .15s; border: 1px solid var(--line); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { border: 0; box-shadow: none !important; padding: 4px 0; font-size: 16px; background: none; }
.palette-list { max-height: 420px; overflow: auto; padding: 6px; }
.palette-list .pg { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 10px 4px; }
.palette-list a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink); }
.palette-list a .ico { color: var(--muted); }
.palette-list a small { margin-inline-start: auto; color: var(--muted); }
.palette-list a.sel { background: var(--accent-soft); }
/* assistant bubble + docked panel (pushes the page on wide screens) */
.bot-fab { position: fixed; inset-inline-end: 22px; bottom: 40px; z-index: 45; width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--mark-a), var(--mark-b));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--mark-a) 45%, transparent); transition: transform .15s; }
.bot-fab:hover { transform: scale(1.07); }
body.bot-open .bot-fab { display: none; }
.bot-panel { position: fixed; top: 0; inset-inline-end: 0; bottom: 0; z-index: 45; width: min(400px, 100vw); display: flex; flex-direction: column;
  background: var(--panel); border-inline-start: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: bot-in .18s var(--ease); }
@keyframes bot-in { from { transform: translateX(40px); opacity: 0; } }
@media (min-width: 1200px) { body.bot-open .main { margin-inline-end: 400px; } }
.bot-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.bot-head > div { display: grid; flex: 1; line-height: 1.25; }
.bot-head small { color: var(--muted); font-size: 12px; }
.bot-ava { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--mark-a), var(--mark-b)); }
.bot-chat { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bot-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.bot-form input { flex: 1; }
@media print { .bot-fab, .bot-panel { display: none !important; } }
.bot-hint { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.bot-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bot-chips button { border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink-2); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; cursor: pointer; }
.bot-chips button:hover { border-color: var(--accent); color: var(--accent); }
.msg { max-width: 92%; border-radius: 12px; padding: 8px 12px; font-size: 13.5px; }
.msg p { margin: 0; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; display: grid; gap: 8px; width: 92%; }
.msg.bot.pending { width: auto; }
.msg.bot .bot-chips { margin-top: 2px; }
.bot-asked { font-size: 12px; margin: 0 0 4px; font-style: italic; }
.bot-items { display: grid; gap: 2px; }
.bot-items > a, .bot-items > div { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; color: var(--ink); background: var(--panel); }
.bot-items > a:hover { background: var(--accent-soft); }
.bi-t { display: grid; min-width: 0; flex: 1; }
.bi-t small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bi-r { display: grid; justify-items: end; gap: 3px; flex-shrink: 0; }
.bi-v { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.bot-items .badge { background: var(--neutral-soft); color: var(--muted); }
.bot-items .badge.warn { background: var(--warn-soft); color: var(--warn); }
.bot-actions { display: flex; flex-wrap: wrap; gap: 6px; }
/* question history */
.hist { display: grid; gap: 2px; max-height: 52vh; overflow: auto; }
.hist-day { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 6px 0 2px; }
.hist-q { all: unset; box-sizing: border-box; display: flex; align-items: baseline; gap: 8px; padding: 5px 8px; border-radius: 8px; cursor: pointer; background: var(--panel); font-size: 13px; }
.hist-q:hover { background: var(--accent-soft); }
.hist-q span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-q small { color: var(--muted); font-size: 11px; }
.hist-q.miss span { color: var(--muted); font-style: italic; }
.palette-list a.sel .ico { color: var(--accent); }
.palette-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; background: var(--panel-2); }

.toast { position: fixed; bottom: 24px; inset-inline-end: 24px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-inline-start: 4px solid var(--ok);
  padding: 12px 12px 12px 14px; border-radius: 10px; z-index: 60; max-width: 440px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; animation: pop .18s; }
.toast > .ico { color: var(--ok); margin-top: 1px; }
.toast span { flex: 1; font-weight: 500; }
.toast.error { border-inline-start-color: var(--danger); }
.toast.error > .ico { color: var(--danger); }
.toast-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 2px; }

/* reports index, calendar, misc */
.report-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.report-list .card { padding: 16px; }
.report-list .card h3 { margin-bottom: 8px; }
.report-list .card h3 .ico { color: var(--accent); }
.report-list a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; margin: 0 -10px; border-radius: 6px; color: var(--ink-2); }
.report-list a:hover { background: var(--accent-softer); color: var(--accent); }
.report-list a .ico { opacity: 0; transition: opacity .12s; }
.report-list a:hover .ico { opacity: 1; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal .dow { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.cal .day { display: grid; align-content: space-between; min-height: 92px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); position: relative; overflow: hidden; }
.cal .day::before { content: ""; position: absolute; inset: 0; background: var(--accent); opacity: var(--heat, 0); pointer-events: none; }
.cal .day > * { position: relative; }
.cal .day:hover { border-color: var(--accent); color: var(--ink); }
.cal .day.today { border: 2px solid var(--accent); }
.cal .day.today .d { color: var(--accent); }
.cal .d { font-weight: 700; }
.cal .v { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cal .v b { display: block; font-size: 13px; color: var(--ink); }

/* attachments */
.file-list { display: grid; gap: 8px; }
.file-list:not(:empty) { margin-bottom: 12px; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.file-row > .ico { color: var(--accent); }
.file-row .fn { flex: 1; min-width: 0; display: grid; }
.file-row .fn a, .file-row .fn > span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .fn small { color: var(--muted); font-size: 12px; }
.file-row .actions { flex-shrink: 0; gap: 2px; }
.dropzone { position: relative; display: grid; justify-items: center; gap: 4px; padding: 22px 16px; border: 2px dashed var(--line-2); border-radius: var(--radius); color: var(--muted);
  text-align: center; cursor: pointer; transition: border-color .12s, background .12s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-softer); color: var(--ink-2); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone b { color: var(--ink); }
.dropzone u { color: var(--accent); text-decoration: none; font-weight: 600; }
.dropzone small { font-size: 12px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone .ico { color: var(--accent); }
.dropzone.compact { grid-auto-flow: column; justify-content: center; align-items: center; gap: 10px; padding: 14px 16px; }

.alloc-sum { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }

/* responsive */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search-btn { min-width: 0; } .search-btn span, .search-btn kbd { display: none; }
}
@media (max-width: 1000px) {
  :root { --gutter: 18px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar { position: fixed; z-index: 40; inset-inline-start: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .shell.side-hidden .sidebar, .shell.side-float .sidebar { margin-inline-start: 0; visibility: visible; }
  .shell.side-float .sidebar:not(.open) { transform: translateX(-100%); box-shadow: none; }
  .shell.side-float .sidebar.open { transform: none; }
  .side-pin, .shell.side-float .side-edge { display: none; }
  .sidebar.open { transform: none; }
  .sidebar.open + .backdrop { display: block; position: fixed; inset: 0; background: var(--overlay); z-index: 35; }
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-scene { min-height: 280px; }
  .splash { inset-block-end: auto; height: 100%; } .splash.shrink { width: 100%; height: 280px; }
  .ls-copy { top: 20px; inset-inline: 16px; max-width: none; }
  .ls-copy h2 { font-size: 24px; } .ls-copy p { margin-top: 6px; font-size: 13px; }
  .ls-city { bottom: 62px; height: 90px; }
  .ls-road { height: 62px; } .ls-poles { top: -30px; height: 30px; } .ls-lane { top: 30px; height: 3px; }
  .ls-truck { left: 16px; bottom: 6px; width: 165px; height: 55px; } .ls-van { bottom: 36px; width: 48px; height: 24px; }
  .ls-doc { top: auto; bottom: 76px; inset-inline-end: auto; right: 16px; width: 136px; padding: 9px 10px; }
  .ls-doc h4 { font-size: 9px; } .ls-way { margin-top: 5px; font-size: 10px; } .ls-track { margin: 6px 0 2px; }
  .ls-stamp { inset-inline-end: -6px; bottom: -12px; padding: 2px 6px; font-size: 9px; }
  .user-btn .uname { display: none; }
  .user-btn { padding: 4px; }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .g4, .g5 { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .quick-tile { padding: 12px; } .quick-tile small { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: auto; }
  .topbar { gap: 6px; }
  .crumbs span.grp, .crumbs .sep { display: none; }
  #newBtn .lbl { display: none; }
  .filters label { min-width: 0; flex: 1 1 140px; }
  .page-head h1 { font-size: 20px; }
  .kpi .value { font-size: 22px; }
  .cal { gap: 4px; } .cal .day { min-height: 60px; padding: 6px; } .cal .v { display: none; }
  .toast { inset-inline-start: 16px; inset-inline-end: 16px; bottom: 16px; }
  .save-bar { bottom: 8px; padding: 10px 12px; gap: 10px; }
  .save-bar .sum div:not(.big), .save-bar .kbd-hint, .save-bar .btn.ghost { display: none; }
  .save-bar .sum .big b { font-size: 17px; }
  .save-bar .btn.lg { padding: 9px 14px; font-size: 14px; }
}

@page { size: A4 portrait; margin: 12mm; }
@media print {
  .sidebar, .topbar, .no-print, .filters, .save-bar, .progress, .backdrop, .toast, .table-meta, .site-bar { display: none !important; }
  .shell { display: block; min-height: 0; }
  .view { padding: 0; max-width: none; } .table-wrap { max-height: none; overflow: visible; border: 0; }
  body { background: #fff; color: #111; font-size: 10.5px; }
  .page-head { margin-bottom: 10px; } .page-head h1 { font-size: 17px; }
  table { font-size: 10px; }
  th, td { padding: 4px 6px; white-space: normal; }
  th { position: static; }
  thead { display: table-header-group; }   /* repeat headers on each printed page */
  tfoot td { position: static; }
  tr { break-inside: avoid; }
  tbody tr:hover td { background: none; }
}
select.needs, .combo-input.needs { border-color: var(--warn) !important; box-shadow: 0 0 0 3px var(--warn-soft); }

/* combo.js */
.combo { position: relative; width: 100%; min-width: 0; }
.combo-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.combo-input { padding-inline-end: 30px; text-overflow: ellipsis; }
.combo::after { content: ""; position: absolute; inset-inline-end: 12px; top: 50%; width: 7px; height: 7px; margin-top: -6px; pointer-events: none;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.combo-list { position: fixed; z-index: 70; max-height: 280px; overflow-y: auto; padding: 4px; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 14px; }
.combo-opt { padding: 7px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-opt.active { background: var(--accent-soft); }
.combo-opt.selected { font-weight: 600; }
.combo-opt.blank { color: var(--muted); }
.combo-group { padding: 8px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.combo-empty { padding: 8px 10px; color: var(--muted); }

/* datepick.js */
.dp { position: relative; display: block; width: 100%; min-width: 0; }
.dp-input { padding-inline-end: 36px !important; }
.dp-input::-webkit-calendar-picker-indicator { display: none; }
.dp-btn { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.dp-btn:hover { color: var(--accent); background: var(--accent-softer, var(--accent-soft)); }
.dp-input:disabled + .dp-btn { display: none; }
.dp-pop { position: fixed; z-index: 75; width: 280px; padding: 10px; background: var(--panel); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 13px; user-select: none;
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top left; transition: opacity .16s ease, transform .18s cubic-bezier(.22, .8, .24, 1); }
.dp-pop.up { transform-origin: bottom left; transform: translateY(6px) scale(.98); }
.dp-pop.in { opacity: 1; transform: none; }
.dp-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.dp-title { flex: 1; display: flex; justify-content: center; gap: 4px; }
.dp-title select { width: auto; min-width: 0; padding: 4px 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink);
  font: inherit; font-weight: 700; cursor: pointer; appearance: none; -webkit-appearance: none; text-align: center; }
.dp-title select:hover, .dp-title select:focus { border-color: var(--line-2); background: var(--panel-2); outline: none; }
.dp-nav { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.dp-nav:hover { background: var(--accent-soft); color: var(--accent); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0 6px; text-transform: uppercase; letter-spacing: .03em; }
.dp-day { height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-variant-numeric: tabular-nums;
  cursor: pointer; position: relative; transition: background .12s, color .12s; }
.dp-day:hover { background: var(--accent-soft); color: var(--accent); }
.dp-day.out { color: var(--muted); opacity: .55; }
.dp-day.today { color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--accent); }
.dp-day.focus { background: var(--accent-soft); }
.dp-day.sel, .dp-day.sel:hover { background: var(--accent); color: var(--accent-ink, #fff); font-weight: 700; box-shadow: none; opacity: 1; }
.dp-day.off { opacity: .3; cursor: not-allowed; pointer-events: none; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.dp-link { border: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.dp-link:hover { background: var(--accent-soft); }
@media (prefers-reduced-motion: reduce) { .dp-pop { transition: none; } }
@media print { .dp-btn { display: none; } }

/* payroll */
.b-approved { background: var(--info-soft); color: var(--info); }
.b-paid, .b-closed, .b-active { background: var(--ok-soft); color: var(--ok); }
.b-exited { background: var(--neutral-soft); color: var(--muted); }
.kpi-lite { display: grid; gap: 2px; padding: 14px 16px; margin: 0; }
.kpi-lite.kpi-go { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.kpi-lite.kpi-go:hover, .kpi-lite.kpi-go:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.kpi-lite small { color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi-lite b { font-size: 18px; font-variant-numeric: tabular-nums; }
.kpi-lite .muted { font-size: 12px; }
table.payroll th small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
table.payroll td { vertical-align: top; }
table.payroll td.num input { width: 84px; text-align: end; }
table.payroll td.num input.note { display: block; margin-top: 4px; text-align: start; font-size: 12px; padding: 4px 6px; }
table.payroll td.num small { display: block; margin-top: 2px; font-size: 11px; }
table.payroll tfoot td { font-weight: 700; }

/* collections */
.warn-text { color: var(--warn); }
.timeline { display: grid; gap: 12px; max-height: 420px; overflow-y: auto; }
.tl-item { display: grid; grid-template-columns: 12px 1fr; gap: 10px; font-size: 13.5px; }
.tl-item small { font-size: 12px; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--muted); }
.tl-dot.k-call { background: var(--info); } .tl-dot.k-whatsapp { background: var(--ok); } .tl-dot.k-email { background: #8b5cf6; }
.tl-dot.k-visit { background: var(--accent); } .tl-dot.k-letter { background: var(--warn); }
.modal-card.lg { width: min(900px, 100%); }

.clip { display: inline-block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }

.form-grid input[readonly] { background: var(--bg, #f4f6f8); color: var(--muted, #6b7280); cursor: not-allowed; }

/* smart audit */
.dc-scan { display: flex; gap: 8px; align-items: flex-start; margin: -4px 0 16px; font-size: 13px; color: var(--muted); } .dc-scan .ico, .dc-scan svg { color: var(--accent); flex: none; margin-top: 2px; } .dc-scan b { color: var(--ink); }
.callout.danger { background: var(--danger-soft); } .callout.danger .ico { color: var(--danger); }
.callout.dc-clear { background: var(--ok-soft); } .callout.dc-clear .ico { color: var(--ok); }
.dc-kpi b { font-size: 26px; }
.dc-kpi.dc-err b { color: var(--danger); } .dc-kpi.dc-warn b { color: var(--warn); } .dc-kpi.dc-okk b { color: var(--ok); }
.dc-check { padding: 0; margin-bottom: 10px; overflow: hidden; border-inline-start: 3px solid var(--line); }
.dc-check.dc-err { border-inline-start-color: var(--danger); } .dc-check.dc-warn { border-inline-start-color: var(--warn); }
.dc-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; background: none; border: 0; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.dc-head:hover { background: var(--panel-2); }
.dc-head > svg:last-child { transition: transform .2s; color: var(--muted); flex: none; }
.dc-head[aria-expanded="false"] > svg:last-child { transform: rotate(-90deg); }
.dc-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none; }
.dc-err .dc-ico { background: var(--danger-soft); color: var(--danger); } .dc-warn .dc-ico { background: var(--warn-soft); color: var(--warn); }
.dc-title { display: grid; gap: 2px; flex: 1; min-width: 0; }
.dc-title small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-items { padding: 0 14px 12px; }
.dc-passed { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 14px 16px; }
.dc-passed span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; }
.dc-passed svg { color: var(--ok); }
.dc-act { display: grid; gap: 8px; } .dc-act div { display: grid; gap: 1px; }
.dc-cancel { display: flex; gap: 8px; align-items: center; padding: 4px 0; font-size: 13px; } .dc-cancel svg { color: var(--warn); flex: none; }
@media (max-width: 640px) { .dc-title small { white-space: normal; } }
.dc-items td:first-child, .dc-items td:nth-child(2) { white-space: nowrap; }
.dc-runbar { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin: -6px 0 12px; font-size: 13px; }
.dc-run { max-width: 100%; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); color: var(--ink); font: inherit; }
.dc-runbar .dc-run { width: auto; flex: none; max-width: 340px; }
.dc-runbar > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* PDCs */
.badge.pdc-in_hand, .badge.pdc-issued { background: var(--info-soft); color: var(--info); }
.badge.pdc-deposited { background: var(--warn-soft); color: var(--warn); }
.badge.pdc-cleared, .badge.pdc-settled { background: var(--ok-soft); color: var(--ok); }
.badge.pdc-bounced { background: var(--danger-soft); color: var(--danger); }
.badge.pdc-replaced, .badge.pdc-returned, .badge.pdc-cancelled { background: var(--neutral-soft); color: var(--muted); }
.pdc-k-warn b { color: var(--warn); } .pdc-k-bad b { color: var(--danger); }
.pdc-tabs { margin-bottom: 12px; } .pdc-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.pdc-sub { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 14px; }
.pdc-sub .hint { font-weight: 400; }
.pdc-dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.pdc-dl dt { color: var(--muted); } .pdc-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pdc-imgs { display: flex; flex-wrap: wrap; gap: 10px; }
.pdc-img { width: 168px; height: 92px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; display: grid; place-items: center;
  background: var(--panel-2); color: var(--muted); font-size: 12px; text-align: center; padding: 4px; text-decoration: none; }
.pdc-img img { width: 100%; height: 100%; object-fit: cover; }
.pdc-img:hover { border-color: var(--accent); }
.pdc-tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pdc-tl li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; position: relative; }
.pdc-tl li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 12px; top: 26px; bottom: -12px; width: 2px; background: var(--line); }
.pdc-tl .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.pdc-tl .ev-bounced .dot, .pdc-tl .ev-cancelled .dot { background: var(--danger-soft); color: var(--danger); }
.pdc-tl .ev-cleared .dot, .pdc-tl .ev-settled .dot { background: var(--ok-soft); color: var(--ok); }
.pdc-tl small { display: block; margin-top: 2px; }
@media (max-width: 640px) { .pdc-dl { grid-template-columns: 1fr; gap: 2px; } .pdc-dl dd { margin-bottom: 8px; } }

/* forced password change */
.pw-rules { list-style: none; margin: -4px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 6px; } .pw-rules li svg { opacity: .35; }
.pw-rules li.ok { color: var(--ok); } .pw-rules li.ok svg { opacity: 1; }

/* roles */
.role-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.role-chip { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; background: var(--accent-softer); color: var(--accent); border: 1px solid var(--accent-soft); }
.role-chip.limit { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.role-perm { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.role-perm:hover { border-color: var(--accent); }
.role-perm:has(input:checked) { background: var(--accent-softer); border-color: var(--accent-soft); }
.role-perm input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.role-perm span { display: grid; gap: 2px; } .role-perm small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.role-perm.limit:has(input:checked) { background: var(--warn-soft); border-color: transparent; }
.role-perm:has(input:disabled) { cursor: default; opacity: .85; }

.perm-bar { display: flex; align-items: center; gap: 8px; margin: 16px 0 10px; flex-wrap: wrap; }
.perm-mods { display: grid; gap: 10px; }
.perm-mod { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.perm-mod.on { border-color: var(--accent-soft); }
.perm-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.perm-all { display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 1; font-size: 15px; }
.perm-all input { width: 17px; height: 17px; accent-color: var(--accent); }
.perm-count { font-size: 12px; color: var(--muted); }
.perm-mod.on .perm-count { color: var(--accent); font-weight: 600; }
.perm-tog svg { transition: transform .2s; } .perm-mod.folded .perm-tog svg { transform: rotate(-90deg); }
.perm-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 12px 12px; }
.perm-mod.folded .perm-feats { display: none; }
@media (max-width: 900px) { .perm-feats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .perm-feats { grid-template-columns: 1fr; } }
.modal-card.xl { width: min(1120px, 100%); }

/* go-live */
.gl-card { padding-bottom: 6px; }
.gl-table td { vertical-align: middle; }
.gl-label { width: 28%; }
.gl-input { width: 38%; } .gl-input input { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.gl-input input.gl-changed { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.gl-status { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.gl-pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.gl-bad { background: var(--danger-soft); color: var(--danger); } .gl-warn { background: var(--warn-soft); color: var(--warn); }
.gl-ok { background: var(--ok-soft); color: var(--ok); } .gl-review { background: var(--info-soft); color: var(--info); }
.gl-empty { background: var(--neutral-soft); color: var(--muted); }
@media (max-width: 720px) { .gl-table tr { display: grid; gap: 4px; padding: 8px 0; } .gl-label, .gl-input { width: auto; } }

/* email */
.mail-att { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); }
.mail-file { padding: 3px 10px; border-radius: 999px; background: var(--neutral-soft); color: var(--ink); font-size: 13px; }
.mail-extra { margin: 0; font-size: 13px; }
.mail-from { margin: 8px 0 0; font-size: 12.5px; }
.mail-presets { margin-bottom: 12px; flex-wrap: wrap; }

/* e-invoicing */
.pill.info { background: var(--info-soft); color: var(--info); }
.ei-fix { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.ei-fix ul, .ei-list { margin: 6px 0 10px; padding-inline-start: 18px; }
.ei-fix li, .ei-list li { margin: 2px 0; }
.ei-fix p { font-size: 13px; }
.ei-card h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ei-card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ei-flags { margin: 10px 0 4px; }
.ei-flags summary { cursor: pointer; font-weight: 600; }
.ei-flag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 16px; margin-top: 8px; }
.ei-tl { margin-top: 14px; }
.ei-meta { margin-bottom: 12px; gap: 12px; }
.ei-meta > div { display: grid; gap: 2px; }
.ei-tot { text-align: end; margin: 8px 0 14px; }

/* payables */
.bill-lines td { vertical-align: middle; }
.bill-lines input, .bill-lines select { width: 100%; }
.bill-lines td.num input { text-align: end; max-width: 110px; }
.bill-lines .bl-pick { min-width: 320px; }
.bill-tot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 18px; margin-top: 12px; }
.cost-pick { display: grid; gap: 2px; max-height: 52vh; overflow: auto; }
.cost-pick label { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: var(--radius-sm); }
.cost-pick label:hover { background: var(--panel-2); }
.pay-h { margin: 18px 0 8px; }
.pay-bills { display: grid; gap: 4px; }
.pay-row { display: grid; grid-template-columns: auto 1fr auto 130px; gap: 10px; align-items: center; padding: 6px 8px; border-radius: var(--radius-sm); }
.pay-row:hover { background: var(--panel-2); }
.pay-row input[type=number] { text-align: end; }
@media (max-width: 640px) { .pay-row { grid-template-columns: auto 1fr; } .bill-lines .bl-pick { min-width: 220px; } }

/* bank rec */
.pos { color: var(--ok); }
.rec-top { margin-bottom: 16px; }
.rec-sum table { width: 100%; border-collapse: collapse; }
.rec-sum td { padding: 5px 0; border-bottom: 1px solid var(--line); }
.rec-sum td.num { text-align: end; white-space: nowrap; padding-inline-start: 12px; }
.rec-sum .rec-line td { border-top: 2px solid var(--line-2); }
.rec-sum .rec-diff.ok td { color: var(--ok); } .rec-sum .rec-diff.bad td { color: var(--danger); }
.rec-counts .grid { margin-bottom: 8px; }
.rec-panes .card h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg.sm button { padding: 3px 10px; font-size: 12.5px; }
.rec-list { max-height: 62vh; overflow: auto; }
.rec-row { display: grid; grid-template-columns: 22px 1fr auto auto; gap: 10px; align-items: start; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.rec-row:hover { background: var(--panel-2); }
.rec-row.st-matched { opacity: .8; } .rec-row.st-ignored { opacity: .6; }
.rec-row .num { white-space: nowrap; } .rec-acts { display: flex; gap: 4px; }
.rec-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-top: 12px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
@media (max-width: 640px) { .rec-row { grid-template-columns: 22px 1fr auto; } .rec-acts { grid-column: 2 / -1; } }

/* FTA */
.fta-top { margin-bottom: 16px; }
.fta-btns { display: flex; gap: 8px; }
.fta-group h4 { margin: 14px 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.fta-item { display: grid; grid-template-columns: 78px 1fr auto; gap: 12px; align-items: start; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.fta-item .pill { justify-content: center; }
table.hist { border-collapse: collapse; margin-top: 4px; font-size: 13px; }
table.hist td { padding: 2px 8px 2px 0; vertical-align: top; }
table.hist td:first-child { color: var(--muted); }
.hist-sum { font-size: 12.5px; margin-top: 2px; }
@media (max-width: 640px) { .fta-item { grid-template-columns: 1fr; } }
.fta-top > * { min-width: 0; }
@media (max-width: 640px) { .fta-top .form-grid { grid-template-columns: 1fr 1fr; } .fta-top .form-grid .span2 { grid-column: 1 / -1; } }
.fta-btns { margin-top: 12px; align-items: center; flex-wrap: wrap; }
.bill-lines td.num input { min-width: 96px; }

/* fleet & trips */
.fleet-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.veh-card { display: grid; gap: 8px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); color: var(--ink); border-top: 3px solid var(--line-2); transition: box-shadow .12s, transform .12s; }
.veh-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); color: var(--ink); }
.veh-card.on-trip { border-top-color: var(--info); } .veh-card.free { border-top-color: var(--ok); } .veh-card.maintenance { border-top-color: var(--hl); }
.veh-card .plate { font: 800 16px/1.1 var(--font); letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.veh-card .plate .ico { color: var(--accent); }
.veh-card small { color: var(--muted); }
.veh-card .papers { display: flex; flex-wrap: wrap; gap: 6px; }
.veh-card .badge, .papers .badge, td .badge.b-due, td .badge.b-expired, td .badge.b-in_transit { text-transform: none; }
.plate-tag { display: inline-block; font-weight: 700; letter-spacing: .02em; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--line-2);
  background: var(--panel-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.route { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.route .arrow { color: var(--hl); font-weight: 700; }
.trip-steps { display: flex; align-items: center; gap: 0; margin: 4px 0 16px; flex-wrap: wrap; }
.trip-step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 13px; }
.trip-step .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--neutral-soft); color: var(--muted); }
.trip-step.done .dot { background: var(--accent); color: var(--accent-ink); } .trip-step.done { color: var(--ink); }
.trip-step.now .dot { background: var(--hl); color: #fff; box-shadow: 0 0 0 4px var(--hl-soft); } .trip-step.now { color: var(--ink); }
.trip-step + .trip-step::before { content: ""; width: 34px; height: 2px; background: var(--line-2); margin: 0 8px; }
.trip-step.done + .trip-step::before { background: var(--accent); }
.money-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.money-strip > div { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); display: grid; gap: 2px; }
.money-strip small { color: var(--muted); font-size: 12px; font-weight: 600; }
.money-strip b { font-size: 18px; font-variant-numeric: tabular-nums; }
.money-strip .profit b { color: var(--ok); } .money-strip .loss b { color: var(--danger); }
.expiry-list { display: grid; gap: 6px; }
.expiry-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink); border: 1px solid var(--line); background: var(--panel); }
.expiry-list a:hover { border-color: var(--hl); }
.expiry-list .when { margin-inline-start: auto; font-size: 12px; font-weight: 700; white-space: nowrap; }
.expiry-list .when.expired { color: var(--danger); } .expiry-list .when.due { color: var(--hl-ink); }
.kpi.hl { border-color: color-mix(in srgb, var(--hl) 45%, var(--line)); background: linear-gradient(180deg, var(--hl-soft), transparent 70%), var(--panel); }
.trip-pick { max-height: 360px; overflow: auto; }
.trip-pick tr.picked td { background: var(--accent-softer); }

/* settings: plan features */
.plan-list { display: grid; gap: 2px; }
.plan-item { display: grid; grid-template-columns: 110px 1fr; gap: 2px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.plan-item:first-child { border-top: 0; }
.plan-item small { grid-column: 2; }
.plan-item:not(.on) b { color: var(--muted); }

/* 2fa setup */
.tf-steps { display: grid; gap: 12px; }
.tf-steps ol { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.tf-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.tf-row .field { flex: 1; min-width: 180px; margin: 0; }
.tf-qr { width: 220px; height: 220px; padding: 10px; background: #fff; border-radius: 12px; border: 1px solid var(--line); justify-self: start; }
.tf-qr svg { width: 100%; height: 100%; display: block; }
.tf-key { font-size: 13px; letter-spacing: .04em; word-break: break-all; }
.tf-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 360px; }
.tf-codes code { font-size: 16px; padding: 8px 10px; border-radius: 8px; background: var(--panel-2, #f4f6fa); border: 1px solid var(--line); text-align: center; letter-spacing: .06em; }
.callout.ok { background: var(--ok-soft); } .callout.ok svg { color: var(--ok); flex: none; }

/* getting started */
.setup-list { display: grid; }
.setup-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.setup-item:first-child { border-top: 0; }
.setup-item:hover { background: var(--panel-2); }
.setup-item .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; color: var(--muted); }
.setup-item.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.setup-item small { display: block; }
.setup-item.done b { color: var(--muted); }
.setup-item .go { color: var(--accent); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.setup-steps { margin: 0 0 12px; padding-inline-start: 20px; display: grid; gap: 14px; }
.setup-steps li > * { vertical-align: middle; }
.setup-banner { text-decoration: none; align-items: center; }
.setup-banner span { flex: 1; }
.setup-item .go svg, .setup-banner > svg:last-child { transform: rotate(-90deg); }
.plan-bar { display: flex; align-items: center; gap: 8px; padding: 8px 20px; font-size: 13.5px; font-weight: 600; background: var(--info-soft); color: var(--ink-2); }
.plan-bar.warn { background: var(--warn-soft); } .plan-bar.bad { background: var(--danger-soft); color: var(--danger, #b91c1c); }
.plan-sum { margin: 0 0 10px; }

/* statement import */
.stmt-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.stmt-form .chk { display: flex; align-items: center; gap: 8px; min-height: 38px; font-weight: 500; }
.stmt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.stmt-map { margin: 12px 0; } .stmt-map summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
.stmt-chips .badge { text-transform: none; }
.list-plain { display: grid; gap: 4px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.list-plain svg { vertical-align: -2px; }
/* rate card hint under freight */
.card-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.card-hint svg { vertical-align: -2px; color: var(--ok); }
.chk-inline { display: flex; align-items: center; gap: 6px; flex-direction: row; }
/* gps */
.fleet-map { height: 380px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; margin-bottom: 18px; z-index: 0; }
.fleet-map-list { height: auto; display: grid; gap: 6px; padding: 12px; background: var(--panel); }
.map-tip { font-weight: 700; font-size: 11px; padding: 1px 6px; }
.gps-line { display: block; margin-top: 4px; color: var(--muted); } .gps-line.moving { color: var(--ok); } .gps-line.stale { opacity: .7; }
.gps-line svg { vertical-align: -1px; }
.gps-box { margin: 12px 0; } .gps-code { display: inline-block; padding: 4px 8px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); word-break: break-all; }
/* GCC permit check */
.gcc-check { grid-column: span 2; font-size: 12.5px; line-height: 1.7; align-self: end; } .gcc-check .ok { color: var(--ok); }
.gcc-check svg { vertical-align: -2px; }
/* job card parts */
table.parts { width: 100%; border-collapse: collapse; margin-bottom: 10px; } table.parts th { text-align: start; font-size: 12px; color: var(--muted); padding: 6px; }
table.parts td { padding: 4px 6px; } table.parts input { width: 100%; } table.parts .r { text-align: end; } table.parts td.amt { white-space: nowrap; }
.span-4 { grid-column: 1 / -1; } .span-2 { grid-column: span 2; } label.chk { flex-direction: row; align-items: center; gap: 8px; display: flex; }

/* rtl. layout uses start/end so it mirrors itself; this is just what logical props can't do + the arabic font */
.lang-links { text-align: center; margin: 14px 0 0; font-size: 13px; }
:root[lang="ar"] body, :root[lang="ar"] button, :root[lang="ar"] input, :root[lang="ar"] select, :root[lang="ar"] textarea {
  font-family: "Noto Sans Arabic", var(--font); }
:root[lang="ar"] * { letter-spacing: 0 !important; }  /* spacing breaks arabic joins */
a[lang="ar"] { font-family: "Noto Sans Arabic", system-ui, "Segoe UI", Tahoma, sans-serif; }
a[lang="en"] { font-family: var(--font); }
[dir="rtl"] .links a { border-radius: 6px 0 0 6px; }
[dir="rtl"] .crumbs .sep svg, [dir="rtl"] .nav-head > svg:last-child { transform: scaleX(-1); }
[dir="rtl"] .dp-pop { transform-origin: top right; } [dir="rtl"] .dp-pop.up { transform-origin: bottom right; }
@keyframes bot-in-rtl { from { transform: translateX(-40px); opacity: 0; } }
[dir="rtl"] .bot-panel { animation-name: bot-in-rtl; }
@media (max-width: 1000px) {
  [dir="rtl"] .sidebar, [dir="rtl"] .shell.side-float .sidebar:not(.open) { transform: translateX(100%); }
  [dir="rtl"] .sidebar.open { transform: none; }
}
/* typed numbers / codes keep their order */
[dir="rtl"] input[type="number"], [dir="rtl"] input[type="email"], [dir="rtl"] input[type="tel"], [dir="rtl"] input[type="password"] { direction: ltr; text-align: right; }

/* help.js */
.help { max-width: 860px; display: grid; gap: 14px; }
.help .card { margin: 0; }
.help ol, .help ul { margin: 0; padding-inline-start: 22px; display: grid; gap: 7px; line-height: 1.5; }
.help b { font-weight: 650; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.help-grid a { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); }
.help-grid a:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.help-grid small { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.help-related { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
[dir="rtl"] .help { direction: ltr; text-align: left; }  /* guide is english */

/* tabbed settings = numbered steps */
.tabs-bar { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: -4px 0 18px; }
.tabs-bar a { padding: 9px 14px; color: var(--muted); font-weight: 600; font-size: 13.5px; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0; white-space: nowrap; }
.tabs-bar a:hover { color: var(--ink); background: var(--panel-2); }
.tabs-bar a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs-bar.steps a { display: inline-flex; align-items: center; gap: 8px; }
.tabs-bar.steps a i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--neutral-soft); color: var(--muted); }
.tabs-bar.steps a.on i { background: var(--accent); color: var(--accent-ink); }
.tabs-bar.steps a.done i { background: var(--accent-soft); color: var(--accent); }
.set-pane[hidden] { display: none; }
.save-bar #setNext .ico { margin-inline-start: 4px; margin-inline-end: -4px; }

/* smart audit score, charts, live run */
.dc-over { display: grid; grid-template-columns: minmax(360px, 1.15fr) 1.3fr 1.3fr; gap: 16px; margin-bottom: 16px; }
.dc-over > .card { margin: 0; }  /* no top margin side by side */
@media (max-width: 1180px) { .dc-over { grid-template-columns: 1fr 1fr; } .dc-over .dc-score { grid-column: 1 / -1; } }
@media (max-width: 720px) { .dc-over { grid-template-columns: 1fr; } }
.section-k { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dc-score { display: flex; gap: 18px; align-items: center; }
.dc-score-txt p { margin: 6px 0 6px; font-size: 14px; } .dc-score-txt small { display: block; line-height: 1.4; }
.dc-w { color: var(--warn); }
.dc-ring { position: relative; min-width: var(--size); flex: none; display: grid; justify-items: center; gap: 6px; }
.dc-ring svg { transform: rotate(-90deg); display: block; }
.dc-ring circle { fill: none; stroke-width: 10; }
.dc-ring .trk { stroke: var(--neutral-soft); }
.dc-ring .val { stroke: var(--ok); stroke-linecap: round; animation: dc-fill 1.2s cubic-bezier(.22, .8, .24, 1) backwards; }
.dc-ring.warn .val { stroke: var(--warn); } .dc-ring.bad .val { stroke: var(--danger); }
@keyframes dc-fill { from { stroke-dashoffset: var(--len); } }
.dc-ring-in { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: var(--size); height: var(--size); display: grid; place-content: center; text-align: center; line-height: 1; }
.dc-ring-in b { font-size: calc(var(--size) * .3); font-weight: 750; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.dc-ring-in small { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.dc-ring-word { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--ok-soft); color: var(--ok); }
.dc-ring.warn .dc-ring-word { background: var(--warn-soft); color: var(--warn); } .dc-ring.bad .dc-ring-word { background: var(--danger-soft); color: var(--danger); }
.dc-chart { display: grid; gap: 8px; align-content: start; min-width: 0; }
.dc-ch-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dc-canvas { position: relative; min-width: 0; }
.dc-empty { display: grid; justify-items: center; gap: 6px; padding: 26px 10px; color: var(--muted); text-align: center; } .dc-empty .ico, .dc-empty svg { color: var(--ok); }
.dc-table summary { cursor: pointer; font-size: 12px; color: var(--muted); } .dc-table table { margin-top: 6px; font-size: 12.5px; }
/* run */
.dc-runner { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: var(--overlay); opacity: 0; transition: opacity .2s; }
.dc-runner.on { opacity: 1; }
.dc-runner-card { width: min(640px, 100%); max-height: min(86vh, 760px); display: grid; grid-template-rows: auto auto auto 1fr; gap: 14px; padding: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow-lg); transform: translateY(10px) scale(.98); transition: transform .3s cubic-bezier(.22, .8, .24, 1); }
.dc-runner.on .dc-runner-card { transform: none; }
.dc-runner-top { display: flex; align-items: center; gap: 16px; } .dc-runner-top h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; } .dc-runner-top p { margin: 3px 0 0; font-size: 13px; }
.dc-runner-top > div:nth-child(2) { flex: 1; min-width: 0; } .dc-runner-top #dcrNow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-runner-pct { font-variant-numeric: tabular-nums; } .dc-runner-pct b { font-size: 30px; font-weight: 750; letter-spacing: -.03em; } .dc-runner-pct small { color: var(--muted); font-weight: 600; }
.dc-radar { position: relative; width: 58px; height: 58px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--accent); background: var(--accent-softer); border: 1px solid var(--accent-soft); overflow: hidden; }
.dc-radar i { position: absolute; inset: 0; background: conic-gradient(from 0deg, transparent 0 290deg, color-mix(in srgb, var(--accent) 45%, transparent) 360deg); animation: dc-sweep 1.4s linear infinite; }
.dc-radar span { position: relative; display: grid; }
@keyframes dc-sweep { to { transform: rotate(360deg); } }
.dc-runner-bar { height: 6px; border-radius: 99px; background: var(--neutral-soft); overflow: hidden; } .dc-runner-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--accent); transition: width .25s ease-out; }
.dc-runner.finished .dc-runner-bar i { background: var(--ok); }
.dc-runner-scan { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.dc-runner-scan div { display: grid; gap: 1px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); min-width: 0; }
.dc-runner-scan b { font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; } .dc-runner-scan small { color: var(--muted); font-size: 11px; }
.dc-runner-list { list-style: none; margin: 0; padding: 4px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 120px; }
.dc-runner-list li { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 6px; font-size: 13px; color: var(--muted); }
.dc-runner-list .tt { display: grid; min-width: 0; } .dc-runner-list .tt small { font-size: 11px; opacity: .8; } .dc-runner-list .rs { font-size: 12px; font-weight: 650; white-space: nowrap; }
.dc-runner-list .st { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); }
.dc-runner-list li.now { background: var(--accent-softer); color: var(--ink); } .dc-runner-list li.now .st { border-color: var(--accent); border-top-color: transparent; animation: spin .7s linear infinite; }
.dc-runner-list li.seen { color: var(--ink-2); } .dc-runner-list li.seen .st { border-color: var(--accent-soft); background: var(--accent-soft); }
.dc-runner-list li.ok, .dc-runner-list li.warn, .dc-runner-list li.err, .dc-runner-list li.done { color: var(--ink); animation: dc-pop .3s ease-out; }
.dc-runner-list li.ok .st { border: 0; background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.dc-runner-list li.ok .rs { color: var(--ok); }
.dc-runner-list li.warn .st { border: 0; background: var(--warn); } .dc-runner-list li.warn .rs { color: var(--warn); }
.dc-runner-list li.err .st { border: 0; background: var(--danger); } .dc-runner-list li.err .rs { color: var(--danger); }
@keyframes dc-pop { from { transform: translateX(-4px); opacity: .4; } }
@media (max-width: 560px) { .dc-runner-scan { grid-template-columns: repeat(3, 1fr); } .dc-runner-scan div:nth-child(n+4) { display: none; } .dc-runner-top { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { .dc-radar i, .dc-ring .val, .dc-runner-list li { animation: none !important; } }
:root[dir=rtl] .dc-ring svg { transform: rotate(-90deg) scaleY(-1); }

/* (!) help tooltip - hover, tap or focus */
.page-head .head-row { display: flex; align-items: center; gap: 8px; }
.head-help { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--muted); color: var(--muted); font: 700 11px/1 system-ui, sans-serif; cursor: help; user-select: none; vertical-align: middle; }
.head-help:hover, .head-help:focus { border-color: var(--accent); color: var(--accent); outline: none; }
.head-tip { position: absolute; top: calc(100% + 8px); inset-inline-start: -8px; z-index: 50; width: max-content; max-width: min(340px, 80vw);
  padding: 8px 11px; border-radius: 8px; background: var(--ink); color: var(--panel); font: 400 12.5px/1.45 var(--font, system-ui), sans-serif;
  letter-spacing: 0; text-align: start; text-transform: none; white-space: normal; box-shadow: var(--shadow); display: none; }
/* display:none, not just invisible - otherwise phones scroll sideways */
.head-help:hover .head-tip, .head-help:focus .head-tip, .head-help:focus-within .head-tip { display: block; }
@media (max-width: 600px) { .head-tip { position: fixed; top: auto; left: 16px; right: 16px; width: auto; max-width: none; margin-top: 26px; } }

/* smaller (!) on cards / fields */
h3 .head-help, label .head-help, .field .head-help { width: 16px; height: 16px; font-size: 10px; margin-inline-start: 4px; }

/* replaces the old grey subtitle */
.help-line { display: inline-flex; vertical-align: middle; margin: 2px 0; }

/* settings → custom fields */
.cf-kind h4 { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; font-size: 14px; }
.cf-table { width: 100%; border-collapse: collapse; }
.cf-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 4px 6px; }
.cf-table td { padding: 3px 6px; vertical-align: middle; }
.cf-table td.c { text-align: center; }
.cf-table input:not([type=checkbox]), .cf-table select { width: 100%; min-width: 90px; }

/* custom report builder */
.rb-grid { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .rb-grid { grid-template-columns: 1fr; } }
.rb-form h4 { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.rb-cols { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.rb-cols .checkbox { font-size: 13px; }
.rb-filter { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 6px; margin-bottom: 6px; align-items: center; }
.rb-preview .filters { margin-bottom: 10px; }
.rb-form .save-bar { position: static; margin: 16px 0 0; box-shadow: none; }

/* ================================================================== XelovaCustix only
   The look above is XelovaHorizon's, unchanged. Below: only what Custix has and Horizon doesn't (job files, customs
   deposits, document jobs, chat, Smart Audit details, plan locks …), in the same tokens. */
.tagline {margin: -14px 0 0; font-size: 13px; letter-spacing: .02em; color: #fbbf24; font-weight: 600; }
.login-card .tagline {margin: -6px 0 14px; color: var(--accent, #0f766e); }
.login .login-card .tagline {color: #fbbf24; }
.login.slide-wait .ls-copy, .login.slide-in .ls-copy {max-width: 420px; }
.login:is(.slide-wait, .slide-in) .login-panel {min-width: 0; overflow: clip; }
.login:is(.slide-wait, .slide-in) .login-card {width: 380px; max-width: calc(100vw - 32px); }
@media (min-width: 1001px) {
  .login.slide-wait {grid-template-columns: 1fr 0fr; }
  .login.slide-wait .login-panel {padding-inline: 0; }
  .login.slide-in {transition: grid-template-columns .85s cubic-bezier(.45, 0, .2, 1); }
  .login.slide-in .login-panel {transition: padding .85s cubic-bezier(.45, 0, .2, 1); }
}
.login.intro .ls-stamp {animation-delay: 1s; }
.login.intro .ls-tick {animation: ls-pop .4s 1.2s forwards, ls-glow 2s 1.7s infinite; }
.splash .ls-stamp {animation-delay: 1s; }
.splash .ls-tick {animation: ls-pop .4s 1.2s forwards; }
.ls-grid {position: absolute; inset: -50%; background-image: radial-gradient(#12805c 1px, transparent 1.5px); background-size: 26px 26px; opacity: .25;
  transform: perspective(600px) rotateX(60deg); animation: ls-drift 22s linear infinite; }
.ls-routes {position: absolute; inset: 0; width: 100%; height: 100%; }
.ls-route {fill: none; stroke: #3fd3a0; stroke-width: 1.5; stroke-dasharray: 6 8; opacity: .55; animation: ls-dash 6s linear infinite; }
.ls-hub {fill: #e8c26a; }
.ls-ping {fill: none; stroke: #e8c26a; stroke-width: 2; transform-origin: center; transform-box: fill-box; animation: ls-ping 2.6s ease-out infinite; }
.ls-doc .ln {height: 6px; border-radius: 3px; background: rgba(255,255,255,.18); margin: 8px 0; transform-origin: left; transform: scaleX(0); animation: ls-type 1.2s ease forwards; }
.ls-doc .ln:nth-of-type(2) {animation-delay: .3s; width: 80%; }
.ls-doc .ln:nth-of-type(3) {animation-delay: .6s; width: 60%; }
.ls-doc .ln:nth-of-type(4) {animation-delay: .9s; width: 72%; }
.ls-yard {position: absolute; left: 8%; bottom: 12%; display: grid; grid-template-columns: repeat(4, 64px); gap: 6px; direction: ltr; }
.ls-box {height: 30px; border-radius: 3px; opacity: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.12) 0 3px, transparent 3px 9px), var(--c);
  animation: ls-drop .7s cubic-bezier(.3,1.4,.5,1) forwards; }
.ls-scanner {position: absolute; left: -10px; right: -10px; top: -14px; height: 3px; background: #3fd3a0; box-shadow: 0 0 18px 4px #3fd3a0; animation: ls-scan 3.2s ease-in-out 2s infinite alternate; }
.ls-tick {position: absolute; right: -46px; top: 50%; width: 34px; height: 34px; border-radius: 50%; background: #12805c; color: #fff; display: grid; place-items: center; font-weight: 700;
  opacity: 0; animation: ls-pop .5s 3.4s forwards, ls-glow 2s 4s infinite; }
@keyframes ls-drift { to { background-position: 0 520px; } }
@keyframes ls-dash { to { stroke-dashoffset: -140; } }
@keyframes ls-ping { from { transform: scale(.4); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }
@keyframes ls-drop { from { transform: translateY(-60px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ls-scan { to { top: calc(100% + 10px); } }
@keyframes ls-pop { from { transform: scale(0); } to { transform: scale(1); opacity: 1; } }
@keyframes ls-glow { 50% { box-shadow: 0 0 0 10px rgba(63,211,160,.15); } }
@keyframes ls-type { to { transform: scaleX(1); } }
.sidebar .brand b {color: var(--side-on, var(--hl)); }
.nav-group.collapsed .nav-head .ico:last-child {transform: rotate(-90deg); }
.nav-group.collapsed .links {display: none; }
.b-entry {background: var(--info-soft); color: var(--info); }
.b-exit {background: var(--warn-soft); color: var(--warn); }
.toast-stack {position: fixed; right: 24px; bottom: 90px; z-index: 60; display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none; }
.toast-stack .toast.stacked {position: static; pointer-events: auto; opacity: .94; }
@media print {
  .toast-stack {display: none !important; }
}
.files-box {display: grid; gap: 8px; justify-items: start; }
.files-box > .file-row {justify-self: stretch; }
.files-box h4 {display: flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; }
.files-box p {margin: 0; }
.card.manifest {border-color: var(--accent-soft); background: linear-gradient(var(--accent-softer), var(--accent-softer)), var(--panel); }
.card.manifest h3 .ico {color: var(--accent); }
#mResult:not(:empty) {margin-top: 12px; }
#mResult .callout {margin: 0; }
#mResult .callout .btn {margin-left: 6px; }
.autofilled {background: var(--accent-softer) !important; border-color: var(--accent) !important; }
@media (max-width: 1000px) {
  .login.slide-wait {height: 100vh; }
  .login.slide-wait .login-scene {min-height: 100vh; }
  .login.slide-in .login-scene {transition: min-height .85s cubic-bezier(.45, 0, .2, 1); }
  .ls-doc .ln:nth-of-type(4) {display: none; }
  .ls-yard {left: 16px; bottom: 18px; grid-template-columns: repeat(4, 38px); gap: 4px; }
  .ls-box {height: 22px; }
  .ls-tick {right: -34px; width: 26px; height: 26px; font-size: 13px; }
}
table.lines th.gov, table.lines td.gov {background: var(--accent-softer); }
.ref {display: inline-flex; align-items: center; gap: 6px; max-width: 155px; vertical-align: middle; }
.ref-v {overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-variant-numeric: tabular-nums; }
.ref-more {flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 1px 7px; }
#lines input.mf-diff {border-color: var(--warn); box-shadow: 0 0 0 2px var(--warn-soft); }
@media (max-width: 640px) {
  .grid > * {min-width: 0; }
}
.doc-stages {display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin-bottom: 16px; }
.doc-stages > .doc-stage-card {margin: 0; }
.doc-stage-card {display: grid; gap: 2px; align-content: start; text-align: left; padding: 12px 14px; cursor: pointer; font: inherit; color: var(--ink); border: 1px solid var(--line); }
.doc-stage-card small {color: var(--muted); font-size: 12px; font-weight: 600; }
.doc-stage-card b {font-size: 22px; font-variant-numeric: tabular-nums; }
.doc-stage-card:hover, .doc-stage-card.on {border-color: var(--accent); }
.doc-stage-card.on {box-shadow: 0 0 0 2px var(--accent-soft); }
.doc-stage-card.accent b {color: var(--accent); }
.doc-stage-card.bad b {color: var(--danger); }
.doc-stage-card.ok b {color: var(--ok); }
.badge[class*="doc-"] {text-transform: none; }
.doc-seg {max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.doc-seg button {white-space: nowrap; flex: none; }
.doc-brief {padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-softer); border: 1px solid var(--accent-soft); }
.doc-brief ul {list-style: none; margin: 8px 0 10px; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.doc-brief li {display: grid; grid-template-columns: 18px 1fr; gap: 6px; align-items: start; }
.doc-brief li svg {margin-top: 2px; color: var(--accent); }
.callout.doc-instr {background: var(--accent-softer); border: 1px solid var(--accent-soft); }
.callout.doc-instr .ico {color: var(--accent); }
.doc-switch {display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.doc-switch input {width: 18px; height: 18px; margin-top: 2px; }
.doc-switch small {display: block; margin-top: 4px; line-height: 1.45; }
.doc-off {opacity: .45; pointer-events: none; }
.doc-mb-status {display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--ok-soft); font-size: 13px; }
.doc-mb-status.bad {background: var(--danger-soft); }
.doc-mb-status .ico {flex: none; margin-top: 1px; }
#tmf td.c, #tmf th.c {text-align: center; }
.doc-tick {display: inline-grid; justify-items: center; gap: 2px; cursor: pointer; }
.doc-tick input {width: 18px; height: 18px; }
.doc-tick.role {cursor: default; }
.doc-tick small {font-size: 11px; color: var(--muted); }
.doc-load {display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.doc-load > small {margin: -2px 0 4px; }
.doc-load-row {display: grid; grid-template-columns: minmax(120px, 1.2fr) 90px 92px 2fr; gap: 10px; align-items: center; padding: 7px 8px; border: 1px solid transparent; border-radius: 6px;
  background: none; font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; cursor: pointer; }
.doc-load-row:hover {background: var(--side-hover); }
.doc-load-row.on {border-color: var(--accent); background: var(--accent-softer); }
.doc-load-row .nm {font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-load-row .bar {height: 6px; border-radius: 99px; background: var(--neutral-soft); overflow: hidden; }
.doc-load-row .bar i {display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.doc-load-row .bar i.bad {background: var(--danger); }
.doc-load-row .ct .ok {color: var(--ok); }
.doc-load-row .dt {color: var(--muted); font-size: 12.5px; }
@media (max-width: 640px) {
  .doc-load-row {grid-template-columns: 1fr 70px auto; }
  .doc-load-row .dt {grid-column: 1 / -1; }
}
.doc-nextline {display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--line); font-size: 14px; }
.doc-nextline.mine {border-color: var(--accent); background: var(--accent-softer); font-weight: 600; }
.doc-nextline.mine .ico {color: var(--accent); }
.doc-nextline > span:first-of-type {flex: 1; }
.doc-nextclock {display: flex; align-items: center; gap: 8px; font-weight: 400; white-space: nowrap; }
.doc-nextclock .doc-clock {margin: 0; }
.btn.doc-next {padding-inline: 18px; font-size: 15px; }
.dropdown button.item.danger {color: var(--danger); }
.dropdown button.item:hover {background: var(--side-hover); }
.doc-share.doc-boe {background: var(--warn-soft); align-items: center; }
.doc-share.doc-boe > span {flex: 1; min-width: 220px; }
.doc-share.doc-boe small {display: block; margin-top: 2px; }
.doc-lbl {display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.doc-days {display: flex; flex-wrap: wrap; gap: 6px; }
.doc-days label {display: inline-flex; cursor: pointer; }
.doc-days input {position: absolute; opacity: 0; pointer-events: none; }
.doc-days span {padding: 7px 12px; border: 1px solid var(--line); border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--muted); }
.doc-days input:checked + span {background: var(--accent); border-color: var(--accent); color: #fff; }
.doc-days input:focus-visible + span {outline: 2px solid var(--accent); outline-offset: 2px; }
.doc-check {display: grid; gap: 4px; }
.doc-check label {display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; }
.doc-check label.miss {border-color: var(--danger-soft); background: color-mix(in srgb, var(--danger-soft) 45%, transparent); }
.doc-check label.miss small {color: var(--danger); font-weight: 600; font-size: 12px; }
.doc-check label.got span {color: var(--ink-2); }
.doc-check label.na small {color: var(--muted); font-size: 12px; }
.doc-check input {width: 17px; height: 17px; }
.doc-checkbox {display: grid; gap: 4px; align-content: start; }
.doc-checkbox .checkbox {margin: 0; }
.doc-type {padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; }
.doc-type.off {opacity: .6; }
.doc-type-t {display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.doc-type-t label {display: grid; gap: 2px; }
.doc-type-t small {color: var(--muted); font-size: 11.5px; }
.doc-type-t input {width: 100%; }
.doc-alerts {display: grid; gap: 8px; margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.doc-alerts .checkbox {display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.doc-alerts select {width: auto; }
.doc-reasons {display: grid; gap: 6px; max-width: 560px; }
.doc-reasons > div {display: grid; grid-template-columns: 220px 1fr 34px; gap: 10px; align-items: center; font-size: 13.5px; }
.doc-reasons .bar {height: 8px; border-radius: 99px; background: var(--neutral-soft); overflow: hidden; }
.doc-reasons .bar i {display: block; height: 100%; background: var(--danger); border-radius: 99px; }
.bell-item.k-warn svg {color: var(--warn); }
@media (max-width: 640px) {
  .doc-type-t {grid-template-columns: repeat(2, 1fr); }
  .doc-reasons > div {grid-template-columns: 1fr 60px 28px; }
}
.doc-shift {display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel); }
.doc-shift.on {border-color: var(--ok); background: var(--ok-soft); }
.doc-shift.off {border-color: var(--warn); background: var(--warn-soft); }
.doc-shift > span {flex: 1; }
.doc-dot {display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); opacity: .5; margin-right: 6px; flex: none; }
.doc-dot.on {background: var(--ok); opacity: 1; box-shadow: 0 0 0 3px var(--ok-soft); }
.doc-load-row.off .nm {color: var(--muted); }
.doc-load-row .nm small {font-weight: 500; font-size: 11.5px; color: var(--warn); }
.doc-board {display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.doc-col {background: var(--neutral-soft); border-radius: var(--radius); padding: 8px; min-height: 120px; }
.doc-col > header {display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 4px 6px 8px; font-size: 13.5px; }
.doc-col > header span {color: var(--muted); font-size: 12.5px; }
.doc-col > header i {font-style: normal; }
.doc-col-body {display: grid; gap: 8px; }
.doc-col-body > p {margin: 8px 6px; font-size: 13px; }
.doc-col.c-on_hold {opacity: .9; outline: 2px dashed var(--line); outline-offset: -2px; background: none; }
.doc-card {display: grid; gap: 3px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); color: var(--ink); text-decoration: none; font-size: 13px; box-shadow: var(--shadow); }
.doc-card:hover {border-color: var(--accent); color: var(--ink); }
.doc-card.urgent {border-left-color: var(--warn); }
.doc-card.late {border-left-color: var(--danger); }
.doc-card .top {display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.doc-card .top .pill {font-size: 11px; padding: 1px 7px; }
.doc-card .cu {font-weight: 600; }
.doc-card .su, .doc-card .ho {color: var(--muted); font-size: 12.5px; }
.doc-card .ho {display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.doc-card .mi {display: flex; align-items: center; gap: 4px; color: var(--danger); font-size: 12px; font-weight: 600; }
.doc-card .cl {display: flex; align-items: center; gap: 8px; }
.doc-card .cl .doc-clock {margin: 0; width: 70px; flex: none; }
#lay button {display: inline-flex; align-items: center; gap: 5px; }
.doc-share .btn.sm {white-space: nowrap; }
.doc-phone {display: flex; align-items: center; gap: 6px; margin: -6px 0 12px; font-size: 12.5px; color: var(--muted); }
.doc-setdrop {min-width: 300px; }
.doc-setdrop .item span, .doc-setdrop a span {display: grid; gap: 1px; font-weight: 600; text-align: left; }
.doc-setdrop small {font-weight: 400; color: var(--muted); font-size: 12px; }
.doc-setdrop .pill {font-size: 10.5px; padding: 0 6px; }
.doc-stages.doc-strip {display: grid; grid-template-columns: minmax(130px, .9fr) minmax(0, 5fr) minmax(0, 2.8fr); gap: 12px; align-items: stretch; }
.doc-pipe {display: grid; grid-template-columns: repeat(5, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.doc-pipe .doc-stage-card {border: 0; border-radius: 0; box-shadow: none; position: relative; padding-left: 22px; background: none; }
.doc-pipe .doc-stage-card:first-child {padding-left: 14px; }
.doc-pipe .doc-stage-card:not(:last-child)::after {content: ""; position: absolute; right: -9px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%) rotate(45deg);
  border-top: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--panel); z-index: 1; }
.doc-pipe .doc-stage-card:hover, .doc-pipe .doc-stage-card.on {background: var(--accent-softer); box-shadow: none; }
.doc-pipe .doc-stage-card.on::after, .doc-pipe .doc-stage-card:hover::after {background: color-mix(in srgb, var(--accent-softer) 100%, var(--panel)); }
.doc-pipe .doc-stage-card.on small {color: var(--accent); }
.doc-side3 {display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.doc-pipe .doc-stage-card, .doc-side3 .doc-stage-card, .doc-strip > .doc-stage-card {margin: 0; align-content: center; }
.doc-stage-card.doc-mine {background: var(--accent-softer); border-color: var(--accent-soft); }
@media (max-width: 1100px) {
  .doc-stages.doc-strip {grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .doc-pipe {grid-template-columns: repeat(2, 1fr); }
  .doc-pipe .doc-stage-card::after {display: none; }
  .doc-pipe .doc-stage-card {padding-left: 14px; border-bottom: 1px solid var(--line); }
}
.doc-sec {padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; background: var(--panel); }
.doc-sec > h3 {display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 15px; }
.doc-sec > h3 .hint {font-weight: 400; }
.doc-sec .doc-src {margin-bottom: 12px; }
.doc-sec:last-of-type {margin-bottom: 0; }
.doc-papers span {display: inline-flex; align-items: center; gap: 6px; }
.doc-papers span svg {opacity: .25; }
.doc-papers input:checked + span svg {opacity: 1; }
.doc-page {display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.doc-col-main, .doc-col-side {display: grid; gap: 16px; min-width: 0; }
.doc-page .card {margin: 0; }
.card h3.doc-h {display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.card h3.doc-h > .ico {color: var(--accent); }
.card h3.doc-h .spacer {flex: 1; }
.card h3.doc-h .hint {font-weight: 400; }
.doc-facts {display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0; }
.doc-facts dt {font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.doc-facts dd {margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.doc-facts dd small {display: block; margin-top: 1px; font-size: 12.5px; }
.doc-facts dd .ico {vertical-align: -2px; }
.doc-notes {margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--panel-2); font-size: 14px; white-space: pre-wrap; }
.doc-notes small {display: block; font-weight: 600; margin-bottom: 2px; }
.doc-page .doc-check {grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.doc-files2 {display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.doc-files2 .doc-files {align-content: start; }
.doc-col-main.prep-view .doc-card-files {order: -1; }
.doc-files-head {display: flex; align-items: center; gap: 6px; min-height: 32px; margin-bottom: 2px; font-size: 13.5px; }
.doc-files-head b {white-space: nowrap; }
.doc-files-head .btn.sm {padding-inline: 8px; }
.doc-files-head .spacer {flex: 1; }
.doc-page .doc-file {grid-template-columns: minmax(0, 1fr) auto auto; padding: 7px 8px 7px 10px; }
.doc-none {margin: 4px 0 0; font-size: 13.5px; }
.doc-files[data-kind="doc_prep"] .doc-file {border-color: var(--accent-soft); background: var(--accent-softer); }
.doc-row {display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.doc-row > span {flex: 1; min-width: 0; }
.doc-row small {display: block; font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.doc-row:first-of-type {border-top: 0; padding-top: 0; }
.doc-share.doc-boe + .doc-row {border-top: 0; }
.doc-row:last-child {padding-bottom: 0; }
.doc-msgbtns {display: flex; flex-wrap: wrap; gap: 6px; }
.doc-page .doc-share.doc-boe {margin: 0 0 6px; }
.doc-nextline.late {border-color: var(--danger); background: var(--danger-soft); }
.doc-nextline.late > .ico {color: var(--danger); }
@media (max-width: 1000px) {
  .doc-page {grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .doc-facts, .doc-files2, .doc-page .doc-check {grid-template-columns: 1fr; }
}
.doc-confirm {display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); font-size: 13.5px; }
.doc-confirm > span {flex: 1; }
.doc-confirm > .ico {color: var(--warn); flex: none; }
.doc-confirm.ok {background: var(--ok-soft); }
.doc-confirm.ok > .ico {color: var(--ok); }
.doc-staff-bar {display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 0 0 14px; }
.badge.doc-received {background: var(--info-soft); color: var(--info); }
.badge.doc-with_prep, .badge.doc-preparing {background: var(--warn-soft); color: var(--warn); }
.badge.doc-prepared {background: var(--ok-soft); color: var(--ok); }
.badge.doc-returned {background: var(--accent-soft); color: var(--accent); }
.badge.doc-done {background: var(--ok-soft); color: var(--ok); }
.badge.doc-on_hold {background: var(--neutral-soft); color: var(--ink-2); }
.badge.doc-cancelled {background: var(--neutral-soft); color: var(--muted); }
.pill.warn {background: var(--warn-soft); color: var(--warn); }
.doc-clock {display: block; width: 110px; height: 6px; border-radius: 99px; background: var(--neutral-soft); overflow: hidden; margin: 4px 0 3px; }
.doc-clock i {display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.doc-clock.warn i {background: var(--warn); }
.doc-clock.bad i {background: var(--danger); }
.doc-clock-row {margin-top: 4px; }
.doc-flow {list-style: none; display: flex; gap: 6px; margin: 0 0 16px; padding: 0; overflow-x: auto; }
.doc-flow li {flex: 1; min-width: 150px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--neutral-soft); color: var(--muted); font-size: 13.5px; }
.doc-flow li b {display: block; font-weight: 700; }
.doc-flow li small {display: block; font-size: 11.5px; font-weight: 500; opacity: .85; line-height: 1.3; }
.doc-flow li span {width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--panel); font-size: 12px; }
.doc-flow li.past {background: var(--ok-soft); color: var(--ok); }
.doc-flow li.now {background: var(--accent); color: #fff; }
.doc-flow li.now span {color: var(--accent); }
.doc-flow li.late {background: var(--danger); color: #fff; }
.doc-flow li.late span {color: var(--danger); }
.doc-flow li.hold {background: var(--warn-soft); color: var(--warn); outline: 2px dashed var(--warn); outline-offset: -2px; }
.doc-src {display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.doc-src button {display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.doc-src button:hover {border-color: var(--accent); }
.doc-src button.on {border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.doc-drop {display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; padding: 14px; border: 2px dashed var(--line); border-radius: var(--radius-sm); color: var(--ink-2); }
.doc-final {margin: 0 0 16px; padding: 18px 16px; background: var(--panel); border-color: var(--accent); font-size: 14.5px; }
.doc-final > .ico {color: var(--accent); }
.doc-final.has {border-style: solid; border-width: 1px; }
.doc-final small {overflow-wrap: anywhere; }
.doc-drop.over {border-color: var(--accent); background: var(--accent-softer); }
.doc-drop small {display: block; margin-top: 2px; }
.doc-drop ul {grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.doc-drop li {display: flex; align-items: center; gap: 6px; font-size: 13px; }
.doc-drop .link, .bell-head .link {color: var(--accent); cursor: pointer; text-decoration: underline; background: none; border: 0; font: inherit; padding: 0; }
.doc-files {display: grid; gap: 6px; }
.doc-file {display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.doc-file a {display: flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; }
.doc-file a span {overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-add {justify-self: start; margin-top: 2px; }
.doc-share {display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding: 12px; border-radius: var(--radius-sm); background: var(--accent-softer); }
.doc-share b {margin-right: auto; }
.doc-note {display: flex; gap: 8px; margin-bottom: 14px; }
.doc-note input {flex: 1; }
.doc-tl .ev-finish .dot, .doc-tl .ev-complete .dot {background: var(--ok-soft); color: var(--ok); }
.doc-tl .ev-cancel .dot, .doc-tl .ev-rework .dot, .doc-tl li.late .dot {background: var(--danger-soft); color: var(--danger); }
.doc-tl .ev-hold .dot {background: var(--warn-soft); color: var(--warn); }
.doc-tl .ev-note .dot, .doc-tl .ev-file .dot {background: var(--neutral-soft); color: var(--muted); }
.doc-mins {display: flex; align-items: center; gap: 8px; }
.doc-mins input {width: 110px; }
@media (max-width: 640px) {
  .doc-src {grid-template-columns: repeat(3, 1fr); }
  .doc-flow li {min-width: 104px; font-size: 12px; }
}
.chat-panel {z-index: 46; }
.chat-panel .bot-head > div b {overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list {flex: 1; overflow: auto; padding: 6px; }
.chat-list h4 {margin: 12px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.chat-row {display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.chat-row:hover {background: var(--side-hover); }
.chat-ava {position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }
.chat-ava.k-job {background: var(--warn-soft); color: var(--warn); border-radius: 10px; }
.chat-ava.k-team {background: var(--accent); color: #fff; }
.chat-ava .doc-dot {position: absolute; right: -2px; bottom: 0; margin: 0; border: 2px solid var(--panel); width: 12px; height: 12px; box-shadow: none; }
.chat-who {min-width: 0; }
.chat-who b {font-size: 14px; }
.chat-who small {display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-who small.pill {display: inline-flex; font-size: 11px; padding: 1px 7px; }
.chat-row.unread .chat-who b {font-weight: 800; }
.chat-row.unread .chat-who > small:last-child {color: var(--ink); font-weight: 600; }
.chat-meta {display: grid; justify-items: end; gap: 4px; }
.chat-meta small {color: var(--muted); font-size: 11.5px; }
.chat-n {min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11.5px; line-height: 20px; text-align: center; }
.chat-msgs {flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; background: var(--panel-2); }
.chat-day {align-self: center; margin: 10px 0 6px; padding: 2px 10px; border-radius: 99px; background: var(--neutral-soft); color: var(--muted); font-size: 11.5px; font-weight: 600; }
.chat-msg {display: flex; flex-direction: column; align-items: flex-start; max-width: 100%; }
.chat-msg.mine {align-items: flex-end; }
.chat-name {margin: 6px 0 2px 4px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.chat-bubble {max-width: 84%; padding: 7px 11px 5px; border-radius: 14px 14px 14px 4px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.chat-msg.mine .chat-bubble {border-radius: 14px 14px 4px 14px; background: var(--accent); border-color: var(--accent); color: #fff; }
.chat-msg.mine .chat-bubble a {color: #fff; text-decoration: underline; }
.chat-bubble time {display: block; margin-top: 1px; text-align: right; font-size: 10.5px; opacity: .65; }
.chat-empty {margin: auto; display: grid; justify-items: center; gap: 8px; color: var(--muted); }
.chat-form textarea {flex: 1; resize: none; min-height: 40px; max-height: 120px; padding: 9px 11px; }
.chat-form .icon-btn {flex: none; align-self: flex-end; }
.chat-file {display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin-bottom: 4px; border-radius: 8px; background: var(--neutral-soft); color: var(--ink); text-decoration: none; }
.chat-file span {min-width: 0; overflow-wrap: anywhere; font-weight: 600; font-size: 13px; }
.chat-file small {display: block; font-weight: 400; color: var(--muted); }
.chat-msg.mine .chat-file {background: rgba(255,255,255,.18); color: #fff; }
.chat-msg.mine .chat-file small {color: rgba(255,255,255,.8); }
.chat-img {display: block; margin: -2px -6px 4px; min-width: 120px; min-height: 60px; border-radius: 10px; overflow: hidden; background: var(--neutral-soft); color: var(--muted); font-size: 12px; text-decoration: none; }
.chat-img span {display: block; padding: 22px 10px; text-align: center; }
.chat-img img {display: block; max-width: 100%; max-height: 260px; margin: 0 auto; }
.chat-search {display: flex; align-items: center; gap: 8px; margin: 4px 4px 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel-2); color: var(--muted); }
.chat-search input {flex: 1; border: 0; background: none; padding: 8px 0; outline: 0; font: inherit; color: var(--ink); min-width: 0; }
.chat-hit {display: grid; gap: 1px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.chat-hit:hover {background: var(--side-hover); }
.chat-hit small {font-size: 11.5px; }
.chat-hit span {font-size: 13px; color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chat-muted {display: inline-flex !important; align-items: center; gap: 2px; font-size: 10.5px !important; color: var(--muted); }
.chat-n.quiet {background: var(--muted); }
.chat-ava.k-group {background: var(--info-soft); color: var(--info); border-radius: 12px; }
.chat-pick {display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; max-height: 260px; overflow: auto; }
.chat-pick .checkbox {margin: 0; }
.chat-msgs {position: relative; }
.chat-wrap {position: relative; display: flex; flex-direction: row-reverse; align-items: center; gap: 4px; max-width: 100%; }
.chat-msg.mine .chat-wrap {flex-direction: row; }
.chat-wrap .chat-bubble {max-width: min(84%, 320px); position: relative; }
.chat-tools {display: flex; gap: 1px; opacity: 0; transition: opacity .12s; flex: none; }
.chat-msg:hover .chat-tools, .chat-msg:focus-within .chat-tools {opacity: 1; }
.chat-tools button {width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.chat-tools button:hover {background: var(--neutral-soft); color: var(--ink); }
@media (hover: none) {
  .chat-tools {opacity: .55; }
}
.chat-quote {display: block; margin: -1px -4px 5px; padding: 4px 8px; border-left: 3px solid var(--accent); border-radius: 6px; background: var(--neutral-soft); color: var(--ink-2); text-decoration: none; font-size: 12.5px; }
.chat-quote b {display: block; font-size: 11.5px; color: var(--accent); }
.chat-quote span {display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-msg.mine .chat-quote {background: rgba(255,255,255,.16); border-left-color: #fff; color: #fff; }
.chat-msg.mine .chat-quote b {color: #fff; }
.chat-reacts {display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 4px 2px; }
.chat-msg.mine .chat-reacts {justify-content: flex-end; }
.chat-reacts button {display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); font: inherit; font-size: 12.5px; cursor: pointer; color: var(--ink); }
.chat-reacts button b {font-size: 11.5px; color: var(--muted); }
.chat-reacts button.mine {border-color: var(--accent); background: var(--accent-soft); }
.chat-reacts button.mine b {color: var(--accent); }
.chat-tick {margin-left: 5px; letter-spacing: -2px; opacity: .8; }
.chat-tick.seen {opacity: 1; color: #a7f3d0; letter-spacing: -1px; }
.chat-msg.gone .chat-bubble {background: none; border-style: dashed; color: var(--muted); }
.chat-msg.mine.gone .chat-bubble {border-color: var(--line); }
.chat-pinmark {float: right; margin: -2px -4px 0 6px; opacity: .8; }
.chat-at {color: var(--accent); }
.chat-msg.mine .chat-at {color: #fff; text-decoration: underline; }
.chat-msg.mine .chat-bubble a.chat-job {color: #fff; }
.chat-msg.flash .chat-bubble {animation: chatflash 1.6s ease-out; }
@keyframes chatflash { 0%, 40% { box-shadow: 0 0 0 4px var(--warn); } 100% { box-shadow: 0 0 0 4px transparent; } }
.chat-new {display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; color: var(--danger); font-size: 11.5px; font-weight: 700; }
.chat-new::before, .chat-new::after {content: ""; flex: 1; height: 1px; background: var(--danger); opacity: .45; }
.chat-typing {color: var(--accent); font-weight: 600; }
.chat-pincount {position: absolute; top: 1px; right: 1px; min-width: 15px; height: 15px; border-radius: 99px; background: var(--accent); color: #fff; font: 700 10px/15px inherit; font-style: normal; text-align: center; padding: 0 3px; }
#chatPins {position: relative; }
.chat-pop {position: absolute; z-index: 5; min-width: 190px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow-lg); display: grid; }
.chat-pop button {display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; cursor: pointer; }
.chat-pop button:hover {background: var(--side-hover); }
.chat-pop.emos {min-width: 0; grid-template-columns: repeat(8, 1fr); }
.chat-pop.emos.wide {grid-template-columns: repeat(8, 1fr); width: 292px; }
.chat-pop .emo {justify-content: center; padding: 5px; font-size: 19px; }
.chat-bar {display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-top: 1px solid var(--line); background: var(--accent-softer); color: var(--accent); }
.chat-bar span {flex: 1; min-width: 0; display: grid; font-size: 12.5px; }
.chat-bar small {color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-bar .icon-btn {width: 28px; height: 28px; }
.chat-at-list {display: grid; margin: 0 10px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow-lg); }
.chat-at-list button {display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer; }
.chat-at-list button.on, .chat-at-list button:hover {background: var(--accent-soft); }
.chat-jump {align-self: center; margin: -42px 0 8px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border: 0; border-radius: 99px; background: var(--accent); color: #fff; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-lg); }
.chat-pinlist {display: grid; gap: 6px; }
.chat-pinlist button {display: grid; gap: 1px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.chat-pinlist button:hover {border-color: var(--accent); }
@media print {
  .chat-panel {display: none !important; }
}
.chat-mini {position: fixed; right: 22px; bottom: 106px; z-index: 44; width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer;
  display: grid; place-items: center; background: var(--panel); color: var(--accent); box-shadow: var(--shadow-lg); transition: transform .15s, border-color .15s; }
.chat-mini:hover {transform: scale(1.07); border-color: var(--accent); }
.chat-mini b {position: absolute; top: -4px; right: -4px; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 99px; border: 2px solid var(--panel); background: var(--danger); color: #fff;
  font-size: 11.5px; font-weight: 700; line-height: 17px; text-align: center; }
body.bot-open .chat-mini {display: none; }
@media print {
  .chat-mini {display: none !important; }
}
.chat-voice {display: flex; align-items: center; gap: 8px; min-width: 190px; margin: 1px 0 3px; }
.chat-voice .vplay {width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--accent); color: #fff; cursor: pointer; }
.chat-voice .vbar {flex: 1; height: 5px; border-radius: 99px; background: var(--neutral-soft); overflow: hidden; }
.chat-voice .vbar i {display: block; width: 0; height: 100%; background: var(--accent); }
.chat-voice .vtime {font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); min-width: 30px; text-align: right; }
.chat-msg.mine .chat-voice .vplay {background: #fff; color: var(--accent); }
.chat-msg.mine .chat-voice .vbar {background: rgba(255,255,255,.3); }
.chat-msg.mine .chat-voice .vbar i {background: #fff; }
.chat-msg.mine .chat-voice .vtime {color: rgba(255,255,255,.85); }
.chat-native {display: block; width: 230px; max-width: 100%; height: 36px; margin: 1px 0 3px; }
.chat-rec {display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid var(--line); background: var(--danger-soft); }
.chat-rec > i {width: 11px; height: 11px; border-radius: 50%; background: var(--danger); animation: chatrec 1s infinite; }
@keyframes chatrec { 50% { opacity: .25; } }
.chat-rec > b {font-variant-numeric: tabular-nums; }
.chat-rec > span {flex: 1; color: var(--ink-2); font-size: 13.5px; }
.bell-wrap {position: relative; }
#bellBtn {position: relative; }
.bell-count {position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; display: none; }
#bellBtn.has .bell-count {display: block; }
.bell-drop {width: min(380px, calc(100vw - 24px)); padding: 0; }
.bell-head {display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.bell-head .link {font-size: 13px; }
.bell-ask {display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 14px; border: 0; border-bottom: 1px solid var(--line); background: var(--accent-softer); color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.bell-list {max-height: 420px; overflow-y: auto; padding: 4px; }
.dropdown .bell-item {display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; padding: 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.bell-item svg {margin-top: 2px; color: var(--muted); }
.bell-item small {display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; overflow-wrap: anywhere; }
.bell-item small.muted {color: var(--muted); font-size: 11.5px; }
.bell-item.unread {background: var(--accent-softer); }
.bell-item.unread b::before {content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.bell-item.k-late svg {color: var(--danger); }
.bell-item.k-assigned svg {color: var(--accent); }
.bell-item.k-returned svg {color: var(--ok); }
.tf-setup {display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.tf-on {display: flex; gap: 10px; align-items: center; }
.tf-on input {width: 150px; font-size: 20px; letter-spacing: 3px; text-align: center; }
.lang-switch {font-weight: 600; padding-inline: 10px; }
.login-card .lang-switch {align-self: center; margin-top: 4px; }
.help-q {font-size: 15px; font-weight: 700; line-height: 1; }
.help-wrap {display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.help-toc {position: sticky; top: 70px; display: grid; gap: 2px; max-height: calc(100vh - 100px); overflow: auto; padding: 14px; margin: 0; }
.help-toc b {margin: 12px 0 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; }
.help-toc a {padding: 5px 8px; border-radius: 6px; color: var(--ink); font-size: 13.5px; }
.help-toc a:hover {background: var(--side-hover); }
.help-body {margin: 0; padding: 8px 28px 28px; }
.help-group {font-size: 13px; text-transform: uppercase; color: var(--accent); margin: 26px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.help-topic {padding: 6px 0 14px; scroll-margin-top: 70px; }
.help-topic h2 {font-size: 19px; margin: 18px 0 6px; }
.help-topic h3 {font-size: 13px; margin: 14px 0 4px; color: var(--muted); }
.help-intro {margin: 0 0 10px; font-size: 15px; }
.help-topic :is(ol, ul) {margin: 0; padding-inline-start: 22px; display: grid; gap: 5px; line-height: 1.5; }
.help-img {display: block; width: 100%; max-width: 900px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 10px 0 4px; }
.help-modal .help-topic h2 {display: none; }
.help-modal {direction: ltr; text-align: left; }
.help-wrap {direction: ltr; text-align: left; }
@media (max-width: 900px) {
  .help-wrap {grid-template-columns: 1fr; }
  .help-toc {position: static; max-height: none; }
}
@media print {
  .help-wrap {display: block; }
  .help-body {border: 0; padding: 0; box-shadow: none; }
  .help-topic {break-inside: avoid; }
  .help-group {break-after: avoid; }
  .help-img {max-width: 100%; }
  .help-topic.hidden {display: block !important; }
}
.lic-bar {display: flex; align-items: center; gap: 10px; padding: 9px 22px; font-size: 13.5px; font-weight: 500; border-bottom: 1px solid var(--line); }
.lic-bar.warn {background: var(--warn-soft); color: var(--ink); }
.lic-bar.warn .ico {color: var(--warn); }
.lic-bar.danger {background: var(--danger-soft); color: var(--ink); }
.lic-bar.danger .ico {color: var(--danger); }
.lic-bar span {flex: 1; }
.lic-bar a {font-weight: 600; white-space: nowrap; }
.lic-bar.hidden {display: none; }
@media print {
  .lic-bar {display: none; }
}
.lay-rows {display: grid; gap: 6px; }
.lay-row {display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.lay-row.off {background: var(--panel-2); }
.lay-row.off span {color: var(--muted); }
.lay-row label {flex: 1; display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; margin: 0; }
.lay-row input {width: 16px; height: 16px; accent-color: var(--accent); }
.lay-row [data-up] .ico {transform: rotate(180deg); }
.lay-row .icon-btn:disabled {opacity: .3; cursor: default; }
.drop-label {font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); padding: 6px 10px 2px; }
.dropdown button.item:hover {background: var(--side-hover); }
.star {border: 0; background: none; cursor: pointer; font-size: 17px; line-height: 1; color: var(--line-2); padding: 0 6px 0 0; }
.star:hover {color: var(--warn); }
.star.on {color: #f59e0b; }
.star.btn {font-size: 18px; padding: 6px 10px; }
.report-list a .grow {flex: 1; }
.dir-tabs {display: inline-grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; margin: 0 0 16px; background: var(--neutral-soft); border: 1px solid var(--line); border-radius: 14px; }
.dir-tab {display: flex; align-items: center; gap: 12px; min-width: 210px; padding: 10px 18px 10px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; border: 1px solid transparent; transition: background .15s, box-shadow .15s; }
.dir-tab .di {width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--panel); color: var(--muted); border: 1px solid var(--line); flex: none; }
.dir-tab b {display: block; font-size: 15px; line-height: 1.2; }
.dir-tab small {display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.dir-tab:hover {background: var(--panel); color: var(--ink); }
.dir-tab.on {background: var(--panel); border-color: var(--dc); box-shadow: 0 0 0 1px var(--dc), var(--shadow); color: var(--ink); }
.dir-tab.on .di {background: var(--dc); border-color: var(--dc); color: #fff; }
.dir-tab.on b {color: var(--dc); }
.dir-tab.entry {--dc: var(--info); }
.dir-tab.exit {--dc: var(--warn); }
@media (max-width: 560px) {
  .dir-tabs {display: grid; }
  .dir-tab {min-width: 0; }
}
.restore-word {font-family: ui-monospace, Consolas, monospace; letter-spacing: 2px; color: var(--danger); background: var(--danger-soft); padding: 1px 8px; border-radius: 6px; user-select: none; }
:where(th, td):not(:last-child) {border-inline-end: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
:where(table:not(.lines):not(.hist):not(.payroll) tbody tr:nth-child(even)) > td {background: color-mix(in srgb, var(--ink) 2.5%, var(--panel)); }
tr.total td {border-top: 2px solid var(--line-2); }
table.hist :where(th, td) {border-inline-end: 0; }
input::placeholder, textarea::placeholder {color: color-mix(in srgb, var(--muted) 78%, transparent); }
input[readonly]:not([type="hidden"]) {background: var(--panel-2); }
.btn:not(.primary):not(.ghost):not(.danger-solid) {border-color: var(--line-2); }
.btn:not(.primary):not(.ghost):not(:disabled):hover {border-color: var(--ink-2); }
.doc-stage-card, .doc-card, .doc-file, .doc-flow li {border-color: var(--line-2); }
.doc-flow li {border: 1px solid var(--line); }
.doc-flow li.now, .doc-flow li.late {border-color: transparent; }
@media print {
  :where(th, td) {border-inline-end: 0 !important; }
  :where(tbody tr) > td {background: none !important; }
}
.mig-steps {display: grid; gap: 14px; }
.mig-step h3 {display: flex; align-items: center; gap: 10px; margin-top: 0; }
.mig-src {display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.mig-pick {display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; }
.mig-pick > input[type=radio] {width: auto; flex: 0 0 auto; margin: 3px 0 0; }
.mig-pick > span {flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mig-pick.on {border-color: var(--accent); background: var(--accent-softer); box-shadow: 0 0 0 1px var(--accent) inset; }
.mig-files tr.bad td {background: color-mix(in srgb, var(--danger, #dc2626) 7%, transparent); }
label.btn.disabled {opacity: .5; pointer-events: none; }
.mig-up {margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; }
.mig-up-head {display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.mig-up-head > span {min-width: 0; overflow-wrap: anywhere; }
.mig-up-pct {font-size: 18px; font-variant-numeric: tabular-nums; }
.mig-bar {height: 8px; border-radius: 99px; background: var(--neutral-soft); overflow: hidden; }
.mig-bar.sm {height: 5px; }
.mig-bar i {display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .2s; }
.mig-bar i.ok {background: var(--ok); }
.mig-bar i.bad {background: var(--danger); }
.mig-up-list {display: grid; gap: 6px; margin-top: 12px; max-height: 320px; overflow: auto; }
.mig-up-row {display: grid; grid-template-columns: minmax(0, 1.4fr) 70px minmax(60px, 1fr) 84px; gap: 10px; align-items: center; font-size: 13px; }
.mig-up-row > span {overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mig-up-row small {text-align: right; font-variant-numeric: tabular-nums; }
.mig-up-row.wait {opacity: .6; }
.mig-up-row.done .mig-up-st {color: var(--ok); }
.mig-up-row.bad .mig-up-st {color: var(--danger); }
.mig-up-row.up .mig-up-st {font-weight: 600; }
@media (max-width: 560px) {
  .mig-up-row {grid-template-columns: minmax(0, 1fr) 70px; }
  .mig-up-row .mig-bar {grid-column: 1 / -1; order: 3; }
  .mig-up-row .mig-up-st {order: 2; }
  .mig-up-row > small:nth-child(2) {display: none; }
}
.legacy-report {font-size: 13px; line-height: 1.6; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel-2); max-height: 360px; overflow: auto; overflow-wrap: anywhere; }
.topclock {display: flex; align-items: baseline; gap: 7px; padding: 0 8px; white-space: nowrap; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.topclock b {color: var(--ink); font-weight: 600; font-size: 14px; }
@media (max-width: 640px) {
  .topclock .tc-date {display: none; }
  .topclock {padding: 0; }
  .topclock b {font-size: 12.5px; font-weight: 600; }
}
@media (max-width: 400px) {
  .topclock b {font-size: 12px; letter-spacing: -.01em; }
}
.impact-list {margin: 8px 0 0; padding-inline-start: 18px; display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.impact-list li.warn {color: var(--warn); font-weight: 600; }
.plan-pill {background: var(--info-soft); color: var(--info); font-size: 11px; padding: 1px 8px; margin-right: 6px; }
.plan-lock {max-width: 560px; }
dl.kv {display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
dl.kv dt {color: var(--muted); }
dl.kv dd {margin: 0; }
.print-only {display: none; }
@media print {
  .print-only {display: block; }
  .report-letterhead .top {display: flex; justify-content: space-between; border-bottom: 2px solid #0f766e; padding-bottom: 8px; margin-bottom: 12px; }
  .report-letterhead h1 {font-size: 18px; margin: 0 0 4px; }
  .report-letterhead .co-logo {max-height: 48px; max-width: 160px; vertical-align: middle; margin-right: 8px; }
}
.my-report {display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.my-report:first-of-type {border-top: 0; }
