:root {
--bg:            #061019;
--surface:       #0A1622;
--surface-2:     #0E1D2C;
--card:          #12212F;
--panel:         #12212F;
--hover:         rgba(56,189,248,0.06);
--border:        rgba(255,255,255,0.07);
--border-mid:    rgba(56,189,248,0.24);
--gold:          #38B6E8;
--gold-dim:      rgba(56,182,232,0.12);
--gold-border:   rgba(56,182,232,0.28);
--maroon:        #7A1A2A;
--maroon-dim:    rgba(122,26,42,0.14);
--maroon-border: rgba(122,26,42,0.35);
--green:         #22C55E;
--green-dim:     rgba(34,197,94,0.11);
--amber:         #F59E0B;
--amber-dim:     rgba(245,158,11,0.11);
--red:           #EF4444;
--red-dim:       rgba(239,68,68,0.11);
--blue:          #60CFFF;
--blue-dim:      rgba(96,207,255,0.09);
--teal:          #2DD4BF;
--purple:        #A78BFA;
--text:          #EAF3FB;
--text-2:        #8CA0B3;
--text-3:        #4A5D6E;
--font-brand:    'Cormorant Garamond', Georgia, serif;
--font-ui:       'Outfit', system-ui, sans-serif;
--font-mono:     'DM Mono', 'Fira Mono', monospace;
--rail-h:        48px;
--sidebar-w:     228px;
--radius:        7px;
--radius-lg:     12px;
--shadow:        0 6px 28px rgba(0,0,0,0.45);
--shadow-sm:     0 2px 10px rgba(0,0,0,0.3);
--transition:    all 0.15s cubic-bezier(0.4,0,0.2,1);
}

html[data-theme="light"] {
--bg:            #EEF1F4;
--surface:       #F8F9FA;
--surface-2:     #F2F4F6;
--card:          #F8F9FA;
--panel:         #F8F9FA;
--hover:         rgba(35,92,122,0.05);
--border:        rgba(10,25,38,0.08);
--border-mid:    rgba(35,92,122,0.18);
--gold:          #235C7A;
--gold-dim:      rgba(35,92,122,0.08);
--gold-border:   rgba(35,92,122,0.20);
--maroon:        #7A1A2A;
--maroon-dim:    rgba(122,26,42,0.07);
--maroon-border: rgba(122,26,42,0.20);
--green:         #1B8A4C;
--green-dim:     rgba(27,138,76,0.08);
--amber:         #A15A0A;
--amber-dim:     rgba(161,90,10,0.09);
--red:           #C23434;
--red-dim:       rgba(194,52,52,0.08);
--blue:          #235C7A;
--blue-dim:      rgba(35,92,122,0.07);
--teal:          #147A70;
--purple:        #6D5AC4;
--text:          #1B2A35;
--text-2:        #5A6B78;
--text-3:        #8496A2;
--shadow:        0 6px 22px rgba(15,35,55,0.07);
--shadow-sm:     0 2px 8px rgba(15,35,55,0.05);
}
html[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse at 8% 0%, rgba(35,92,122,0.03) 0%, transparent 45%),
    radial-gradient(ellipse at 92% 100%, rgba(122,26,42,0.02) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(35,92,122,0.01) 0%, transparent 60%);
}
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(35,92,122,0.16); }
html[data-theme="light"] img[src*="Jastar_Logo"] { background: #fff; }

body, .shell, .admin-rail, .sidebar, .card, .panel, .form-card, .modal-box, .login-split {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

/* ══ THEME TOGGLE ══ */
.theme-toggle-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer; transition: var(--transition);
  flex-shrink: 0;
}
.theme-toggle-btn:hover { color: var(--gold); border-color: var(--gold-border); background: var(--hover); }
.theme-toggle-btn svg { width: 14px; height: 14px; }
.theme-toggle-btn .icon-sun { display: none; }
.theme-toggle-btn .icon-moon { display: block; }
html[data-theme="light"] .theme-toggle-btn .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle-btn .icon-moon { display: none; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 8% 0%, rgba(56,189,248,0.06) 0%, transparent 45%),
    radial-gradient(ellipse at 92% 100%, rgba(122,26,42,0.05) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(56,189,248,0.015) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(56,189,248,0.2); border-radius: 2px; }

/* ══ LOADER ══ */
.loader { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 9999; transition: opacity 0.5s ease; }
.loader.out { opacity: 0; pointer-events: none; }
.loader-inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.loader-emblem { margin-bottom: 24px; animation: emblemPulse 2.2s ease-in-out infinite; }
@keyframes emblemPulse { 0%,100%{opacity:0.6;transform:scale(1)} 50%{opacity:1;transform:scale(1.04)} }
.loader-wordmark { font-family: var(--font-brand); font-size: 38px; font-weight: 700; color: var(--text); letter-spacing: 7px; margin-bottom: 6px; }
.loader-tagline { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 3.5px; color: var(--text-3); text-transform: uppercase; margin-bottom: 44px; }
.loader-bar-wrap { width: 200px; margin-bottom: 18px; }
.loader-bar { width: 100%; height: 1px; background: var(--border); border-radius: 1px; overflow: hidden; }
.loader-fill { height: 100%; background: linear-gradient(90deg, var(--maroon), var(--gold)); width: 0; transition: width 2.4s cubic-bezier(0.2,1,0.5,1); }
.loader-status { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); letter-spacing: 0.5px; }

/* ══ LOGIN ══ */
#loginScreen { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 9998; }
.login-split { display: flex; width: 100%; max-width: 920px; min-height: 530px; border-radius: 20px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 0 80px rgba(56,189,248,0.07), var(--shadow); animation: fadeUp 0.4s ease; }
.login-panel-left { flex: 1; background: linear-gradient(135deg, rgba(56,189,248,0.09) 0%, rgba(122,26,42,0.06) 100%); border-right: 1px solid var(--border); padding: 44px; display: flex; flex-direction: column; justify-content: space-between; position: relative; }
.login-panel-left::after { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background: linear-gradient(180deg, var(--gold), var(--maroon)); }
.login-left-brand { display: flex; align-items: center; gap: 14px; }
.login-brand-name { font-family: var(--font-brand); font-size: 23px; font-weight: 700; letter-spacing: 2px; color: var(--text); }
.login-brand-sub { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 2.2px; color: var(--text-3); text-transform: uppercase; margin-top: 2px; }
.login-left-copy { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 32px 0; }
.login-stat-row { display: flex; gap: 32px; margin-bottom: 24px; }
.login-stat-n { font-family: var(--font-brand); font-size: 30px; font-weight: 700; color: var(--gold); line-height: 1; }
.login-stat-l { font-family: var(--font-mono); font-size: 8.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.login-blurb { font-size: 13px; color: var(--text-2); line-height: 1.75; max-width: 290px; }
.login-left-foot { font-family: var(--font-mono); font-size: 9px; color: var(--text-3); letter-spacing: 0.5px; }
.login-panel-right { width: 350px; background: var(--card); display: flex; align-items: center; justify-content: center; padding: 44px; }
.login-form-wrap { width: 100%; }
.login-form-head { margin-bottom: 28px; }
.login-form-title { font-size: 23px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.login-form-sub { font-family: var(--font-mono); font-size: 8.5px; color: var(--text-3); letter-spacing: 1.2px; text-transform: uppercase; }
.login-field { margin-bottom: 14px; }
.login-field label { display: block; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 1.4px; color: var(--text-3); text-transform: uppercase; margin-bottom: 7px; }
.login-field input { width: 100%; padding: 11px 14px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); font-size: 13px; font-family: var(--font-ui); transition: var(--transition); outline: none; }
.login-field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding: 11px 40px 11px 14px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); font-size: 13px; font-family: var(--font-ui); transition: var(--transition); outline: none; }
.pw-wrap input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.pw-eye { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-3); display: flex; align-items: center; padding: 4px; transition: color 0.15s; }
.pw-eye:hover { color: var(--text-2); }
.pw-eye svg { width: 15px; height: 15px; }
.login-btn { width: 100%; padding: 13px; background: var(--gold); color: #06121c; border: none; border-radius: var(--radius); font-size: 12px; font-weight: 700; font-family: var(--font-ui); letter-spacing: 0.4px; cursor: pointer; transition: all 0.18s; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; }
.login-btn:hover { opacity: 0.86; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(56,189,248,0.32); }
.login-btn:active { transform: translateY(0); }
.login-error { color: var(--red); font-size: 11px; margin-top: 12px; min-height: 1.2em; font-family: var(--font-mono); }
.login-demo-hint { font-family: var(--font-mono); font-size: 9px; color: var(--text-3); margin-top: 18px; text-align: center; border: 1px dashed var(--border); border-radius: 6px; padding: 8px; }
@keyframes fadeUp { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:translateY(0)} }

/* ══ SHELL ══ */
.shell { display: flex; flex-direction: column; min-height: 100vh; }

/* ══ ADMIN COMMAND RAIL ══ */
.admin-rail {
  height: var(--rail-h);
  background: rgba(6,8,15,0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 200;
  gap: 10px;
}
.admin-rail-left { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; overflow: hidden; }
.admin-rail-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; position: relative; }
.rail-brand { display: flex; align-items: center; gap: 9px; flex-shrink: 0; padding-right: 16px; border-right: 1px solid var(--border); }
.rail-brand img.rail-logo { height: 22px; width: auto; display: block; }
.rail-brand-name { font-family: var(--font-brand); font-size: 14px; font-weight: 700; color: var(--gold); letter-spacing: 1.5px; }
.rail-brand-sep { color: var(--text-3); }
.rail-brand-sub { font-family: var(--font-mono); font-size: 8.5px; color: var(--text-3); letter-spacing: 0.5px; white-space: nowrap; }
.admin-nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav-group { display: flex; align-items: center; gap: 2px; padding: 0 6px; border-right: 1px solid var(--border); }
.admin-nav-group:last-child { border-right: none; }
.admin-nav-group-label { font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 1.5px; color: var(--text-3); text-transform: uppercase; padding-right: 6px; }
.admin-nav-item {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 9px; border: none; background: transparent;
  color: var(--text-3); font-family: var(--font-ui); font-size: 11px; font-weight: 500;
  border-radius: var(--radius); cursor: pointer; transition: var(--transition);
  white-space: nowrap; position: relative;
}
.admin-nav-item:hover { color: var(--text); background: var(--hover); }
.admin-nav-item.active { color: var(--gold); background: var(--gold-dim); border: 1px solid var(--gold-border); }
.rail-badge { font-family: var(--font-mono); font-size: 8.5px; background: var(--red-dim); color: var(--red); border-radius: 8px; padding: 1px 4px; border: 1px solid rgba(239,68,68,0.2); }
.lock-icon { opacity: 0.45; flex-shrink: 0; }
.rail-live { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.rail-clock { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }
.rail-tz { font-family: var(--font-mono); font-size: 7.5px; color: var(--text-3); }
.rail-alert-btn { position: relative; width: 32px; height: 32px; border: 1px solid var(--border); background: transparent; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); }
.rail-alert-btn:hover { border-color: var(--gold-border); background: var(--hover); }
.rail-alert-btn svg { width: 14px; height: 14px; fill: none; stroke: var(--text-2); stroke-width: 1.4; stroke-linecap: round; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: blink 2.5s ease-in-out infinite; flex-shrink: 0; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.18} }
.alert-dot { position: absolute; top: -2px; right: -2px; width: 7px; height: 7px; background: var(--red); border-radius: 50%; border: 2px solid var(--bg); animation: alertPulse 2s ease-in-out infinite; }
@keyframes alertPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.3)} }

/* ══ SEARCH ══ */
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 13px; height: 13px; fill: none; stroke: var(--text-3); stroke-width: 1.8; }
.search-input { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 6px 12px 6px 30px; font-size: 11.5px; font-family: var(--font-ui); outline: none; width: 220px; transition: var(--transition); }
.search-input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-dim); width: 260px; }
.search-input::placeholder { color: var(--text-3); }
.search-results-panel { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface-2); border: 1px solid var(--border-mid); border-radius: var(--radius-lg); box-shadow: var(--shadow); z-index: 400; overflow: hidden; min-width: 300px; animation: fadeUp 0.15s ease; }
.search-result-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; cursor: pointer; transition: background 0.1s; font-size: 12px; }
.search-result-item:hover { background: var(--hover); }
.search-result-type { font-family: var(--font-mono); font-size: 8.5px; color: var(--text-3); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 2px 5px; flex-shrink: 0; }

/* ══ USER CHIP ══ */
.user-chip-rail { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: var(--transition); }
.user-chip-rail:hover { border-color: var(--border-mid); background: var(--hover); }
.user-av-rail { width: 26px; height: 26px; border-radius: 50%; background: var(--gold-dim); border: 1px solid var(--gold-border); color: var(--gold); font-family: var(--font-mono); font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.user-name-rail { font-size: 11.5px; font-weight: 600; color: var(--text); line-height: 1.2; }
.user-role-rail { font-family: var(--font-mono); font-size: 7.5px; color: var(--text-3); }
.user-menu { position: absolute; top: calc(100% + 8px); right: 0; background: var(--surface-2); border: 1px solid var(--border-mid); border-radius: var(--radius-lg); min-width: 200px; box-shadow: var(--shadow); z-index: 500; overflow: hidden; animation: fadeUp 0.15s ease; }
.user-menu-header { padding: 12px 16px 10px; border-bottom: 1px solid var(--border); }
.user-menu-header-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-menu-header-role { font-family: var(--font-mono); font-size: 9px; color: var(--gold); margin-top: 2px; }
.user-menu-item { display: flex; align-items: center; gap: 9px; padding: 10px 16px; font-size: 12px; color: var(--text-2); cursor: pointer; transition: var(--transition); }
.user-menu-item:hover { background: var(--hover); color: var(--text); }
.user-menu-item.danger { color: var(--red); }
.user-menu-item.danger:hover { background: var(--red-dim); }
.user-menu-divider { height: 1px; background: var(--border); }

/* ══ BODY WRAP ══ */
.body-wrap { display: flex; flex: 1; overflow: hidden; }

/* ══ OPS SIDEBAR ══ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto; scrollbar-width: none;
  height: calc(100vh - var(--rail-h));
  position: sticky;
  top: var(--rail-h);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar-section-head { padding: 14px 16px 8px; }
.sidebar-section-label { font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 2.2px; color: var(--text-3); text-transform: uppercase; }
.sidebar-nav { flex: 1; padding: 4px 8px 10px; }
.nav-group-label { font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 1.8px; color: var(--text-3); padding: 13px 10px 4px; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: none; background: transparent; color: var(--text-2); font-family: var(--font-ui); font-size: 12px; font-weight: 500; border-radius: var(--radius); cursor: pointer; text-align: left; transition: var(--transition); margin-bottom: 1px; position: relative; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--gold-border); }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 2px; height: 18px; background: var(--gold); border-radius: 0 2px 2px 0; }
.nav-icon { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-badge { margin-left: auto; font-family: var(--font-mono); font-size: 9px; font-weight: 700; background: var(--gold-dim); color: var(--gold); border-radius: 10px; padding: 1px 6px; border: 1px solid var(--gold-border); }
.nav-badge.warn { background: var(--red-dim); color: var(--red); border-color: rgba(239,68,68,0.22); }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
.sidebar-footer-label { font-family: var(--font-mono); font-size: 8px; color: var(--text-3); letter-spacing: 0.5px; margin-bottom: 6px; }
.sidebar-footer-status { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 9px; color: var(--green); }

/* ══ MAIN ══ */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ══ SECTION TOPBAR ══ */
.section-topbar { height: 48px; background: rgba(6,8,15,0.85); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; flex-shrink: 0; }
.section-topbar-left { display: flex; align-items: center; gap: 12px; }
.section-topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-date { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
.role-chip { font-family: var(--font-mono); font-size: 9px; color: var(--gold); background: var(--gold-dim); border: 1px solid var(--gold-border); border-radius: 6px; padding: 3px 8px; }
.install-app-btn { display: flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-size: 11px; font-weight: 600; letter-spacing: 0.2px; color: var(--gold); background: var(--gold-dim); border: 1px solid var(--gold-border); border-radius: 6px; padding: 6px 11px; cursor: pointer; transition: all 0.18s; }
.install-app-btn:hover { background: rgba(56,189,248,0.2); border-color: var(--gold); }
.install-app-btn svg { flex-shrink: 0; }
.refresh-app-btn { display: flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-size: 11px; font-weight: 600; letter-spacing: 0.2px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 11px; cursor: pointer; transition: all 0.18s; }
.refresh-app-btn:hover { color: var(--gold); border-color: var(--gold-border); background: var(--gold-dim); }
.refresh-app-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.refresh-app-btn svg { flex-shrink: 0; }
.refresh-app-btn svg.spinning { animation: refresh-spin 0.7s linear infinite; }
@keyframes refresh-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@media (max-width: 720px) { .install-app-btn span, .refresh-app-btn span { display: none; } .install-app-btn, .refresh-app-btn { padding: 6px 8px; } }
@media (max-width: 480px) { .topbar-date, .role-chip { display: none; } }
@media (max-width: 400px) { #syncLabel { display: none; } }
.hamburger { background: none; border: none; cursor: pointer; display: flex; flex-direction: column; gap: 4px; padding: 4px; }
.hamburger span { display: block; width: 18px; height: 1.5px; background: var(--text-2); border-radius: 1px; transition: var(--transition); }
.hamburger:hover span { background: var(--text); }
.section-breadcrumb { display: flex; align-items: center; gap: 8px; }
.breadcrumb-area { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
.breadcrumb-title { font-size: 13px; font-weight: 600; color: var(--text); }

/* ══ ALERTS PANEL ══ */
.alerts-panel { display: none; position: fixed; top: calc(var(--rail-h) + 48px); right: 20px; width: 340px; background: var(--surface-2); border: 1px solid var(--border-mid); border-radius: var(--radius-lg); box-shadow: var(--shadow); z-index: 150; overflow: hidden; animation: fadeUp 0.2s ease; }
.alerts-panel.open { display: block; }
.alerts-title { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 12px; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--border); }
.alert-close-btn { margin-left: auto; background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.alert-close-btn:hover { color: var(--text); }
.alert-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 11.5px; color: var(--text-2); transition: background 0.1s; }
.alert-item:hover { background: var(--hover); }
.alert-item.crit { border-left: 2px solid var(--red); }
.alert-item.warn { border-left: 2px solid var(--amber); }
.alert-dot-sm { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }

/* ══ CONTENT AREA ══ */
.content { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; z-index: 1; }
.section { display: none; padding: 20px; animation: fadeUp 0.2s ease; }
.section.active { display: block; }

/* ══ SECTION HEADER ══ */
.sec-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.sec-title { font-family: var(--font-brand); font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: 0.3px; }
.sec-title-admin { font-family: var(--font-brand); font-size: 22px; font-weight: 700; color: var(--gold); letter-spacing: 0.3px; display: flex; align-items: center; gap: 9px; }
.filter-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-btn { padding: 5px 12px; background: transparent; border: 1px solid var(--border); border-radius: 20px; color: var(--text-3); font-size: 11.5px; font-family: var(--font-ui); cursor: pointer; transition: var(--transition); }
.filter-btn:hover { border-color: var(--border-mid); color: var(--text); background: var(--hover); }
.filter-btn.active { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold); font-weight: 600; }
.pill { padding: 4px 11px; background: transparent; border: 1px solid var(--border); border-radius: 20px; color: var(--text-3); font-size: 11px; font-family: var(--font-ui); cursor: pointer; transition: var(--transition); }
.pill:hover { border-color: var(--border-mid); color: var(--text); }
.pill.active { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold); }
.action-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 13px; background: var(--gold); color: #06121c; border: none; border-radius: var(--radius); font-size: 11.5px; font-weight: 600; font-family: var(--font-ui); cursor: pointer; transition: var(--transition); white-space: nowrap; }
.action-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.action-btn:active { transform: translateY(0); }
.action-btn.ghost { background: transparent; border: 1px solid var(--border-mid); color: var(--text-2); }
.action-btn.ghost:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); transform: none; }
.action-btn.danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.25); }
.action-btn.danger:hover { background: var(--red); color: #fff; }
.admin-only-btn { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--gold-border); }
.admin-only-btn:hover { background: var(--gold); color: #06121c; }
.label-optional { font-size: 9px; color: var(--text-3); font-weight: 400; margin-left: 4px; }

/* ══ KPI CARDS ══ */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; transition: var(--transition); position: relative; overflow: hidden; }
.kpi-card:hover { border-color: var(--border-mid); transform: translateY(-1px); }
.kpi-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.kpi-card.kpi-gold::before { background: var(--gold); }
.kpi-card.kpi-green::before { background: var(--green); }
.kpi-card.kpi-red::before { background: var(--red); }
.kpi-card.kpi-blue::before { background: var(--blue); }
.kpi-card.kpi-orange::before { background: var(--amber); }
.kpi-value { font-family: var(--font-brand); font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.1; }
.kpi-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 1.2px; color: var(--text-3); text-transform: uppercase; margin-top: 5px; }
.kpi-sub { font-size: 10.5px; color: var(--text-3); margin-top: 3px; }
.money-mask { color: var(--text-3); letter-spacing: 2px; }

/* ══ PANELS ══ */
.two-col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.panel-title { font-size: 12px; font-weight: 600; color: var(--text); }
.panel-meta { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-3); }

/* ══ FORMS ══ */
.fg { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.fg label { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 1.4px; color: var(--text-3); text-transform: uppercase; }
.fg input, .fg select, .fg textarea { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 9px 12px; font-size: 12.5px; font-family: var(--font-ui); outline: none; transition: var(--transition); }
.fg input:focus, .fg select:focus, .fg textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-dim); }
.fg input.input-valid { border-color: var(--green); }
.fg input.input-invalid { border-color: var(--red); }
.fg select { cursor: pointer; }
.fg textarea { resize: vertical; min-height: 60px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.form-card-head { padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text); }
.form-card-body { padding: 18px; }
.submit-btn { width: 100%; padding: 12px; background: var(--gold); color: #06121c; border: none; border-radius: var(--radius); font-size: 12.5px; font-weight: 700; font-family: var(--font-ui); cursor: pointer; transition: var(--transition); margin-top: 6px; }
.submit-btn:hover { opacity: 0.86; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(56,189,248,0.3); }

/* ══ TABLES ══ */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { padding: 10px 14px; text-align: left; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 1.2px; color: var(--text-3); text-transform: uppercase; border-bottom: 1px solid var(--border); background: var(--surface); white-space: nowrap; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.data-table tr:hover td { background: var(--hover); color: var(--text); cursor: pointer; }
.data-table tr:last-child td { border-bottom: none; }
.empty-td { text-align: center; padding: 30px; color: var(--text-3); font-style: italic; }
.mono { font-family: var(--font-mono); font-size: 11px; }
.tbl-btn { padding: 4px 10px; background: transparent; border: 1px solid var(--border); color: var(--text-3); border-radius: 5px; font-size: 11px; cursor: pointer; transition: var(--transition); }
.tbl-btn:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }

/* ══ STATUS BADGES ══ */
.sbadge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 10px; font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.3px; border: 1px solid transparent; text-transform: uppercase; }
.s-available { background: rgba(34,197,94,0.12); color: var(--green); border-color: rgba(34,197,94,0.22); }
.s-on_trip { background: rgba(56,189,248,0.12); color: var(--gold); border-color: var(--gold-border); }
.s-maintenance { background: rgba(245,158,11,0.12); color: var(--amber); border-color: rgba(245,158,11,0.22); }
.s-breakdown { background: rgba(239,68,68,0.12); color: var(--red); border-color: rgba(239,68,68,0.22); }
.s-off_duty { background: rgba(74,82,104,0.2); color: var(--text-3); border-color: rgba(74,82,104,0.3); }
.s-grounded { background: rgba(239,68,68,0.12); color: var(--red); border-color: rgba(239,68,68,0.22); }
.s-active { background: rgba(34,197,94,0.12); color: var(--green); border-color: rgba(34,197,94,0.22); }
.s-completed { background: rgba(56,189,248,0.1); color: var(--blue); border-color: rgba(56,189,248,0.18); }
.s-delayed { background: rgba(245,158,11,0.12); color: var(--amber); border-color: rgba(245,158,11,0.22); }
.s-pending { background: rgba(56,189,248,0.12); color: var(--gold); border-color: var(--gold-border); }
.s-approved { background: rgba(34,197,94,0.12); color: var(--green); border-color: rgba(34,197,94,0.22); }
.s-rejected { background: rgba(239,68,68,0.12); color: var(--red); border-color: rgba(239,68,68,0.22); }
.s-pending_review { background: rgba(245,158,11,0.12); color: var(--amber); border-color: rgba(245,158,11,0.22); }
.s-verified { background: rgba(34,197,94,0.12); color: var(--green); border-color: rgba(34,197,94,0.22); }
.s-fulfilled { background: rgba(56,189,248,0.1); color: var(--blue); border-color: rgba(56,189,248,0.18); }
.s-overdue { background: rgba(239,68,68,0.14); color: var(--red); border-color: rgba(239,68,68,0.25); }
.s-draft { background: rgba(74,82,104,0.2); color: var(--text-3); border-color: rgba(74,82,104,0.3); }
.s-sent { background: rgba(56,189,248,0.1); color: var(--blue); border-color: rgba(56,189,248,0.18); }
.s-paid { background: rgba(34,197,94,0.12); color: var(--green); border-color: rgba(34,197,94,0.22); }
.s-partial { background: rgba(245,158,11,0.12); color: var(--amber); border-color: rgba(245,158,11,0.22); }
.s-critical, .s-breakdown { background: rgba(239,68,68,0.12); color: var(--red); border-color: rgba(239,68,68,0.22); }
.s-in_progress { background: rgba(167,139,250,0.12); color: var(--purple); border-color: rgba(167,139,250,0.22); }
.s-loaded { background: rgba(56,189,248,0.1); color: var(--blue); border-color: rgba(56,189,248,0.18); }
.s-offloaded { background: rgba(167,139,250,0.12); color: var(--purple); border-color: rgba(167,139,250,0.22); }
.s-reported { background: rgba(245,158,11,0.12); color: var(--amber); border-color: rgba(245,158,11,0.22); }
.s-diagnosed { background: rgba(56,189,248,0.1); color: var(--blue); border-color: rgba(56,189,248,0.18); }
.s-suspended { background: rgba(239,68,68,0.12); color: var(--red); border-color: rgba(239,68,68,0.22); }
.s-reconciled { background: rgba(45,212,191,0.1); color: var(--teal); border-color: rgba(45,212,191,0.18); }
.s-open { background: rgba(245,158,11,0.12); color: var(--amber); border-color: rgba(245,158,11,0.22); }
.s-resolved { background: rgba(34,197,94,0.12); color: var(--green); border-color: rgba(34,197,94,0.22); }
.s-redelivery { background: rgba(167,139,250,0.12); color: var(--purple); border-color: rgba(167,139,250,0.22); }
.s-high { background: rgba(245,158,11,0.12); color: var(--amber); border-color: rgba(245,158,11,0.22); }
.s-urgent { background: rgba(122,26,42,0.16); color: #E88A9A; border-color: rgba(122,26,42,0.4); }
.s-normal { background: rgba(74,82,104,0.2); color: var(--text-3); border-color: rgba(74,82,104,0.3); }

/* ══ TRUCK GRID ══ */
.truck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.truck-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; transition: var(--transition); position: relative; }
.truck-card:hover { border-color: var(--gold-border); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.truck-card-inner { position: relative; }
.truck-card-status-bar { height: 3px; }
.truck-card-status-bar.available { background: var(--green); }
.truck-card-status-bar.on_trip { background: var(--gold); }
.truck-card-status-bar.maintenance { background: var(--amber); }
.truck-card-status-bar.breakdown { background: var(--red); }
.truck-card-status-bar.off_duty { background: var(--text-3); }
.truck-card-body { padding: 14px; }
.truck-card-reg { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--gold); letter-spacing: 0.5px; }
.truck-card-make { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }
.truck-card-type { display: inline-block; font-family: var(--font-mono); font-size: 9px; color: var(--text-3); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; margin-top: 6px; }
.truck-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.ts { font-size: 10.5px; color: var(--text-3); }
.ts b { display: block; color: var(--text-2); font-weight: 600; margin-top: 1px; }
.fuel-bar-outer { grid-column: 1 / -1; }
.fuel-bar { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.fuel-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }

/* ══ DRIVER TABLE ══ */
.driver-cell { display: flex; align-items: center; gap: 9px; }
.driver-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-mid); color: var(--gold); font-family: var(--font-mono); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.driver-name { font-weight: 600; color: var(--text); font-size: 12px; }
.driver-id { font-family: var(--font-mono); font-size: 9px; color: var(--text-3); }

/* ══ TRIP CARDS ══ */
.trips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.trip-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; cursor: pointer; transition: var(--transition); }
.trip-card:hover { border-color: var(--gold-border); transform: translateY(-2px); }
.trip-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.trip-route { font-size: 13.5px; font-weight: 600; color: var(--text); }
.arrow { color: var(--gold); margin: 0 4px; }
.trip-meta { margin-top: 8px; font-size: 11.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 3px; }
.trip-card.status-active { border-left: 2px solid var(--green); }
.trip-card.status-delayed { border-left: 2px solid var(--amber); }
.trip-card.status-completed { border-left: 2px solid var(--blue); opacity: 0.8; }

/* ══ DISPATCH ══ */
.dispatch-layout { display: grid; grid-template-columns: 400px 1fr; gap: 16px; }
.dispatch-queue-item { display: grid; grid-template-columns: 80px 1fr auto auto; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); transition: background 0.1s; }
.dispatch-queue-item:hover { background: var(--hover); }
.dqi-ref { font-family: var(--font-mono); font-size: 10px; color: var(--gold); font-weight: 700; }
.dqi-route { font-size: 12px; color: var(--text); }
.dqi-time { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-3); white-space: nowrap; }

/* ══ BULK DISPATCH ══ */
.dispatch-bulk-info { background: var(--gold-dim); border: 1px solid var(--gold-border); border-radius: var(--radius); padding: 12px 14px; display: flex; align-items: flex-start; gap: 10px; font-size: 11.5px; color: var(--text-2); margin-bottom: 14px; line-height: 1.6; }
.file-upload-area { border: 1.5px dashed var(--border-mid); border-radius: var(--radius); padding: 14px; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: var(--transition); font-size: 12px; color: var(--text-3); }
.file-upload-area:hover, .file-upload-area.drag-over { border-color: var(--gold); background: var(--gold-dim); color: var(--text-2); }
.file-upload-area.large { flex-direction: column; padding: 36px 20px; text-align: center; }
.upload-label { font-size: 14px; font-weight: 600; color: var(--text-2); margin-top: 8px; }
.upload-sub { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.bulk-template-row { margin-top: 10px; }

/* ══ CONTAINER PHOTO GRID (multi-upload) ══ */
.container-img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.container-img-thumb { position: relative; width: 100%; aspect-ratio: 1/1; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.container-img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.container-img-thumb.view-only img { cursor: zoom-in; }
.container-img-remove { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; border: none; background: rgba(6,8,15,0.75); color: var(--text); font-size: 10px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.container-img-remove:hover { background: var(--red); }

/* ══ RATE PREVIEW ══ */
.rate-preview-box { background: var(--gold-dim); border: 1px solid var(--gold-border); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.rpb-label { font-family: var(--font-mono); font-size: 8.5px; color: var(--text-3); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 8px; }
.rpb-row { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; padding: 4px 0; border-bottom: 1px solid var(--gold-border); }
.rpb-row:last-child { border-bottom: none; }
.rpb-row.total { font-weight: 700; color: var(--text); margin-top: 4px; padding-top: 8px; }
.rpb-total-val { font-family: var(--font-brand); font-size: 18px; color: var(--gold); }

/* ══ MAINTENANCE CARDS ══ */
.maint-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; margin-bottom: 10px; cursor: pointer; transition: var(--transition); }
.maint-card:hover { border-color: var(--border-mid); transform: translateY(-1px); }
.maint-card.p-critical { border-left: 3px solid var(--red); }
.maint-card.p-high { border-left: 3px solid var(--amber); }
.maint-card.p-medium { border-left: 3px solid var(--gold); }
.maint-card.p-low { border-left: 3px solid var(--text-3); }
.maint-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.maint-desc { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.maint-meta { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-3); margin-top: 6px; }

/* ══ FUEL ══ */
.fuel-summary-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 12px; }
.fuel-summary-row:last-child { border-bottom: none; }
.fsr-label { color: var(--text-2); }
.fsr-val { font-family: var(--font-mono); font-weight: 700; color: var(--gold); }

/* ══ SHUTOUT / INTERCHANGE / REQ / WORKSHOP CARDS ══ */
.shutout-card, .ic-card, .req-card, .ws-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; margin-bottom: 10px; cursor: pointer; transition: var(--transition); }
.shutout-card:hover, .ic-card:hover, .req-card:hover, .ws-card:hover { border-color: var(--border-mid); transform: translateY(-1px); }
.ic-card { display: flex; gap: 14px; align-items: flex-start; }
.ic-card-img { width: 70px; height: 52px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; }
.ic-card-img-placeholder { width: 70px; height: 52px; border-radius: 6px; background: var(--surface-2); border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.req-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.req-items { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.req-amount { font-family: var(--font-brand); font-size: 16px; font-weight: 700; color: var(--gold); }
.req-meta { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-3); }

/* ══ OPS NOTICE ══ */
.ops-notice { display: flex; align-items: center; gap: 10px; background: var(--gold-dim); border: 1px solid var(--gold-border); border-radius: var(--radius); padding: 10px 14px; font-size: 11.5px; color: var(--text-2); margin-bottom: 14px; line-height: 1.5; }

/* ══ SHIPPING LINES ══ */
.line-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; cursor: pointer; transition: var(--transition); }
.line-card:hover { border-color: var(--border-mid); transform: translateY(-2px); }
.line-code-badge { display: inline-block; font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--gold); background: var(--gold-dim); border: 1px solid var(--gold-border); border-radius: 5px; padding: 3px 8px; margin-bottom: 8px; }

/* ══ INVOICING ══ */
.inv-kpi-reveal-bar { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; font-size: 12px; color: var(--text-2); }
.inv-reveal-btn { padding: 5px 12px; background: var(--gold); color: #06121c; border: none; border-radius: var(--radius); font-size: 11.5px; font-weight: 700; cursor: pointer; transition: var(--transition); margin-left: auto; }
.inv-reveal-btn:hover { opacity: 0.85; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.inv-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; cursor: pointer; transition: var(--transition); }
.inv-card:hover { border-color: var(--border-mid); transform: translateY(-2px); }
.inv-card.overdue { border-left: 2px solid var(--red); }
.inv-card.paid { border-left: 2px solid var(--green); opacity: 0.85; }
.inv-card.sent { border-left: 2px solid var(--blue); }
.inv-card.draft { border-left: 2px solid var(--text-3); }
.inv-type-tag { font-family: var(--font-mono); font-size: 10px; color: var(--gold); font-weight: 700; margin-bottom: 4px; }

/* Invoice Document */
.inv-doc { font-size: 12px; }
.inv-doc-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.inv-doc-company-name { font-family: var(--font-brand); font-size: 22px; font-weight: 700; color: var(--gold); }
.inv-doc-company-details { font-size: 11px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.inv-doc-id { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--text); }
.inv-doc-type { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.inv-doc-status { margin-top: 6px; }
.inv-billing-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.inv-bill-label { font-family: var(--font-mono); font-size: 8px; letter-spacing: 1.5px; color: var(--text-3); text-transform: uppercase; margin-bottom: 5px; }
.inv-bill-name { font-size: 13px; font-weight: 600; color: var(--text); }
.inv-bill-detail { font-size: 11px; color: var(--text-2); line-height: 1.5; margin-top: 2px; }
.inv-items-table-wrap { margin-bottom: 12px; }
.inv-items-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.inv-items-table th { padding: 8px 12px; text-align: left; font-family: var(--font-mono); font-size: 8.5px; color: var(--text-3); border-bottom: 1px solid var(--border); background: var(--surface); }
.inv-items-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.inv-totals { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.inv-totals-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 12px; }
.inv-totals-row:last-child { border-bottom: none; }
.inv-totals-row.total-row { background: var(--gold-dim); font-weight: 700; }
.inv-amount { font-family: var(--font-mono); font-size: 12px; }
.inv-bank { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-3); padding: 10px; background: var(--surface); border-radius: var(--radius); line-height: 1.6; margin-bottom: 10px; }
.inv-notes { font-size: 11px; color: var(--text-3); padding: 10px; background: var(--surface); border-radius: var(--radius); margin-bottom: 10px; line-height: 1.6; }

/* ══ ALLOCATION ══ */
.alloc-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.alloc-rule { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; }
.rule-name { font-size: 12px; font-weight: 600; color: var(--text); }
.rule-desc { font-size: 11px; color: var(--text-2); margin-top: 3px; }
.rule-weight { font-family: var(--font-mono); font-size: 11px; color: var(--gold); font-weight: 700; }
.recommend-card { background: var(--gold-dim); border: 1px solid var(--gold-border); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 12px; align-items: center; }
.rc-label { font-family: var(--font-mono); font-size: 8px; color: var(--text-3); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 3px; }
.rc-val { font-size: 12px; font-weight: 600; color: var(--text); }
.admin-status-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 12px; }
.admin-status-row:last-child { border-bottom: none; }

/* ══ WORK ANALYSIS ══ */
.wt-bars-grid { padding: 12px; }
.wt-bar-item { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 10px; margin-bottom: 10px; }
.wt-bar-label { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wt-bar-track { background: var(--surface-2); border-radius: 3px; height: 8px; overflow: hidden; }
.wt-bar-fill { height: 100%; background: var(--gold); border-radius: 3px; transition: width 0.6s ease; }
.wt-bar-count { font-family: var(--font-mono); font-size: 10px; color: var(--gold); font-weight: 700; text-align: right; }

/* ══ TRACKING ══ */
.tracking-map-layout { display: flex; flex-direction: column; border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; }
.tracking-map { background: var(--surface); height: 340px; display: flex; position: relative; overflow: hidden; }
.tracking-map-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; flex: 1; height: 100%; }
.tracking-map-canvas { flex: 1; height: 100%; background: var(--surface); }
.tracking-map-canvas .leaflet-container { width: 100%; height: 100%; background: var(--surface); font-family: var(--font-ui, sans-serif); }
.tracking-map-canvas .leaflet-popup-content-wrapper { border-radius: 8px; }
.tracking-vehicles { position: static; width: auto; max-height: 260px; background: var(--card); border-top: 1px solid var(--border); overflow-y: auto; padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-content: start; }
.tv-item { padding: 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 11px; color: var(--text-2); cursor: pointer; }
.tv-item:hover { color: var(--text); border-color: var(--border-mid); background: var(--hover); }
.tv-reg { font-family: var(--font-mono); font-size: 10px; color: var(--gold); font-weight: 700; }
@media (min-width: 900px) {
  .tracking-map-layout { flex-direction: row; height: 440px; }
  .tracking-map { flex: 2 1 0; height: 100%; }
  .tracking-vehicles { flex: 1 1 260px; max-width: 260px; max-height: none; border-top: none; border-left: 1px solid var(--border); grid-template-columns: 1fr; }
}
.duty-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; margin-bottom: 14px; }
.duty-status { display: flex; align-items: center; gap: 10px; }
.duty-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.duty-dot.live { background: var(--green); box-shadow: 0 0 0 rgba(62, 207, 110, 0.5); animation: duty-pulse 1.8s infinite; }
@keyframes duty-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(62, 207, 110, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(62, 207, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 207, 110, 0); }
}
.duty-label { font-size: 13px; font-weight: 700; color: var(--text); }
.duty-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.movement-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 11.5px; cursor: pointer; }
.movement-row:hover { background: rgba(255,255,255,0.03); }
.geofence-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 11.5px; }

/* ══ REPORTS ══ */
.trc-period-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.trc-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.report-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 14px; }
.report-block h3 { font-family: var(--font-mono); font-size: 9px; letter-spacing: 1.5px; color: var(--text-3); text-transform: uppercase; margin-bottom: 14px; }
.report-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.report-row:last-child { border-bottom: none; }
.report-row .label { color: var(--text-2); }
.report-row .val { font-family: var(--font-mono); font-weight: 700; color: var(--text); }

/* ══ USER MGMT ══ */
.user-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.1s; }
.user-row:hover { background: var(--hover); }
.user-av-lg { width: 36px; height: 36px; border-radius: 50%; background: var(--gold-dim); border: 1px solid var(--gold-border); color: var(--gold); font-family: var(--font-mono); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.user-row-info { flex: 1; }
.user-row-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.user-row-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.role-card { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.role-name { font-size: 12px; font-weight: 600; color: var(--text); }
.role-perms { font-size: 11px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.audit-row { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--border); }
.audit-time { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }

/* ══ SETTINGS ══ */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; gap: 20px; }
.detail-row:last-child { border-bottom: none; }
.detail-row span { color: var(--text-3); flex-shrink: 0; }
.detail-row b { color: var(--text-2); text-align: right; font-weight: 500; }

/* ══ DASHBOARD SPECIFICS ══ */
.fleet-status-bar { margin-bottom: 10px; }
.fsb-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.fsb-label { font-size: 11.5px; color: var(--text-2); }
.fsb-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.fsb-track { height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.fsb-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }
.live-trip-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--border); transition: background 0.1s; cursor: pointer; }
.live-trip-row:hover { background: var(--hover); }
.ltr-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ltr-info { flex: 1; }
.ltr-route { font-size: 11.5px; font-weight: 600; color: var(--text); }
.ltr-meta { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.activity-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 11.5px; }
.act-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px; }
.act-time { font-family: var(--font-mono); font-size: 9px; color: var(--text-3); white-space: nowrap; margin-left: auto; }
.maint-alert-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 11.5px; cursor: pointer; transition: background 0.1s; }
.maint-alert-row:hover { background: var(--hover); }

/* ══ MODAL ══ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; z-index: 900; padding: 20px; }
.modal-backdrop.active { display: flex; animation: fadeModal 0.2s ease; }
@keyframes fadeModal { from{opacity:0} to{opacity:1} }
.modal-box { background: var(--surface-2); border: 1px solid var(--border-mid); border-radius: var(--radius-lg); width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,0.6); animation: slideUp 0.22s cubic-bezier(0.2,0,0,1); }
@keyframes slideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
.vault-modal { max-width: 420px; }
.modal-hdr { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
.modal-title { font-size: 14px; font-weight: 700; color: var(--text); }
.modal-close { background: none; border: none; color: var(--text-3); font-size: 16px; cursor: pointer; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 5px; transition: var(--transition); }
.modal-close:hover { color: var(--text); background: var(--hover); }
.modal-body { padding: 18px 20px; }
.modal-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius); font-size: 12px; font-weight: 600; font-family: var(--font-ui); cursor: pointer; transition: var(--transition); border: none; }
.modal-btn.primary { background: var(--gold); color: #06121c; }
.modal-btn.primary:hover { opacity: 0.85; }
.modal-btn.ghost { background: transparent; border: 1px solid var(--border-mid); color: var(--text-2); }
.modal-btn.ghost:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.modal-btn.danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.25); }
.modal-btn.danger:hover { background: var(--red); color: #fff; }
.modal-btn.success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,197,94,0.25); }
.modal-btn.success:hover { background: var(--green); color: #000; }

/* ══ VAULT MODAL ══ */
.vault-banner { background: var(--gold-dim); border: 1px solid var(--gold-border); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.vault-banner-label { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 2px; color: var(--gold); text-transform: uppercase; margin-bottom: 6px; }
.vault-banner-desc { font-size: 12px; color: var(--text-2); line-height: 1.6; }
.vault-locked-banner { display: flex; align-items: center; gap: 14px; background: var(--gold-dim); border: 1px solid var(--gold-border); border-radius: var(--radius-lg); padding: 18px; grid-column: 1/-1; }
.vault-locked-banner .title { font-size: 13px; font-weight: 700; color: var(--gold); }
.vault-locked-banner .desc { font-size: 11.5px; color: var(--text-2); margin-top: 3px; }

/* ══ TOAST ══ */
#toastStack { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; }
.toast { padding: 11px 16px; border-radius: var(--radius); font-size: 12.5px; font-family: var(--font-ui); display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); animation: toastIn 0.25s ease; min-width: 240px; max-width: 380px; }
.toast.out { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn { from{opacity:0;transform:translateX(20px)} to{opacity:1;transform:translateX(0)} }
@keyframes toastOut { to{opacity:0;transform:translateX(20px)} }
.toast.success { background: #0a2614; border: 1px solid rgba(34,197,94,0.3); color: var(--green); }
.toast.error { background: #1f0808; border: 1px solid rgba(239,68,68,0.3); color: var(--red); }
.toast.warning { background: #1f1300; border: 1px solid rgba(245,158,11,0.3); color: var(--amber); }
.toast.info { background: var(--surface-2); border: 1px solid var(--border-mid); color: var(--text-2); }

/* ══ EMPTY STATE ══ */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 44px 20px; text-align: center; }
.empty-state-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.4; }
.empty-state-label { font-size: 13px; color: var(--text-3); }
.empty-state-sub { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }

/* ══ SIDEBAR TOGGLE (MOBILE) ══ */
body.sidebar-open .sidebar { transform: translateX(0); }
@media (max-width: 900px) {
  .sidebar { position: fixed; top: var(--rail-h); left: 0; bottom: 0; z-index: 100; transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: translateX(0); box-shadow: var(--shadow); }
  .two-col-grid { grid-template-columns: 1fr; }
  .dispatch-layout { grid-template-columns: 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
  .admin-nav-group-label { display: none; }
  .rail-brand-sub { display: none; }
  .search-input { width: 150px; }
  .truck-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (max-width: 600px) {
  .login-split { flex-direction: column; }
  .login-panel-left { display: none; }
  .login-panel-right { width: 100%; }
  .section { padding: 14px; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
}

/* ══ MISC ══ */
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }


.tiny-btn {
  width: 22px; height: 22px; border-radius: 4px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-3); font-size: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: var(--transition);
}
.tiny-btn:hover { border-color: var(--gold); color: var(--gold); }
.tiny-btn.del:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }

/* ══ DRIVER PORTAL ACTION BUTTONS ══ */
.dp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 10px 16px; border-radius: 9px;
  font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
  border: 1px solid transparent;
}
.dp-btn:active { transform: scale(0.97); }
.dp-btn-primary { background: var(--gold); color: #06121c; }
.dp-btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.dp-btn-ghost { background: var(--surface-2); border: 1px solid var(--border-mid); color: var(--text-2); }
.dp-btn-ghost:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.dp-btn-warn { background: var(--amber-dim); border: 1px solid rgba(245,158,11,0.32); color: var(--amber); }
.dp-btn-warn:hover { background: var(--amber); color: #06121c; }
.dp-btn-sm { min-height: 32px; padding: 7px 12px; font-size: 11px; border-radius: 7px; }
.dp-btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; }
.dp-btn.step-active { background: var(--green-dim); border-color: rgba(34,197,94,0.35); color: var(--green); }

.tiny-img-btn {
  width: 28px; height: 28px; border-radius: 50%; border: 1px dashed var(--border-mid);
  background: var(--surface); color: var(--text-3); font-size: 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: var(--transition);
  flex-shrink: 0;
}
.tiny-img-btn:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }


.driver-reported-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.3);
  border-radius: 10px; padding: 2px 8px; font-size: 9px; font-weight: 700;
  font-family: var(--font-mono); text-transform: uppercase; animation: alertPulse 2s ease-in-out infinite;
}