/* Noor v0.8.26 - redesigned look. Loaded AFTER workspace.css. Look, layout and navigation only: no data or logic here.
   Palette and layout follow the approved design (navy menu, blue #2f6bff, Inter). */
:root {
  --ui-bg: #f4f6fa; --ui-panel: #fff; --ui-line: #e4e8f0; --ui-line2: #eef1f6; --ui-ink: #0f172a; --ui-ink2: #334155;
  --ui-muted: #64748b; --ui-faint: #94a3b8;
  --ui-navy: #0b1426; --ui-navy2: #13213b; --ui-navy3: #1d2f50; --ui-navy-text: #b8c4da;
  --ui-blue: #2f6bff; --ui-blue600: #2557d6; --ui-blue50: #eef3ff; --ui-blue100: #dce6ff;
  --ui-red: #c62828; --ui-red50: #fdeceb; --ui-amber: #b45309; --ui-amber50: #fff4e2; --ui-green: #15803d; --ui-green50: #e7f6ee;
  --ui-r: 14px; --ui-shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.05);
  /* re-point the older token layers so every existing screen picks the new palette up */
  --teal: var(--ui-blue); --teal-soft: var(--ui-blue50); --navy: var(--ui-ink); --navy-dark: var(--ui-navy);
  --n-ground: var(--ui-bg); --n-ink: var(--ui-ink); --n-muted: var(--ui-muted); --n-line: var(--ui-line); --n-soft: var(--ui-line2);
  --n-teal: var(--ui-blue); --n-teal-soft: var(--ui-blue50); --n-amber: var(--ui-amber); --n-amber-soft: var(--ui-amber50);
  --n-blue: var(--ui-blue600); --n-blue-soft: var(--ui-blue50);
  --page: var(--ui-bg); --line: var(--ui-line); --text: var(--ui-ink); --muted: var(--ui-muted);
  --ui-font: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}
html body { background: var(--ui-bg); color: var(--ui-ink); font: 14px/1.45 var(--ui-font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
html body button, html body input, html body select, html body textarea { font-family: var(--ui-font); }
.nm-m, .nm-login { --sans: Inter, "Segoe UI", system-ui, sans-serif; }

/* ------------------------------------------------------------------ logo (Arcthrust) */
.ui-mark { width: 34px; height: 34px; border-radius: 9px; background: #000; display: grid; place-items: center; flex: none; }
.ui-mark svg { width: 20px; height: 19px; display: block; }
.ui-word { display: flex; flex-direction: column; line-height: 1; }
.ui-word b { font-weight: 800; letter-spacing: .06em; font-size: 15px; color: #fff; }
.ui-word span { font-weight: 700; letter-spacing: .42em; font-size: 8.5px; color: #4d86ff; margin-top: 4px; }

/* ------------------------------------------------------------------ login */
html body .login-layout { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 5vw; padding: 7vw;
  background: radial-gradient(ellipse 70% 60% at 20% 20%, #1a2f5a 0%, var(--ui-navy) 60%); }
html body .login-copy { color: #fff; }
.login-copy .ui-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.login-copy .ui-mark { width: 46px; height: 46px; border-radius: 12px; background: #000; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.login-copy .ui-mark svg { width: 26px; height: 24px; }
html body .login-copy .kicker { color: #7fa6ff; }
html body .login-copy h1 { margin: 14px 0 16px; font-size: clamp(2.4rem, 5.4vw, 4.6rem); line-height: 1; letter-spacing: -.045em; font-weight: 800; }
html body .login-copy p { max-width: 560px; color: #b8c4da; font-size: 1.05rem; line-height: 1.65; }
html body .login-card { width: min(440px, 100%); justify-self: center; padding: 34px; border-radius: 18px; border: 0; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
html body .login-card h2 { margin: 8px 0 22px; font-size: 1.7rem; letter-spacing: -.02em; }
@media (max-width: 860px) { html body .login-layout { grid-template-columns: 1fr; padding: 8vw 6vw; gap: 32px; } }

/* ------------------------------------------------------------------ shell: navy menu + top bar */
html body .app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.app.hidden { display: none; }
html body .side { position: sticky; top: 0; height: 100vh; background: var(--ui-navy); color: var(--ui-navy-text); display: flex; flex-direction: column; padding: 20px 14px; overflow-y: auto; }
.side .brandrow { display: flex; align-items: center; gap: 11px; padding: 0 8px 20px; }
.side .prod { margin: 0 6px 12px; padding: 10px 12px; border-radius: 12px; background: var(--ui-navy2); }
.side .prod small { display: block; font-size: 11px; color: #7f8fac; }
.side .prod b { color: #fff; font-size: 13.5px; }
.side .grp { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: #5d6d8c; font-weight: 700; padding: 14px 12px 6px; }
html body .side #nav { display: flex; flex-direction: column; gap: 2px; flex-grow: 0; }
html body .side .nav-item, html body .side #nav .nav-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 12px; min-height: 0; border-radius: 9px; color: var(--ui-navy-text); font: 500 14px var(--ui-font); cursor: pointer; }
html body .side .nav-item svg { width: 17px; height: 17px; opacity: .8; flex: none; }
html body .side .nav-item:hover, html body .side #nav .nav-item:hover { background: var(--ui-navy2); color: #fff; }
html body .side #nav .nav-item.active, html body .side .settings-button.active { background: var(--ui-blue); color: #fff; font-weight: 600; }
html body .side .nav-item.active svg { opacity: 1; }
html body .side #nav .nav-item b { margin-left: auto; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; background: var(--ui-navy3); color: #c9d5ec; }
html body .side #nav .nav-item.active b { background: rgba(255,255,255,.22); color: #fff; }
html body .side .settings-button { border: 0; background: transparent; color: var(--ui-navy-text); }
.side .me { margin-top: auto; border-top: 1px solid var(--ui-navy2); padding: 14px 8px 0; display: grid; gap: 10px; }
.side .me-id { display: flex; align-items: center; gap: 10px; }
.side .av { width: 32px; height: 32px; border-radius: 50%; background: var(--ui-blue); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.side .identity { display: grid; line-height: 1.25; min-width: 0; }
.side .identity strong { color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .identity span { color: #7f8fac; font-size: 11.5px; }
.side .me-actions { display: flex; gap: 8px; }
html body .side .top-quiet { flex: 1; min-height: 34px; padding: 6px 10px; font-size: 12.5px; border-radius: 9px; color: #c9d5ec; border: 1px solid var(--ui-navy3); background: transparent; font-weight: 600; }
html body .side .top-quiet:hover { background: var(--ui-navy2); color: #fff; }

html body .content-shell { min-width: 0; }
html body .topbar { position: sticky; top: 0; z-index: 30; min-height: 0; height: 60px; background: rgba(244,246,250,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ui-line); box-shadow: none; display: flex; align-items: center; gap: 14px; padding: 0 28px; color: var(--ui-ink); }
html body .topbar .company-switch { background: transparent; padding: 0; gap: 6px; flex-wrap: nowrap; overflow-x: auto; max-width: calc(100% - 220px); scrollbar-width: none; }
.topbar .company-switch::-webkit-scrollbar { display: none; }
html body .company-switch button { min-height: 0; padding: 7px 13px; border-radius: 9px; border: 1px solid var(--ui-line); background: #fff; color: var(--ui-ink2); font: 600 13px var(--ui-font); white-space: nowrap; }
html body .company-switch button:hover { border-color: #cdd5e2; }
html body .company-switch button.active { background: var(--ui-blue); border-color: var(--ui-blue); color: #fff; }
html body .company-switch .company-single { padding: 7px 4px; font-weight: 700; color: var(--ui-ink); }
.topbar .live-pill { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ui-muted); background: #fff; border: 1px solid var(--ui-line); padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.topbar .live-pill.on { color: var(--ui-green); background: var(--ui-green50); border-color: transparent; }
html body .status-dot { width: 7px; height: 7px; border-radius: 50%; background: #c3cbd9; box-shadow: none; }
html body .status-dot.live { background: #22a05a; box-shadow: 0 0 0 3px rgba(34,160,90,.2); }
html body .pagebar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; width: auto; max-width: none; margin: 0; padding: 24px 28px 6px; }
html body #pageKicker { color: var(--ui-blue); font-weight: 700; letter-spacing: .1em; font-size: 11px; }
html body #pageTitle { font: 700 24px/1.2 var(--ui-font); letter-spacing: -.4px; margin: 4px 0 0; color: var(--ui-ink); }
html body main, html body main:is(*) { width: auto; max-width: none; margin: 0; padding: 14px 28px 40px; }
html body .appfoot { padding: 0 28px 28px; border: 0; }
.appfoot .text-button { color: var(--ui-faint); }
.settings-tabs, html body .segmented { background: var(--ui-line2); border-radius: 11px; padding: 3px; gap: 3px; }
.settings-tabs button, html body .segmented button { min-height: 0; padding: 7px 14px; border-radius: 8px; font: 600 13px var(--ui-font); color: var(--ui-ink2); }
.settings-tabs button.active, html body .segmented button.active { background: #fff; color: var(--ui-ink); box-shadow: 0 1px 2px rgba(15,23,42,.12); }

/* ------------------------------------------------------------------ components */
html body .card { background: #fff; border: 1px solid var(--ui-line); border-radius: var(--ui-r); box-shadow: var(--ui-shadow); }
html body .button { min-height: 0; padding: 8px 14px; border-radius: 10px; font: 600 13px var(--ui-font); transition: background .15s, border-color .15s, transform .08s; }
html body .button:active { transform: translateY(1px); }
html body .button.primary { background: var(--ui-blue); border-color: var(--ui-blue); color: #fff; }
html body .button.primary:hover { background: var(--ui-blue600); }
html body .button.quiet { background: #fff; border: 1px solid var(--ui-line); color: var(--ui-ink); }
html body .button.quiet:hover { border-color: #cdd5e2; }
html body .button.danger { color: var(--ui-red); background: var(--ui-red50); border-color: #f7c9c7; }
html body .kicker { color: var(--ui-blue); }
html body input:focus, html body select:focus, html body textarea:focus { border-color: var(--ui-blue); box-shadow: 0 0 0 3px rgba(47,107,255,.14); }
html body input, html body select, html body textarea { border-color: #d5dbe6; border-radius: 10px; }
html body .section-head h2 { font-size: 17px; letter-spacing: -.2px; }
html body .section-head p { color: var(--ui-muted); }

html body .tabs { gap: 4px; margin-bottom: 14px; background: transparent; }
html body .tabs .tab { padding: 8px 14px; border: 1px solid transparent; background: transparent; color: var(--ui-muted); border-radius: 9px; font: 600 13px var(--ui-font); }
html body .tabs .tab:hover { background: #fff; color: var(--ui-ink); }
html body .tabs .tab.active { background: #fff; color: var(--ui-blue); border-color: var(--ui-line); box-shadow: var(--ui-shadow); font-weight: 700; }
html body #recordTabs { background: var(--ui-bg); }

html body .metric { border: 1px solid var(--ui-line); border-radius: var(--ui-r); box-shadow: var(--ui-shadow); min-height: 0; padding: 16px 18px; }
html body .metric span { color: var(--ui-muted); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
html body .metric strong { font-size: 22px; letter-spacing: -.4px; margin-top: 6px; }
html body .metric.alert { background: var(--ui-amber50); border-color: #f7d9a8; }
html body .metric-card { border-radius: var(--ui-r); box-shadow: var(--ui-shadow); border-color: var(--ui-line); }
html body .metric-card b, html body .side-figures b { font-family: var(--ui-font); font-weight: 700; letter-spacing: -.5px; }
html body .metric-card.hero { background: linear-gradient(135deg, #0b1426, #1d3a7a); border: 0; }

html body .task { border-radius: var(--ui-r); border: 1px solid var(--ui-line); border-left: 4px solid var(--ui-blue); box-shadow: var(--ui-shadow); }
html body .empty { border: 1px dashed #cbd5e1; background: #fff; border-radius: var(--ui-r); }
html body .queue-chip { border-radius: 999px; }

html body .table-card { background: #fff; border: 1px solid var(--ui-line); border-radius: var(--ui-r); box-shadow: var(--ui-shadow); }
html body .table-card table th, html body table.trade-compact thead th { color: var(--ui-muted); font: 600 11.5px var(--ui-font); letter-spacing: .04em; text-transform: uppercase; background: #f8fafc; box-shadow: 0 1px 0 var(--ui-line); }
html body table td { border-color: var(--ui-line2); }
html body table.trade-compact tbody tr { transition: background .12s; }
html body table.trade-compact tbody tr:hover { background: #f7f9fe; }
table.trade-compact tbody tr { cursor: pointer; }
.lift { display: block; height: 5px; border-radius: 3px; background: var(--ui-line2); margin-top: 5px; overflow: hidden; min-width: 70px; }
.lift i { display: block; height: 100%; background: var(--ui-blue); border-radius: 3px; }
.lift.full i { background: var(--ui-green); }
.chip { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: 5px; vertical-align: 1px; }
.chip.adv { background: var(--ui-amber50); color: var(--ui-amber); }
.chip.due { background: var(--ui-red50); color: var(--ui-red); }
html body .due-red { color: var(--ui-red); }
.row-actions .button { padding: 5px 10px; font-size: 12px; }

/* ------------------------------------------------------------------ dialogs */
html body dialog { border-radius: 16px; box-shadow: 0 35px 100px rgba(15,23,42,.35); }
html body dialog::backdrop { background: rgba(11,20,38,.6); backdrop-filter: blur(3px); }
html body .dialog-head h2 { font-size: 18px; letter-spacing: -.3px; }

/* The deal details window becomes a right-hand drawer (same dialog, same buttons) */
html body dialog#tripSheetDialog { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(920px, 96vw); max-width: 96vw; height: 100vh; max-height: 100vh; border-radius: 18px 0 0 18px; border: 0; background: #fff; }
html body dialog#tripSheetDialog[open] { animation: ui-drawer .28s cubic-bezier(.22,1,.36,1); }
html body dialog#tripSheetDialog .dialog-content { max-height: 100vh; height: 100vh; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
#tripSheetDialog .dialog-head { padding: 18px 24px 12px; border-bottom: 1px solid var(--ui-line2); margin: 0; flex: none; }
#tripSheetDialog .ui-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 24px 24px; }
@keyframes ui-drawer { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.ui-tabs { display: flex; gap: 2px; padding: 0 24px; border-bottom: 1px solid var(--ui-line); flex: none; overflow-x: auto; }
.ui-tabs button { border: 0; background: transparent; padding: 11px 13px; font: 600 13px var(--ui-font); color: var(--ui-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.ui-tabs button:hover { color: var(--ui-ink); }
.ui-tabs button.on { color: var(--ui-blue); border-bottom-color: var(--ui-blue); }
.ui-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.ui-money div { background: #f8fafc; border: 1px solid var(--ui-line2); border-radius: 12px; padding: 11px 13px; }
.ui-money small { display: block; color: var(--ui-muted); font-size: 11.5px; font-weight: 600; }
.ui-money b { display: block; font-size: 17px; letter-spacing: -.3px; margin-top: 2px; }
.ui-money .red b { color: var(--ui-red); } .ui-money .amber b { color: var(--ui-amber); }
.ui-liftbar { margin: -4px 0 16px; }
.ui-liftbar .lift { height: 8px; margin: 0 0 5px; }
.ui-liftbar small { color: var(--ui-muted); font-size: 12px; }
[data-ui-tab].ui-hide { display: none !important; }

/* ------------------------------------------------------------------ Summary book / misc */
html body .side-card.purchase .side-tag { background: var(--ui-amber50); color: var(--ui-amber); }
html body .side-card.sale .side-tag { background: var(--ui-blue50); color: var(--ui-blue600); }
html body .side-figures div { background: #f8fafc; border: 1px solid var(--ui-line2); }
html body .toast { border-radius: 12px; }

/* ------------------------------------------------------------------ small screens: menu becomes a top strip */
@media (max-width: 980px) {
  html body .app { grid-template-columns: 1fr; }
  html body .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; overflow: visible; }
  .side .brandrow { padding: 0 8px 0 0; } .side .prod, .side .grp { display: none; }
  html body .side #nav { flex-direction: row; flex-wrap: wrap; } html body .side .nav-item, html body .side #nav .nav-item { width: auto; padding: 7px 11px; }
  .side .me { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; align-items: center; }
  .side .me-id .identity { display: none; }
  html body .topbar { padding: 0 14px; } html body .pagebar, html body main { padding-left: 14px; padding-right: 14px; }
  .ui-money { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
html.motion-off body dialog#tripSheetDialog[open] { animation: none; }

/* ------------------------------------------------------------------ v0.8.26 fixes found while testing */
html body .task:has(> .task-main:first-child) { grid-template-columns: minmax(0, 1fr) auto; }
html body table.trade-compact { font-size: 12.5px; }
html body table.trade-compact th, html body table.trade-compact td { padding: 9px 8px; overflow-wrap: normal; word-break: normal; }
html body table.trade-compact td:nth-child(3) { min-width: 100px; }
.ui-dup { display: none !important; }
.row-more { position: relative; display: inline-block; }
.row-actions { display: flex; align-items: center; gap: 6px; }
.row-actions .more-btn { padding: 5px 9px; font-size: 14px; line-height: 1; letter-spacing: 1px; }
.row-menu { position: fixed; z-index: 60; min-width: 150px; background: #fff; border: 1px solid var(--ui-line); border-radius: 12px; box-shadow: 0 16px 40px rgba(15,23,42,.18); padding: 6px; display: grid; gap: 2px; }
.row-menu[hidden] { display: none; }
.row-menu .button { justify-content: flex-start; width: 100%; border: 0; background: transparent; font-weight: 600; font-size: 13px; padding: 8px 10px; border-radius: 8px; color: var(--ui-ink); }
.row-menu .button:hover { background: var(--ui-line2); }
.row-menu .button[data-trade-delete] { color: var(--ui-red); }
html body table.trade-compact th, html body table.trade-compact td { padding: 8px 6px; }
html body table.trade-compact td:nth-child(6) small, html body table.trade-compact td:nth-child(9) small { display: block; }
html body table.trade-compact td.actions-cell { padding-right: 10px; white-space: nowrap; }

/* drawer: every tripSheetDialog window (details, review, correct) shares the same frame; Save / Approve stay in view */
#tripSheetDialog .dialog-actions { position: sticky; bottom: -24px; background: #fff; padding: 12px 0 4px; margin-top: 16px; border-top: 1px solid var(--ui-line2); z-index: 2; }
html body #toast.toast { right: auto; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 10000; border-radius: 12px; }

/* ================================================================== v0.8.27 - layout of the approved design */
/* ---- sign-in: split screen, exactly as the approved design ---- */
html body .ui-login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.ui-login.hidden { display: none; }
.ui-login .ul-left { background: radial-gradient(1200px 600px at 10% 0%, #1d3a7a 0%, #0b1426 55%); color: #fff; padding: 48px; display: flex; flex-direction: column; }
.ui-login .ui-brand { display: flex; align-items: center; gap: 12px; }
.ui-login .ui-mark { width: 42px; height: 42px; border-radius: 10px; }
.ui-login .ui-mark svg { width: 24px; height: 22px; }
.ui-login .ui-word b { font-size: 19px; }
.ui-login .ul-left h2 { font-size: 38px; line-height: 1.15; letter-spacing: -.8px; margin: auto 0 14px; max-width: 520px; font-weight: 700; color: #fff; }
.ui-login .ul-left p { color: #a9bbdf; max-width: 460px; font-size: 15px; margin: 0 0 30px; line-height: 1.6; }
.ui-login .ul-feat { display: flex; gap: 26px; color: #c8d5ef; font-size: 13px; }
.ui-login .ul-feat b { display: block; color: #fff; font-size: 20px; }
.ui-login .ul-right { display: grid; place-items: center; background: #fff; padding: 24px; }
.ui-login .ul-form { width: min(360px, 100%); }
.ui-login .ul-form h3 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.2px; }
.ui-login .ul-sub { color: var(--ui-muted); margin: 0 0 24px; }
.ui-login .field { display: block; font-size: 12.5px; font-weight: 600; color: var(--ui-ink2); margin-bottom: 14px; }
.ui-login .field input { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; font-size: 14px; border: 1px solid var(--ui-line); border-radius: 10px; background: #fff; color: var(--ui-ink); }
.ui-login .button.full { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }
.ui-login .error { min-height: 18px; color: var(--ui-red); margin: 10px 0 0; font-size: 13px; }
.ui-login .ul-foot { margin: 12px 0 0; font-size: 12px; color: var(--ui-faint); text-align: center; }
@media (max-width: 1100px) { html body .ui-login { grid-template-columns: 1fr; } .ui-login .ul-left { display: none; } }

/* ---- menu (left) ---- */
.ui-legacy-nav { display: none !important; }
html body .side .prod { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side .prod .sw { font: 500 11px var(--ui-font); color: #9fb4dc; border: 1px solid var(--ui-navy3); border-radius: 7px; padding: 3px 7px; background: transparent; cursor: pointer; }
.side .prod .sw:hover { background: var(--ui-navy3); color: #fff; }
.side .prod-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50; background: #fff; border-radius: 12px; box-shadow: 0 16px 40px rgba(11,20,38,.35); padding: 6px; display: grid; gap: 2px; max-height: 60vh; overflow: auto; }
.side .prod-menu[hidden] { display: none; }
.side .prod-menu button { border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 8px; font: 600 13px var(--ui-font); color: var(--ui-ink); cursor: pointer; }
.side .prod-menu button:hover { background: var(--ui-line2); }
.side .prod-menu button.on { background: var(--ui-blue50); color: var(--ui-blue); }
html body .side #uiNav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.side .nav-link { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 12px; border-radius: 9px; color: var(--ui-navy-text); font: 500 14px var(--ui-font); cursor: pointer; }
.side .nav-link svg { width: 17px; height: 17px; opacity: .8; flex: none; }
.side .nav-link:hover { background: var(--ui-navy2); color: #fff; }
.side .nav-link.on { background: var(--ui-blue); color: #fff; font-weight: 600; }
.side .nav-link.on svg { opacity: 1; }
.side .nav-link .n { margin-left: auto; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; background: var(--ui-navy3); color: #c9d5ec; }
.side .nav-link .n.alert { background: #e5484d; color: #fff; }
.side .nav-link .n[hidden] { display: none; }
.side #uiNav .grp { padding: 14px 12px 6px; }
.side .me .me-actions { gap: 6px; }

/* ---- top bar ---- */
#companySwitch[hidden], .company-switch[hidden] { display: none !important; }
.tb-toggle { flex: none; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--ui-line); background: #fff; color: var(--ui-ink2); display: grid; place-items: center; cursor: pointer; padding: 0; }
.tb-toggle:hover { border-color: #cdd5e2; color: var(--ui-ink); }
.tb-toggle svg { width: 17px; height: 17px; }
.topbar .crumb { color: var(--ui-muted); font-weight: 500; white-space: nowrap; }
.topbar .crumb b { color: var(--ui-ink); }
.topbar .gsearch { position: relative; margin-left: auto; width: min(340px, 36vw); display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--ui-line); border-radius: 10px; padding: 0 10px; height: 36px; color: var(--ui-faint); }
.topbar .gsearch[hidden] { display: none; }
.topbar .gsearch svg { width: 15px; height: 15px; flex: none; }
.topbar .gsearch input { border: 0; box-shadow: none !important; background: transparent; padding: 0; height: 100%; flex: 1; min-width: 0; font-size: 13px; color: var(--ui-ink); }
.topbar .gsearch:focus-within { border-color: var(--ui-blue); box-shadow: 0 0 0 3px rgba(47,107,255,.14); }
.topbar .gsearch kbd { font: 600 11px var(--ui-font); border: 1px solid var(--ui-line); border-radius: 5px; padding: 1px 5px; color: var(--ui-faint); }
.gs-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--ui-line); border-radius: 12px; box-shadow: 0 16px 40px rgba(15,23,42,.16); padding: 6px; display: grid; gap: 2px; z-index: 70; }
.gs-results[hidden] { display: none; }
.gs-results button { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: 500 13px var(--ui-font); color: var(--ui-ink); }
.gs-results button:hover { background: var(--ui-line2); }
.gs-results button span { color: var(--ui-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-results em { font: 700 10.5px var(--ui-font); font-style: normal; padding: 2px 6px; border-radius: 5px; background: var(--ui-blue50); color: var(--ui-blue); }
.gs-results em.sale { background: var(--ui-amber50); color: var(--ui-amber); }
.gs-results p { margin: 0; padding: 10px; color: var(--ui-muted); font-size: 13px; }
html body .topbar .live-pill { margin-left: 0; }
body.side-hidden .app { grid-template-columns: minmax(0, 1fr); }
body.side-hidden .side { display: none; }

/* ---- page heading ---- */
html body #pageKicker { display: none; }
html body .pagebar { padding-top: 26px; }
.ui-sub { color: var(--ui-muted); margin-top: 3px; font-size: 14px; }
.ui-sub:empty { display: none; }
html body #recordTabs { display: none !important; }

/* ---- summary figures above Purchases / Sales ---- */
.ui-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 16px; }
.ui-stats[hidden] { display: none; }
.ui-stats .stat { background: #fff; border: 1px solid var(--ui-line); border-radius: var(--ui-r); padding: 16px 18px; box-shadow: var(--ui-shadow); min-width: 0; }
.ui-stats .stat .l { display: flex; align-items: center; justify-content: space-between; color: var(--ui-muted); font-size: 12.5px; font-weight: 500; }
.ui-stats .stat .l i { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.ui-stats .stat .l svg { width: 15px; height: 15px; }
.ui-stats .stat b { display: block; font-size: 21px; margin-top: 6px; letter-spacing: -.4px; font-weight: 700; overflow-wrap: anywhere; }
.ui-stats .stat b.red { color: var(--ui-red); }
.ui-stats .stat small { color: var(--ui-faint); font-size: 12px; }
.i-blue { background: var(--ui-blue50); color: var(--ui-blue); } .i-red { background: var(--ui-red50); color: var(--ui-red); }
.i-amber { background: var(--ui-amber50); color: var(--ui-amber); } .i-green { background: var(--ui-green50); color: var(--ui-green); }
@media (max-width: 1100px) { .ui-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- deal list ---- */
html body #recordsTable.table-card { padding: 0; overflow: hidden; }
#recordsTable > .dialog-actions { justify-content: flex-end; gap: 8px; padding: 10px 14px; margin: 0; border-bottom: 1px solid var(--ui-line); }
.ui-listbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--ui-line); }
.ui-listbar .sp { flex: 1; }
.ui-seg { display: flex; gap: 2px; background: #f1f4f8; padding: 3px; border-radius: 10px; }
.ui-seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font: 600 12.5px var(--ui-font); color: var(--ui-muted); cursor: pointer; }
.ui-seg button.on { background: #fff; color: var(--ui-ink); box-shadow: 0 1px 2px rgba(15,23,42,.1); }
.ui-seg button em { font-style: normal; color: var(--ui-faint); margin-left: 4px; }
.ui-lsearch input { width: 240px; max-width: 100%; padding: 7px 11px; border: 1px solid var(--ui-line); border-radius: 10px; font-size: 13px; }
html body table.trade-compact { width: 100%; border-collapse: collapse; font-size: 14px; }
html body table.trade-compact thead th { position: sticky; top: 60px; z-index: 4; background: #f8fafc; text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--ui-line); box-shadow: none; }
html body table.trade-compact td { padding: 13px 14px; border-bottom: 1px solid var(--ui-line2); vertical-align: middle; white-space: nowrap; overflow: visible; }
html body table.trade-compact th.num, html body table.trade-compact td.num { text-align: right; }
html body table.trade-compact tbody tr:last-child td { border-bottom: 0; }
table.trade-compact .ref { font-weight: 650; color: var(--ui-ink); }
table.trade-compact small { display: block; font-weight: 400; color: var(--ui-faint); font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
table.trade-compact .p b { font-weight: 550; display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.prod-chip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: #f1f4f8; color: var(--ui-ink2); }
table.trade-compact td.prog { min-width: 150px; }
.track { display: block; height: 6px; border-radius: 9px; background: #f1f4f8; overflow: hidden; margin-bottom: 6px; }
.track i { display: block; height: 100%; background: var(--ui-blue); border-radius: 9px; }
.track i.full { background: var(--ui-green); }
table.trade-compact .prog small { color: var(--ui-muted); }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 600; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.open { background: var(--ui-blue50); color: var(--ui-blue); } .pill.due { background: var(--ui-red50); color: var(--ui-red); }
.pill.adv { background: var(--ui-amber50); color: var(--ui-amber); } .pill.done { background: var(--ui-green50); color: var(--ui-green); }
.money-red { color: var(--ui-red); font-weight: 650; } .money-amber { color: var(--ui-amber); font-weight: 600; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .05em; padding: 1px 6px; border-radius: 5px; background: var(--ui-amber50); color: var(--ui-amber); margin-left: 4px; }
.ui-listfoot { padding: 11px 14px; color: var(--ui-muted); font-size: 12.5px; border-top: 1px solid var(--ui-line); }
.row-actions [data-trade-open] { display: none; }
.row-actions .more-btn { border: 0; background: transparent; font-size: 17px; color: var(--ui-faint); padding: 2px 8px; border-radius: 7px; line-height: 1; letter-spacing: 0; }
.row-actions .more-btn:hover { background: #f1f4f8; color: var(--ui-ink); }

/* ---- animations play centre-screen at the moment of the task ---- */
.nm-m { right: auto !important; bottom: auto !important; left: 50% !important; top: 50% !important; width: 440px; max-width: calc(100vw - 32px);
  transform: translate(-50%, -46%) scale(.96) !important; box-shadow: 0 0 0 100vmax rgba(11,20,38,.38), 0 30px 80px rgba(11,20,38,.35) !important; z-index: 10001 !important; }
.nm-m.nm-open { transform: translate(-50%, -50%) scale(1) !important; }
.nm-m .stage { height: 250px; }
@media (max-width: 980px) { html body .topbar .gsearch { display: none; } .ui-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- deal drawer heading, bottom action bar, plain pages ---- */
.ui-hd { min-width: 0; }
.ui-kick { display: block; font-size: 12px; color: var(--ui-muted); font-weight: 500; margin-bottom: 4px; }
#tripSheetDialog .ui-hd h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 21px; letter-spacing: -.3px; }
.ui-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ui-muted); margin-top: 8px; font-size: 13px; }
.ui-facts b { color: var(--ui-ink); font-weight: 600; }
.pill.grey { background: #f1f4f8; color: var(--ui-muted); }
#tripSheetDialog .ui-body { display: flex; flex-direction: column; }
#tripSheetDialog .ui-body > .dialog-actions { margin-top: auto; }
html body #recordsTable > :is(h3, p, pre, details, .hint, .review-warning, form, label) { margin-left: 18px; margin-right: 18px; }
html body #recordsTable > :is(h3, p, details):first-child { margin-top: 16px; }
html body #recordsTable > :is(p, h3):last-child { margin-bottom: 16px; }

/* ======================================================================================================
   v0.8.28 - "Floating Sheet" design chosen by the owner: no side menu, the page sits on one floating sheet,
   the menu is a dock at the bottom of the screen, and a dark blue mode. Colours are the motion kit's own
   (blue #2B7BFF / #1F63E0 / #123F99, ink #0B0D12, ground #EEF2F9), so screens and animations match.
   Look and layout only: every button, id and data path is unchanged.
   ====================================================================================================== */
:root {
  --ui-bg: #EEF2F9; --ui-panel: #FFFFFF; --ui-line: #E3E8F2; --ui-line2: #EEF1F7; --ui-ink: #0B0D12; --ui-ink2: #2B3345;
  --ui-muted: #4A5468; --ui-faint: #9AA3B5; --ui-soft: #F7F9FD;
  --ui-blue: #2B7BFF; --ui-blue600: #1F63E0; --ui-blue-ink: #123F99; --ui-blue50: #EAF1FF; --ui-blue100: #C9DAFF;
  --ui-red: #C62828; --ui-red50: #FDECEB; --ui-amber: #9A4A00; --ui-amber50: #FFF1E3; --ui-green: #0E6B57; --ui-green50: #E6F6F2;
  --ui-warn: #E8590C;
  --ui-ground: linear-gradient(160deg, #E3ECFF 0%, #EEF2F9 45%, #E9EDF5 100%);
  --ui-sheet-shadow: 0 0 0 1px rgba(11,13,18,.06), 0 30px 70px rgba(18,63,153,.14);
  --ui-glass: rgba(247,249,253,.88);
  --ui-dock: rgba(255,255,255,.62); --ui-dock-line: rgba(255,255,255,.85); --ui-dock-shadow: 0 24px 50px rgba(18,63,153,.18), inset 0 1px 0 #fff;
  --ui-spring: cubic-bezier(.34,1.56,.64,1); --ui-ease: cubic-bezier(.22,1,.36,1);
}
html.theme-dark {
  color-scheme: dark;
  --ui-bg: #071330; --ui-panel: #0D1C3B; --ui-line: #1B2E57; --ui-line2: #152648; --ui-ink: #E8EEFC; --ui-ink2: #C3D0EC;
  --ui-muted: #93A6CF; --ui-faint: #6B80AD; --ui-soft: #0A1834;
  --ui-blue: #3D88FF; --ui-blue600: #5B97FF; --ui-blue-ink: #9DBBF5; --ui-blue50: rgba(61,136,255,.16); --ui-blue100: rgba(61,136,255,.3);
  --ui-red: #FF8A80; --ui-red50: rgba(255,107,107,.14); --ui-amber: #F5B26B; --ui-amber50: rgba(245,178,107,.14); --ui-green: #5FD8B0; --ui-green50: rgba(95,216,176,.14);
  --ui-warn: #F5A05B;
  --ui-ground: linear-gradient(160deg, #0B1A3F 0%, #071330 50%, #050E25 100%);
  --ui-sheet-shadow: 0 0 0 1px rgba(157,187,245,.10), 0 30px 80px rgba(0,0,0,.45);
  --ui-glass: rgba(10,24,52,.86);
  --ui-dock: rgba(8,20,46,.7); --ui-dock-line: rgba(157,187,245,.16); --ui-dock-shadow: 0 24px 50px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06);
  /* the older token layers follow */
  --surface: var(--ui-panel); --page: var(--ui-bg); --text: var(--ui-ink); --muted: var(--ui-muted); --line: var(--ui-line);
  --navy: var(--ui-ink); --navy-dark: #050E25; --navy-soft: var(--ui-ink2); --shadow: 0 8px 28px rgba(0,0,0,.35);
  --blue-soft: var(--ui-blue50); --green-soft: var(--ui-green50); --amber-soft: var(--ui-amber50); --red-soft: var(--ui-red50); --teal-soft: var(--ui-blue50);
  --blue: var(--ui-blue600); --green: var(--ui-green); --amber: var(--ui-amber); --red: var(--ui-red);
}
html.theme-anim, html.theme-anim body, html.theme-anim .sheet, html.theme-anim .topbar, html.theme-anim .card, html.theme-anim td, html.theme-anim th, html.theme-anim .dock, html.theme-anim .ui-stats {
  transition: background-color .5s ease, color .4s ease, border-color .5s ease, box-shadow .5s ease !important; }

/* ---- ground, sheet, top bar ---- */
html body { background: var(--ui-ground); background-attachment: fixed; color: var(--ui-ink); }
html body .app { display: block; min-height: 100vh; padding: 22px 28px 118px; }
html body .app.hidden { display: none; }
html body .sheet { max-width: 1680px; margin: 0 auto; min-height: calc(100vh - 140px); background: var(--ui-panel); border-radius: 22px; box-shadow: var(--ui-sheet-shadow); }
html body .topbar { position: sticky; top: 0; z-index: 30; height: 64px; padding: 0 22px; gap: 14px; border-radius: 22px 22px 0 0;
  background: var(--ui-glass); backdrop-filter: blur(12px) saturate(1.4); border-bottom: 1px solid var(--ui-line); }
.topbar .brandrow { display: flex; align-items: center; gap: 10px; flex: none; }
.topbar .ui-mark { width: 32px; height: 32px; border-radius: 9px; background: #0B0D12; transition: transform .5s var(--ui-spring); }
html.theme-dark .topbar .ui-mark { background: #000; box-shadow: 0 0 0 1px rgba(157,187,245,.18); }
.topbar .brandrow:hover .ui-mark { transform: rotate(-8deg) scale(1.08); }
.topbar .ui-mark svg { width: 18px; height: 17px; }
.topbar .ui-word b { color: var(--ui-ink); font-size: 13.5px; } .topbar .ui-word span { color: var(--ui-blue); font-size: 7.5px; }
.tb-sep { width: 1px; height: 26px; background: var(--ui-line); flex: none; }
.topbar .prod { position: relative; flex: none; }
.topbar .prod .sw { display: grid; grid-template-columns: auto 14px; column-gap: 6px; align-items: end; text-align: left; border: 0; background: transparent; padding: 3px 8px; border-radius: 9px; cursor: pointer; color: var(--ui-ink); font: inherit; transition: background .2s; }
.topbar .prod .sw small { grid-column: 1; font-size: 10.5px; color: var(--ui-faint); font-weight: 500; line-height: 1.1; }
.topbar .prod .sw b { grid-column: 1; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.topbar .prod .sw svg { grid-column: 2; grid-row: 1 / span 2; width: 14px; height: 14px; color: var(--ui-faint); align-self: center; transition: transform .3s var(--ui-spring); }
.topbar .prod .sw[aria-expanded="true"] svg { transform: rotate(180deg); }
.topbar .prod .sw:hover:not(:disabled) { background: var(--ui-blue50); }
.topbar .prod .sw:disabled { cursor: default; } .topbar .prod .sw.single svg { display: none; }
.topbar .prod-menu { position: absolute; left: 0; top: calc(100% + 8px); min-width: 230px; z-index: 80; background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: 14px;
  box-shadow: 0 20px 44px rgba(11,13,18,.18); padding: 6px; display: grid; gap: 2px; animation: ui-pop .28s var(--ui-ease); }
.topbar .prod-menu[hidden] { display: none; }
.topbar .prod-menu button { border: 0; background: transparent; text-align: left; padding: 9px 11px; border-radius: 9px; font: 600 13px var(--ui-font); color: var(--ui-ink); cursor: pointer; }
.topbar .prod-menu button:hover { background: var(--ui-line2); } .topbar .prod-menu button.on { background: var(--ui-blue50); color: var(--ui-blue600); }
@keyframes ui-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.topbar .crumb[hidden] { display: none; }
.topbar .gsearch { margin-left: auto; width: min(360px, 34vw); height: 38px; border-radius: 11px; background: var(--ui-panel); border-color: var(--ui-line); }
html.theme-dark .topbar .gsearch { background: var(--ui-soft); }
html body .topbar .live-pill { background: var(--ui-panel); border-color: var(--ui-line); color: var(--ui-muted); }
html body .topbar .live-pill.on { background: var(--ui-green50); color: var(--ui-green); border-color: transparent; }
.tb-icon { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--ui-line); background: var(--ui-panel); color: var(--ui-ink2); display: grid; place-items: center; cursor: pointer; padding: 0; transition: transform .35s var(--ui-spring), background .2s; }
.tb-icon:hover { transform: rotate(-14deg) scale(1.08); } .tb-icon:active { transform: scale(.92); }
.tb-icon svg { width: 18px; height: 18px; } .tb-icon .ic-sun { display: none; }
html.theme-dark .tb-icon .ic-sun { display: block; color: #F5C76B; } html.theme-dark .tb-icon .ic-moon { display: none; }
.topbar .me { position: relative; flex: none; }
.topbar .me .av { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--ui-blue); color: #fff; font: 700 12.5px var(--ui-font); cursor: pointer; display: grid; place-items: center; padding: 0; transition: transform .35s var(--ui-spring), box-shadow .2s; }
.topbar .me .av:hover { transform: scale(1.08); box-shadow: 0 6px 16px rgba(43,123,255,.35); }
.me-pop { position: absolute; right: 0; top: calc(100% + 10px); z-index: 80; width: 250px; background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: 14px; box-shadow: 0 20px 44px rgba(11,13,18,.2); padding: 14px; display: grid; gap: 12px; animation: ui-pop .28s var(--ui-ease); }
.me-pop[hidden] { display: none; }
.me-pop .identity { display: grid; line-height: 1.3; } .me-pop .identity strong { font-size: 14px; color: var(--ui-ink); } .me-pop .identity span { font-size: 12.5px; color: var(--ui-muted); }
.me-pop .me-actions { display: grid; gap: 6px; }
html body .me-pop .top-quiet { width: 100%; justify-content: flex-start; min-height: 36px; padding: 7px 11px; border-radius: 9px; border: 1px solid var(--ui-line); background: var(--ui-soft); color: var(--ui-ink); font: 600 13px var(--ui-font); }
html body .me-pop .top-quiet:hover { border-color: var(--ui-blue); color: var(--ui-blue600); }
html body .ui-legacy-nav { display: none !important; }

/* ---- page heading and body inside the sheet ---- */
html body .pagebar { padding: 26px 30px 8px; }
html body #pageTitle { font-size: 30px; letter-spacing: -.8px; font-weight: 700; color: var(--ui-ink); }
html body main, html body main:is(*) { padding: 14px 30px 36px; }
html body .appfoot { padding: 0 30px 18px; }
html body table.trade-compact thead th { top: 64px; background: var(--ui-soft); color: var(--ui-faint); }

/* ---- the four figures: one quiet line, no boxes ---- */
html body .ui-stats { gap: 0; background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: 16px; padding: 16px 0; margin: 0 0 20px; }
html body .ui-stats .stat { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 2px 22px; display: flex; flex-direction: column; gap: 2px; transition: transform .45s var(--ui-spring); }
html body .ui-stats .stat + .stat { border-left: 1px solid var(--ui-line); }
html body .ui-stats .stat:hover { transform: translateY(-3px) scale(1.03); }
html body .ui-stats .stat .l { font-size: 12.5px; color: var(--ui-muted); font-weight: 500; display: block; }
html body .ui-stats .stat b { font-size: 25px; letter-spacing: -.6px; margin: 0; color: var(--ui-ink); font-variant-numeric: tabular-nums; }
html body .ui-stats .stat b.red { color: var(--ui-warn); }
html body .ui-stats .stat em { font-style: normal; font-size: 12px; color: var(--ui-faint); }
@media (max-width: 1100px) { html body .ui-stats .stat:nth-child(3) { border-left: 0; } html body .ui-stats { row-gap: 14px; } }

/* ---- list: card, sliding filter, rows that lift under the pointer ---- */
html body #recordsTable.table-card, html body .card { background: var(--ui-panel); border-color: var(--ui-line); }
html body #recordsTable.table-card { border-radius: 18px; box-shadow: 0 8px 24px rgba(18,63,153,.06); }
.ui-seg { position: relative; background: var(--ui-soft); border: 1px solid var(--ui-line); }
.ui-seg .sind { position: absolute; top: 3px; left: 0; height: calc(100% - 6px); border-radius: 8px; background: var(--ui-panel); box-shadow: 0 1px 3px rgba(11,13,18,.12), 0 0 0 1px var(--ui-line);
  transition: transform .5s var(--ui-spring), width .5s var(--ui-spring); pointer-events: none; }
.ui-seg button { position: relative; z-index: 1; transition: color .25s; }
.ui-seg.has-ind button.on { background: transparent; box-shadow: none; }
.ui-seg button.on em { color: var(--ui-blue600); }
html.theme-dark .ui-seg .sind { background: #1B2E57; box-shadow: none; }
.ui-lsearch input { background: var(--ui-soft); color: var(--ui-ink); border-color: var(--ui-line); transition: border-color .2s, box-shadow .2s, width .4s var(--ui-spring); }
.ui-lsearch input:focus { outline: 0; border-color: var(--ui-blue); box-shadow: 0 0 0 4px rgba(43,123,255,.14); width: 290px; }
html body table.trade-compact tbody tr { transition: transform .35s var(--ui-spring), box-shadow .35s; }
@media (hover: hover) and (pointer: fine) {
  html body table.trade-compact tbody tr:hover { transform: scale(1.008); box-shadow: 0 12px 30px rgba(18,63,153,.13); position: relative; z-index: 2; }
  html body table.trade-compact tbody tr:hover td { background: var(--ui-panel); }
  html.theme-dark table.trade-compact tbody tr:hover { box-shadow: 0 12px 30px rgba(0,0,0,.45), 0 0 0 1px rgba(61,136,255,.35); }
  html body table.trade-compact tbody tr:hover .ref { color: var(--ui-blue600); }
}
html body table.trade-compact td { border-bottom-color: var(--ui-line2); }
.track { background: var(--ui-line2); } .prod-chip { background: var(--ui-line2); color: var(--ui-ink2); }
.pill.open { background: var(--ui-blue50); color: var(--ui-blue600); }
.pill.due { background: var(--ui-amber50); color: var(--ui-amber); }
.pill.adv { background: var(--ui-blue50); color: var(--ui-blue-ink); }
.pill.done { background: var(--ui-green50); color: var(--ui-green); }
.money-red { color: var(--ui-warn); }

/* ---- the dock (bottom of the screen) ---- */
html body .dock { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60;
  display: flex; align-items: flex-end; gap: 9px; padding: 9px 11px; border-radius: 22px; max-width: calc(100vw - 24px);
  background: var(--ui-dock); border: 1px solid var(--ui-dock-line); box-shadow: var(--ui-dock-shadow); backdrop-filter: blur(18px) saturate(1.6); }
.app.hidden + .dock, .app.hidden .dock { display: none; }
.dock .dk { --s: 1; --ic-ac: #C9DAFF; position: relative; flex: none; width: calc(46px * var(--s)); height: calc(46px * var(--s)); border-radius: calc(13px * var(--s));
  display: grid; place-items: center; padding: 0; border: 0; cursor: pointer; color: #fff;
  background: linear-gradient(165deg, #5B97FF 0%, #2B7BFF 46%, #1F63E0 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 10px rgba(18,63,153,.28);
  transition: width .16s ease-out, height .16s ease-out, border-radius .16s ease-out, filter .2s; }
.dock .dk svg { width: calc(23px * var(--s)); height: calc(23px * var(--s)); transition: width .16s ease-out, height .16s ease-out; }
.dock .dk.grey { --ic-ac: #C3CCDD; background: linear-gradient(165deg, #69728A 0%, #4A5468 55%, #3A4356 100%); }
.dock .dk:hover { filter: brightness(1.06); }
.dock .dk .tip { position: absolute; left: 50%; bottom: calc(100% + 14px); transform: translate(-50%, 6px); opacity: 0; pointer-events: none; white-space: nowrap;
  background: rgba(11,13,18,.9); color: #fff; font: 600 12px var(--ui-font); padding: 5px 10px; border-radius: 8px; box-shadow: 0 8px 20px rgba(11,13,18,.25); transition: opacity .15s, transform .25s var(--ui-spring); }
.dock .dk:hover .tip, .dock .dk:focus-visible .tip { opacity: 1; transform: translate(-50%, 0); }
.dock .dk.on::after { content: ""; position: absolute; bottom: -7px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--ui-blue); }
html.theme-dark .dock .dk.on::after { background: #9DBBF5; }
.dock .dk .n { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; display: grid; place-items: center; font: 700 10px var(--ui-font); background: var(--ui-warn); color: #fff; border-radius: 999px; padding: 0 5px; box-shadow: 0 0 0 2px var(--ui-panel); }
.dock .dk .n[hidden] { display: none; }
.dock .dk:focus-visible { outline: 3px solid #9DBBF5; outline-offset: 2px; }
.dock .dsep { width: 1px; align-self: stretch; margin: 6px 2px; background: rgba(11,13,18,.14); flex: none; }
html.theme-dark .dock .dsep { background: rgba(157,187,245,.2); }
.dock .dk.bounce { animation: ui-bounce .65s var(--ui-spring); }
@keyframes ui-bounce { 30% { translate: 0 -16px; } 60% { translate: 0 0; } 80% { translate: 0 -5px; } }
@media (max-width: 760px) {
  html body .app { padding: 10px 10px 96px; } html body .sheet { border-radius: 16px; } html body .topbar { border-radius: 16px 16px 0 0; padding: 0 12px; gap: 8px; }
  .topbar .ui-word, .tb-sep, .topbar .live-pill #liveLabel { display: none; }
  html body .dock { left: 8px; right: 8px; transform: none; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .dock .dk .tip { display: none; }
}

/* ---- entrance: once, when you move to another page (never on a background refresh) ---- */
@keyframes ui-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
body.ui-enter .pagebar > div:first-child { animation: ui-rise .6s var(--ui-ease) both; }
body.ui-enter #uiStats .stat, body.ui-enter #recordsTable .ui-listbar, body.ui-enter #recordsTable tbody tr,
body.ui-enter #taskList > *, body.ui-enter #companySummary > *, body.ui-enter #recordsTable > :not(table):not(.ui-listbar) { animation: ui-rise .7s var(--ui-ease) both; }
body.ui-enter #uiStats .stat:nth-child(1) { animation-delay: .08s; } body.ui-enter #uiStats .stat:nth-child(2) { animation-delay: .13s; }
body.ui-enter #uiStats .stat:nth-child(3) { animation-delay: .18s; } body.ui-enter #uiStats .stat:nth-child(4) { animation-delay: .23s; }
body.ui-enter #recordsTable .ui-listbar { animation-delay: .22s; }
body.ui-enter #recordsTable tbody tr:nth-child(1), body.ui-enter #taskList > :nth-child(1) { animation-delay: .28s; }
body.ui-enter #recordsTable tbody tr:nth-child(2), body.ui-enter #taskList > :nth-child(2) { animation-delay: .32s; }
body.ui-enter #recordsTable tbody tr:nth-child(3), body.ui-enter #taskList > :nth-child(3) { animation-delay: .36s; }
body.ui-enter #recordsTable tbody tr:nth-child(4), body.ui-enter #taskList > :nth-child(4) { animation-delay: .40s; }
body.ui-enter #recordsTable tbody tr:nth-child(5), body.ui-enter #taskList > :nth-child(5) { animation-delay: .44s; }
body.ui-enter #recordsTable tbody tr:nth-child(6), body.ui-enter #taskList > :nth-child(6) { animation-delay: .48s; }
body.ui-enter #recordsTable tbody tr:nth-child(7) { animation-delay: .52s; } body.ui-enter #recordsTable tbody tr:nth-child(8) { animation-delay: .56s; }
body.ui-enter #recordsTable tbody tr:nth-child(n+9) { animation-delay: .6s; }
body.ui-enter #recordsTable .track i { animation: ui-fill 1.1s var(--ui-ease) .45s both; }
@keyframes ui-fill { from { width: 0; } }
html.motion-off body.ui-enter *, html.motion-off .dock .dk, html.motion-off .dock .dk.bounce, html.motion-off .ui-seg .sind, html.motion-off body table.trade-compact tbody tr { animation: none !important; transition: none !important; }

/* ---- dark blue mode: everything else on the page ---- */
html.theme-dark body { color: var(--ui-ink); }
html.theme-dark .card, html.theme-dark dialog, html.theme-dark .dialog-content, html.theme-dark .task, html.theme-dark .metric-card,
html.theme-dark .side-card, html.theme-dark .gs-results, html.theme-dark .row-menu, html.theme-dark .connector-card, html.theme-dark .groups-card { background: var(--ui-panel); color: var(--ui-ink); border-color: var(--ui-line); }
html.theme-dark input, html.theme-dark select, html.theme-dark textarea { background: var(--ui-soft); color: var(--ui-ink); border-color: var(--ui-line); }
html.theme-dark input::placeholder, html.theme-dark textarea::placeholder { color: var(--ui-faint); }
html.theme-dark table th { background: var(--ui-soft); color: var(--ui-faint); border-color: var(--ui-line); }
html.theme-dark table td { border-color: var(--ui-line2); color: var(--ui-ink); }
html.theme-dark .button.quiet, html.theme-dark .button.secondary, html.theme-dark .button.top-quiet { background: var(--ui-soft); color: var(--ui-ink); border-color: var(--ui-line); }
html.theme-dark .button.primary { background: var(--ui-blue); border-color: var(--ui-blue); color: #fff; }
html.theme-dark h1, html.theme-dark h2, html.theme-dark h3, html.theme-dark strong { color: var(--ui-ink); }
html.theme-dark p, html.theme-dark small, html.theme-dark .hint { color: var(--ui-muted); }
html.theme-dark .side-figures div { background: var(--ui-soft); border-color: var(--ui-line); }
html.theme-dark dialog::backdrop { background: rgba(2,8,22,.6); }

/* the motion kit follows the mode, so its panels match the screen */
html.theme-dark .nm-m { --ground: #0B1A36; --surface: #0D1C3B; --ink: #E8EEFC; --muted: #93A6CF; --line: #1B2E57; --soft: #0A1834;
  --blue-soft: rgba(61,136,255,.18); --blue-ink: #9DBBF5; --amber-soft: rgba(245,178,107,.16); --amber-ink: #F5B26B; --green-soft: rgba(95,216,176,.16); --green-ink: #5FD8B0;
  background: #0D1C3B !important; color: #E8EEFC; box-shadow: 0 0 0 100vmax rgba(2,8,22,.55), 0 30px 80px rgba(0,0,0,.55) !important; }

/* ---- dark blue mode: every surface the older stylesheets paint white ---- */
html.theme-dark body .card, html.theme-dark body .table-card, html.theme-dark body .empty, html.theme-dark body .task, html.theme-dark body .metric,
html.theme-dark body .metric-card, html.theme-dark body .row-menu, html.theme-dark body .gs-results, html.theme-dark body dialog,
html.theme-dark body #tripSheetDialog .dialog-head, html.theme-dark body #tripSheetDialog .deal-actions, html.theme-dark body #tripSheetDialog .dialog-actions,
html.theme-dark body .company-switch button, html.theme-dark body .settings-button, html.theme-dark body .tabs .tab, html.theme-dark body .tab { background: var(--ui-panel); color: var(--ui-ink); border-color: var(--ui-line); }
html.theme-dark body .empty { border-color: var(--ui-line); color: var(--ui-muted); }
html.theme-dark body .ui-money div, html.theme-dark body .side-figures div, html.theme-dark body .evidence, html.theme-dark body .order-totals,
html.theme-dark body .edit-update, html.theme-dark body .prod-chip, html.theme-dark body .pill.grey { background: var(--ui-soft); border-color: var(--ui-line); color: var(--ui-ink); }
html.theme-dark body .ui-money div.red b { color: var(--ui-red); } html.theme-dark body .ui-money div.amber b { color: var(--ui-amber); }
html.theme-dark body .settings-tabs, html.theme-dark body .segmented { background: var(--ui-soft); }
html.theme-dark body .settings-tabs button, html.theme-dark body .segmented button { color: var(--ui-muted); background: transparent; }
html.theme-dark body .settings-tabs button.active, html.theme-dark body .segmented button.active { background: var(--ui-line); color: var(--ui-ink); box-shadow: none; }
html.theme-dark body .button.quiet, html.theme-dark body .button.secondary { background: var(--ui-soft); color: var(--ui-ink); border-color: var(--ui-line); }
html.theme-dark body .button.danger { background: rgba(255,107,107,.12); color: var(--ui-red); border-color: rgba(255,107,107,.3); }
html.theme-dark body input, html.theme-dark body select, html.theme-dark body textarea,
html.theme-dark body #teamList select, html.theme-dark body .records-toolbar select { background: var(--ui-soft); color: var(--ui-ink); border-color: var(--ui-line); }
html.theme-dark body th, html.theme-dark body .table-card table th, html.theme-dark body table.trade-compact thead th { background: var(--ui-soft); color: var(--ui-faint); border-color: var(--ui-line); }
html.theme-dark body td { border-color: var(--ui-line2); }
html.theme-dark body .clear-records { background: rgba(255,138,128,.06); border-color: rgba(255,138,128,.25); }
html.theme-dark body .review-warning, html.theme-dark body .intelligence-banner.offline, html.theme-dark body #tripSheetForm .notice,
html.theme-dark body .stage-row.missing { background: var(--ui-amber50); color: var(--ui-amber); border-color: rgba(245,178,107,.3); }
html.theme-dark body .ui-login, html.theme-dark body .ui-login .ul-right { background: var(--ui-bg); }
html.theme-dark body .ui-login .ul-form h3 { color: var(--ui-ink); }
html.theme-dark body .ui-login .field input { background: var(--ui-panel); color: var(--ui-ink); border-color: var(--ui-line); }
html.theme-dark body .dialog-head h2, html.theme-dark body .ui-hd h2, html.theme-dark body #tripSheetDialog h2 { color: var(--ui-ink); }
html.theme-dark body .ui-facts, html.theme-dark body .ui-kick { color: var(--ui-muted); } html.theme-dark body .ui-facts b { color: var(--ui-ink); }
html.theme-dark body .ui-tabs button { color: var(--ui-muted); } html.theme-dark body .ui-tabs button.on { color: var(--ui-blue600); }
/* small notices sit above the dock, never on top of it */
html body #toast.toast { bottom: calc(102px + env(safe-area-inset-bottom, 0px)); background: #0B0D12; color: #fff; }
html.theme-dark body #toast.toast { background: #1B2E57; color: #E8EEFC; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
html.theme-dark body label, html.theme-dark body .field, html.theme-dark body .form-grid label { color: var(--ui-ink2); }

/* ---- v0.8.29: Animations switch, goodbye on sign-out, sign-in page entrance ---- */
.motion-sw { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 1px solid var(--ui-line); background: var(--ui-soft); color: var(--ui-ink); border-radius: 9px; padding: 8px 11px; font: 600 13px var(--ui-font); cursor: pointer; }
.motion-sw i { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--ui-line); transition: background .25s; flex: none; }
.motion-sw i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(11,13,18,.3); transition: transform .3s var(--ui-spring); }
.motion-sw[aria-checked="true"] i { background: var(--ui-blue); }
.motion-sw[aria-checked="true"] i::after { transform: translateX(14px); }
.ui-bye { position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center; background: var(--ui-ground); animation: bye-bg .35s ease both; }
.ui-bye .bye-in { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.ui-bye .bye-mark { width: 72px; height: 72px; border-radius: 20px; background: #0B0D12; display: grid; place-items: center; margin-bottom: 10px; position: relative;
  box-shadow: 0 18px 40px rgba(18,63,153,.25); animation: bye-mark .9s var(--ui-spring) both .05s; }
.ui-bye .bye-mark::after { content: ""; position: absolute; inset: -8px; border-radius: 26px; border: 3px solid #2B7BFF; opacity: 0; animation: bye-ring 1s var(--ui-ease) .35s both; }
.ui-bye .bye-mark svg { width: 40px; height: 37px; }
.ui-bye b { font: 700 24px var(--ui-font); letter-spacing: -.5px; color: var(--ui-ink); animation: ui-rise .6s var(--ui-ease) .25s both; }
.ui-bye span { color: var(--ui-muted); font-size: 15px; animation: ui-rise .6s var(--ui-ease) .35s both; }
.ui-bye .bye-bar { display: block; width: 160px; height: 4px; border-radius: 9px; margin-top: 18px; background: var(--ui-line); overflow: hidden; position: relative; }
.ui-bye .bye-bar::after { content: ""; position: absolute; inset: 0; background: var(--ui-blue); transform-origin: left; animation: bye-bar 1.35s var(--ui-ease) both .1s; }
@keyframes bye-bg { from { opacity: 0; } to { opacity: 1; } }
@keyframes bye-mark { 0% { transform: scale(.4) rotate(-12deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes bye-ring { 0% { opacity: .9; transform: scale(.85); } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes bye-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* sign-in page: the welcome text and the form rise in when the page opens */
.ui-login .ul-left > * { animation: ui-rise .8s var(--ui-ease) both; }
.ui-login .ul-left > :nth-child(1) { animation-delay: .05s; } .ui-login .ul-left > :nth-child(2) { animation-delay: .15s; }
.ui-login .ul-left > :nth-child(3) { animation-delay: .25s; } .ui-login .ul-left > :nth-child(4) { animation-delay: .35s; }
.ui-login .ul-form > * { animation: ui-rise .7s var(--ui-ease) both; }
.ui-login .ul-form > :nth-child(1) { animation-delay: .2s; } .ui-login .ul-form > :nth-child(2) { animation-delay: .26s; } .ui-login .ul-form > :nth-child(3) { animation-delay: .32s; }
.ui-login .ul-form > :nth-child(4) { animation-delay: .38s; } .ui-login .ul-form > :nth-child(5) { animation-delay: .44s; } .ui-login .ul-form > :nth-child(n+6) { animation-delay: .5s; }
.ui-login .button.primary { transition: transform .3s var(--ui-spring), box-shadow .3s; }
.ui-login .button.primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(43,123,255,.35); }
.ui-login .button.primary:active { transform: scale(.97); }

/* hotfix row menu: opened menu sits on the page, above the dock */
body > .row-menu { z-index: 9000; }

/* v0.8.38 Documents pages: sub-page tabs, month / search toolbar, document numbers as links */
html body .segmented.doc-tabs { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; margin: 0 0 14px; }
.doc-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: 0 0 12px; }
.doc-toolbar label { display: grid; gap: 4px; font: 600 12px var(--ui-font); color: var(--ui-muted); }
.doc-toolbar select, .doc-toolbar input { min-width: 170px; }
.link-button { border: 0; background: none; padding: 0; color: var(--ui-blue); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-button:hover { color: var(--ui-ink); }
.summary-month { display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--ui-font); color: var(--ui-muted); }
.summary-month input { min-height: 0; padding: 5px 8px; }
/* v0.8.39 order file */
.order-file-sec { border-top: 1px solid var(--ui-line); padding-top: 10px; margin-top: 10px; }
.order-file-sec h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.order-file-slips { margin: 4px 0 8px; padding-left: 18px; display: grid; gap: 4px; }
/* v0.8.40 daily sheet */
.sheet-scroll { overflow-x: auto; }
table.daily-sheet td, table.daily-sheet th { white-space: nowrap; }
table.daily-sheet tfoot th { font-weight: 700; border-top: 2px solid var(--ui-line); }
/* v0.8.41 transport registers: long text in 3 lines, sideways scroll, Action column always visible, flags */
.fleet-scroll { overflow-x: auto; max-width: 100%; }
table.fleet-table td { vertical-align: top; }
table.fleet-table td, table.fleet-table th { min-width: 90px; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 260px; white-space: normal; }
.clamp3.open { display: block; -webkit-line-clamp: unset; }
table.fleet-table .sticky-action { position: sticky; right: 0; background: var(--ui-panel, #fff); box-shadow: -6px 0 8px -6px rgba(15,23,42,.18); z-index: 1; }
.fleet-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 120px; }
.fleet-actions .button { white-space: nowrap; }
td.fleet-flag { background: var(--ui-red50, #fdecea); color: var(--ui-red, #b3261e); font-weight: 600; cursor: help; }
.fuel-balance { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0 0 12px; }
.fuel-balance b { font-size: 1.25rem; }

/* v0.8.48 (owner, 2 Nov 2026: "the three dots are out of screen"): the PO / SO list is narrower (wrapping supplier
   names, smaller gaps) and its last column (the ... menu) stays inside the screen even when the table is wider. */
html body table.trade-compact th, html body table.trade-compact td { padding-left: 10px; padding-right: 10px; }
html body table.trade-compact td .p b, table.trade-compact .p b { max-width: 210px; white-space: normal; }
table.trade-compact td.prog { min-width: 120px; }
html body table.trade-compact tr > th:last-child, html body table.trade-compact tr > td:last-child {
  position: sticky; right: 0; z-index: 3; background: var(--ui-panel, #fff); box-shadow: -8px 0 10px -8px rgba(15,23,42,.18); }
html body table.trade-compact thead tr > th:last-child { z-index: 5; background: #f8fafc; }
html body table.trade-compact tbody tr:hover > td:last-child { background: #f7f9fe; }
html.theme-dark body table.trade-compact tr > td:last-child { background: var(--ui-panel); }
html.theme-dark body table.trade-compact thead tr > th:last-child { background: var(--ui-soft); }

/* v0.8.48 (owner, 14 Nov 2026): type-to-search box above a party dropdown */
.select-search { display: block; width: 100%; margin: 4px 0 6px; padding: 6px 10px; border: 1px solid var(--ui-line, #d6dbe4); border-radius: 9px; font-size: 13px; background: var(--ui-soft, #fff); color: var(--ui-ink, inherit); }
.select-search:focus { outline: 0; border-color: var(--ui-blue, #2b7bff); box-shadow: 0 0 0 3px rgba(43,123,255,.14); }
/* the taller party field must not stretch the field beside it */
.form-grid:has(.select-search) { align-items: start; }
.form-grid:has(.select-search) > label.test-toggle { align-self: center; }

/* v0.8.49 (owner, 18 Nov 2026): Print / Print Excel next to every download */
.print-actions { display: inline-flex; gap: 6px; margin-left: 6px; vertical-align: middle; flex-wrap: wrap; }
.print-actions .print-btn { padding: 6px 12px; font-size: 13px; }
/* v0.8.49: period choice (All time / month / From - To) beside downloads */
.period-range { display: inline-flex; gap: 8px; align-items: center; }
.period-range.hidden { display: none; }
.period-range label, .period-pick { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; white-space: nowrap; }
.period-range input[type=date], .period-pick select { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--ui-line, #d6dbe4); font: inherit; background: var(--ui-soft, #fff); color: inherit; }
