/* ============================================================
   CIMS — Construction Inventory Management System
   Design system: graphite chrome · hi-vis accent · concrete surfaces
   ============================================================ */

:root {
  --bg: #F3F4F6;
  --surface: #FFFFFF;
  --surface-2: #F9FAFB;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6B7280;
  --line: #E5E7EB;
  --line-2: #EEF0F3;

  --chrome: #0F141B;
  --chrome-2: #161D27;
  --chrome-3: #1F2937;
  --chrome-ink: #E5E7EB;
  --chrome-muted: #8B95A5;

  --accent: #F97316;
  --accent-2: #EA580C;
  --accent-soft: #FFEDD5;
  --accent-ink: #9A3412;

  --good: #15803D; --good-bg: #DCFCE7;
  --warn: #B45309; --warn-bg: #FEF3C7;
  --bad: #B91C1C;  --bad-bg: #FEE2E2;
  --info: #1D4ED8; --info-bg: #DBEAFE;
  --delay: #6D28D9; --delay-bg: #EDE9FE;
  --neutral: #4B5563; --neutral-bg: #E5E7EB;
  --teal: #0F766E; --teal-bg: #CCFBF1;

  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17,24,39,.04), 0 4px 16px rgba(17,24,39,.05);
  --shadow-lg: 0 12px 40px rgba(17,24,39,.14);
  --sidebar-w: 264px;
  --font-head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: .9rem; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, .fw-heading { font-family: var(--font-head); letter-spacing: -.01em; }
a { color: var(--info); text-decoration: none; } a:hover { text-decoration: underline; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; letter-spacing: .01em; }
.min-w-0 { min-width: 0; }
.small-label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.text-accent { color: var(--accent-2) !important; }
.muted { color: var(--muted); }
.hairline { border-top: 1px solid var(--line-2); }

/* ---------- Layout ---------- */
.app-wrapper { display: flex; min-height: 100vh; }
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 22px 26px 90px; max-width: 1480px; width: 100%; margin: 0 auto; }
@media (min-width: 992px) { .content { padding-bottom: 40px; } }
@media (max-width: 575.98px) { .content { padding: 14px 16px 90px; } }

/* ---------- Sidebar ---------- */
.sidebar { width: var(--sidebar-w); background: var(--chrome); color: var(--chrome-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; z-index: 1040; }
.sidebar-brand { padding: 20px 20px 14px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none !important; }
.brand-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #111; display: grid; place-items: center; font-size: 1.25rem; box-shadow: 0 6px 18px rgba(249,115,22,.35); }
.brand-text { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; line-height: 1; letter-spacing: .02em; }
.brand-text small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .68rem; color: var(--chrome-muted); letter-spacing: .04em; margin-top: 4px; text-transform: uppercase; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.sidebar-nav::-webkit-scrollbar { width: 6px; } .sidebar-nav::-webkit-scrollbar-thumb { background: var(--chrome-3); border-radius: 6px; }
.nav-section { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--chrome-muted); padding: 16px 12px 6px; font-weight: 700; }
.nav-item-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--chrome-ink); text-decoration: none !important; font-weight: 500; font-size: .875rem; margin-bottom: 2px; transition: background .15s, color .15s; position: relative; }
.nav-item-link i { font-size: 1.05rem; width: 22px; text-align: center; color: var(--chrome-muted); transition: color .15s; }
.nav-item-link:hover { background: var(--chrome-2); color: #fff; } .nav-item-link:hover i { color: #fff; }
.nav-item-link.active { background: var(--chrome-3); color: #fff; }
.nav-item-link.active i { color: var(--accent); }
.nav-item-link.active::before { content: ""; position: absolute; inset-inline-start: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav-badge { margin-inline-start: auto; background: var(--accent); color: #111; font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; min-width: 20px; text-align: center; }
.nav-badge.danger { background: #EF4444; color: #fff; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--chrome-3); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--chrome-2); }
.user-chip .name { font-size: .82rem; font-weight: 600; color: #fff; } .user-chip .role { font-size: .7rem; color: var(--chrome-muted); }
.logout-btn { background: none; border: 0; color: var(--chrome-muted); font-size: 1.05rem; padding: 4px; border-radius: 8px; } .logout-btn:hover { color: #fff; background: var(--chrome-3); }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(15,20,27,.55); z-index: 1035; opacity: 0; pointer-events: none; transition: opacity .2s; backdrop-filter: blur(2px); }
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
@media (max-width: 991.98px) {
  .sidebar { position: fixed; top: 0; inset-inline-start: 0; height: 100vh; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0) !important; }
}

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 1020; background: rgba(255,255,255,.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 10px 26px; min-height: 64px; }
@media (max-width: 575.98px) { .topbar { padding: 8px 12px; } }
.page-title { font-size: 1.15rem; font-weight: 700; margin: 0; }
.page-subtitle { margin: 0; font-size: .76rem; color: var(--muted); }
.btn-icon { width: 40px; height: 40px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--ink-2); display: inline-grid; place-items: center; font-size: 1.15rem; position: relative; }
.btn-icon:hover { background: var(--surface-2); border-color: var(--line); }
.notif-dot { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #EF4444; color: #fff; font-size: .62rem; font-weight: 700; line-height: 16px; text-align: center; }
.topbar-search { position: relative; width: 320px; }
.topbar-search > i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar-search .form-control { padding-inline-start: 36px; border-radius: 12px; background: var(--surface-2); border-color: var(--line); height: 40px; }
.search-results { display: none; position: absolute; top: 46px; inset-inline: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; z-index: 1050; }
.search-results.show { display: block; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-2); font-size: .84rem; }
.search-results a:hover { background: var(--surface-2); } .search-results a i { color: var(--accent-2); }
.lang-toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.lang-toggle:hover { border-color: var(--ink-2); }
.topbar-user { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid transparent; border-radius: 12px; padding: 4px 8px 4px 4px; }
.topbar-user:hover { background: var(--surface-2); border-color: var(--line); }
.notif-menu { width: 360px; max-width: 92vw; border-radius: 14px; border-color: var(--line); box-shadow: var(--shadow-lg); padding: 6px 0; }
.notif-item { display: flex; gap: 10px; padding: 10px 14px; white-space: normal; font-size: .8rem; align-items: flex-start; border-bottom: 1px solid var(--line-2); }
.notif-item.unread { background: #FFF7ED; } .notif-item:hover { background: var(--surface-2); }
.notif-ico { width: 30px; height: 30px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; flex-shrink: 0; font-size: .85rem; }
.role-menu { width: 300px; border-radius: 14px; border-color: var(--line); box-shadow: var(--shadow-lg); padding: 6px 0; }
.role-item { display: flex; gap: 10px; align-items: center; font-size: .82rem; padding: 8px 14px; } .role-item small { color: var(--muted); font-size: .7rem; }
.role-item.active { background: var(--accent-soft); color: var(--ink); }
.dropdown-menu { font-size: .86rem; }

/* ---------- Mobile bottom tabs ---------- */
.mobile-tabs { display: none; position: fixed; bottom: 0; inset-inline: 0; background: #fff; border-top: 1px solid var(--line); z-index: 1030; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.mobile-tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .64rem; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 2px; border-radius: 10px; }
.mobile-tabs a .ic { position: relative; font-size: 1.25rem; line-height: 1; }
.mobile-tabs a .dot { position: absolute; top: -2px; inset-inline-end: -6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.mobile-tabs a.active { color: var(--accent-2); }
@media (max-width: 991.98px) { .mobile-tabs { display: flex; } }

/* ---------- Avatars ---------- */
.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; font-weight: 700; font-size: .8rem; color: #fff; flex-shrink: 0; letter-spacing: .02em; }
.avatar-sm { width: 32px; height: 32px; font-size: .72rem; border-radius: 10px; }
.avatar-xs { width: 26px; height: 26px; font-size: .62rem; border-radius: 8px; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; border-radius: 16px; }
.av-SE { background: #2563EB; } .av-PM { background: #0F766E; } .av-GM { background: #7C3AED; } .av-IH { background: #EA580C; }
.av-SK { background: #B45309; } .av-PO { background: #DB2777; } .av-FIN { background: #4B5563; } .av-ADMIN { background: #111827; } .av-SYS { background: #9CA3AF; }
.user-inline { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--line-2); padding: 14px 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-header h5, .card-header h6 { margin: 0; font-size: .95rem; font-weight: 700; }
.card-body { padding: 18px; }
.card-body.p-0 { padding: 0; }
.stat-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px 18px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: flex-start; height: 100%; position: relative; overflow: hidden; }
.stat-card .stat-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; flex-shrink: 0; }
.stat-card .stat-label { font-size: .74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .stat-value { font-family: var(--font-head); font-size: 1.7rem; font-weight: 700; line-height: 1.1; margin-top: 2px; }
.stat-card .stat-sub { font-size: .74rem; color: var(--muted); margin-top: 4px; }
.stat-card > * { position: relative; z-index: 1; }
.stat-card.hot::after { content: ""; position: absolute; z-index: 0; inset-inline-end: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: var(--accent-soft); opacity: .7; }
@media (max-width: 575.98px) { .stat-card { padding: 14px; gap: 10px; } .stat-card .stat-ico { width: 38px; height: 38px; font-size: 1.05rem; } .stat-card .stat-label { font-size: .66rem; } .stat-card .stat-value { font-size: 1.45rem; } }
.ico-blue { background: var(--info-bg); color: var(--info); } .ico-green { background: var(--good-bg); color: var(--good); } .ico-amber { background: var(--warn-bg); color: var(--warn); }
.ico-red { background: var(--bad-bg); color: var(--bad); } .ico-violet { background: var(--delay-bg); color: var(--delay); } .ico-orange { background: var(--accent-soft); color: var(--accent-ink); }
.ico-teal { background: var(--teal-bg); color: var(--teal); } .ico-gray { background: var(--neutral-bg); color: var(--neutral); }

/* ---------- Badges / pills ---------- */
.status-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; line-height: 1.3; }
.status-badge i { font-size: .8rem; }
.st-draft { background: var(--neutral-bg); color: var(--neutral); }
.st-l1_pending, .st-l2_pending { background: var(--warn-bg); color: var(--warn); }
.st-clarification { background: #FEF9C3; color: #854D0E; }
.st-approved { background: var(--teal-bg); color: var(--teal); }
.st-processing { background: var(--info-bg); color: var(--info); }
.st-ready { background: #E0F2FE; color: #0369A1; }
.st-in_transit { background: var(--accent-soft); color: var(--accent-ink); }
.st-delivered { background: #FDE68A; color: #92400E; }
.st-closed { background: var(--good-bg); color: var(--good); }
.st-rejected { background: var(--bad-bg); color: var(--bad); }
.st-delayed { background: var(--delay-bg); color: var(--delay); }
.st-escalated { background: var(--bad); color: #fff; animation: pulseRed 1.6s infinite; }
@keyframes pulseRed { 0%, 100% { box-shadow: 0 0 0 0 rgba(185,28,28,.35); } 50% { box-shadow: 0 0 0 6px rgba(185,28,28,0); } }
.urgency-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .68rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--neutral-bg); color: var(--neutral); text-transform: uppercase; letter-spacing: .04em; }
.urgency-tag.urgent { background: var(--bad-bg); color: var(--bad); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill-good { background: var(--good-bg); color: var(--good); } .pill-warn { background: var(--warn-bg); color: var(--warn); } .pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-info { background: var(--info-bg); color: var(--info); } .pill-gray { background: var(--neutral-bg); color: var(--neutral); } .pill-violet { background: var(--delay-bg); color: var(--delay); }
.pill-orange { background: var(--accent-soft); color: var(--accent-ink); } .pill-teal { background: var(--teal-bg); color: var(--teal); }
.sla-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sla-ok { background: var(--good-bg); color: var(--good); } .sla-warn { background: var(--warn-bg); color: var(--warn); } .sla-breached { background: var(--bad); color: #fff; } .sla-done { background: var(--neutral-bg); color: var(--neutral); }
.cat-chip { font-size: .68rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }

/* ---------- Tables ---------- */
.table-modern { margin: 0; font-size: .84rem; }
.table-modern thead th { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); padding: 12px 16px; background: var(--surface-2); white-space: nowrap; }
.table-modern tbody td { padding: 12px 16px; vertical-align: middle; border-bottom: 1px solid var(--line-2); }
.table-modern tbody tr:last-child td { border-bottom: 0; }
.table-modern tbody tr.row-link { cursor: pointer; } .table-modern tbody tr.row-link:hover { background: #FFFBF7; }
.table-modern .num { text-align: end; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.table-modern .item-cell { display: flex; flex-direction: column; } .table-modern .item-cell small { color: var(--muted); font-size: .7rem; }
.qty-bar { height: 6px; border-radius: 4px; background: var(--line-2); overflow: hidden; min-width: 80px; } .qty-bar > span { display: block; height: 100%; background: var(--info); }
.ledger-in { color: var(--good); font-weight: 600; } .ledger-out { color: var(--bad); font-weight: 600; }

/* ---------- Tabs / filters ---------- */
.tab-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-pills .btn { border-radius: 999px; font-size: .8rem; font-weight: 600; padding: 6px 14px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); }
.tab-pills .btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab-pills .btn .cnt { margin-inline-start: 6px; background: rgba(0,0,0,.08); padding: 0 6px; border-radius: 999px; font-size: .7rem; }
.tab-pills .btn.active .cnt { background: rgba(255,255,255,.2); }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-bar .form-select, .filter-bar .form-control { width: auto; min-width: 150px; border-radius: 10px; font-size: .84rem; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 18px; }

/* ---------- Buttons / forms ---------- */
.btn { border-radius: 10px; font-weight: 600; font-size: .85rem; padding: 8px 16px; }
.btn-sm { padding: 5px 11px; font-size: .78rem; border-radius: 8px; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #111; } .btn-accent:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); }
.btn-outline-dark { border-color: var(--line); color: var(--ink-2); background: #fff; } .btn-outline-dark:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-soft-success { background: var(--good-bg); color: var(--good); border-color: transparent; } .btn-soft-success:hover { background: var(--good); color: #fff; }
.btn-soft-danger { background: var(--bad-bg); color: var(--bad); border-color: transparent; } .btn-soft-danger:hover { background: var(--bad); color: #fff; }
.btn-soft-warning { background: var(--warn-bg); color: var(--warn); border-color: transparent; } .btn-soft-warning:hover { background: var(--warn); color: #fff; }
.btn-soft-info { background: var(--info-bg); color: var(--info); border-color: transparent; } .btn-soft-info:hover { background: var(--info); color: #fff; }
.form-control, .form-select { border-radius: 10px; border-color: var(--line); padding: 9px 12px; font-size: .86rem; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(249,115,22,.18); }
.form-label { font-size: .76rem; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.form-text { font-size: .72rem; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.modal-content { border-radius: 16px; border: 0; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--line-2); } .modal-footer { border-top: 1px solid var(--line-2); }
.modal-title { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; }
.urgency-switch { display: flex; gap: 8px; }
.urgency-switch label { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; gap: 10px; align-items: center; transition: all .15s; }
.urgency-switch input { display: none; }
.urgency-switch input:checked + label { border-color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ink); }
.urgency-switch input[value="urgent"]:checked + label { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); background: #FFF5F5; }
.line-row { display: grid; grid-template-columns: 2fr 1fr 1.2fr 1.5fr auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); margin-bottom: 10px; }
@media (max-width: 767.98px) { .line-row { grid-template-columns: 1fr 1fr; } .line-row .span-2 { grid-column: span 2; } }
.line-row .dup { grid-column: 1 / -1; font-size: .74rem; color: var(--bad); font-weight: 600; }
.line-row .auto { font-size: .72rem; color: var(--muted); }
.stock-hint { font-size: .72rem; font-weight: 600; }

/* ---------- Stepper ---------- */
.stepper { list-style: none; margin: 0; padding: 0; position: relative; }
.stepper li { position: relative; padding: 0 0 22px 40px; }
.stepper li::before { content: ""; position: absolute; inset-inline-start: 13px; top: 28px; bottom: -2px; width: 2px; background: var(--line); }
.stepper li:last-child::before { display: none; }
.stepper .dot { position: absolute; inset-inline-start: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; background: #fff; border: 2px solid var(--line); color: var(--muted); }
.stepper li.done .dot { background: var(--good); border-color: var(--good); color: #fff; }
.stepper li.done::before { background: var(--good); }
.stepper li.current .dot { background: var(--info); border-color: var(--info); color: #fff; animation: pulseBlue 1.8s infinite; }
.stepper li.rejected .dot { background: var(--bad); border-color: var(--bad); color: #fff; }
@keyframes pulseBlue { 0%, 100% { box-shadow: 0 0 0 0 rgba(29,78,216,.4); } 50% { box-shadow: 0 0 0 8px rgba(29,78,216,0); } }
.stepper .s-title { font-weight: 700; font-size: .86rem; } .stepper li.future .s-title { color: var(--muted); font-weight: 600; }
.stepper .s-meta { font-size: .74rem; color: var(--muted); } .stepper .s-comment { font-size: .78rem; margin-top: 4px; background: var(--surface-2); border: 1px solid var(--line-2); padding: 6px 10px; border-radius: 8px; }

/* ---------- SLA widget ---------- */
.sla-widget { border-radius: 12px; padding: 14px 16px; border: 1px solid var(--line); background: var(--surface-2); }
.sla-widget .sla-big { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.sla-widget.ok { border-color: #BBF7D0; background: #F0FDF4; } .sla-widget.ok .sla-big { color: var(--good); }
.sla-widget.warn { border-color: #FDE68A; background: #FFFBEB; } .sla-widget.warn .sla-big { color: var(--warn); }
.sla-widget.breached { border-color: #FCA5A5; background: #FEF2F2; } .sla-widget.breached .sla-big { color: var(--bad); }
.sla-track { height: 8px; border-radius: 6px; background: rgba(0,0,0,.08); overflow: hidden; margin-top: 8px; } .sla-track > span { display: block; height: 100%; border-radius: 6px; }
.sla-widget.ok .sla-track > span { background: var(--good); } .sla-widget.warn .sla-track > span { background: var(--warn); } .sla-widget.breached .sla-track > span { background: var(--bad); }

/* ---------- Thread ---------- */
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; } .msg .bubble { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; font-size: .84rem; max-width: 90%; }
.msg.mine { flex-direction: row-reverse; } .msg.mine .bubble { background: #FFF7ED; border-color: #FED7AA; }
.msg .meta { font-size: .68rem; color: var(--muted); margin-top: 4px; }

/* ---------- Action toolbar / info list ---------- */
.action-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: .84rem; }
.kv dt { color: var(--muted); font-weight: 500; margin: 0; } .kv dd { margin: 0; font-weight: 600; }
.info-strip { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: .8rem; }
.info-strip b { display: block; font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.photo-thumb { width: 84px; height: 64px; border-radius: 8px; background: linear-gradient(135deg, #CBD5E1, #94A3B8); display: grid; place-items: center; color: #fff; font-size: 1.3rem; position: relative; }
.photo-thumb small { position: absolute; bottom: 2px; inset-inline: 4px; font-size: .55rem; color: #fff; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.callout { border-radius: 12px; padding: 12px 14px; font-size: .82rem; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.callout i { font-size: 1.05rem; }
.callout-danger { background: var(--bad-bg); border-color: #FCA5A5; color: #7F1D1D; } .callout-warn { background: var(--warn-bg); border-color: #FDE68A; color: #78350F; }
.callout-info { background: var(--info-bg); border-color: #BFDBFE; color: #1E3A8A; } .callout-good { background: var(--good-bg); border-color: #BBF7D0; color: #14532D; }
.callout-violet { background: var(--delay-bg); border-color: #DDD6FE; color: #4C1D95; }

/* ---------- Lists ---------- */
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); font-size: .84rem; }
.list-row:last-child { border-bottom: 0; } .list-row:hover { background: #FFFBF7; }
.list-row .ttl { font-weight: 600; } .list-row .sub { font-size: .74rem; color: var(--muted); }
.empty-state { text-align: center; padding: 36px 20px; color: var(--muted); } .empty-state i { font-size: 2rem; display: block; margin-bottom: 8px; color: #CBD5E1; }
.dispatch-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #fff; box-shadow: var(--shadow); height: 100%; display: flex; flex-direction: column; gap: 10px; }
.dispatch-card .plate { font-family: var(--font-head); font-weight: 700; letter-spacing: .08em; background: #FDE68A; color: #111; border: 2px solid #111; border-radius: 6px; padding: 2px 10px; display: inline-block; font-size: .82rem; }
.dispatch-card.delayed { border-color: #C4B5FD; box-shadow: 0 0 0 3px var(--delay-bg); }
.chart-box { position: relative; height: 280px; } .chart-box.sm { height: 220px; } .chart-box.xs { height: 160px; }
.legend-inline { display: flex; gap: 14px; flex-wrap: wrap; font-size: .76rem; color: var(--ink-2); }
.legend-inline span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-inline-end: 6px; vertical-align: -1px; }
.audit-row summary { list-style: none; cursor: pointer; } .audit-row summary::-webkit-details-marker { display: none; }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: .78rem; }
.diff pre { margin: 0; padding: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: .72rem; white-space: pre-wrap; }
.diff .before pre { background: #FEF2F2; } .diff .after pre { background: #F0FDF4; }
.action-chip { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .7rem; background: var(--ink); color: #fff; padding: 2px 8px; border-radius: 6px; letter-spacing: .02em; }
.hero-number { font-family: var(--font-head); font-size: 2.4rem; font-weight: 700; line-height: 1; }
.progress-thin { height: 6px; border-radius: 4px; background: var(--line-2); } .progress-thin > span { display: block; height: 100%; border-radius: 4px; }
.warehouse-tile { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.rating { color: #F59E0B; font-size: .8rem; letter-spacing: -1px; }
.step-badge { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; font-weight: 700; font-size: .74rem; background: var(--ink); color: #fff; }
.strength { height: 6px; border-radius: 4px; background: var(--line-2); overflow: hidden; } .strength > span { display: block; height: 100%; transition: width .2s; }

/* ---------- Login ---------- */
.auth-wrapper { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
@media (max-width: 991.98px) { .auth-wrapper { grid-template-columns: 1fr; } }
.auth-visual { background: var(--chrome); color: var(--chrome-ink); padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-visual::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, transparent 0 28px, rgba(249,115,22,.05) 28px 56px); pointer-events: none; }
.auth-visual::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(249,115,22,.22), transparent 65%); inset-inline-end: -180px; bottom: -200px; pointer-events: none; }
.auth-visual > * { position: relative; z-index: 1; }
@media (max-width: 991.98px) { .auth-visual { padding: 28px 24px; } .auth-visual .d-lg-block-only { display: none; } }
.auth-visual h1 { color: #fff; font-size: clamp(1.8rem, 3.2vw, 2.7rem); font-weight: 700; line-height: 1.12; }
.auth-visual h1 em { font-style: normal; color: var(--accent); }
.glass-chip { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 12px 14px; backdrop-filter: blur(6px); }
.flow-mini { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .72rem; color: var(--chrome-muted); }
.flow-mini span { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); padding: 4px 10px; border-radius: 999px; color: var(--chrome-ink); }
.flow-mini i { color: var(--accent); }
.auth-form { padding: 40px 48px; display: flex; flex-direction: column; justify-content: center; background: var(--bg); }
@media (max-width: 991.98px) { .auth-form { padding: 28px 20px 40px; } }
.auth-card { background: #fff; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 28px; max-width: 560px; width: 100%; margin: 0 auto; }
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .role-grid { grid-template-columns: 1fr; } }
.role-card { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; text-align: start; cursor: pointer; transition: all .15s; width: 100%; }
.role-card:hover { border-color: var(--ink); transform: translateY(-1px); box-shadow: var(--shadow); }
.role-card .r-name { font-weight: 700; font-size: .8rem; line-height: 1.2; } .role-card .r-sub { font-size: .68rem; color: var(--muted); }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Print ---------- */
@media print { .sidebar, .topbar, .mobile-tabs, .action-bar, .no-print { display: none !important; } .content { padding: 0; } .card { box-shadow: none; } body { background: #fff; } }

body:not(.ready) .content { opacity: 0; } body.ready .content { opacity: 1; transition: opacity .2s; }
