/* ============================================================================
   Pre-redesign shell stylesheet for the NON-admin pages that extend
   templates/base.html — the customer Help page, the customer document
   archive, the Telegram link page, and anonymous visitors on those pages.

   A frozen, verbatim copy of static/css/admin_shell.css as of 9c1d49c (the
   last release before the admin redesign), including its "Refined Blue"
   colour tokens. base.html loads it INSTEAD of admin_tokens.css +
   admin_shell.css when the viewer is not an admin, so the admin redesign
   (R1–R5) changes nothing a customer sees on these pages (spec "What does
   NOT change" item 1 and V6; the owner's palette decision is admin-only).

   Do not restyle it for the admin palette. A fix that customers on these
   pages need goes here as well as in admin_shell.css.
   ============================================================================ */

    
    /* Kill Bootstrap row hover/transition on plain tables only — keep .trio-table
       rows interactive (they get their own gentle hover below). */
    table:not(.trio-table) tbody tr { transition: none !important; }
    table:not(.trio-table) tbody tr:hover { background: inherit !important; }
    .trio-table tbody tr:hover { background: var(--bg-main); }


    

    :root {
  /* ── Midnight Navy Theme ── */
  --primary: #2c5282;            /* Refined Blue B — deeper "owned" blue (was #3b82f6) */
  --primary-dark: #234876;
  --accent: #c79a4b;             /* Refined Blue B — subtle warm-bronze accent */
  /* Light mode — softer on the eyes: off-white cards on a cool pale-slate
     background. Avoids pure #ffffff + #f7f8fa which glare against dark UI. */
  --bg-main: #eef1f6;            /* Cool pale slate page background */
  --bg-card: #fafbfd;            /* Off-white card — not stark #fff */
  --bg-sidebar: #e9edf3;         /* Sidebar slightly recessed from page */
  --sidebar-text: #1e293b;       /* Slate-900 — softer than pure black */
  --sidebar-text-muted: #5e6e84; /* AA-safe on the #e9edf3 sidebar (~4.6:1); was #64748b (~4.06:1, sub-AA) */
  --sidebar-border: #d7dce4;     /* Subtle divider */
  --sidebar-hover-bg: #dde3ec;   /* Gentle hover tint */
  --sidebar-active-bg: #d8e2f1;  /* Soft blue wash for active item (Refined Blue B) */
  --sidebar-active-text: #234876;
  --text-primary: #2a3442;       /* Softened from slate-900 — eases the ~14:1 glare for long sessions */
  --text-secondary: #475569;     /* Slate-600 */
  --text-muted: #5e6e84;         /* AA-safe on #eef1f6/#fafbfd (~4.6/5.0:1); was #64748b (sub-AA on the page bg) */
  --text-on-dark: #ffffff;
  --success: #10b981;
  --success-bg: #dcfce7;
  /* Status text, light mode — WCAG AA (checkup 2026-10-02 UX-15): #16a34a /
     #d97706 / #dc2626 were 3.2 / 3.1 / 4.7:1 on the card and 3.0 / 2.9 / 4.0:1
     on their own -bg badges. These clear 4.5:1 on the page, the card and the badge. */
  --success-text: #157a3a;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --warning-text: #a85008;
  --error: #ef4444;
  --error-bg: #fee2e2;
  --error-text: #b91c1c;
  --info: #3b82f6;
  --info-bg: #eff6ff;
  --info-text: #1d4ed8;
  --border-light: #e3e7ee;
  --border-medium: #c6cdd7;
  --shadow-sm: 0 1px 2px rgba(30,41,59,0.04);
  --shadow-md: 0 2px 6px rgba(30,41,59,0.06);
  /* ── Design-system scale (radius / space / card shadow) 2026-06-27 ── */
  --r-sm: 6px;  --r-md: 10px;  --r-lg: 14px;  --r-pill: 999px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px;
  --shadow-card: 0 1px 2px rgba(13,19,33,.05), 0 0 0 1px rgba(13,19,33,.03);
  --shadow-card-hover: 0 6px 20px rgba(13,19,33,.10);
  /* Violet status token pair (badges) */
  --violet-bg: #ede9fe; --violet-text: #6d28d9;
  /* ── Layout ── */
  --sidebar-width: 220px;
  --topbar-h: 49px;              /* sticky topbar height — sticky table headers clear this */
  --border: #e8eaed;
  --border-color: #e8eaed;
  --warning-text: #a85008;
  --success-text: #157a3a;
  --error-text: #b91c1c;
  --info-text: #1d4ed8;
  /* Filled controls with white text (active chip / pager / buttons). Same as
     --primary in light; dark mode needs its own, see the dark block (UX-15). */
  --primary-fill: #2c5282;
  --success-fill: #047857;       /* white text 5.5:1 — --success #10b981 was 2.5:1 */
}
    * { box-sizing: border-box; }
    body {
      font-family: 'DM Sans', -apple-system, 'Segoe UI', Roboto, 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
      background: var(--bg-main); color: var(--text-primary);
      margin: 0; min-height: 100vh;
    }
    html[lang="ar"] body { font-family: 'Cairo', 'Noto Sans SC', 'PingFang SC', sans-serif; }
    /* a11y: visible keyboard-focus ring across interactive elements (V-3) */
    a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
    textarea:focus-visible, [tabindex]:focus-visible, .sidebar-item:focus-visible {
      outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px;
    }
    /* a11y: skip-link — first tab stop jumps past the ~13-item nav to content. */
    /* Hidden by clipping, not left:-9999px: an element parked far off the left
       edge widens the scrollable area of an RTL page (checkup 2026-10-02 UX-12). */
    .skip-link { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 2000;
      width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .skip-link:focus {
      width: auto; height: auto; overflow: visible; clip-path: none;
      padding: 8px 14px; background: var(--bg-card);
      color: var(--text-primary); border-radius: var(--r-sm); box-shadow: var(--shadow-card);
      font-size: 13px; font-weight: 600; text-decoration: none;
    }
    /* Click-to-sort column headers (data-sort on a .trio-table th) */
    .trio-table th.th-sortable { cursor: pointer; user-select: none; }
    .trio-table th.th-sortable:hover { color: var(--text-primary); }
    /* The sortable label is wrapped in a <button> (keeps the th as a real
       columnheader for screen readers); strip the button chrome so it reads as
       header text, and inherit the th's alignment via display:inline. */
    .trio-table th .th-sort-btn { display: block; width: 100%; margin: 0; padding: 0; background: none;
      border: 0; cursor: pointer; font: inherit; color: inherit; letter-spacing: inherit;
      text-transform: inherit; text-align: inherit; }
    .trio-table th .th-sort-btn:hover { color: var(--text-primary); }
    .trio-table th .th-sort-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 3px; }
    .trio-table th .th-sort-ind { font-size: 11px; opacity: .85; margin-inline-start: 3px; }
    html[lang="ar"] { direction: rtl; }

    /* ── LAYOUT ── */
    .app-layout { display: flex; min-height: 100vh; }

    /* ── SIDEBAR ── */
    .sidebar {
      width: var(--sidebar-width); background: var(--bg-sidebar);
      padding: 20px 14px; display: flex; flex-direction: column; gap: 2px;
      position: fixed; top: 0; bottom: 0; z-index: 100; overflow-y: auto;
      left: 0; right: auto; transition: transform 0.25s;
    }
    html[lang="ar"] .sidebar { left: auto; right: 0; }

    .sidebar-logo { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 18px; text-decoration: none; }
    html[lang="ar"] .sidebar-logo { flex-direction: row-reverse; }
    .sidebar-logo .badge { background: var(--primary-fill); padding: 4px 10px; border-radius: 5px; }
    .sidebar-logo .badge span { color: #fff; font-weight: 700; font-size: 12px; letter-spacing: 1px; }
    .sidebar-logo .tech { color: var(--sidebar-text-muted); font-size: 11px; letter-spacing: 1px; }
    html[lang="ar"] .sidebar-logo .tech { letter-spacing: 0; }

    .sidebar-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--sidebar-text-muted); padding: 8px 12px 4px; margin-top: 8px; }
    html[lang="ar"] .sidebar-section { text-align: right; letter-spacing: 0; text-transform: none; font-size: 11px; }

    .sidebar-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13px; color: var(--sidebar-text); text-decoration: none; transition: all 0.15s; }
    html[lang="ar"] .sidebar-item { flex-direction: row-reverse; text-align: right; }
    .sidebar-item:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-active-text); text-decoration: none; }
    .sidebar-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600; position: relative; }
    /* Refined Blue B — subtle warm-bronze active indicator */
    .sidebar-item.active::before { content: ""; position: absolute; inset-inline-start: 3px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--accent); }
    .sidebar-item i { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
    .sidebar-badge { background: var(--error); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 20px; margin-left: auto; }
    html[lang="ar"] .sidebar-badge { margin-left: 0; margin-right: auto; }

    .sidebar-bottom { margin-top: auto; border-top: 1px solid var(--sidebar-border); padding-top: 14px; }
    .sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-decoration: none; }
    html[lang="ar"] .sidebar-user { flex-direction: row-reverse; }
    .sidebar-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-fill); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
    .sidebar-user-name { font-size: 12px; font-weight: 600; color: var(--sidebar-text); }
    .sidebar-user-role { font-size: 10px; color: var(--sidebar-text-muted); }

    /* ── MAIN ── */
    .main-content { margin-left: var(--sidebar-width); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
    html[lang="ar"] .main-content { margin-left: 0; margin-right: var(--sidebar-width); }
    /* inline-block: a transform is ignored on an inline <i>, so these icons
       never actually flipped in Arabic (checkup 2026-10-02 UX-12). */
    html[lang="ar"] .bi-arrow-left, html[lang="ar"] .bi-arrow-right { display: inline-block; transform: scaleX(-1); }
    html[lang="ar"] .trio-table th, html[lang="ar"] .trio-table td { text-align: right; }


  /* ── DARK MODE ── */
  [data-theme="dark"] {
    --bg-main: #0e141d;            /* Refined Blue B (dark) — cool near-black page */
    --bg-card: #161f2b;            /* B-dark card, lifted off the page */
    --bg-sidebar: #1c2735;         /* B-dark: RAISED slate sidebar (was near-black #0c1220) */
    --sidebar-text: #dde6f1;
    --sidebar-text-muted: #8595a9;
    --sidebar-border: rgba(255,255,255,0.08);
    --sidebar-hover-bg: rgba(69,132,214,0.14);
    --sidebar-active-bg: #26344a;
    --sidebar-active-text: #cfe0f5;
    --text-primary: #e7edf5;       /* B-dark — brighter primary text */
    --text-secondary: #93a2b6;
    --text-muted: #93a2b6;         /* B-dark muted (~6:1 on the #161f2b card — AA pass) */
    --border-light: #253143;
    --border-medium: #2c3a4f;
    --primary: #4584d6;            /* B-dark — owned blue, brighter for dark */
    --primary-fill: #3a6fb0;       /* white text 5.2:1 — on #4584d6 it was 3.8:1 (UX-15) */
    --primary-dark: #3a6fb0;
    --accent: #c79a4b;             /* Refined Blue B — warm-bronze accent (dark) */
    /* Dark variants of the semantic status tokens (light-only before) so any
       var(--success-bg) etc. tracks the theme instead of staying a light pastel. */
    --success-bg: rgba(34,197,94,0.16);  --success-text: #86efac;
    --warning-bg: rgba(234,179,8,0.16);  --warning-text: #fcd34d;
    --error-bg:   rgba(239,68,68,0.16);  --error-text:   #fca5a5;
    --info-bg:    rgba(59,130,246,0.16); --info-text:    #93c5fd;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.4);
    /* Dark values for the design-system card shadow + violet status pair */
    --shadow-card: 0 1px 2px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.04);
    --shadow-card-hover: 0 8px 24px rgba(0,0,0,.5);
    --violet-bg: rgba(139,92,246,0.18); --violet-text: #c4b5fd;
  }
  [data-theme="dark"] .trio-card { background: var(--bg-card); border-color: var(--border-light); }
  [data-theme="dark"] .topbar { background: #18212e; border-bottom-color: var(--border-light); }
  [data-theme="dark"] .trio-table th { background: #1f2a3a; color: var(--text-secondary); }
  [data-theme="dark"] .trio-table td { border-bottom-color: var(--border-light); color: var(--text-primary); }
  [data-theme="dark"] .form-control, [data-theme="dark"] .form-select {
    background: #1f2a3a; border-color: var(--border-light);
    color: var(--text-primary);
  }
  [data-theme="dark"] .form-control::placeholder,
  [data-theme="dark"] .form-select::placeholder,
  [data-theme="dark"] input::placeholder,
  [data-theme="dark"] textarea::placeholder { color: #94a3b8 !important; opacity: 1; }
  [data-theme="dark"] .form-control:focus,
  [data-theme="dark"] .form-select:focus { background: #1f2a3a; color: var(--text-primary); border-color: var(--primary); }
  [data-theme="dark"] .stat-card { background: #1f2a3a; border-color: var(--border-light); }
  [data-theme="dark"] .filter-btn { background: #1f2a3a; border-color: var(--border-light); color: var(--text-secondary); }
  [data-theme="dark"] .filter-btn.active { background: var(--primary-fill); border-color: var(--primary-fill); color: #fff; }
  [data-theme="dark"] .page-footer { background: #18212e; border-top-color: var(--border-light); }

  /* ── Dark-mode remap for Bootstrap color utilities ──
     Bootstrap's text-muted / bg-light / etc. use !important and hardcode colors,
     which makes them invisible against a dark page background. Remap them to
     our theme vars so any template using them tracks light↔dark correctly. */
  [data-theme="dark"] .text-muted,
  [data-theme="dark"] .text-secondary,
  [data-theme="dark"] small.text-muted { color: var(--text-secondary) !important; }
  [data-theme="dark"] .text-body,
  [data-theme="dark"] .text-dark { color: var(--text-primary) !important; }
  [data-theme="dark"] .text-black-50 { color: var(--text-muted) !important; }
  [data-theme="dark"] .text-white-50 { color:var(--text-muted) !important; }
  [data-theme="dark"] .bg-light,
  [data-theme="dark"] .bg-white,
  [data-theme="dark"] .bg-body { background-color: var(--bg-card) !important; color: var(--text-primary); }
  [data-theme="dark"] .bg-dark { background-color: #0a1119 !important; color: var(--text-primary); }
  [data-theme="dark"] .card,
  [data-theme="dark"] .modal-content,
  [data-theme="dark"] .dropdown-menu,
  [data-theme="dark"] .list-group-item { background-color: var(--bg-card); color: var(--text-primary); border-color: var(--border-light); }
  [data-theme="dark"] .card-header,
  [data-theme="dark"] .card-footer { background-color: var(--bg-main); border-color: var(--border-light); color: var(--text-primary); }
  [data-theme="dark"] .table { color: var(--text-primary); }
  [data-theme="dark"] .table thead th { color: var(--text-secondary); }
  [data-theme="dark"] .badge.bg-light,
  [data-theme="dark"] .badge.bg-white { background-color: var(--bg-main) !important; color: var(--text-primary) !important; }
  [data-theme="dark"] .alert { background-color: var(--bg-card); border-color: var(--border-light); color: var(--text-primary); }
  [data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(180%); }
  [data-theme="dark"] .form-label,
  [data-theme="dark"] .form-text { color: var(--text-secondary); }
  [data-theme="dark"] .text-reset { color: var(--text-primary) !important; }
  [data-theme="dark"] .text-black { color: var(--text-primary) !important; }
  [data-theme="dark"] .text-body-secondary { color: var(--text-secondary) !important; }
  [data-theme="dark"] .text-body-tertiary { color: var(--text-muted) !important; }
  [data-theme="dark"] .text-body-emphasis { color: var(--text-primary) !important; }
  /* Required-field marker rendered via CSS, not baked into the label text, so
     the asterisk shows in BOTH languages — applyLang() rewrites an element's
     textContent (dropping a literal " *"), but it can't touch an ::after. */
  .req-star::after { content: " *"; color: var(--error); font-weight: 700; }
  /* ── Light-mode remap for Bootstrap color utilities ──
     Align Bootstrap utility classes to the project CSS-var palette so
     both themes are consistent.  Light-mode already looks close, so
     these are subtle corrections — NOT visible fixes, just var alignment. */
  .text-muted, small.text-muted { color: var(--text-muted) !important; }
  .text-danger { color: var(--error) !important; }
  .bg-light { background-color: var(--bg-main) !important; }
  .badge.bg-secondary { background-color: var(--text-muted) !important; color: #fff !important; }
  .badge.bg-warning { background-color: #f59e0b !important; color: #000 !important; }
  .badge.bg-success { background-color: var(--success, #22c55e) !important; color: #fff !important; }
  .badge.bg-danger { background-color: var(--error) !important; color: #fff !important; }
  /* Shared error/validation box — single source of truth, theme-aware.
     Replaces ~10 copy-pasted inline #fee2e2 boxes across confirm pages. */
  .err-box { background: var(--error-bg); color: var(--error-text); padding: 10px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }

  /* Inline-hex catch-net: unified dark-mode override for hardcoded inline
     style="color:#..." / style="background:#..." across all templates.
     Attribute selectors anchored at html[data-theme=dark] beat normal class
     specificity and, with !important, win over inline style. Strategy:
       - dark text hexes  → readable text-primary / text-secondary
       - muted text hexes → text-muted
       - dark accent text → softer accent (so error/success/warn keep color)
       - white / neutral light bg → bg-card (unifies boxes)
       - colored status bg → translucent tint of the accent
     Bright accents on text (#3b82f6, #ef4444, etc.) are left alone — they
     read fine on dark bg.
  */

  /* — TEXT: dark / near-black shades → text-primary — */
  html[data-theme="dark"] [style*="color:#1e2530"],
  html[data-theme="dark"] [style*="color: #1e2530"],
  html[data-theme="dark"] [style*="color:#0f1623"],
  html[data-theme="dark"] [style*="color: #0f1623"] { color: var(--text-primary) !important; }

  /* — TEXT: slate / mid-gray shades → text-secondary — */
  html[data-theme="dark"] [style*="color:#4A5058"],
  html[data-theme="dark"] [style*="color: #4A5058"],
  html[data-theme="dark"] [style*="color:#4a5058"],
  html[data-theme="dark"] [style*="color: #4a5058"] { color: var(--text-secondary) !important; }

  /* — TEXT: dark blue accents (links/headings) → bright blue — */
  html[data-theme="dark"] [style*="color:#1d4ed8"],
  html[data-theme="dark"] [style*="color: #1d4ed8"],
  html[data-theme="dark"] [style*="color:#1e40af"],
  html[data-theme="dark"] [style*="color: #1e40af"],
  html[data-theme="dark"] [style*="color:#1e3a8a"],
  html[data-theme="dark"] [style*="color: #1e3a8a"],
  html[data-theme="dark"] [style*="color:#1a3c5e"],
  html[data-theme="dark"] [style*="color: #1a3c5e"],
  html[data-theme="dark"] [style*="color:#084298"],
  html[data-theme="dark"] [style*="color: #084298"],
  html[data-theme="dark"] [style*="color:#2563eb"],
  html[data-theme="dark"] [style*="color: #2563eb"],
  html[data-theme="dark"] [style*="color:#0d6efd"],
  html[data-theme="dark"] [style*="color: #0d6efd"] { color: #60a5fa !important; }

  /* — TEXT: dark red (error) → light red — */
  html[data-theme="dark"] [style*="color:#b91c1c"],
  html[data-theme="dark"] [style*="color: #b91c1c"],
  html[data-theme="dark"] [style*="color:#991b1b"],
  html[data-theme="dark"] [style*="color: #991b1b"],
  html[data-theme="dark"] [style*="color:#9b1c1c"],
  html[data-theme="dark"] [style*="color: #9b1c1c"],
  html[data-theme="dark"] [style*="color:#7f1d1d"],
  html[data-theme="dark"] [style*="color: #7f1d1d"],
  html[data-theme="dark"] [style*="color:#b23"],
  html[data-theme="dark"] [style*="color: #b23"] { color: #fca5a5 !important; }

  /* — TEXT: dark green (success) → light green — */
  html[data-theme="dark"] [style*="color:#166534"],
  html[data-theme="dark"] [style*="color: #166534"],
  html[data-theme="dark"] [style*="color:#15803d"],
  html[data-theme="dark"] [style*="color: #15803d"],
  html[data-theme="dark"] [style*="color:#065f46"],
  html[data-theme="dark"] [style*="color: #065f46"],
  html[data-theme="dark"] [style*="color:#0f766e"],
  html[data-theme="dark"] [style*="color: #0f766e"],
  html[data-theme="dark"] [style*="color:#2a9d4a"],
  html[data-theme="dark"] [style*="color: #2a9d4a"] { color: #86efac !important; }

  /* — TEXT: dark orange / amber (warning) → light amber — */
  html[data-theme="dark"] [style*="color:#7c2d12"],
  html[data-theme="dark"] [style*="color: #7c2d12"],
  html[data-theme="dark"] [style*="color:#92400e"],
  html[data-theme="dark"] [style*="color: #92400e"],
  html[data-theme="dark"] [style*="color:#b45309"],
  html[data-theme="dark"] [style*="color: #b45309"],
  html[data-theme="dark"] [style*="color:#b88f00"],
  html[data-theme="dark"] [style*="color: #b88f00"],
  html[data-theme="dark"] [style*="color:#a78b3e"],
  html[data-theme="dark"] [style*="color: #a78b3e"] { color: #fed7aa !important; }

  /* — BACKGROUND: white / neutral light shades → bg-card (unifies boxes) — */
  html[data-theme="dark"] [style*="background:#fff"]:not([style*="background:#fff7"]):not([style*="background:#ffe"]):not([style*="background:#fff,"]),
  html[data-theme="dark"] [style*="background: #fff"]:not([style*="background: #fff7"]):not([style*="background: #ffe"]),
  html[data-theme="dark"] [style*="background-color:#fff"]:not([style*="background-color:#fff7"]):not([style*="background-color:#ffe"]),
  html[data-theme="dark"] [style*="background-color: #fff"]:not([style*="background-color: #fff7"]):not([style*="background-color: #ffe"]),
  html[data-theme="dark"] [style*="background:#f8fafc"],
  html[data-theme="dark"] [style*="background: #f8fafc"],
  html[data-theme="dark"] [style*="background:#f1f5f9"],
  html[data-theme="dark"] [style*="background: #f1f5f9"],
  html[data-theme="dark"] [style*="background:#f3f4f6"],
  html[data-theme="dark"] [style*="background: #f3f4f6"],
  html[data-theme="dark"] [style*="background:#f4f6f9"],
  html[data-theme="dark"] [style*="background: #f4f6f9"],
  html[data-theme="dark"] [style*="background:#f6f7f9"],
  html[data-theme="dark"] [style*="background: #f6f7f9"],
  html[data-theme="dark"] [style*="background:#f0f4f7"],
  html[data-theme="dark"] [style*="background: #f0f4f7"],
  html[data-theme="dark"] [style*="background:#f0f4f8"],
  html[data-theme="dark"] [style*="background: #f0f4f8"],
  html[data-theme="dark"] [style*="background:#f0f7ff"],
  html[data-theme="dark"] [style*="background: #f0f7ff"],
  html[data-theme="dark"] [style*="background:#eff6ff"],
  html[data-theme="dark"] [style*="background: #eff6ff"],
  html[data-theme="dark"] [style*="background:#e2e8f0"],
  html[data-theme="dark"] [style*="background: #e2e8f0"],
  html[data-theme="dark"] [style*="background:#9ca3af"],
  html[data-theme="dark"] [style*="background: #9ca3af"] { background-color: var(--bg-card) !important; color: var(--text-primary) !important; }

  /* — BACKGROUND: status-colored light shades → translucent dark tint — */
  html[data-theme="dark"] [style*="background:#fee2e2"],
  html[data-theme="dark"] [style*="background: #fee2e2"],
  html[data-theme="dark"] [style*="background:#fef2f2"],
  html[data-theme="dark"] [style*="background: #fef2f2"],
  html[data-theme="dark"] [style*="background:#fecaca"],
  html[data-theme="dark"] [style*="background: #fecaca"],
  html[data-theme="dark"] [style*="background-color:#fee2e2"],
  html[data-theme="dark"] [style*="background-color: #fee2e2"] { background-color: rgba(239,68,68,0.18) !important; color: #fca5a5 !important; }

  html[data-theme="dark"] [style*="background:#dcfce7"],
  html[data-theme="dark"] [style*="background: #dcfce7"],
  html[data-theme="dark"] [style*="background:#d1fae5"],
  html[data-theme="dark"] [style*="background: #d1fae5"],
  html[data-theme="dark"] [style*="background-color:#dcfce7"],
  html[data-theme="dark"] [style*="background-color: #dcfce7"] { background-color: rgba(34,197,94,0.18) !important; color: #86efac !important; }

  html[data-theme="dark"] [style*="background:#fef3c7"],
  html[data-theme="dark"] [style*="background: #fef3c7"],
  html[data-theme="dark"] [style*="background-color:#fef3c7"],
  html[data-theme="dark"] [style*="background-color: #fef3c7"] { background-color: rgba(234,179,8,0.18) !important; color: #fde68a !important; }

  html[data-theme="dark"] [style*="background:#dbeafe"],
  html[data-theme="dark"] [style*="background: #dbeafe"],
  html[data-theme="dark"] [style*="background:#bfdbfe"],
  html[data-theme="dark"] [style*="background: #bfdbfe"],
  html[data-theme="dark"] [style*="background:#cfe2ff"],
  html[data-theme="dark"] [style*="background: #cfe2ff"] { background-color: rgba(59,130,246,0.18) !important; color: #93c5fd !important; }

  html[data-theme="dark"] [style*="background:#fed7aa"],
  html[data-theme="dark"] [style*="background: #fed7aa"],
  html[data-theme="dark"] [style*="background:#fff7ed"],
  html[data-theme="dark"] [style*="background: #fff7ed"] { background-color: rgba(249,115,22,0.18) !important; color: #fed7aa !important; }

  /* Remaining hardcoded pastels (amber/red/cream/green) used inline across
     templates → matching dark tints so they don't flash as light boxes. */
  html[data-theme="dark"] [style*="background:#fff3cd"],
  html[data-theme="dark"] [style*="background: #fff3cd"],
  html[data-theme="dark"] [style*="background:#fffdf0"],
  html[data-theme="dark"] [style*="background: #fffdf0"] { background-color: rgba(234,179,8,0.15) !important; color: #fde68a !important; }
  html[data-theme="dark"] [style*="background:#fff1f0"],
  html[data-theme="dark"] [style*="background: #fff1f0"],
  html[data-theme="dark"] [style*="background:#fff8f8"],
  html[data-theme="dark"] [style*="background: #fff8f8"] { background-color: rgba(239,68,68,0.14) !important; color: #fca5a5 !important; }
  html[data-theme="dark"] [style*="background:#f0fdf4"],
  html[data-theme="dark"] [style*="background: #f0fdf4"] { background-color: rgba(34,197,94,0.15) !important; color: #86efac !important; }
  html[data-theme="dark"] hr { border-color: var(--border-light); }

  /* ── TOPBAR ── */
    .topbar { background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 12px 28px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
    html[lang="ar"] .topbar { flex-direction: row-reverse; }
    .topbar-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0; display: inline; line-height: inherit; }
    .topbar-actions { display: flex; align-items: center; gap: 10px; }
    html[lang="ar"] .topbar-actions { flex-direction: row-reverse; }

    /* ── LANGUAGE TOGGLE ── */
    .lang-toggle { display: flex; align-items: center; gap: 4px; background: var(--bg-main); border: 1px solid var(--border-light); border-radius: 20px; padding: 3px; }
    .lang-btn { padding: 4px 12px; border-radius: 20px; border: none; background: none; font-size: 12px; font-weight: 700; color: var(--text-secondary); cursor: pointer; transition: all 0.15s; font-family: inherit; }
    .lang-btn:hover { color: var(--text-primary); }
    .lang-btn.active { background: var(--primary-fill); color: #fff; box-shadow: 0 1px 2px rgba(59,130,246,0.25); }
    /* Mobile drawer copy of the pill (partials/lang_seg.html) — shown only below 768px, see mobile_admin.css */
    .sidebar-lang { display: none; margin-top: 10px; }
    .sidebar-lang .lang-seg { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--sidebar-border); border-radius: 20px; background: var(--bg-main); }
    .sidebar-lang .lang-seg-btn { flex: 1; height: 38px; border: 0; border-radius: 20px; background: none; color: var(--sidebar-text-muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
    .sidebar-lang .lang-seg-btn.active { background: var(--primary-fill); color: #fff; }

    /* ── THEME TOGGLE ── */
    .theme-toggle { background: none; border: none; cursor: pointer; padding: 2px; display: inline-flex; align-items: center; vertical-align: middle; margin-inline-end: 4px; }
    .theme-toggle-track { width: 44px; height: 26px; border-radius: 99px; background: var(--border-light); border: 1px solid var(--border-medium); display: flex; align-items: center; padding: 0 3px; transition: background 0.25s, border-color 0.25s; position: relative; }
    .theme-toggle-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,0.15); transition: transform 0.25s cubic-bezier(0.4,0,0.2,1); transform: translateX(0); }
    [data-theme="dark"] .theme-toggle-track { background: #2a3a52; border-color: #334155; }
    [data-theme="dark"] .theme-toggle-thumb { transform: translateX(17px); background: #1e293b; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }

    .topbar-logout { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); text-decoration: none; padding: 6px 12px; border-radius: 8px; transition: all 0.15s; }
    .topbar-logout:hover { background: var(--bg-main); color: var(--text-secondary); text-decoration: none; }

    .sidebar-toggle { display: none; background: none; border: none; font-size: 24px; color: var(--text-primary); cursor: pointer; padding: 6px 10px; position: relative; z-index: 101; -webkit-tap-highlight-color: rgba(59,130,246,0.2); touch-action: manipulation; }
    .sidebar-toggle:active { opacity: 0.6; }

    /* ── PAGE ── */
    .page-body { padding: 28px; flex: 1; }
    .alerts-wrap { padding: 0 28px; margin-top: 12px; }
    .alert { border-radius: 10px; border: none; font-size: 13px; padding: 10px 16px; }

    /* ── COMPONENTS ── */
    .trio-card { background: var(--bg-card); border-radius: 12px; padding: 22px; box-shadow: var(--shadow-card); border: 1px solid var(--border); }
    .stat-card { background: var(--bg-card); border-radius: 12px; padding: 20px; box-shadow: var(--shadow-card); border: 1px solid var(--border); text-decoration: none; display: block; transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s; }
    .stat-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-card-hover); }
    html[lang="ar"] .stat-card { text-align: right; }
    .stat-num { font-size: 28px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
    /* Bidi isolation for numbers in RTL — mirrors the portal rule
       (customer/_base.html) so qty/price cells don't reorder in Arabic. */
    .num { unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
    .stat-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
    html[lang="ar"] .stat-label { text-transform: none; letter-spacing: 0; font-size: 12px; }
    .stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

    .btn-primary { background: var(--primary-fill) !important; color: #fff !important; border: none !important; border-radius: 10px !important; font-size: 13px !important; font-weight: 600 !important; padding: 9px 18px !important; }
    .btn-primary:hover { background: var(--primary-dark) !important; }
    .btn-success-trio { background: var(--success-fill) !important; color: #fff !important; border: none !important; border-radius: 10px !important; font-size: 13px !important; font-weight: 600 !important; padding: 9px 18px !important; }
    .btn-secondary-trio { background: var(--bg-main) !important; color: var(--text-primary) !important; border: none !important; border-radius: 10px !important; font-size: 13px !important; font-weight: 500 !important; padding: 9px 18px !important; }
    /* Tokenize Bootstrap's stock color buttons so admin pages follow the design
       system AND dark mode (the tokens are theme-aware) instead of rendering in
       stock Bootstrap blue/red/teal. Colour + radius only — Bootstrap keeps
       control of sizing so .btn-sm etc. aren't disturbed. A template with its
       own local .btn-* palette still wins: its extra_css block style loads
       after this one in the head. */
    .btn-success, .btn-info, .btn-danger, .btn-warning, .btn-secondary,
    .btn-outline-primary, .btn-outline-danger, .btn-outline-secondary,
    .btn-outline-dark, .btn-outline-success { border-radius: 9px !important; }
    .btn-success { background: var(--success) !important; border-color: var(--success) !important; color: #fff !important; }
    .btn-info    { background: var(--info) !important; border-color: var(--info) !important; color: #fff !important; }
    .btn-danger  { background: var(--error) !important; border-color: var(--error) !important; color: #fff !important; }
    .btn-warning { background: var(--warning) !important; border-color: var(--warning) !important; color: #3a2c14 !important; }
    .btn-secondary { background: var(--bg-main) !important; border-color: var(--border) !important; color: var(--text-primary) !important; }
    .btn-success:hover, .btn-danger:hover, .btn-warning:hover, .btn-info:hover { filter: brightness(0.93); }
    .btn-secondary:hover { background: var(--border) !important; }
    .btn-outline-primary, .btn-outline-danger, .btn-outline-secondary, .btn-outline-dark, .btn-outline-success { background: transparent !important; }
    .btn-outline-primary   { color: var(--primary) !important; border-color: var(--primary) !important; }
    .btn-outline-danger    { color: var(--error) !important; border-color: var(--error) !important; }
    .btn-outline-secondary { color: var(--text-secondary) !important; border-color: var(--border) !important; }
    .btn-outline-dark      { color: var(--text-primary) !important; border-color: var(--text-primary) !important; }
    .btn-outline-success   { color: var(--success) !important; border-color: var(--success) !important; }
    .btn-outline-primary:hover   { background: var(--primary-fill) !important; color: #fff !important; }
    .btn-outline-danger:hover    { background: var(--error) !important; color: #fff !important; }
    .btn-outline-secondary:hover { background: var(--bg-main) !important; color: var(--text-primary) !important; }
    .btn-outline-dark:hover      { background: var(--text-primary) !important; color: var(--bg-card) !important; }
    .btn-outline-success:hover   { background: var(--success) !important; color: #fff !important; }

    .form-control, .form-select { border-radius: 8px !important; border: 1px solid var(--border) !important; font-size: 14px !important; padding: 9px 13px !important; color: var(--text-primary) !important; }
    html[lang="ar"] .form-control, html[lang="ar"] .form-select { text-align: right; }
    .form-control:focus, .form-select:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(74,80,88,0.1) !important; }
    .form-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }

    .badge-success { background: var(--success-bg); color: var(--success-text); padding: 3px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; }
    .badge-warning { background: var(--warning-bg); color: var(--warning-text); padding: 3px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; }
    .badge-error { background: var(--error-bg); color: var(--error-text); padding: 3px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; }
    .badge-info { background: var(--info-bg); color: var(--info-text); padding: 3px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; }
    .badge-muted { background: var(--bg-main); color: var(--text-muted); padding: 3px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; }
    .badge-violet { background: var(--violet-bg); color: var(--violet-text); padding: 3px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; }
    /* One order-status → colour map (admin quick-fix Q9), read by the desktop status badge
       (.badge-<status>) AND the phone orders list's status dot (.sdot.st-<status>), so the two
       can no longer disagree. Amber means "needs attention". Dark mode: v3-admin.css. */
    .badge-pending_review, .st-pending_review, .badge-on_hold, .st-on_hold { --st-bg: var(--warning-bg); --st-fg: var(--warning-text); --st-dot: var(--warning); }  /* needs attention: amber */
    .badge-approved, .st-approved, .badge-processing, .st-processing { --st-bg: var(--info-bg); --st-fg: var(--info-text); --st-dot: var(--info); }  /* in hand: blue */
    .badge-shipped, .st-shipped, .badge-in_transit, .st-in_transit { --st-bg: var(--violet-bg); --st-fg: var(--violet-text); --st-dot: var(--violet-text); }  /* on the way: violet */
    .badge-delivered, .st-delivered { --st-bg: var(--success-bg); --st-fg: var(--success-text); --st-dot: var(--success); }  /* done: green */
    .badge-rejected, .st-rejected { --st-bg: var(--error-bg); --st-fg: var(--error-text); --st-dot: var(--error); }  /* refused: red */
    .badge-cancelled, .st-cancelled { --st-bg: var(--bg-main); --st-fg: var(--text-muted); --st-dot: var(--text-muted); }  /* stopped: grey */
    .badge-pending_review, .badge-on_hold, .badge-approved, .badge-processing, .badge-shipped, .badge-in_transit, .badge-delivered, .badge-rejected, .badge-cancelled {
      background: var(--st-bg); color: var(--st-fg); padding: 3px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; }
    .sdot.st-pending_review, .sdot.st-on_hold, .sdot.st-approved, .sdot.st-processing, .sdot.st-shipped, .sdot.st-in_transit, .sdot.st-delivered, .sdot.st-rejected, .sdot.st-cancelled { background: var(--st-dot); }

    .trio-table { width: 100%; border-collapse: collapse; font-size: 13px; }
    .trio-table th { text-align: left; padding: 14px 16px; font-weight: 600; color: var(--text-secondary); background: var(--bg-main); font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; border-bottom: 2px solid var(--border); }
    html[lang="ar"] .trio-table th { text-align: right; text-transform: none; letter-spacing: 0; font-size: 12px; }
    .trio-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text-primary); vertical-align: middle; }
    html[lang="ar"] .trio-table td { text-align: right; }
    /* Soft hover that uses the theme's bg token — works in both light and dark.
       Neutralize Bootstrap's table-hover box-shadow inset (which defaults to a
       light wash and looks near-white in dark mode), then apply our own. */
    .trio-table { --bs-table-bg: transparent; --bs-table-hover-bg: transparent; --bs-table-hover-color: var(--text-primary); }
    .trio-table > :not(caption) > * > *,
    .trio-table.table-hover > tbody > tr:hover > * { box-shadow: none !important; }
    .trio-table tr:hover td { background: var(--bg-main); }
    /* Sticky column headers on long lists — keeps Status/Total/Date labels in
       view while scanning. top clears the sticky topbar; the inset shadow
       stands in for the bottom border (border-collapse drops it on sticky
       cells). The th background is already opaque (var(--bg-main)). */
    .trio-table thead th { position: sticky; top: var(--topbar-h); z-index: 5; box-shadow: inset 0 -2px 0 var(--border); }

    .section-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
    html[lang="ar"] .section-title { flex-direction: row-reverse; }
    .section-title a { font-size: 12px; color: var(--primary); font-weight: 600; text-decoration: none; }

    .page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
    html[lang="ar"] .page-header { flex-direction: row-reverse; }
    html[lang="ar"] .page-header h2 { text-align: right; }
    .page-header h2 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin: 0; }
    .page-header p { font-size: 13px; color: var(--text-secondary); margin: 3px 0 0; }

    .filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
    .filter-btn { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); font-size: 12px; text-decoration: none; transition: all 0.15s; }
    .filter-btn:hover, .filter-btn.active { background: var(--primary-fill); color: #fff; border-color: var(--primary-fill); text-decoration: none; }

    @media (max-width: 768px) {
      .sidebar { transform: translateX(-100%); }
      html[lang="ar"] .sidebar { transform: translateX(100%); }
      .sidebar.open,
      html[lang="ar"] .sidebar.open { transform: translateX(0); }
      .main-content { margin-left: 0 !important; margin-right: 0 !important; }
      .sidebar-toggle { display: block; }
      .page-body { padding: 16px; overflow-x: hidden; }
      /* Mobile safety net: any non-stacked admin table scrolls within its own box
         instead of widening the whole page (root fix for wide tables on phones). */
      .page-body table:not(.stack-mobile){ display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; white-space:nowrap; }
      /* Stack the title block above its action button on phones instead of
         squeezing them side-by-side. Override the RTL row-reverse too so Arabic
         stacks as well (the h2 stays right-aligned via its own rule). */
      .page-header,
      html[lang="ar"] .page-header { flex-direction: column; align-items: stretch; gap: 12px; }
      /* iOS Safari zooms the page when a focused field's font-size <16px. Admin .form-control is
         14px (rule ~line 515) and many per-page custom inputs are 12-15px; force 16px on phones so
         focus never auto-zooms (mobile audit 2026-06-27 M10/M13 + ~20 lows + the jump-palette input).
         !important beats the non-!important per-component rules. Also covers the unauthenticated
         public/auth pages, which extend base.html and load no mobile stylesheet. */
      input, textarea, select, .form-control, .form-select { font-size: 16px !important; }
      /* 2026-09-14: phone tap targets — filter pills were ~30px/12px text
         (below the 44px the portal enforces); row action links get padding so
         a thumb can hit them in the non-stacked scroll tables. */
      .filter-btn { min-height: 44px; display: inline-flex; align-items: center; }
      .page-body table:not(.stack-mobile) td a,
      .page-body table:not(.stack-mobile) td button { display: inline-block; padding: 6px 8px; }
    }
    .sidebar-backdrop{
      display:none;position:fixed;inset:0;background:rgba(0,0,0,0.45);
      z-index:99;-webkit-tap-highlight-color:transparent;
    }
    .sidebar-backdrop.on{display:block}
    .sidebar-close{
      display:none;position:absolute;top:14px;right:10px;width:34px;height:34px;
      border-radius:50%;background:rgba(255,255,255,0.08);border:none;color:#fff;
      font-size:20px;line-height:1;cursor:pointer;align-items:center;justify-content:center;
      -webkit-appearance:none;appearance:none;
    }
    html[lang="ar"] .sidebar-close{right:auto;left:10px}
    @media (max-width: 768px){ .sidebar-close{display:inline-flex} }

    .app-footer { padding: 14px 28px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted); background: var(--bg-card); }
    html[lang="ar"] .app-footer { text-align: right; }


/* ── Order cockpit "what's next" strip (admin suggestion #2, 2026-09-21) ── */
.ns-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin: 0 0 16px; box-shadow: var(--tt-shadow-sm, 0 1px 3px rgba(2,6,23,.08)); }
.ns-card.off { border-style: dashed; }
/* Compact 12-stage deal bar (order workflow Phase 1, orders.workflow.deal_state) */
.ns-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; margin: 0 0 8px; }
.ns-head b { font-size: 13.5px; color: var(--text-primary); }
.ns-head span { font-size: 12px; color: var(--text-muted); }
.ns-bar { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.ns-seg { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ns-seg .b { display: block; height: 6px; border-radius: 3px; background: var(--border); }
.ns-seg .l { font-size: 10.5px; line-height: 1.25; color: var(--text-muted); overflow-wrap: anywhere; }
.ns-seg.done .b { background: var(--success); }
.ns-seg.done .l { color: var(--text-secondary); }
.ns-seg.current .b { background: var(--primary-fill); }
.ns-seg.current .l { color: var(--primary); font-weight: 800; }
.ns-seg.skipped .b { background: repeating-linear-gradient(135deg, var(--border) 0 3px, transparent 3px 6px); }
.ns-seg.skipped .l { opacity: .55; }
.ns-seg.off .b { background: var(--border-light); }
.ns-seg.off .l { opacity: .6; }
@media (max-width: 900px) { .ns-seg .l { display: none; } .ns-bar { gap: 3px; } }
.ns-next { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ns-txt { flex: 1; min-width: 180px; }
.ns-txt b { display: block; font-size: 14.5px; color: var(--text-primary); }
.ns-txt span { color: var(--text-secondary); font-size: 12.5px; }
.ns-form { display: contents; }
.ns-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: none; }
.ns-btn.pri { background: var(--primary-fill); border-color: var(--primary-fill); color: #fff; padding: 12px 22px; font-size: 14px; }
.ns-btn.ghost { background: transparent; color: var(--text-secondary); }
.ns-btn.danger { color: var(--error-text); border-color: var(--error-bg); }
.ns-btn:disabled { opacity: .6; cursor: wait; }
.mobile-admin-only .ns-card { margin: 10px 12px 6px; }
.mobile-admin-only .ns-seg .l { display: none; }   /* phone: the thin bar + "Stage N of 12" line only */
.mobile-admin-only .ns-bar { gap: 3px; }
.cc-more > summary::-webkit-details-marker { display: none; }

/* ── Home page: "needs you" item lists (was templates/core/today.html; merged 2026-09-21, admin suggestion #1) ── */
.needs-lists .today-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.needs-lists .today-card{background:var(--bg-card);border:1px solid var(--border);border-radius:8px;overflow:hidden}
.needs-lists .today-card.full{grid-column:1/-1}
.needs-lists .card-head{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid var(--border)}
.needs-lists .card-head h3{font-size:13px;font-weight:700;margin:0;display:flex;align-items:center;gap:8px}
.needs-lists .card-head .count{background:var(--bg-main);color:var(--text-muted);padding:1px 7px;border-radius:20px;font-size:11px;font-weight:700}
.needs-lists .card-head a{font-size:11px;color:var(--text-muted);text-decoration:none}
.needs-lists .card-head a:hover{color:var(--text-primary)}
.needs-lists .card-body{padding:0}
.needs-lists .card-row{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;border-bottom:1px solid var(--border);font-size:12.5px;gap:8px}
.needs-lists .card-row:last-child{border-bottom:0}
.needs-lists .card-row:hover{background:var(--bg-main)}
.needs-lists .card-row a{color:var(--text-primary);text-decoration:none;font-weight:600}
.needs-lists .card-row .meta{color:var(--text-muted);font-size:11px;white-space:nowrap}
.needs-lists .card-row .tag{display:inline-flex;padding:2px 8px;border-radius:3px;font-size:10px;font-weight:600}
.needs-lists .tag-overdue{background:#fef2f2;color:#b91c1c}
.needs-lists .tag-pending{background:#eff6ff;color:#1d4ed8}
.needs-lists .tag-expiring{background:#fff3cd;color:#7a5a00}
.needs-lists .tag-open{background:#e6f0f1;color:#1f4a4d}
.needs-lists .tag-age{background:#f0fdf4;color:#166534}
.needs-lists .tag-age.warm{background:#fff7ed;color:#9a3412}
.needs-lists .tag-age.hot{background:#fef2f2;color:#b91c1c}
html[data-theme="dark"] .needs-lists .tag-overdue{background:#2c1010;color:#fca5a5}
html[data-theme="dark"] .needs-lists .tag-pending{background:#0f172a;color:#93c5fd}
html[data-theme="dark"] .needs-lists .tag-expiring{background:#3a2c14;color:#e9c97a}
html[data-theme="dark"] .needs-lists .tag-open{background:#142a2c;color:#7ed4d8}
html[data-theme="dark"] .needs-lists .tag-age{background:#052e16;color:#86efac}
html[data-theme="dark"] .needs-lists .tag-age.warm{background:#431407;color:#fdba74}
html[data-theme="dark"] .needs-lists .tag-age.hot{background:#2c1010;color:#fca5a5}
.needs-lists .empty-card{padding:20px 16px;text-align:center;color:var(--text-muted);font-size:12.5px}
@media(max-width:760px){.needs-lists .today-grid{grid-template-columns:1fr}}
.needs-lists { margin: 18px 0 8px; }
.needs-lists .nl-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; }
.needs-lists .nl-head h3 { font-size: 14px; font-weight: 800; margin: 0; }
.needs-lists .nl-head span { font-size: 12px; color: var(--text-muted); }


/* ── Wave-1 shared list components (admin suggestions #4–#7, 2026-09-21) ── */
.section-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 0 0 16px; }
.section-tabs a { padding: 8px 12px; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.section-tabs a:hover { color: var(--text-primary); }
.section-tabs a.on { color: var(--primary); border-bottom-color: var(--primary); }
.section-tabs a.adv { margin-inline-start: auto; color: var(--text-muted); font-weight: 600; }
.list-toolbar { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.list-search { display: flex; align-items: center; gap: 6px; }
.list-search input[type="search"] { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); color: var(--text-primary); font: inherit; font-size: 14px; }
.list-search input[type="search"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(44,82,130,.12); }
.list-search-btn { height: 38px; width: 40px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); color: var(--text-secondary); cursor: pointer; }
.list-search-clear { font-size: 12px; color: var(--text-muted); text-decoration: none; padding: 0 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips .chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 100px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); text-decoration: none; }
.chips .chip.on { background: var(--primary-fill); border-color: var(--primary-fill); color: #fff; }
.chips .chip .n { opacity: .75; font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 0 0; font-size: 12.5px; color: var(--text-muted); }
.pager-sizes { display: inline-flex; border: 1px solid var(--border); border-radius: 100px; overflow: hidden; }
.pager-sizes a { padding: 4px 11px; font-weight: 700; color: var(--text-secondary); text-decoration: none; }
.pager-sizes a.on { background: var(--primary-fill); color: #fff; }
.pager-pages { display: inline-flex; gap: 4px; }
.pager-pages a, .pager-pages span { min-width: 28px; height: 28px; padding: 0 8px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--text-secondary); text-decoration: none; font-weight: 700; }
.pager-pages .on { background: var(--primary-fill); border-color: var(--primary-fill); color: #fff; }
/* Phones (checkup 2026-10-02 GAP-search-03): the shared search box
   (core/partials/list_toolbar.html) and pager (core/_pagination.html) must stay
   usable wherever a list includes them, also inside the .mobile-admin-only card
   lists, which have no card padding of their own. 44px thumb targets (the
   portal's minimum), and the pager wraps into centred rows instead of squeezing. */
@media (max-width: 768px) {
  .mobile-admin-only .list-toolbar { padding: 0 14px; }
  .mobile-admin-only .pager { padding: 12px 14px 4px; }
  .list-search input[type="search"], .list-search-btn { height: 44px; }
  .list-search-btn { width: 44px; }
  .list-search-clear { padding: 12px 8px; }
  .chips .chip { min-height: 40px; }
  .pager { justify-content: center; }
  .pager-info { flex-basis: 100%; text-align: center; }
  .pager-sizes a { padding: 14px; line-height: 16px; }
  .pager-pages a, .pager-pages span { min-width: 44px; height: 44px; }
}
/* Shared list empty state — partials/list_empty.html (GAP-search-11) */
.list-empty { padding: 28px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.list-empty-title { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: var(--text-primary); }
.list-empty-hint { margin: 0 0 10px; }
.list-empty-clear { font-weight: 700; color: var(--primary); text-decoration: none; }
.list-empty-clear:hover { text-decoration: underline; }
.settings-page { max-width: 980px; }
.settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.settings-head h2 { font-size: 18px; margin: 0 0 4px; }
.settings-head p { margin: 0; color: var(--text-secondary); font-size: 13px; max-width: 640px; line-height: 1.55; }
.settings-form { padding: 18px 20px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
@media (max-width: 720px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-field { display: grid; gap: 5px; }
.settings-field label { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.settings-field.check { grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.settings-field textarea { min-height: 80px; }
.settings-field.has-err .form-control, .settings-field.has-err .form-select { border-color: var(--error); }
.settings-help { font-size: 11.5px; color: var(--text-muted); }
.settings-err { font-size: 12px; color: var(--error-text); }
.settings-actions-bar { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.settings-actions { white-space: nowrap; }
.settings-actions form { display: inline; }
.settings-empty { text-align: center; color: var(--text-muted); padding: 22px 12px !important; }
.btn-primary-sm { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-fill); color: #fff !important; padding: 9px 16px; border-radius: 10px; border: 0; font: inherit; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn-link-sm { display: inline-flex; align-items: center; background: transparent; border: 0; padding: 6px 8px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--primary); text-decoration: none; cursor: pointer; }
.btn-link-sm.danger { color: var(--error-text); }
/* ── Order intake ("New request for customer") and order edit (workflow Phase 1) ── */
.oi-page { max-width: 980px; }
.oi-card { padding: 18px 20px; margin-bottom: 14px; }
.oi-card .section-title { margin-bottom: 12px; }
.oi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.oi-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .oi-grid { grid-template-columns: 1fr; } }
.oi-field { display: grid; gap: 5px; min-width: 0; }
.oi-field > label, .oi-legend { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.oi-help { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }
.oi-or { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--text-muted); margin: 2px 0; }
.oi-or::before, .oi-or::after { content: ""; flex: 1; height: 1px; background: var(--border-light); }
.oi-errors { background: var(--error-bg); color: var(--error-text); border: 1px solid var(--error); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.oi-errors ul { margin: 6px 0 0; padding-inline-start: 18px; }
.oi-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.oi-pill { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.oi-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.oi-pill span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); color: var(--text-primary); font-size: 13px; font-weight: 600; }
.oi-pill input:checked + span { background: var(--primary-fill); border-color: var(--primary-fill); color: #fff; }
.oi-pill input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.oi-row { position: relative; border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: var(--bg-main); }
.oi-row.removing { opacity: .55; }
.oi-row-n { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.oi-row-meta { display: grid; grid-template-columns: minmax(0, 1fr) 110px 110px; gap: 8px; margin-top: 8px; }
@media (max-width: 600px) { .oi-row-meta { grid-template-columns: 1fr 1fr; } .oi-row-meta .link { grid-column: 1 / -1; } }
.oi-row-rm { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 36px; min-height: 36px; border: 0; background: none; color: var(--text-muted); font-size: 15px; cursor: pointer; }
.oi-row-rm:hover { color: var(--error-text); }
.oi-row-check { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--text-secondary); cursor: pointer; }
.oi-row-img { max-width: 64px; max-height: 64px; border-radius: 6px; border: 1px solid var(--border); margin-top: 6px; }
.oi-add { width: 100%; border: 1.5px dashed var(--border-medium, var(--border)); background: var(--bg-card); color: var(--primary); font: inherit; font-size: 13px; font-weight: 700; border-radius: 10px; padding: 10px; cursor: pointer; }
.oi-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.oi-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-primary); cursor: pointer; margin: 0; }
.oi-check input { margin-top: 3px; }
.oi-sub[hidden] { display: none; }
.oi-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 20px; }
.oi-actions .oi-check { font-weight: 600; }
.detail-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* ── Purchase order page + cockpit PO card (workflow Phase 2, AdminPO mockup) ── */
.po-page { max-width: 1280px; }
.po-head { align-items: flex-end; }
.po-head h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.po-head-r { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.po-crumbs { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.po-crumbs a, .po-sub a { color: var(--primary); text-decoration: none; font-weight: 600; }
.po-sub { font-size: 13.5px; color: var(--text-secondary); margin: 4px 0 0; }
.po-rev { font-size: 12px; font-weight: 700; color: var(--warning-text); background: var(--warning-bg); border-radius: 999px; padding: 2px 9px; }
.po-alert { border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; }
.po-alert.bad { background: var(--error-bg); color: var(--error-text); border: 1px solid var(--error); }
.po-alert.warn { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning); }
.po-alert.info { background: var(--info-bg); color: var(--info-text); border: 1px solid var(--info); }
.po-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .po-grid { grid-template-columns: minmax(0, 1fr); } }
.po-main, .po-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.po-card { padding: 16px 18px; margin: 0; }
.po-card .section-title { margin-bottom: 10px; }
.po-line-grid { display: grid; grid-template-columns: 110px minmax(0, 1.4fr) minmax(0, 1.4fr) 90px 80px 110px 100px; gap: 8px; }
.po-line-pack { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 8px; }
@media (max-width: 1200px) { .po-line-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .po-line-grid .po-f-wide { grid-column: span 2; } }
@media (max-width: 600px) { .po-line-grid, .po-line-pack { grid-template-columns: 1fr 1fr; } .po-line-grid .po-f-wide { grid-column: 1 / -1; } }
.po-f { display: grid; gap: 4px; margin: 0; min-width: 0; font-size: 11.5px; font-weight: 700; color: var(--text-secondary); }
.po-f .form-control, .po-f .form-select { font-weight: 400; }
.po-f-specs { margin-top: 8px; }
.po-f-specs textarea { min-height: 38px; }
.po-line-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.po-line-amt { font-size: 12.5px; color: var(--text-secondary); font-weight: 600; }
.po-totals { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 18px; font-size: 14px; border-top: 1px solid var(--border-light); padding-top: 10px; margin-top: 12px; color: var(--text-secondary); }
.po-totals b { color: var(--text-primary); }
.po-table-wrap { overflow-x: auto; }
.po-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
.po-table th { text-align: start; padding: 8px 6px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 12px; font-weight: 600; }
.po-table td { padding: 9px 6px; border-bottom: 1px solid var(--border-light); vertical-align: top; color: var(--text-primary); }
.po-table .end { text-align: end; }
.po-strong { font-weight: 700; }
.po-muted { color: var(--text-muted); font-size: 12.5px; margin: 0 0 8px; }
.po-pre { white-space: pre-line; }
.po-terms { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 0; }
.po-terms .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .po-terms { grid-template-columns: 1fr; } }
.po-terms dt, .po-kv dt { font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.po-terms dd { margin: 2px 0 0; font-size: 13px; color: var(--text-primary); }
.po-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 10px; font-size: 13px; }
.po-kv dd { margin: 0; }
.po-events { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.po-events li { padding: 6px 0; border-bottom: 1px solid var(--border-light); line-height: 1.45; }
.po-events li:last-child { border-bottom: 0; }
.po-ev-when { color: var(--text-muted); margin-inline-end: 6px; }
.po-ev-kind { font-weight: 700; margin-inline-end: 6px; }
.po-checks { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.po-checks li { display: flex; align-items: flex-start; gap: 10px; }
.po-checks .dot { width: 10px; height: 10px; border-radius: 5px; margin-top: 5px; flex: 0 0 10px; background: var(--border); }
.po-checks .ok .dot { background: var(--success); }
.po-checks .bad .dot { background: var(--error); }
.po-checks .wait .dot { background: var(--warning); }
.po-wide { width: 100%; justify-content: center; text-align: center; display: flex; align-items: center; min-height: 42px; margin-bottom: 8px; }
.po-form { display: grid; gap: 10px; margin-top: 8px; }
.po-form .oi-check { font-size: 13px; }
.po-2col { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
.po-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.po-blocked { border: 2px solid var(--error); }
.po-blocked-h { font-weight: 800; color: var(--error-text); margin-bottom: 6px; }
.po-blocked-list { margin: 0 0 8px; padding-inline-start: 18px; font-size: 13.5px; color: var(--text-primary); }
.po-err { background: var(--error-bg); color: var(--error-text); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin: 6px 0; }
.po-code { letter-spacing: .2em; max-width: 180px; }
.po-line-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; margin: 0 0 8px; }
.po-pays { list-style: none; margin: 0 0 8px; padding: 0; font-size: 13px; }
.po-pays li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 0; border-bottom: 1px solid var(--border-light); }
.po-details > summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--primary); }
.po-danger .po-details > summary { color: var(--error-text); }
/* Cockpit "Suppliers & purchase orders" card (orders/partials/po_card.html) */
.po-card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.po-new-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.po-new-form select { min-width: 200px; max-width: 260px; }
.po-num-draft { font-size: 11px; font-weight: 700; color: var(--text-muted); }
/* Deal-invoice strip on the cockpit's PO card (workflow Phase 3) */
.deal-inv-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 12px; margin: 0 0 18px; border-radius: 10px; background: var(--info-bg); color: var(--text-primary); }
.deal-inv-txt { flex: 1 1 260px; font-size: 13px; }
.deal-inv-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.deal-inv-form select { width: auto; min-width: 90px; }
/* Shipments (workflow Phase 4): list, the shipment page (AdminShipment mockup), the cockpit card */
.sh-count { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-inline-start: 4px; white-space: nowrap; }
.sh-actual { font-size: 10.5px; font-weight: 700; color: var(--success-text, var(--success)); }
.sh-late { font-size: 11.5px; color: var(--error-text); margin-top: 3px; }
.sh-ports { font-weight: 600; }
.sh-fixed { background: var(--bg-main); color: var(--text-secondary); }
.po-checks .off { color: var(--text-muted); }
.sh-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; padding: 14px 16px; margin: 0 0 18px; }
@media (max-width: 1000px) { .sh-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .sh-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sh-fact { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sh-fact-k { font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.sh-fact-v { font-size: 14px; font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.sh-muted-inline { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-inline-start: 6px; }
.sh-planned { font-size: 11px; color: var(--text-muted); }
.sh-edit-row > td { background: var(--bg-main); }
.sh-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 18px; align-items: start; }
.sh-edit-form { margin: 0; }
.sh-edit-h { font-size: 12.5px; font-weight: 700; color: var(--text-primary); }
.sh-3col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 600px) { .sh-3col { grid-template-columns: 1fr 1fr; } }
.sh-po-list { display: grid; gap: 8px; margin: 6px 0; }
.sh-po-pick { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-main); }
.sh-add { border-top: 1px solid var(--border-light); margin-top: 14px; padding-top: 12px; }
.sh-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sh-bill-form { background: var(--bg-main); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin: 0 0 14px; }
.sh-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.sh-step { display: flex; align-items: center; gap: 10px; min-height: 30px; font-size: 13px; color: var(--text-muted); }
.sh-dot { width: 14px; height: 14px; flex: 0 0 14px; border-radius: 50%; border: 2px solid var(--border-medium, var(--border)); background: var(--bg-card); box-sizing: border-box; }
.sh-step.done { color: var(--text-primary); }
.sh-step.done .sh-dot { border-color: var(--success); background: var(--success); }
.sh-step.current { color: var(--text-primary); font-weight: 700; }
.sh-step.current .sh-dot { border-color: var(--primary); }
.sh-step-l { flex: 1 1 auto; min-width: 0; }
.sh-step-d { font-size: 12px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.sh-log-h { font-size: 11.5px; font-weight: 700; color: var(--text-muted); margin: 14px 0 4px; }
.sh-card-table td .badge-error { margin-inline-start: 4px; }
/* Shipment documents panel + B/L release (workflow Phase 5, AdminShipment mockup) */
.sh-gen { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.sh-doc-table .sh-doc-item td { border-top: 1px solid var(--border); }
.sh-doc-table .sh-doc-file td { border-bottom: 0; padding-top: 4px; padding-bottom: 4px; font-size: 12.5px; }
.sh-doc-acts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-weight: 500; }
.sh-doc-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding-inline-start: 12px; min-width: 0; }
.sh-doc-line a { font-weight: 600; overflow-wrap: anywhere; }
.sh-doc-line input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; }
.sh-doc-nopick { display: inline-block; width: 16px; flex: 0 0 16px; }
.sh-doc-seen { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.sh-inline-form { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; margin: 0; }
.sh-email { border-top: 1px solid var(--border-light); margin-top: 14px; padding-top: 12px; }
/* Production updates on the PO page (workflow Phase 6) */
.po-upds { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.po-upds li { padding: 0 0 10px; border-bottom: 1px solid var(--border-light); display: grid; gap: 6px; }
.po-upds li:last-child { border-bottom: 0; padding-bottom: 0; }
.po-upd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; }
.po-upd-head .po-muted { margin: 0; }
.po-upd-text { font-size: 13.5px; color: var(--text-primary); white-space: pre-line; overflow-wrap: anywhere; }
.po-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.po-photo { display: flex; flex-direction: column; gap: 4px; text-decoration: none; min-width: 0; }
.po-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-main); }
.po-photo-cap { font-size: 11.5px; color: var(--text-secondary); overflow-wrap: anywhere; }
/* Quality-check page (workflow Phase 6, AdminQC mockup) */
.qc-table { min-width: 720px; table-layout: fixed; }
.qc-table th:nth-child(1) { width: 28%; }
.qc-table th:nth-child(2), .qc-table th:nth-child(3) { width: 26%; }
.qc-table th:nth-child(4) { width: 12%; }
.qc-table th:nth-child(5) { width: 8%; }
.qc-table td { vertical-align: top; overflow-wrap: anywhere; }
.qc-table .form-control, .qc-table .form-select { font-size: 13px; min-height: 36px; }
.qc-table .qc-ar { margin-top: 6px; }
.qc-table tr.removing td { opacity: .5; }
.qc-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.qc-photo { display: flex; flex-direction: column; gap: 6px; margin: 0; min-width: 0; }
.qc-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-main); display: block; }
.qc-photo figcaption { font-size: 12px; color: var(--text-secondary); overflow-wrap: anywhere; }
.qc-photo .form-control { font-size: 12.5px; min-height: 34px; }
.qc-photo .oi-check { font-size: 12.5px; }
.qc-photo.removing { opacity: .5; }
.qc-add-photos { border-top: 1px solid var(--border-light); margin-top: 14px; padding-top: 12px; display: grid; gap: 10px; }
.qc-results { border: 0; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.qc-pill { position: relative; display: flex; margin: 0; cursor: pointer; }
.qc-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.qc-pill span { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 40px; padding: 4px 8px; border: 1px solid var(--border-medium, var(--border)); border-radius: 8px; background: var(--bg-card); color: var(--text-primary); font-size: 13px; font-weight: 600; }
.qc-pill input:checked + span { background: var(--primary-fill); border-color: var(--primary-fill); color: #fff; }
.qc-pill input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.qc-when { display: grid; gap: 8px; margin-top: 10px; }
.qc-when[hidden] { display: none; }
.qc-note { font-size: 13px; color: var(--text-primary); background: var(--bg-main); border-radius: 8px; padding: 9px 11px; margin: 10px 0 8px; line-height: 1.45; }
.qc-note.ok { background: var(--success-bg); color: var(--success-text); font-weight: 600; }
.qc-note.bad { background: var(--error-bg); color: var(--error-text); }
.qc-note.warn { background: var(--warning-bg); color: var(--warning-text); }
.qc-quote { margin: 6px 0; padding-inline-start: 10px; border-inline-start: 3px solid currentColor; font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; }
.qc-child { margin-top: 6px; }
.qc-when .btn, #qc-result .btn { min-height: 44px; font-weight: 700; }
.qc-btn-ok { background: var(--success-fill); color: #fff; border: 0; }
.qc-btn-ok:hover { color: #fff; filter: brightness(1.06); }
.qc-btn-gold { background: #c79a4b; color: #1a2433; border: 0; }
.qc-btn-gold:hover { color: #1a2433; filter: brightness(1.05); }
.qc-summary p { font-size: 13px; margin: 0 0 8px; white-space: pre-line; overflow-wrap: anywhere; }
.qc-2col { grid-template-columns: 1fr 1fr; }
.qc-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.qc-hist li { display: flex; gap: 10px; }
.qc-hist li.on { font-weight: 600; }
.qc-hist-d { color: var(--text-muted); min-width: 56px; }
.qc-create { max-width: 720px; }
