/* ─────────────────────────────────────────────────────────────
   Tesla Tracker — app.css
   Theme: Dark automotive / HUD. Font: Syne + DM Mono
   ───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;700;800&family=DM+Mono:wght@300;400;500&display=swap');

/* ── TOKENS ─────────────────────────────────────────────────── */
:root {
  --bg:        #080c12;
  --bg-2:      #0e1421;
  --bg-3:      #141d2e;
  --border:    #1e2d42;
  --text:      #e2e8f0;
  --muted:     #64748b;
  --accent:    #e31937;
  --accent-2:  #ff4d63;
  --green:     #22c55e;
  --orange:    #f97316;
  --blue:      #3b82f6;
  --sidebar-w: 240px;
  --radius:    10px;
  --font:      'Syne', sans-serif;
  --mono:      'DM Mono', monospace;
}

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

html { font-size: 15px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

.mono { font-family: var(--mono); font-size: .88em; }

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── LAYOUT ─────────────────────────────────────────────────── */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.main-content {
  padding: 32px 40px;
  overflow-y: auto;
  max-width: 1400px;
}

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-top { padding: 24px 20px 16px; border-bottom: 1px solid var(--border); }

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1rem; font-weight: 800; color: var(--text);
  margin-bottom: 18px; letter-spacing: -.02em;
}
.brand-logo { width: 28px; height: 28px; flex-shrink: 0; }

.vehicle-selector { }
.selector-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: block; margin-bottom: 6px; }
.vehicle-select {
  width: 100%; background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text); padding: 7px 10px; border-radius: var(--radius);
  font-family: var(--mono); font-size: .82rem; cursor: pointer;
}

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

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--muted); font-size: .88rem; font-weight: 700;
  transition: all .15s;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item .icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item .icon svg { width: 18px; height: 18px; }

.sidebar-footer { padding: 16px 16px 24px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }

.connection-status {
  display: flex; align-items: center; gap: 6px;
  font-size: .8rem; color: var(--green);
}
.connection-status .icon svg { width: 15px; height: 15px; }

.user-bar {
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: .85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .72rem; color: var(--muted); text-transform: uppercase; }
.logout-btn { color: var(--muted); }
.logout-btn:hover { color: var(--accent); }
.logout-btn .icon svg { width: 16px; height: 16px; }

/* ── PAGE HEADER ────────────────────────────────────────────── */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 32px; flex-wrap: wrap; gap: 16px;
}
.page-title { font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em; }
.page-sub { color: var(--muted); font-size: .88rem; margin-top: 4px; font-family: var(--mono); }
.page-actions { display: flex; align-items: center; gap: 12px; }

/* ── STATUS BADGE ───────────────────────────────────────────── */
.status-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  font-family: var(--mono); font-size: .8rem; font-weight: 500;
  border: 1px solid var(--border);
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
}
.status-badge.online .status-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-badge.sleep  .status-dot { background: var(--orange); }
.status-badge.offline .status-dot { background: var(--muted); }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius);
  font-family: var(--font); font-weight: 700; font-size: .88rem;
  cursor: pointer; border: none; transition: all .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-accent  { background: var(--accent); color: #fff; }
.btn-ghost   { background: var(--bg-3); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger  { background: transparent; color: #f87171; border: 1px solid #f87171; }
.btn-sm  { padding: 6px 14px; font-size: .82rem; }
.btn-xs  { padding: 4px 10px; font-size: .78rem; }
.btn-lg  { padding: 12px 24px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── ALERTS ─────────────────────────────────────────────────── */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 24px; font-size: .88rem;
}
.alert .icon svg { width: 18px; height: 18px; }
.alert-error   { background: rgba(227,25,55,.12); border: 1px solid rgba(227,25,55,.3); color: #f87171; }
.alert-success { background: rgba(34,197,94,.1);  border: 1px solid rgba(34,197,94,.25); color: var(--green); }

/* ── KPI CARDS ──────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
.kpi-grid-sm .kpi-card { }

.kpi-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.kpi-card .icon { display: block; margin-bottom: 12px; }
.kpi-card .icon svg { width: 20px; height: 20px; color: var(--accent); }
.kpi-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-bottom: 4px; }
.kpi-label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.kpi-sub   { color: var(--muted); font-size: .8rem; margin-top: 6px; font-family: var(--mono); }

/* ── LIVE BANNER ────────────────────────────────────────────── */
.live-banner {
  display: flex; flex-wrap: wrap; gap: 0;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 28px;
  overflow: hidden; align-items: stretch;
}
.live-stat {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 24px; flex: 1; min-width: 150px;
  border-right: 1px solid var(--border);
  position: relative;
}
.live-stat:last-of-type { border-right: none; }
.live-stat .icon svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }
.ls-value { font-size: 1.25rem; font-weight: 800; font-family: var(--mono); }
.ls-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; margin-top: 2px; }
.battery-bar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: var(--border);
}
.battery-fill { height: 100%; background: var(--green); transition: width .5s; }
.live-stat-ts {
  padding: 8px 20px; font-size: .72rem; color: var(--muted);
  font-family: var(--mono); align-self: flex-end; width: 100%;
  border-top: 1px solid var(--border);
}

/* ── SECTION HEADERS ────────────────────────────────────────── */
.section-title { font-weight: 800; font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 14px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.section-link { font-size: .82rem; color: var(--muted); }
.section-link:hover { color: var(--accent); }

/* ── TRIP LIST ──────────────────────────────────────────────── */
.trip-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 24px; }
.trip-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 18px;
  cursor: pointer; transition: all .15s;
}
.trip-row:hover, .trip-row.active { border-color: var(--accent); background: var(--bg-3); }
.trip-icon .icon svg { width: 18px; height: 18px; color: var(--muted); }
.trip-date-col { text-align: center; min-width: 36px; }
.trip-day { font-size: 1.2rem; font-weight: 800; line-height: 1; }
.trip-mon { font-size: .72rem; color: var(--muted); text-transform: uppercase; }
.trip-main { flex: 1; min-width: 0; }
.trip-route { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 700; }
.trip-from, .trip-to { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.trip-arrow { color: var(--muted); flex-shrink: 0; }
.trip-meta { font-size: .78rem; color: var(--muted); margin-top: 3px; font-family: var(--mono); }
.trip-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.trip-km   { font-family: var(--mono); font-weight: 500; font-size: .9rem; }
.trip-kwh  { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.trip-eff  { font-family: var(--mono); font-size: .75rem; color: var(--muted); }

/* ── CHARGE LIST ────────────────────────────────────────────── */
.charge-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 24px; }
.charge-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 16px;
}
.charge-type-badge {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 800; background: var(--bg-3);
  color: var(--muted); flex-shrink: 0; gap: 1px;
}
.charge-type-badge .icon svg { width: 12px; height: 12px; }
.charge-type-badge.Supercharger { background: rgba(227,25,55,.15); color: var(--accent); }
.charge-type-badge.DC_fast { background: rgba(249,115,22,.15); color: var(--orange); }
.charge-type-badge.AC_public { background: rgba(59,130,246,.15); color: var(--blue); }
.charge-type-badge.AC_home { background: rgba(34,197,94,.1); color: var(--green); }
.charge-main { flex: 1; min-width: 0; }
.charge-loc { font-size: .88rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.charge-meta { font-size: .75rem; color: var(--muted); font-family: var(--mono); margin-top: 2px; }
.charge-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.charge-kwh  { font-family: var(--mono); font-weight: 500; color: var(--green); }
.charge-soc  { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.charge-cost { font-family: var(--mono); font-size: .75rem; color: var(--orange); }

/* ── LIVE PAGE ──────────────────────────────────────────────── */
.live-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; height: calc(100vh - 160px); }
.live-map-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.live-map { width: 100%; height: 100%; }
.live-panel { display: flex; flex-direction: column; gap: 16px; }
.live-kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.live-kpi {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px;
}
.lk-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.lk-value { font-size: 1.2rem; font-weight: 800; font-family: var(--mono); margin-top: 4px; }
.live-ts { font-size: .75rem; color: var(--muted); font-family: var(--mono); text-align: right; }
.refresh-indicator { display: flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--green); font-family: var(--mono); }
.refresh-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.charge-live-panel {
  background: rgba(34,197,94,.07); border: 1px solid rgba(34,197,94,.2);
  border-radius: 8px; padding: 14px;
}
.clp-title { font-size: .82rem; font-weight: 700; color: var(--green); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.clp-title .icon svg { width: 15px; height: 15px; }
.clp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.clp-item { display: flex; flex-direction: column; gap: 2px; }
.clp-item span { font-size: .7rem; color: var(--muted); }
.clp-item strong { font-family: var(--mono); font-size: .88rem; }

.car-marker { filter: drop-shadow(0 2px 8px rgba(0,0,0,.5)); }

/* ── TRIPS DETAIL ───────────────────────────────────────────── */
.trips-layout { display: flex; gap: 20px; }
.trips-list-col { flex: 0 0 420px; }
.trip-detail-col { flex: 1; }
.trips-layout.with-detail .trip-from, .trips-layout.with-detail .trip-to { max-width: 130px; }
.detail-header { margin-bottom: 16px; }
.detail-title { font-size: 1.1rem; font-weight: 800; }
.detail-date { font-size: .8rem; color: var(--muted); font-family: var(--mono); margin-top: 4px; }
.trip-detail-map { height: 380px; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 16px; overflow: hidden; }
.detail-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ds-item { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.ds-item span { font-size: .72rem; color: var(--muted); display: block; margin-bottom: 4px; text-transform: uppercase; }
.ds-item strong { font-family: var(--mono); font-size: .95rem; }

/* ── TABLE ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table thead { background: var(--bg-3); }
.data-table th { padding: 11px 14px; text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-3); }

/* Badges tabella */
.badge-type, .badge-role, .badge-status {
  display: inline-block; padding: 3px 8px; border-radius: 5px;
  font-size: .75rem; font-weight: 700; white-space: nowrap;
}
.badge-type.Supercharger { background: rgba(227,25,55,.15); color: var(--accent); }
.badge-type.DC_fast      { background: rgba(249,115,22,.15); color: var(--orange); }
.badge-type.AC_public    { background: rgba(59,130,246,.15); color: var(--blue); }
.badge-type.AC_home      { background: rgba(34,197,94,.1);  color: var(--green); }
.badge-role.admin   { background: rgba(227,25,55,.15); color: var(--accent); }
.badge-role.user    { background: var(--bg-3); color: var(--muted); }
.badge-status.active   { color: var(--green); }
.badge-status.inactive { color: var(--muted); }

.action-group { display: flex; gap: 6px; flex-wrap: wrap; }
.link-muted { color: var(--muted); font-size: .82rem; }
.link-muted:hover { color: var(--accent); }
.text-muted { color: var(--muted); font-size: .82rem; }

/* ── CHARTS ─────────────────────────────────────────────────── */
.chart-section { margin-bottom: 28px; }
.chart-section.half { flex: 1; }
.charts-row { display: flex; gap: 20px; flex-wrap: wrap; }
.chart-title { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 14px; }
.chart-wrap { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.chart-doughnut { display: flex; align-items: center; justify-content: center; }

/* ── FILTER BAR ─────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.input-sm {
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text); padding: 7px 10px; border-radius: 7px;
  font-family: var(--mono); font-size: .82rem;
}
.input-sm:focus { outline: none; border-color: var(--accent); }
.input-lg {
  width: 100%; background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text); padding: 10px 12px; border-radius: var(--radius);
  font-family: var(--font); font-size: .9rem;
}
.input-lg:focus { outline: none; border-color: var(--accent); }

/* ── PAGINATION ─────────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.pag-item {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 7px;
  background: var(--bg-2); border: 1px solid var(--border);
  font-size: .85rem; color: var(--muted); font-family: var(--mono);
}
.pag-item:hover { border-color: var(--accent); color: var(--accent); }
.pag-item.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── MODAL ──────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px); padding: 28px;
  width: 100%; max-width: 440px;
}
.modal-box h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ── EMPTY STATE ────────────────────────────────────────────── */
.empty-state {
  text-align: center; color: var(--muted); padding: 60px 20px;
  font-size: .9rem; border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ── CONNECT CTA ────────────────────────────────────────────── */
.connect-cta {
  text-align: center; padding: 80px 20px;
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.cta-icon .icon { display: flex; justify-content: center; margin-bottom: 20px; }
.cta-icon .icon svg { width: 40px; height: 40px; color: var(--accent); }
.connect-cta h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 10px; }
.connect-cta p { color: var(--muted); margin-bottom: 24px; }

/* ── LOGIN PAGE ─────────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  background-image: radial-gradient(ellipse at 20% 50%, rgba(227,25,55,.06) 0%, transparent 60%),
                    radial-gradient(ellipse at 80% 20%, rgba(59,130,246,.04) 0%, transparent 50%);
}
.login-wrap { width: 100%; max-width: 380px; padding: 20px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.brand-icon { width: 36px; height: 36px; }
.brand-name { font-size: 1.2rem; font-weight: 800; }
.login-form { background: var(--bg-2); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); padding: 32px; }
.login-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 24px; }

/* ── ICON HELPER ────────────────────────────────────────────── */
.icon { display: inline-flex; align-items: center; justify-content: center; }
.icon svg { display: block; }

/* ── MOBILE HEADER ──────────────────────────────────────────── */
.mobile-header { display: none; }
.sidebar-overlay { display: none; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .main-content { padding: 16px; padding-top: 72px; }
  .live-layout { grid-template-columns: 1fr; height: auto; }
  .live-map { height: 320px; }
  .trips-layout { flex-direction: column; }
  .trips-list-col { flex: none; }
  .charts-row { flex-direction: column; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .live-banner { flex-direction: column; }
  .live-stat { border-right: none; border-bottom: 1px solid var(--border); }

  /* Sidebar mobile — nascosta di default, slide-in quando .open */
  .sidebar {
    display: flex;
    position: fixed;
    top: 0; left: 0;
    width: 270px;
    height: 100vh;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  /* Overlay scuro dietro la sidebar */
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 998;
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
  }
  .sidebar-overlay.open {
    opacity: 1;
    pointer-events: all;
  }

  /* Mobile top bar */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
  }
  .mobile-brand {
    display: flex; align-items: center; gap: 8px;
    font-weight: 800; font-size: .95rem; color: var(--text);
    text-decoration: none;
  }

  /* Hamburger button */
  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px; height: 36px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
  }
  .hamburger span {
    display: block;
    width: 22px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all .2s;
  }

  /* Blocca scroll body quando sidebar è aperta */
  body.sidebar-open { overflow: hidden; }

  /* Page header più compatto */
  .page-header { margin-bottom: 20px; }
  .page-title { font-size: 1.4rem; }

  /* Tabelle scorrevoli */
  .table-wrap { border-radius: 8px; }
  .data-table { font-size: .8rem; }
  .data-table th, .data-table td { padding: 9px 10px; }

  /* Trip list più compatto */
  .trip-from, .trip-to { max-width: 110px; }
  .detail-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .trip-detail-map { height: 260px; }
}

@media (min-width: 901px) {
  .mobile-header { display: none !important; }
  .sidebar-overlay { display: none !important; }
  .hamburger { display: none; }
}
