/* ---- Variables ---- */
:root {
  --hertz-yellow: #FFD100;
  --hertz-dark:   #1A1A1A;
  --navy:         #1A3A5C;
  --navy-light:   #2A5A8C;
  --bg:           #F4F6F9;
  --card:         #FFFFFF;
  --border:       #D8DDE6;
  --text:         #1A1A1A;
  --text-muted:   #5E6A7A;
  --success:      #0D7440;
  --radius:       8px;
  --shadow:       0 2px 8px rgba(0,0,0,0.08);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

/* ---- Header ---- */
.header {
  background: var(--hertz-dark);
  color: #fff;
  padding: 12px 32px;
  display: flex;
  align-items: center;
  gap: 0;
  box-shadow: 0 3px 8px rgba(0,0,0,0.35);
  border-bottom: 3px solid var(--hertz-yellow);
}
.header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.header-logo-img {
  height: 32px;
  width: auto;
  display: block;
}
.header-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.2);
  margin: 0 24px;
  flex-shrink: 0;
}
.header h1 { font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.header-sub { font-size: 12px; color: #AAA; margin-top: 3px; }

/* ---- Layout ---- */
.main-layout { display: flex; min-height: calc(100vh - 60px); }

.sidebar {
  width: 280px;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
  flex-shrink: 0;
}

.content {
  flex: 1;
  padding: 24px 28px;
  overflow-x: hidden;
}

/* ---- Form ---- */
.form-section { margin-bottom: 22px; }
.form-section h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); margin-bottom: 10px; }

label { display: block; font-size: 13px; margin-bottom: 4px; color: var(--text-muted); }
input[type="date"] {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px; background: var(--bg);
}
input[type="date"]:focus { outline: none; border-color: var(--navy-light); }

/* ---- Hour range picker ---- */
.hour-range {
  display: flex; align-items: flex-end; gap: 8px;
}
.hour-range > div { flex: 1; }
.hour-range select {
  width: 100%; padding: 7px 8px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px; background: var(--bg); cursor: pointer;
}
.hour-range select:focus { outline: none; border-color: var(--navy-light); }
.hour-sep { font-size: 16px; color: var(--text-muted); padding-bottom: 6px; flex-shrink: 0; }
.window-hint {
  margin-top: 7px; font-size: 11px; color: var(--text-muted);
  background: var(--bg); border-radius: 4px; padding: 5px 8px;
  border-left: 3px solid var(--hertz-yellow);
}

/* ---- Checkboxes ---- */
.airport-list { display: flex; flex-direction: column; gap: 6px; }
.airport-item { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.airport-item input[type="checkbox"] { accent-color: var(--navy); width: 14px; height: 14px; cursor: pointer; }
.iata-badge {
  font-size: 10px; font-weight: 700; background: var(--navy); color: #fff;
  padding: 1px 5px; border-radius: 3px; letter-spacing: .5px;
}
.select-links { display: flex; gap: 8px; margin-bottom: 8px; }
.select-links a { font-size: 12px; color: var(--navy-light); cursor: pointer; text-decoration: underline; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; transition: filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn-primary   { background: var(--hertz-yellow); color: var(--hertz-dark); width: 100%; justify-content: center; font-weight: 700; }
.btn-excel     { background: #0D7440;        color: #fff; }
.btn-print     { background: var(--hertz-yellow); color: var(--hertz-dark); }
.btn-secondary { background: var(--border);  color: var(--text); }

.action-bar { display: flex; gap: 10px; margin-bottom: 20px; align-items: center; flex-wrap: wrap; }

/* ---- Summary cards ---- */
.summary-cards { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow);
}
.card-kpi { min-width: 140px; text-align: center; }
.card-kpi .kpi-value { font-size: 32px; font-weight: 700; color: var(--navy); line-height: 1; }
.card-kpi .kpi-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }
.card-list { min-width: 180px; }
.card-list h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin-bottom: 8px; }
.card-list .list-item { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 3px 0; border-bottom: 1px solid var(--bg); }
.badge-count { font-weight: 700; color: var(--navy); }

/* ---- Night tabs ---- */
.night-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn {
  padding: 8px 16px; font-size: 13px; font-weight: 500; border: none;
  background: none; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--hertz-yellow); font-weight: 700; }
.tab-badge { background: var(--navy); color: #fff; font-size: 10px; border-radius: 10px; padding: 1px 6px; margin-left: 5px; }

/* ---- Night panel ---- */
.night-panel { display: none; }
.night-panel.active { display: block; }

/* ---- Airport section ---- */
.airport-section { margin-bottom: 22px; }
.airport-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--navy); color: #fff;
  border-radius: var(--radius) var(--radius) 0 0; cursor: pointer;
}
.airport-header .iata-big { font-size: 18px; font-weight: 800; letter-spacing: 1px; }
.airport-header .apt-name { font-size: 13px; color: #A8C0D8; }
.airport-header .apt-count { margin-left: auto; font-size: 12px; background: var(--hertz-yellow); color: var(--hertz-dark); padding: 2px 10px; border-radius: 12px; font-weight: 700; }
.airport-collapse { background: var(--card); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); padding: 0; overflow: hidden; }
.airport-collapse.collapsed { display: none; }

/* ---- Alert banner ---- */
.alert-banner {
  background: #FFF8E6; border-left: 4px solid #F5A623;
  padding: 10px 16px; font-size: 13px; color: #7A5000; font-weight: 500;
}

/* ---- Airport KPI row ---- */
.apt-kpi-row {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
}
.apt-kpi {
  flex: 1; padding: 14px 18px; border-right: 1px solid var(--border);
}
.apt-kpi:last-child { border-right: none; }
.apt-kpi-main { background: var(--hertz-yellow); }
.apt-kpi-main .apt-kpi-val,
.apt-kpi-main .apt-kpi-lbl,
.apt-kpi-main .apt-kpi-sub { color: var(--hertz-dark) !important; }
.apt-kpi-val  { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.apt-kpi-lbl  { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-top: 2px; }
.apt-kpi-sub  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.apt-kpi-good .apt-kpi-val { color: var(--success); }
.apt-kpi-warn .apt-kpi-val { color: #D4810A; }
.apt-kpi-alert { background: #FFF0F0; }
.apt-kpi-alert .apt-kpi-val { color: #C00; }

/* ---- Dashboard grid ---- */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.dash-card {
  padding: 16px 18px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.dash-card:nth-child(2n) { border-right: none; }
.dash-card:nth-child(3),
.dash-card:nth-child(4)  { border-bottom: none; }
.dash-card-title { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.dash-card-note  { font-weight: 400; color: var(--text-muted); font-size: 11px; float: right; }

/* ---- Horizontal bar chart ---- */
.chart-wrap-h { height: 220px; position: relative; }
.chart-wrap-v { height: 180px; position: relative; }
.chart-legend  { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); margin-top: 8px; flex-wrap: wrap; }
.leg-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* ---- Airline table ---- */
.airline-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.airline-table th { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); padding: 4px 6px; text-align: left; border-bottom: 1px solid var(--border); }
.airline-table td { padding: 5px 6px; border-bottom: 1px solid #F5F7FA; vertical-align: middle; }
.airline-table tr:last-child td { border-bottom: none; }
.bar-cell { display: inline-flex; width: 60px; height: 8px; background: #EEE; border-radius: 4px; overflow: hidden; margin-right: 6px; vertical-align: middle; }
.bar-total { background: var(--hertz-yellow); height: 100%; border-radius: 4px; transition: width .3s; }
.intl-dot  { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #4A90D9; margin-right: 4px; vertical-align: middle; }

/* ---- Origins list ---- */
.origins-list { display: flex; flex-direction: column; gap: 5px; max-height: 220px; overflow-y: auto; }
.origin-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.origin-name { flex: 1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.origin-bars { display: flex; gap: 2px; align-items: center; flex-shrink: 0; }
.origin-bar  { width: 14px; height: 6px; background: var(--hertz-yellow); border-radius: 2px; }
.origin-count { font-weight: 700; color: var(--navy); width: 24px; text-align: right; flex-shrink: 0; }

/* ---- Flights toggle ---- */
.flights-toggle {
  padding: 10px 16px; font-size: 12px; cursor: pointer; color: var(--navy-light);
  font-weight: 600; user-select: none; display: flex; align-items: center; gap: 6px;
  border-top: 1px solid var(--border);
}
.flights-toggle:hover { background: var(--bg); }
.toggle-icon { font-size: 10px; }
.flights-detail { overflow: hidden; }
.flights-detail.collapsed { display: none; }

/* ---- Flight table ---- */
.flight-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.flight-table th { background: #EEF2F7; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.flight-table td { padding: 7px 12px; border-bottom: 1px solid var(--bg); }
.flight-table tr:hover td { background: #F7F9FC; }
.flight-table tr:last-child td { border-bottom: none; }
.tag-dom  { background: #E6F4FF; color: #1060A0; padding: 2px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.tag-intl { background: #FFF3E0; color: #B06000; padding: 2px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.tag-late { background: #FFF0F0; color: #C00; padding: 2px 7px; border-radius: 10px; font-size: 11px; }
.no-data  { padding: 16px; color: var(--text-muted); text-align: center; font-style: italic; }

/* ---- Loader ---- */
.loader-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35);
  align-items: center; justify-content: center; z-index: 100; flex-direction: column; gap: 16px;
}
.loader-overlay.visible { display: flex; }
.spinner {
  width: 48px; height: 48px; border: 5px solid #fff3; border-top-color: var(--hertz-yellow);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { color: #fff; font-size: 15px; font-weight: 600; }

/* ---- Empty state ---- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .es-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h2 { font-size: 18px; color: var(--text); margin-bottom: 6px; }

/* ---- Print ---- */
@media print {
  .sidebar, .action-bar, .night-tabs, .header-divider { display: none !important; }
  .main-layout { display: block; }
  .content { padding: 0; }
  .card { break-inside: avoid; }
  .airport-section { break-inside: avoid; }
  .airport-collapse.collapsed { display: block !important; }
  body { font-size: 12px; }
  .flight-table th, .flight-table td { padding: 4px 8px; }
}
