/* ====================================================
   GATE BARCODE VALIDATION — KUSHWAHA ENTERPRISE
   styles.css — Industrial Utility Aesthetic
   ==================================================== */

:root {
  --bg-base:      #0a0c0f;
  --bg-card:      #111318;
  --surface-1:    #161a21;
  --surface-2:    #1e232d;
  --surface-3:    #252b37;
  --border:       #2a3040;
  --border-light: #323b4f;

  --text-primary: #e8ecf4;
  --text-secondary:#a0aab8;
  --text-muted:   #5c6578;

  --accent-blue:  #3d8bff;
  --accent-green: #00c875;
  --accent-red:   #ff3b5c;
  --accent-yellow:#f5a623;
  --accent-cyan:  #00d4ff;

  --font-mono: 'Space Mono', monospace;
  --font-sans: 'DM Sans', sans-serif;

  --radius: 8px;
  --radius-lg: 14px;
  --transition: 0.18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.mono { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.05em; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }


/* ══════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════ */

.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; position: relative; }

.login-bg {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(61,139,255,0.07) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(0,200,117,0.05) 0%, transparent 50%);
}

.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.3;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

.scan-line {
  position: absolute; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  animation: scanDown 4s linear infinite;
  opacity: 0.4;
}
@keyframes scanDown {
  0% { top: 0; opacity: 0; }
  10% { opacity: 0.4; }
  90% { opacity: 0.4; }
  100% { top: 100%; opacity: 0; }
}

.login-container { position: relative; z-index: 1; width: 100%; max-width: 520px; padding: 24px 16px; }

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.03);
  animation: fadeUp 0.5s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.brand-header { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }

.brand-icon {
  width: 56px; height: 56px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--font-mono); font-size: 0.8rem;
  letter-spacing: 0.12em; color: var(--text-primary); font-weight: 700;
}
.brand-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; }

.login-divider {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.login-divider span { color: var(--text-muted); white-space: nowrap; }

.role-grid { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }

.role-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left; color: var(--text-primary);
  position: relative; overflow: hidden;
}
.role-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent-blue); transform: scaleY(0);
  transition: transform var(--transition);
}
.role-card:hover { background: var(--surface-2); border-color: var(--accent-blue); transform: translateX(3px); }
.role-card:hover::before { transform: scaleY(1); }
.role-card.selected { background: var(--surface-2); border-color: var(--accent-green); }
.role-card.selected::before { background: var(--accent-green); transform: scaleY(1); }

.role-icon { color: var(--accent-cyan); flex-shrink: 0; }
.role-info { flex: 1; }
.role-title { display: block; font-weight: 600; font-size: 0.95rem; }
.role-desc { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; }
.role-arrow { color: var(--text-muted); font-size: 1.2rem; }

.login-note { color: var(--text-muted); text-align: center; }


/* ══════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════ */

.topbar {
  position: sticky; top: 0; z-index: 100;
  height: 52px;
  background: rgba(10,12,15,0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
}

.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-center { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }

.topbar-brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.brand-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse 2s infinite;
}
.brand-dot.admin { background: var(--accent-blue); box-shadow: 0 0 8px var(--accent-blue); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.user-badge {
  font-family: var(--font-mono); font-size: 0.68rem;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 4px; color: var(--text-secondary);
  letter-spacing: 0.05em;
}
.admin-badge { color: var(--accent-blue); border-color: rgba(61,139,255,0.3); }

.logout-btn {
  font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.08em;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); padding: 5px 12px; border-radius: 4px;
  cursor: pointer; transition: all var(--transition);
}
.logout-btn:hover { border-color: var(--accent-red); color: var(--accent-red); }

.sidebar-toggle {
  background: transparent; border: none; color: var(--text-secondary);
  font-size: 1.1rem; cursor: pointer; padding: 4px 8px;
  display: none;
}


/* ══════════════════════════════════════════
   SCANNER PAGE
══════════════════════════════════════════ */

.scanner-page { background: var(--bg-base); }

.scanner-layout {
  max-width: 680px; margin: 0 auto;
  padding: 20px 16px 40px;
  display: flex; flex-direction: column; gap: 20px;
}

.section-label {
  color: var(--text-muted); font-size: 0.65rem; letter-spacing: 0.12em;
  display: block; margin-bottom: 10px;
}

/* Camera */
.camera-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.camera-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}

.camera-controls { display: flex; gap: 8px; }

.cam-btn {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.08em;
  background: var(--accent-blue); color: white;
  border: none; padding: 7px 14px; border-radius: 5px;
  cursor: pointer; transition: all var(--transition);
}
.cam-btn:hover { opacity: 0.85; }
.cam-btn.danger { background: var(--accent-red); }

.camera-viewport {
  position: relative; width: 100%;
  background: var(--bg-base);
  aspect-ratio: 16/9;
  min-height: 200px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.camera-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  color: var(--text-muted);
}
.camera-placeholder p { font-size: 0.82rem; }

#scannerVideo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: none;
}

.scan-reticle {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.reticle-corner {
  position: absolute; width: 24px; height: 24px;
  border-color: var(--accent-cyan); border-style: solid;
}
.reticle-corner.tl { top: 20%; left: 10%; border-width: 2px 0 0 2px; }
.reticle-corner.tr { top: 20%; right: 10%; border-width: 2px 2px 0 0; }
.reticle-corner.bl { bottom: 20%; left: 10%; border-width: 0 0 2px 2px; }
.reticle-corner.br { bottom: 20%; right: 10%; border-width: 0 2px 2px 0; }

.reticle-line {
  position: absolute; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  animation: scanH 2s ease-in-out infinite;
}
@keyframes scanH {
  0%, 100% { top: 30%; }
  50% { top: 70%; }
}

.camera-status {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.1em;
  background: rgba(0,0,0,0.7); color: var(--accent-cyan);
  padding: 4px 12px; border-radius: 20px;
}

/* Manual */
.manual-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
}

.manual-input-row { display: flex; gap: 10px; margin-bottom: 12px; }

.manual-field {
  flex: 1; background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: var(--font-mono); font-size: 0.85rem;
  color: var(--text-primary);
  transition: border-color var(--transition);
  outline: none;
}
.manual-field:focus { border-color: var(--accent-blue); }
.manual-field::placeholder { color: var(--text-muted); }

.validate-btn {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em;
  background: var(--accent-blue); color: white;
  border: none; padding: 10px 18px; border-radius: var(--radius);
  cursor: pointer; white-space: nowrap; transition: all var(--transition);
}
.validate-btn:hover { background: #5a9fff; }

.quick-test { color: var(--text-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.chip {
  font-family: var(--font-mono); font-size: 0.65rem;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--accent-cyan); padding: 4px 10px; border-radius: 4px;
  cursor: pointer; transition: all var(--transition);
}
.chip:hover { border-color: var(--accent-cyan); background: var(--surface-3); }

/* Log section */
.log-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.log-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}

.log-stats { display: flex; gap: 8px; }

.stat-chip {
  font-family: var(--font-mono); font-size: 0.65rem;
  padding: 4px 10px; border-radius: 4px;
}
.stat-chip.success { background: rgba(0,200,117,0.15); color: var(--accent-green); border: 1px solid rgba(0,200,117,0.3); }
.stat-chip.error   { background: rgba(255,59,92,0.15);  color: var(--accent-red);   border: 1px solid rgba(255,59,92,0.3); }

.log-table-wrap { overflow-x: auto; max-height: 320px; overflow-y: auto; }

.log-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.8rem;
}
.log-table thead th {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em;
  color: var(--text-muted);
  background: var(--surface-1);
  padding: 10px 16px; text-align: left;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
  cursor: pointer;
}
.log-table thead th:hover { color: var(--text-primary); }
.log-table tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
.log-table tbody tr:hover { background: var(--surface-1); }
.log-table td { padding: 10px 16px; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-secondary); }

.log-table .status-badge {
  padding: 3px 10px; border-radius: 4px;
  font-size: 0.65rem; letter-spacing: 0.08em; font-weight: 700;
}
.status-badge.success { background: rgba(0,200,117,0.15); color: var(--accent-green); }
.status-badge.duplicate { background: rgba(245,166,35,0.15); color: var(--accent-yellow); }
.status-badge.invalid { background: rgba(255,59,92,0.15); color: var(--accent-red); }

.log-empty td { color: var(--text-muted); text-align: center; padding: 24px; font-size: 0.78rem; }

.log-row-new { animation: rowIn 0.3s ease; }
@keyframes rowIn {
  from { background: rgba(61,139,255,0.12); }
  to { background: transparent; }
}


/* ══════════════════════════════════════════
   ALERT OVERLAY
══════════════════════════════════════════ */

.alert-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.alert-overlay.show { opacity: 1; pointer-events: all; }

.alert-box {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  width: min(360px, 90vw);
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
}
.alert-overlay.show .alert-box { transform: scale(1); }

.alert-box.allowed { border-color: var(--accent-green); }
.alert-box.denied  { border-color: var(--accent-red); }

.alert-icon {
  width: 72px; height: 72px; border-radius: 50%;
  margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}
.alert-icon.allowed { background: rgba(0,200,117,0.15); color: var(--accent-green); border: 2px solid rgba(0,200,117,0.4); }
.alert-icon.denied  { background: rgba(255,59,92,0.15);  color: var(--accent-red);   border: 2px solid rgba(255,59,92,0.4); }

.alert-status {
  font-family: var(--font-mono); font-size: 1.6rem; font-weight: 700;
  letter-spacing: 0.1em; margin-bottom: 8px;
}
.alert-box.allowed .alert-status { color: var(--accent-green); }
.alert-box.denied  .alert-status { color: var(--accent-red); }

.alert-barcode {
  font-family: var(--font-mono); font-size: 0.9rem;
  color: var(--text-muted); margin-bottom: 8px;
  background: var(--surface-1); padding: 6px 14px; border-radius: 6px; display: inline-block;
}

.alert-detail { font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 28px; }

.alert-dismiss {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); padding: 12px 28px; border-radius: 8px;
  cursor: pointer; width: 100%; transition: all var(--transition);
}
.alert-dismiss:hover { background: var(--surface-3); color: var(--text-primary); }


/* ══════════════════════════════════════════
   DASHBOARD PAGE
══════════════════════════════════════════ */

.dashboard-page { display: flex; flex-direction: column; min-height: 100vh; }

.dashboard-layout { display: flex; flex: 1; }

/* Sidebar */
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
}

.sidebar-nav {
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
  flex: 1;
}

.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  text-decoration: none; color: var(--text-secondary);
  font-size: 0.85rem; font-weight: 500;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.sidebar-link:hover { background: var(--surface-2); color: var(--text-primary); }
.sidebar-link.active { background: var(--surface-2); color: var(--accent-blue); border-color: rgba(61,139,255,0.2); }
.sidebar-link.gate-link { color: var(--accent-green); margin-top: 8px; }
.sidebar-link.gate-link:hover { background: rgba(0,200,117,0.08); }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: space-between;
}
.session-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

/* Main */
.dash-main {
  flex: 1; padding: 28px 28px 48px; overflow-y: auto;
  max-width: 1100px;
}

.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.section-title h1 { font-size: 1.4rem; font-weight: 600; }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 20px 16px;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent-blue);
}
.stat-card.success-card::after { background: var(--accent-green); }
.stat-card.error-card::after   { background: var(--accent-red); }
.stat-card.warn-card::after    { background: var(--accent-yellow); }

.stat-label { color: var(--text-muted); margin-bottom: 8px; display: block; }
.stat-value { font-family: var(--font-mono); font-size: 2.4rem; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; }

.stat-bar { height: 3px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.stat-fill { height: 100%; border-radius: 3px; background: var(--accent-blue); transition: width 0.8s ease; }
.stat-fill.green  { background: var(--accent-green); }
.stat-fill.red    { background: var(--accent-red); }
.stat-fill.yellow { background: var(--accent-yellow); }

/* Overview bottom */
.overview-bottom { display: grid; grid-template-columns: 1fr 280px; gap: 20px; }

.activity-panel, .donut-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.panel-title { color: var(--text-muted); margin-bottom: 16px; display: block; }

.activity-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }

.activity-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--surface-1);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  animation: rowIn 0.3s ease;
}
.activity-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.activity-dot.green  { background: var(--accent-green); }
.activity-dot.red    { background: var(--accent-red); }
.activity-dot.yellow { background: var(--accent-yellow); }

.activity-info { flex: 1; }
.activity-bc { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-primary); }
.activity-time { font-size: 0.72rem; color: var(--text-muted); }

.activity-status { font-family: var(--font-mono); font-size: 0.65rem; }
.activity-status.green  { color: var(--accent-green); }
.activity-status.red    { color: var(--accent-red); }
.activity-status.yellow { color: var(--accent-yellow); }

/* Donut */
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.donut-chart { width: 140px; height: 140px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.legend-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.78rem; color: var(--text-secondary);
}
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.legend-dot.green  { background: var(--accent-green); }
.legend-dot.red    { background: var(--accent-red); }
.legend-dot.yellow { background: var(--accent-yellow); }

/* Filter bar */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.filter-input, .filter-select {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-family: var(--font-sans); font-size: 0.82rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition);
  min-width: 140px;
}
.filter-input:focus, .filter-select:focus { border-color: var(--accent-blue); }
.filter-select option { background: var(--bg-card); }

.clear-filter-btn {
  font-family: var(--font-mono); font-size: 0.65rem;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); padding: 8px 14px; border-radius: var(--radius);
  cursor: pointer; letter-spacing: 0.08em; transition: all var(--transition);
}
.clear-filter-btn:hover { border-color: var(--accent-red); color: var(--accent-red); }

.export-btn {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--accent-cyan); padding: 8px 18px; border-radius: var(--radius);
  cursor: pointer; transition: all var(--transition);
}
.export-btn:hover { background: var(--surface-3); }

.admin-table { min-width: 640px; }
.table-footer {
  padding: 12px 16px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--surface-1);
}

/* Inventory */
.inv-filters { display: flex; gap: 10px; flex-wrap: wrap; }

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.inv-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  transition: all var(--transition);
}
.inv-card:hover { border-color: var(--border-light); transform: translateY(-1px); }
.inv-card.dispatched { border-color: rgba(0,200,117,0.3); }
.inv-card.pending    { border-color: rgba(245,166,35,0.3); }

.inv-status-dot {
  position: absolute; top: 14px; right: 14px;
  width: 8px; height: 8px; border-radius: 50%;
}
.inv-status-dot.dispatched { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.inv-status-dot.pending    { background: var(--accent-yellow); }

.inv-bc { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-primary); margin-bottom: 6px; }
.inv-order { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.inv-vehicle { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 12px; }
.inv-tag {
  display: inline-block; font-family: var(--font-mono); font-size: 0.6rem;
  padding: 3px 8px; border-radius: 4px;
}
.inv-tag.dispatched { background: rgba(0,200,117,0.15); color: var(--accent-green); }
.inv-tag.pending    { background: rgba(245,166,35,0.15);  color: var(--accent-yellow); }

/* Sort icon */
.sort-icon { opacity: 0.4; font-size: 0.7rem; }
th:hover .sort-icon { opacity: 1; }


/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */

@media (max-width: 900px) {
  .overview-bottom { grid-template-columns: 1fr; }
  .donut-wrap { flex-direction: row; justify-content: flex-start; }
}

@media (max-width: 768px) {
  .sidebar-toggle { display: block; }

  .sidebar {
    position: fixed;
    top: 52px; left: 0; bottom: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 240px;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.5); }

  .dash-main { padding: 20px 16px 40px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .login-card { padding: 28px 24px; }

  .alert-box { padding: 28px 20px; }
  .alert-status { font-size: 1.3rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar-center { display: none; }

  .camera-viewport { aspect-ratio: 4/3; }

  .manual-input-row { flex-direction: column; }
}
