/* ═══════════════════════════════════════════════════
   Owner Operator AI — Dashboard PWA Styles
   Premium dark theme with glassmorphism
   ═══════════════════════════════════════════════════ */

/* ── Reset & Custom Properties ─────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base: #07070d;
  --bg-surface: #0d0d16;
  --bg-card: #111120;
  --bg-card-hover: #16162a;
  --bg-elevated: #1a1a2e;
  --bg-input: #0f0f1e;
  --border-primary: rgba(129, 140, 248, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-accent: rgba(129, 140, 248, 0.25);
  --text-primary: #f0f0f5;
  --text-secondary: #9ca3af;
  --text-tertiary: #6b7280;
  --text-accent: #818cf8;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --green: #10b981;
  --green-light: #34d399;
  --red: #ef4444;
  --red-light: #f87171;
  --amber: #f59e0b;
  --amber-light: #fbbf24;
  --pink: #ec4899;
  --purple: #a855f7;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.25);
  --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.35);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Layout Shell ──────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-primary);
}

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand-icon svg { width: 22px; height: 22px; color: white; }

.sidebar-brand-text {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.sidebar-brand-text .brand-ai {
  color: var(--accent-light);
  font-weight: 900;
}

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

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  padding: 0 12px;
  margin-bottom: 8px;
  font-weight: 600;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
}

.sidebar-link:hover {
  background: rgba(129, 140, 248, 0.06);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-light);
  font-weight: 600;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-link.active svg { opacity: 1; }

.sidebar-badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-light);
  letter-spacing: 0.02em;
}

.sidebar-badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green-light);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-primary);
}

.sidebar-download {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-download-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  font-weight: 600;
  padding: 0 4px;
}

.sidebar-download-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
}

.sidebar-download-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.sidebar-download-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99;
  backdrop-filter: blur(4px);
}

/* ── Main Content ──────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: rgba(7, 7, 13, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}

.topbar-hamburger svg { width: 24px; height: 24px; }

.topbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.topbar-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.topbar-btn svg { width: 18px; height: 18px; }

.topbar-btn .notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--bg-base);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  cursor: pointer;
  transition: all var(--transition);
}

.topbar-user:hover {
  border-color: var(--border-accent);
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: white;
}

.topbar-username {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-user-role {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

/* ── Page Content ──────────────────────────────── */
.page-content {
  flex: 1;
  padding: 32px;
  max-width: 1400px;
  width: 100%;
}

/* ── Dashboard Grid ────────────────────────────── */
.dash-welcome {
  margin-bottom: 32px;
}

.dash-welcome h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.dash-welcome p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.dash-welcome .greeting-accent {
  color: var(--accent-light);
}

/* ── Stat Cards Row ────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.08;
  pointer-events: none;
}

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

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.stat-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card-icon svg { width: 20px; height: 20px; }

.stat-card-icon.icon-revenue {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green-light);
}
.stat-card::nth-child(1)::after { background: var(--green); }

.stat-card-icon.icon-loads {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-light);
}

.stat-card-icon.icon-savings {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber-light);
}

.stat-card-icon.icon-fleet {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
}

.stat-card-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.stat-card-trend.up {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green-light);
}

.stat-card-trend.down {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red-light);
}

.stat-card-trend svg { width: 12px; height: 12px; }

.stat-card-value {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
  line-height: 1;
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ── Dashboard Main Grid ───────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-header-action {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-light);
  cursor: pointer;
  transition: opacity var(--transition);
}

.card-header-action:hover { opacity: 0.8; }

.card-body { padding: 20px 24px; }

/* ── Active Loads Table ────────────────────────── */
.loads-table {
  width: 100%;
  border-collapse: collapse;
}

.loads-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.loads-table td {
  padding: 14px 16px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.loads-table tbody tr {
  transition: background var(--transition);
}

.loads-table tbody tr:hover {
  background: rgba(129, 140, 248, 0.03);
}

.loads-table tbody tr:last-child td { border-bottom: none; }

.load-route {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.load-route-from {
  font-weight: 600;
  color: var(--text-primary);
}

.load-route-to {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.load-rate {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--green-light);
}

.load-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.load-status-active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green-light);
}

.load-status-pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--amber-light);
}

.load-status-transit {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-light);
}

.load-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.load-grade {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.grade-a { background: rgba(16, 185, 129, 0.15); color: var(--green-light); }
.grade-b { background: rgba(99, 102, 241, 0.15); color: var(--accent-light); }
.grade-c { background: rgba(245, 158, 11, 0.15); color: var(--amber-light); }

/* ── AI Copilot Panel ──────────────────────────── */
.ai-panel { margin-bottom: 24px; }

.ai-panel .card-body { padding: 0; }

.ai-chat-messages {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 280px;
  overflow-y: auto;
}

.ai-message {
  display: flex;
  gap: 12px;
}

.ai-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-avatar svg { width: 16px; height: 16px; color: white; }

.ai-bubble {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(129, 140, 248, 0.1);
  border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.ai-bubble strong { color: var(--text-primary); }
.ai-bubble .ai-highlight {
  color: var(--green-light);
  font-weight: 700;
  font-family: var(--font-mono);
}

.ai-input-row {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
}

.ai-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition);
}

.ai-input::placeholder { color: var(--text-tertiary); }
.ai-input:focus { border-color: var(--accent); }

.ai-send-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.ai-send-btn:hover {
  background: var(--accent-light);
  transform: scale(1.05);
}

.ai-send-btn svg { width: 18px; height: 18px; }

/* ── Right Column Panels ───────────────────────── */
.compliance-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.compliance-item:last-child { border-bottom: none; }

.compliance-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.compliance-icon svg { width: 18px; height: 18px; }

.compliance-icon.ok {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green-light);
}

.compliance-icon.warn {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber-light);
}

.compliance-icon.danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red-light);
}

.compliance-info {
  flex: 1;
}

.compliance-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.compliance-status {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.compliance-value {
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-align: right;
}

.compliance-value.ok { color: var(--green-light); }
.compliance-value.warn { color: var(--amber-light); }
.compliance-value.danger { color: var(--red-light); }

/* ── Vehicle Health Bar ────────────────────────── */
.health-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.health-bar-wrap:last-child { border-bottom: none; }

.health-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
}

.health-bar-label span:first-child { color: var(--text-primary); }
.health-bar-label span:last-child { font-family: var(--font-mono); }

.health-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.health-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease-out;
}

.health-bar-fill.green { background: linear-gradient(90deg, var(--green), var(--green-light)); }
.health-bar-fill.amber { background: linear-gradient(90deg, var(--amber), var(--amber-light)); }
.health-bar-fill.red { background: linear-gradient(90deg, var(--red), var(--red-light)); }

/* ── Download App Banner ───────────────────────── */
.download-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.08));
  border: 1px solid rgba(129, 140, 248, 0.2);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
}

.download-banner h4 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.download-banner p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.download-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid var(--border-accent);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
}

.download-btn:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.download-btn svg { width: 20px; height: 20px; }

/* ── Login Overlay ─────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-container {
  width: 100%;
  max-width: 440px;
  padding: 24px;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 40px;
}

.login-logo-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo-icon svg { width: 28px; height: 28px; color: white; }

.login-logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-logo-text .brand-ai {
  color: var(--accent-light);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-elevated);
}

.login-card h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 6px;
  text-align: center;
  letter-spacing: -0.02em;
}

.login-card .login-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
}

.login-field {
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.login-field input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition);
}

.login-field input::placeholder { color: var(--text-tertiary); }
.login-field input:focus { border-color: var(--accent); }

.login-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border: none;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 8px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-primary);
}

.login-alt {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.login-alt a {
  color: var(--accent-light);
  font-weight: 600;
}

.login-alt a:hover { text-decoration: underline; }

.login-app-links {
  margin-top: 28px;
  text-align: center;
}

.login-app-links p {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.login-app-links .download-btns {
  justify-content: center;
}

.login-app-links .download-btn {
  font-size: 0.78rem;
  padding: 8px 14px;
}

/* ── Empty state animation ─────────────────────── */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.2); }
  50% { box-shadow: 0 0 0 12px rgba(99, 102, 241, 0); }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: slide-up 0.5s ease-out both;
}

/* Stagger children */
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 1200px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .topbar-hamburger {
    display: flex;
  }

  .topbar {
    padding: 0 16px;
  }

  .page-content {
    padding: 20px 16px;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card { padding: 18px; }
  .stat-card-value { font-size: 1.4rem; }

  .loads-table th:nth-child(4),
  .loads-table td:nth-child(4) {
    display: none;
  }

  .download-btns {
    flex-direction: column;
  }

  .topbar-username,
  .topbar-user-role {
    display: none;
  }
}

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

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

/* ── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(129, 140, 248, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(129, 140, 248, 0.25); }
