/* =====================================================
   SMARTTOLL SYSTEM - Main Stylesheet
   Theme: Industrial Dark / Cyber-Transit Aesthetic
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Exo+2:wght@300;400;500;600;700;900&display=swap');

:root {
  --bg-primary:    #080c14;
  --bg-secondary:  #0e1520;
  --bg-card:       #111827;
  --bg-card-hover: #162033;
  --bg-panel:      #0a1018;

  --accent-cyan:   #00d4ff;
  --accent-green:  #00ff9d;
  --accent-amber:  #ffb300;
  --accent-red:    #ff3d5a;
  --accent-purple: #9b59ff;
  --accent-dim:    rgba(0,212,255,0.12);

  --text-primary:  #e8edf5;
  --text-secondary:#8fa0b8;
  --text-muted:    #4a5a72;
  --text-accent:   #00d4ff;

  --border:        rgba(0,212,255,0.12);
  --border-hover:  rgba(0,212,255,0.3);
  --border-bright: rgba(0,212,255,0.5);

  --sidebar-width: 260px;
  --header-height: 64px;

  --font-mono: 'Space Mono', monospace;
  --font-body: 'Exo 2', sans-serif;

  --shadow-glow: 0 0 20px rgba(0,212,255,0.15);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.6);

  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* Light theme */
[data-theme="light"] {
  --bg-primary:    #f0f4f8;
  --bg-secondary:  #e8edf5;
  --bg-card:       #ffffff;
  --bg-card-hover: #f5f8ff;
  --bg-panel:      #edf2f9;
  --text-primary:  #1a2332;
  --text-secondary:#4a5a72;
  --text-muted:    #8fa0b8;
  --text-accent:   #006bcc;
  --accent-cyan:   #006bcc;
  --border:        rgba(0,107,204,0.12);
  --border-hover:  rgba(0,107,204,0.3);
  --shadow-glow:   0 0 20px rgba(0,107,204,0.1);
  --shadow-card:   0 4px 24px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 10px; }

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

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent-cyan), #0055aa);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 12px rgba(0,212,255,0.3);
}

.brand-text {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.brand-text span { display: block; font-size: 10px; color: var(--text-muted); font-weight: 400; letter-spacing: 1px; }

.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }

.nav-group-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  padding: 16px 20px 6px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: var(--transition);
  position: relative;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--accent-dim);
  border-left-color: var(--border-hover);
}

.nav-item.active {
  color: var(--accent-cyan);
  background: rgba(0,212,255,0.08);
  border-left-color: var(--accent-cyan);
}

.nav-item .nav-icon { width: 18px; font-size: 15px; opacity: 0.8; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--accent-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  font-family: var(--font-mono);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }

/* ---- MAIN CONTENT ---- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- TOP BAR ---- */
.topbar {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-size: 16px; font-weight: 700; color: var(--text-primary); flex: 1; }
.topbar-title small { display: block; font-size: 11px; color: var(--text-muted); font-weight: 400; font-family: var(--font-mono); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.btn-icon {
  width: 36px; height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  text-decoration: none;
}
.btn-icon:hover { border-color: var(--border-hover); color: var(--accent-cyan); background: var(--accent-dim); }

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-green);
  background: rgba(0,255,157,0.08);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(0,255,157,0.2);
}

.live-dot {
  width: 6px; height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,100% { opacity: 1; box-shadow: 0 0 4px var(--accent-green); }
  50% { opacity: 0.5; box-shadow: none; }
}

/* ---- PAGE CONTENT ---- */
.page-content { flex: 1; padding: 24px; }

/* ---- STAT CARDS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-color, var(--accent-cyan));
  opacity: 0.6;
}

.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow-hover); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: var(--icon-bg, rgba(0,212,255,0.1));
  color: var(--accent-color, var(--accent-cyan));
}

.stat-body { flex: 1; min-width: 0; }
.stat-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; font-family: var(--font-mono); }
.stat-delta { font-size: 11px; color: var(--accent-green); margin-top: 4px; }
.stat-delta.down { color: var(--accent-red); }

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

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto ;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  flex: 1;
}

.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); }

/* ---- TABLES ---- */
.table-responsive { overflow-x: auto;}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  
}

.data-table th {
  padding: 10px 14px;
  background: var(--bg-panel);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody tr:hover { background: var(--bg-card-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success  { background: rgba(0,255,157,0.1); color: var(--accent-green); border: 1px solid rgba(0,255,157,0.2); }
.badge-danger   { background: rgba(255,61,90,0.1);  color: var(--accent-red);   border: 1px solid rgba(255,61,90,0.2); }
.badge-warning  { background: rgba(255,179,0,0.1);  color: var(--accent-amber); border: 1px solid rgba(255,179,0,0.2); }
.badge-info     { background: rgba(0,212,255,0.1);  color: var(--accent-cyan);  border: 1px solid rgba(0,212,255,0.2); }
.badge-purple   { background: rgba(155,89,255,0.1); color: var(--accent-purple);border: 1px solid rgba(155,89,255,0.2); }
.badge-muted    { background: rgba(255,255,255,0.05);color: var(--text-muted);  border: 1px solid var(--border); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-cyan);
  color: #000;
}
.btn-primary:hover { background: #33ddff; box-shadow: 0 0 16px rgba(0,212,255,0.4); }

.btn-success {
  background: var(--accent-green);
  color: #000;
}
.btn-success:hover { background: #33ffb4; box-shadow: 0 0 16px rgba(0,255,157,0.4); }

.btn-danger  { background: var(--accent-red); color: #fff; }
.btn-danger:hover { filter: brightness(1.2); }

.btn-warning { background: var(--accent-amber); color: #000; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-hover);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); background: var(--accent-dim); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-xs { padding: 3px 8px; font-size: 10px; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-family: var(--font-mono);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  transition: var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--accent-cyan); box-shadow: 0 0 0 3px rgba(0,212,255,0.1); }
.form-control::placeholder { color: var(--text-muted); }
.form-control option { background: var(--bg-card); }

.form-row { display: grid; gap: 16px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-error { font-size: 11px; color: var(--accent-red); margin-top: 4px; }
.form-hint  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ---- MODALS ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-hover), 0 0 40px rgba(0,212,255,0.1);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(-10px); } to { opacity: 1; transform: none; } }

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-title { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--text-primary); flex: 1; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; transition: var(--transition); padding: 4px; border-radius: 4px; }
.modal-close:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ---- CHART CONTAINERS ---- */
.chart-container { position: relative; width: 100%; }
.chart-container canvas { border-radius: var(--radius); }

/* ---- GRID LAYOUTS ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ---- DEVICE STATUS ---- */
.device-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: var(--transition);
}
.device-card:hover { border-color: var(--border-hover); }
.device-card.online  { border-left: 3px solid var(--accent-green); }
.device-card.offline { border-left: 3px solid var(--accent-red); }
.device-card.maintenance { border-left: 3px solid var(--accent-amber); }

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.online { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); animation: pulse 2s infinite; }
.status-dot.offline { background: var(--text-muted); }
.status-dot.maintenance { background: var(--accent-amber); box-shadow: 0 0 6px var(--accent-amber); }
.status-dot.fault { background: var(--accent-red); box-shadow: 0 0 6px var(--accent-red); }

/* ---- ALERTS / TOASTS ---- */
.toast-container {
  position: fixed;
  top: 80px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow-hover);
  animation: slideIn 0.3s ease;
  font-size: 13px;
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error   { border-left: 3px solid var(--accent-red); }
.toast.warning { border-left: 3px solid var(--accent-amber); }
.toast.info    { border-left: 3px solid var(--accent-cyan); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideOut { to { transform: translateX(110%); opacity: 0; } }

/* ---- PAGINATION ---- */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.page-link {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius);
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}
.page-link:hover { border-color: var(--border-hover); color: var(--accent-cyan); }
.page-link.active { background: var(--accent-cyan); color: #000; border-color: var(--accent-cyan); }
.page-link.disabled { opacity: 0.4; cursor: default; pointer-events: none; }

/* ---- FILTER BAR ---- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .form-control { width: auto; }

/* ---- WALLET ---- */
.wallet-balance-card {
  background: linear-gradient(135deg, #0a1a2e, #0e2040);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.wallet-balance-card::after {
  content: '$';
  position: absolute;
  right: -10px; bottom: -20px;
  font-size: 120px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: rgba(0,212,255,0.04);
  line-height: 1;
}
.wallet-amount {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  color: var(--accent-cyan);
  line-height: 1;
}

/* ---- AUTH PAGES ---- */
.auth-page {
  min-height: 100vh;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: fixed;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at 30% 40%, rgba(0,212,255,0.04) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(155,89,255,0.03) 0%, transparent 40%);
  pointer-events: none;
}

/* Grid overlay */
.auth-page::after {
  content: '';
  position: fixed;
  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;
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-hover), 0 0 60px rgba(0,212,255,0.08);
  position: relative;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent-cyan), #0055aa);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin: 0 auto 12px;
  box-shadow: 0 0 24px rgba(0,212,255,0.4);
}
.auth-logo h1 { font-family: var(--font-mono); font-size: 18px; color: var(--text-primary); }
.auth-logo p  { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-danger  { background: rgba(255,61,90,0.1); border: 1px solid rgba(255,61,90,0.25); color: var(--accent-red); }
.alert-success { background: rgba(0,255,157,0.1); border: 1px solid rgba(0,255,157,0.25); color: var(--accent-green); }
.alert-warning { background: rgba(255,179,0,0.1); border: 1px solid rgba(255,179,0,0.25); color: var(--accent-amber); }
.alert-info    { background: rgba(0,212,255,0.1); border: 1px solid rgba(0,212,255,0.25); color: var(--accent-cyan); }

/* ---- UTILITY ---- */
.text-cyan    { color: var(--accent-cyan); }
.text-green   { color: var(--accent-green); }
.text-red     { color: var(--accent-red); }
.text-amber   { color: var(--accent-amber); }
.text-muted   { color: var(--text-muted); }
.text-mono    { font-family: var(--font-mono); }
.text-sm      { font-size: 12px; }
.text-xs      { font-size: 11px; }

.d-flex       { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; }
.mb-16  { margin-bottom: 16px; }
.mb-20  { margin-bottom: 20px; }
.mb-24  { margin-bottom: 24px; }
.mt-16  { margin-top: 16px; }
.p-0    { padding: 0; }
.w-100  { width: 100%; }

.mono { font-family: var(--font-mono); font-size: 12px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .page-content { padding: 16px; }
}

/* ---- MOBILE SIDEBAR OVERLAY ---- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* Hamburger always visible */
#sidebarToggle { display: flex; }

@media (min-width: 901px) {
  #sidebarToggle { display: none; }
}

/* Fix table-responsive on small screens */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Fix filter bar wrapping */
.filter-bar form {
  flex-wrap: wrap;
}

/* Ensure modals sit above overlay */
.modal-overlay { z-index: 1000; }

/* ======================================================
   FONT AWESOME ICON FIXES + NEW FEATURE STYLES
   ====================================================== */

/* Sidebar nav icons - consistent sizing */
.nav-icon { width: 20px; display: inline-flex; justify-content: center; font-size: 14px; }
.nav-icon i { font-size: 14px; }
.brand-icon i { font-size: 22px; }

/* Topbar alert badge */
.topbar-actions { position: relative; }
.btn-icon { position: relative; }
.topbar-badge {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--accent-red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  pointer-events: none;
}

/* AI Insights page */
.ai-card {
  background: linear-gradient(135deg, rgba(155,89,255,.08) 0%, rgba(0,212,255,.05) 100%);
  border: 1px solid rgba(155,89,255,.25);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.ai-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(180deg, var(--accent-purple), var(--accent-cyan));
}
.ai-card .ai-icon {
  width: 36px; height: 36px;
  background: rgba(155,89,255,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--accent-purple);
  margin-bottom: 12px;
}
.ai-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(155,89,255,.12);
  border: 1px solid rgba(155,89,255,.2);
  color: var(--accent-purple);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .5px;
}

/* Alert items */
.alert-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.alert-item:hover { background: var(--bg-panel); }
.alert-item.unread { border-left: 3px solid var(--accent-amber); }
.alert-item.unread.critical { border-left-color: var(--accent-red); }
.alert-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 14px;
}
.alert-icon.warning { background: rgba(255,179,0,.12); color: var(--accent-amber); }
.alert-icon.critical { background: rgba(255,61,90,.12); color: var(--accent-red); }
.alert-icon.info    { background: rgba(0,212,255,.12);  color: var(--accent-cyan); }
.alert-icon.success { background: rgba(0,255,157,.12);  color: var(--accent-green); }

/* Blacklist */
.blacklist-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,61,90,.1); border: 1px solid rgba(255,61,90,.2);
  color: var(--accent-red); padding: 2px 8px; border-radius: 20px;
  font-size: 10px; font-weight: 600;
}

/* Maintenance schedule */
.maintenance-timeline {
  position: relative; padding-left: 28px;
}
.maintenance-timeline::before {
  content: ''; position: absolute;
  left: 10px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.maintenance-event {
  position: relative; margin-bottom: 20px;
}
.maintenance-event::before {
  content: ''; position: absolute;
  left: -22px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent-cyan); border: 2px solid var(--bg-base);
}
.maintenance-event.done::before { background: var(--accent-green); }
.maintenance-event.overdue::before { background: var(--accent-red); }

/* Forecast */
.forecast-kpi {
  text-align: center; padding: 20px;
  background: var(--bg-panel); border-radius: var(--radius);
  border: 1px solid var(--border);
}
.forecast-kpi .fk-value {
  font-size: 28px; font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}
.forecast-kpi .fk-label {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .8px;
  margin-top: 4px;
}
.forecast-kpi .fk-delta {
  font-size: 12px; margin-top: 6px;
}
.fk-delta.up { color: var(--accent-green); }
.fk-delta.down { color: var(--accent-red); }

/* ── Font Awesome icon sizing in nav + stats ── */
.nav-icon i        { font-size: 14px; width: 16px; text-align: center; }
.stat-icon i       { font-size: 22px; }
.card-header i     { font-size: 14px; margin-right: 2px; }
.topbar-actions .btn-icon i { font-size: 16px; }
.brand-icon i      { font-size: 22px; }

/* ── AI Insights purple badge ── */
.badge-purple {
  background: rgba(155,89,255,.15);
  color: var(--accent-purple, #9b59ff);
  border: 1px solid rgba(155,89,255,.3);
}

/* ── Kiosk quick amount buttons ── */
.kiosk-amounts { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }

/* ── Shift active indicator ── */
.shift-active { animation: pulse-green 2s infinite; }
@keyframes pulse-green {
  0%,100% { box-shadow: 0 0 0 0 rgba(0,255,157,.4); }
  50%      { box-shadow: 0 0 0 6px rgba(0,255,157,0); }
}
