/* ============================================================
   SaaS Transporte Escolar v1.5 — Design System
   Paleta: Indigo/Violet moderno + dark mode completo
   ============================================================ */

/* ── Variáveis de Tema ─────────────────────────────────────── */
:root {
  --primary:        #4f46e5;
  --primary-hover:  #4338ca;
  --primary-light:  #eef2ff;
  --secondary:      #6b7280;
  --success:        #10b981;
  --danger:         #ef4444;
  --warning:        #f59e0b;
  --info:           #3b82f6;

  --bg:             #f8fafc;
  --bg-card:        #ffffff;
  --bg-sidebar:     #1e1b4b;
  --sidebar-text:   #c7d2fe;
  --sidebar-active: #4f46e5;
  --sidebar-active-bg: rgba(99, 102, 241, 0.2);

  --text:           #1e293b;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;
  --border:         #e2e8f0;
  --border-light:   #f1f5f9;

  --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
  --shadow-md:      0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.12);

  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      16px;
  --radius-xl:      24px;

  --sidebar-w:      256px;
  --topbar-h:       64px;
  --transition:     all .2s ease;
}

[data-theme="dark"] {
  --bg:             #0f172a;
  --bg-card:        #1e293b;
  --bg-sidebar:     #0f172a;
  --sidebar-text:   #94a3b8;
  --text:           #e2e8f0;
  --text-muted:     #94a3b8;
  --border:         #334155;
  --border-light:   #1e293b;
  --primary-light:  #1e1b4b;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.3);
  --shadow-md:      0 4px 16px rgba(0,0,0,.4);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  transition: background .3s, color .3s;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

ul { list-style: none; }

/* ── Layout Principal ─────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .3s;
}

.content-area {
  flex: 1;
  padding: 2rem;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform .3s;
  scrollbar-width: thin;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: .625rem;
  color: #fff;
  font-weight: 700;
  font-size: .875rem;
  letter-spacing: -.01em;
}

.sidebar-logo svg { color: #818cf8; flex-shrink: 0; }

.sidebar-close { display: none; color: var(--sidebar-text); background: none; border: none; font-size: 1.5rem; cursor: pointer; }

.sidebar-nav { flex: 1; padding: 1rem 0; }

.nav-section { margin-bottom: .5rem; }

.nav-label {
  display: block;
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(199, 210, 254, .4);
  padding: .625rem 1rem .25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem 1rem;
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  margin: 0 .5rem;
  font-size: .8125rem;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
  text-decoration: none;
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: #a5b4fc;
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.06);
}

.app-version { font-size: .7rem; color: rgba(199,210,254,.3); }

/* Overlay mobile */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
}

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: .5rem;
  border-radius: var(--radius-sm);
  display: none;
}

.page-title {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .4rem .6rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }

[data-theme="light"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="dark"]  .icon-sun  { display: block; }
[data-theme="dark"]  .icon-moon { display: none; }

.user-menu {
  display: flex;
  align-items: center;
  gap: .625rem;
}

.user-name { font-size: .8125rem; font-weight: 500; }

.role-badge {
  font-size: .65rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.role-admin   { background: #ede9fe; color: #6d28d9; }
.role-driver  { background: #dcfce7; color: #15803d; }
.role-student { background: #dbeafe; color: #1d4ed8; }

.btn-logout {
  color: var(--text-muted);
  padding: .4rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.btn-logout:hover { color: var(--danger); text-decoration: none; }

/* ── Section Header ─────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.section-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
}
.section-count {
  font-size: .8125rem;
  color: var(--text-muted);
  margin-top: .125rem;
  display: block;
}
.section-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

/* ── Filter Row ─────────────────────────────────────────────── */
.filter-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.card-title { font-size: .9375rem; font-weight: 600; }

.card-body { padding: 1.5rem; }

/* ── Metrics Grid ──────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, auto-fill), minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.metric-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.metric-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-primary .metric-icon { background: #eef2ff; color: var(--primary); }
.metric-success .metric-icon { background: #d1fae5; color: var(--success); }
.metric-danger  .metric-icon { background: #fee2e2; color: var(--danger);  }
.metric-warning .metric-icon { background: #fef3c7; color: var(--warning); }
.metric-info    .metric-icon { background: #dbeafe; color: var(--info);    }
.metric-secondary .metric-icon { background: var(--border-light); color: var(--secondary); }

.metric-data { display: flex; flex-direction: column; }
.metric-value { font-size: 1.625rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.metric-label { font-size: .75rem; color: var(--text-muted); font-weight: 500; margin-top: .125rem; }

/* ── Dashboard Row ─────────────────────────────────────────── */
.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  align-items: start;
}

/* ── Quick Actions ─────────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1rem .75rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius);
  font-size: .8125rem;
  font-weight: 600;
  text-align: center;
  transition: var(--transition);
  text-decoration: none;
}

.quick-action-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, .3);
  text-decoration: none;
}

/* ── Financial Summary ─────────────────────────────────────── */
.financial-summary { display: flex; flex-direction: column; gap: .75rem; }

.fin-item { display: flex; justify-content: space-between; align-items: center; }
.fin-label { font-size: .8125rem; color: var(--text-muted); }
.fin-value { font-size: .9375rem; font-weight: 700; }

.fin-divider { border-top: 1px solid var(--border); margin: .25rem 0; }

.progress-label { display: flex; justify-content: space-between; font-size: .8125rem; font-weight: 600; }
.progress-bar-wrap { background: var(--border); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 999px; transition: width .6s ease; }
.bg-success { background: var(--success); }
.bg-warning { background: var(--warning); }
.bg-danger  { background: var(--danger); }

.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-muted   { color: var(--text-muted); }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: flex; justify-content: space-between; align-items: center; font-size: .8125rem; font-weight: 500; margin-bottom: .375rem; }
.form-control {
  width: 100%;
  padding: .625rem .875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: .875rem;
  font-family: inherit;
  transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }

.input-icon-wrap { position: relative; }
.input-icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.input-icon-wrap .form-control { padding-left: 2.5rem; }

.toggle-pwd {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}

.btn:hover { text-decoration: none; }

.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.3); }

.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }

.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-warning   { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; color: #fff; }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-sm { padding: .375rem .75rem; font-size: .75rem; }
.btn-lg { padding: .875rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-login { width: 100%; justify-content: center; padding: .875rem; font-size: .9375rem; border-radius: var(--radius); }

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  padding: .875rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  margin: 0 2rem 1rem;
}

.alert-dismissible { justify-content: space-between; }
.alert-dismissible button { background: none; border: none; cursor: pointer; font-size: 1.25rem; color: inherit; opacity: .6; line-height: 1; margin-left: auto; }

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8125rem;
}

th {
  text-align: left;
  padding: .625rem 1rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

tr:hover td { background: var(--border-light); }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-success   { background: #d1fae5; color: #065f46; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-warning   { background: #fef3c7; color: #78350f; }
.badge-info      { background: #dbeafe; color: #1e40af; }
.badge-primary   { background: #eef2ff; color: #4338ca; }
.badge-secondary { background: var(--border-light); color: var(--text-muted); }

/* ── Pagination ────────────────────────────────────────────── */
.pagination { margin-top: 1.5rem; }
.pagination ul { display: flex; gap: .25rem; justify-content: center; }
.pagination li a {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .8125rem;
  color: var(--text);
  transition: var(--transition);
  text-decoration: none;
}
.pagination li.active a { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination li a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* ── Login Page ────────────────────────────────────────────── */
.login-body { background: var(--bg); min-height: 100vh; display: flex; align-items: center; justify-content: center; }

.login-container {
  display: grid;
  grid-template-columns: 460px 420px;
  min-height: 100vh;
  width: 100%;
  max-width: 880px;
  margin: auto;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.login-card {
  background: var(--bg-card);
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.login-brand { text-align: center; }
.login-logo {
  width: 72px; height: 72px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}

.login-app-name { font-size: 1.375rem; font-weight: 800; letter-spacing: -.02em; }
.login-tagline  { color: var(--text-muted); font-size: .875rem; }

.login-form { display: flex; flex-direction: column; gap: .125rem; }
.forgot-link { font-size: .75rem; color: var(--primary); font-weight: 400; }

.login-footer { text-align: center; font-size: .75rem; color: var(--text-muted); }
.privacy-link { margin-top: .5rem; }

.login-visual {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
}

.visual-content { color: #fff; }
.visual-content h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 1.5rem; letter-spacing: -.02em; }
.feature-list { display: flex; flex-direction: column; gap: .75rem; }
.feature-list li { font-size: .9375rem; opacity: .9; }

/* ── Driver Interface ──────────────────────────────────────── */
.driver-body { background: #0f172a; color: #e2e8f0; min-height: 100dvh; }

.driver-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  position: sticky; top: 0; z-index: 100;
}

.driver-header-info { display: flex; align-items: center; gap: .75rem; }
.driver-name { display: block; font-weight: 700; font-size: .9375rem; }
.route-badge { font-size: .7rem; background: #4f46e5; color: #fff; padding: .15rem .5rem; border-radius: 999px; display: block; margin-top: .125rem; }
.driver-logout { color: #94a3b8; font-size: .8125rem; }

.driver-route-select { padding: 1.5rem 1rem; max-width: 480px; margin: 0 auto; }
.driver-route-select h2 { font-size: 1.125rem; font-weight: 700; margin-bottom: 1rem; color: #e2e8f0; }
.route-list { display: flex; flex-direction: column; gap: .5rem; }
.route-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius);
  color: #e2e8f0;
  text-decoration: none;
  transition: var(--transition);
}
.route-option:hover { border-color: var(--primary); background: #1e1b4b; text-decoration: none; }
.route-option-name { font-weight: 600; }
.route-option-shift { font-size: .75rem; color: #94a3b8; margin-top: .125rem; }
.route-option-info { display: flex; flex-direction: column; }

.driver-scanner-wrapper { padding: 1rem; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }

/* QR Section */
.qr-section { background: #1e293b; border-radius: var(--radius-lg); padding: 1.25rem; }
.qr-reader-box { width: 100%; border-radius: var(--radius); overflow: hidden; background: #000; min-height: 280px; }
.qr-hint { text-align: center; font-size: .8125rem; color: #94a3b8; margin: .75rem 0 1rem; }
.qr-manual { display: flex; flex-direction: column; gap: .5rem; }
.manual-label { font-size: .75rem; color: #94a3b8; }
.manual-input-row { display: flex; gap: .5rem; }
.manual-input-row .form-control { background: #0f172a; border-color: #334155; color: #e2e8f0; }

/* Student Card */
.student-result { display: flex; flex-direction: column; gap: 1rem; }
.student-result.hidden { display: none; }

.student-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 2px solid;
}
.card-ok     { background: #052e16; border-color: #10b981; }
.card-defaulter { background: #450a0a; border-color: #ef4444; }

.student-photo-placeholder {
  width: 56px; height: 56px;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.student-card-name   { font-size: 1.125rem; font-weight: 700; color: #f1f5f9; }
.status-ok       { color: #10b981; font-size: .8125rem; font-weight: 600; display: block; }
.status-defaulter { color: #ef4444; font-size: .8125rem; font-weight: 700; display: block; }

/* PIN Section */
.pin-section { background: #1e293b; border-radius: var(--radius-lg); padding: 1.25rem; text-align: center; }
.pin-label { font-size: .875rem; font-weight: 600; margin-bottom: 1rem; }

.pin-display { display: flex; justify-content: center; gap: 1rem; margin-bottom: 1.5rem; }
.pin-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid #475569;
  background: transparent;
  transition: var(--transition);
}
.pin-dot.filled { background: var(--primary); border-color: var(--primary); }

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .625rem;
  max-width: 240px;
  margin: 0 auto 1rem;
}

.pin-key {
  aspect-ratio: 1;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.pin-key:hover:not(:disabled) { background: var(--primary); border-color: var(--primary); color: #fff; }
.pin-key-empty { visibility: hidden; }

.driver-direction {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: .8125rem;
  font-weight: 600;
  color: #94a3b8;
}
.driver-direction label { display: flex; align-items: center; gap: .375rem; cursor: pointer; }
.driver-direction input:checked + * { color: #a5b4fc; }

/* Feedback Overlay */
.feedback-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
}
.feedback-overlay.hidden { display: none; }

.feedback-card {
  background: #1e293b;
  border-radius: var(--radius-xl);
  padding: 2rem 2.5rem;
  text-align: center;
  border: 2px solid;
  min-width: 260px;
  animation: feedbackIn .2s ease;
}

@keyframes feedbackIn { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.feedback-success { border-color: var(--success); }
.feedback-warning { border-color: var(--warning); }
.feedback-error   { border-color: var(--danger);  }

.feedback-icon    { font-size: 3rem; margin-bottom: .75rem; }
.feedback-message { font-size: 1rem; font-weight: 600; color: #e2e8f0; line-height: 1.4; }

/* Driver History */
.driver-history { background: #1e293b; border-radius: var(--radius-lg); padding: 1rem 1.25rem; }
.driver-history h4 { font-size: .875rem; font-weight: 600; color: #94a3b8; margin-bottom: .75rem; }

.history-list { display: flex; flex-direction: column; gap: .375rem; max-height: 200px; overflow-y: auto; }
.history-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .8125rem;
}
.history-item.boarding  { background: rgba(16, 185, 129, .1); }
.history-item.alighting { background: rgba(59, 130, 246, .1); }
.history-name { flex: 1; font-weight: 500; }
.history-time { color: #64748b; font-size: .75rem; }
.history-dir  { font-size: 1rem; }

/* Empty state */
.empty-state { color: var(--text-muted); text-align: center; padding: 2rem; }
td.empty-state { display: table-cell; }
div.empty-state, .card-body.empty-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 1rem; padding: 3rem;
}

/* Table row actions */
.row-actions { display: flex; gap: .25rem; }

/* Font helpers */
.font-medium { font-weight: 600; color: var(--primary); }

/* File drop zone (label nativa — sem JavaScript) */
.file-drop-zone {
  display: block;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.file-drop-zone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Code inline */
code {
  font-family: 'Courier New', Courier, monospace;
  font-size: .8125rem;
  background: rgba(99,102,241,.1);
  color: #4338ca;
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 4px;
  padding: .15rem .45rem;
  white-space: nowrap;
}
[data-theme="dark"] code {
  background: rgba(99,102,241,.2);
  color: #a5b4fc;
  border-color: rgba(99,102,241,.35);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .dashboard-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .sidebar-close { display: block; }
  .sidebar-toggle { display: flex; }
  .main-content { margin-left: 0; }
  .topbar { padding: 0 1rem; }
  .content-area { padding: 1rem; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }

  .login-container { grid-template-columns: 1fr; max-width: 480px; }
  .login-visual { display: none; }
}

@media (max-width: 480px) {
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}
