/* ============================================================
   PILOT DASHBOARD – dashboard.css
   Dark aerospace theme with light-mode support
   ============================================================ */

/* ─── CSS Custom Properties ─────────────────────────────── */
:root {
  /* Dark theme (default) */
  --bg-root:          #080912;
  --bg-header:        #0d0d1a;
  --bg-tile:          #0f1629;
  --bg-tile-alt:      #111828;
  --bg-input:         rgba(255,255,255,0.06);
  --bg-input-focus:   rgba(74,158,255,0.1);
  --bg-modal:         #0d0d1a;
  --bg-overlay:       rgba(0,0,0,0.75);
  --bg-badge-active:  rgba(0,214,143,0.15);
  --bg-badge-upcoming:rgba(74,158,255,0.12);

  --border:           rgba(74,158,255,0.18);
  --border-strong:    rgba(74,158,255,0.38);
  --border-input:     rgba(255,255,255,0.12);
  --border-focus:     #4a9eff;

  --accent:           #4a9eff;
  --accent-dim:       rgba(74,158,255,0.5);
  --accent-green:     #00d68f;
  --accent-orange:    #f5a623;
  --accent-red:       #ff4b4b;
  --accent-purple:    #a78bfa;

  --text-primary:     #c8d4e8;
  --text-secondary:   #5a6a88;
  --text-header:      #e4eaf8;
  --text-accent:      #4a9eff;
  --text-muted:       #3d4d68;

  --shadow-tile:      0 4px 32px rgba(0,0,0,0.5);
  --shadow-glow:      0 0 24px rgba(74,158,255,0.12);
  --shadow-modal:     0 8px 64px rgba(0,0,0,0.8);

  --radius:           6px;
  --radius-lg:        10px;
  --transition:       0.3s cubic-bezier(0.4,0,0.2,1);

  --header-h:         52px;
  --tile-gap:         3px;

  --font-base:        14px;
  --font-metar:       11px;
}

/* Light theme overrides */
[data-theme="light"] {
  --bg-root:          #e8eef8;
  --bg-header:        #1a2840;
  --bg-tile:          #ffffff;
  --bg-tile-alt:      #f4f7fc;
  --bg-input:         rgba(0,0,0,0.05);
  --bg-input-focus:   rgba(26,110,245,0.06);
  --bg-modal:         #ffffff;
  --bg-overlay:       rgba(0,0,0,0.5);
  --bg-badge-active:  rgba(0,168,112,0.12);
  --bg-badge-upcoming:rgba(26,110,245,0.1);

  --border:           rgba(0,0,0,0.1);
  --border-strong:    rgba(26,110,245,0.3);
  --border-input:     rgba(0,0,0,0.15);
  --border-focus:     #1a6ef5;

  --accent:           #1a6ef5;
  --accent-dim:       rgba(26,110,245,0.5);
  --accent-green:     #00a870;
  --accent-orange:    #e08700;
  --accent-red:       #d93025;

  --text-primary:     #1a2840;
  --text-secondary:   #6b7a90;
  --text-header:      #e4eaf8;
  --text-accent:      #1a6ef5;
  --text-muted:       #9ba8bc;

  --shadow-tile:      0 2px 16px rgba(0,0,0,0.08);
  --shadow-glow:      0 0 20px rgba(26,110,245,0.08);
  --shadow-modal:     0 8px 40px rgba(0,0,0,0.25);
}

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

html {
  font-size: var(--font-base);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg-root);
  color: var(--text-primary);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background var(--transition), color var(--transition);
}

/* ─── Typography ────────────────────────────────────────── */
.mono {
  font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
  letter-spacing: 0.04em;
}

/* ─── Header ────────────────────────────────────────────── */
#header {
  height: var(--header-h);
  min-height: var(--header-h);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 8px;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  position: relative;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-header);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.logo-icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.dashboard-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--text-header);
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: flex-end;
}

.header-weather {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px 0 4px;
  border-right: 1px solid var(--border);
  margin-right: 4px;
}

.header-weather-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.header-weather-location {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.header-weather-val {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-header);
  white-space: nowrap;
}

.header-weather-sep {
  width: 1px;
  height: 10px;
  background: var(--border);
  flex-shrink: 0;
}

.time-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  border-right: 1px solid var(--border);
}

.time-block:first-child {
  padding-left: 4px;
}

.time-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  line-height: 1;
  margin-bottom: 2px;
}

.time-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-header);
  line-height: 1;
  white-space: nowrap;
}

.time-separator {
  display: none;
}

/* Status dot */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 4px;
}

.status-dot.online  { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.status-dot.offline { background: var(--accent-red);   box-shadow: 0 0 6px var(--accent-red); }

/* Buttons */
.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  border-radius: var(--radius);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  background: var(--bg-input-focus);
  border-color: var(--border-focus);
  color: var(--accent);
}

.icon-btn:active {
  transform: scale(0.94);
}

/* ─── Dashboard Grid ─────────────────────────────────────── */
#dashboard {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--tile-gap);
  padding: var(--tile-gap);
  overflow: hidden;
  background: var(--bg-root);
}

/* ─── Tiles ──────────────────────────────────────────────── */
.tile {
  background: var(--bg-tile);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-tile);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.tile:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-tile), var(--shadow-glow);
}

.tile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(0,0,0,0.15);
}

.tile-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  line-height: 1;
}

.tile-subtitle {
  font-size: 0.7rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.tile-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tile-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.tile-content::-webkit-scrollbar {
  width: 4px;
}

.tile-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ─── Control Buttons ────────────────────────────────────── */
.ctrl-btn {
  height: 26px;
  min-width: 26px;
  padding: 0 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  transition: all var(--transition);
}

.ctrl-btn svg {
  width: 14px;
  height: 14px;
}

.ctrl-btn:hover,
.ctrl-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-input-focus);
}

/* ─── Weather Tile ───────────────────────────────────────── */
.weather-main {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.weather-icon-large {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.weather-icon-large svg {
  width: 100%;
  height: 100%;
}

.weather-temp-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.weather-temp {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-header);
  line-height: 1;
  letter-spacing: -0.02em;
}

.weather-feels {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.weather-desc {
  font-size: 0.75rem;
  color: var(--text-primary);
  font-weight: 500;
}

.weather-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 8px;
  margin-bottom: 10px;
  padding: 8px;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.weather-detail-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.detail-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  line-height: 1;
}

.detail-value {
  font-size: 0.78rem;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.3;
}

/* ─── METAR Block ────────────────────────────────────────── */
.metar-block {
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-dim);
  border-radius: var(--radius);
}

.metar-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.metar-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  line-height: 1;
}

.metar-time {
  font-size: 0.58rem;
  color: var(--text-secondary);
}

.metar-text {
  font-size: var(--font-metar);
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
  overflow-wrap: break-word;
}

/* ─── Map Tile ───────────────────────────────────────────── */
.tile-map .tile-content {
  padding: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.map-content {
  position: relative;
  flex: 1;
  min-height: 0;
}

#flight-map {
  width: 100%;
  height: 100%;
  min-height: 150px;
  background: #070d1a;
}

.tracking-overlay {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  background: rgba(8,9,18,0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  gap: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 500;
  overflow: hidden;
}

[data-theme="light"] .tracking-overlay {
  background: rgba(255,255,255,0.88);
}

.track-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 4px;
  border-right: 1px solid var(--border);
}

.track-item:last-child {
  border-right: none;
}

.track-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  line-height: 1;
  margin-bottom: 2px;
}

.track-value {
  font-size: 0.78rem;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1;
}

.map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-secondary);
  pointer-events: none;
  z-index: 10;
}

.map-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.3;
}

.map-placeholder p {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  opacity: 0.6;
}

.map-placeholder small {
  font-size: 0.65rem;
  opacity: 0.4;
  text-align: center;
  padding: 0 16px;
}

.map-placeholder.hidden {
  display: none;
}

/* Leaflet customization */
.leaflet-container {
  background: #070d1a;
  font-family: inherit;
}

.leaflet-control-zoom {
  border-color: var(--border) !important;
}

.leaflet-control-zoom a {
  background: var(--bg-tile) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--bg-input-focus) !important;
  color: var(--accent) !important;
}

.leaflet-control-attribution {
  background: rgba(8,9,18,0.75) !important;
  color: var(--text-secondary) !important;
  font-size: 9px !important;
}

.leaflet-control-attribution a {
  color: var(--accent-dim) !important;
}

/* Plane marker */
.plane-icon-wrapper {
  transform-origin: center center;
}

/* Airport popup */
.airport-popup {
  background: var(--bg-tile);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.75rem;
}

/* ─── Roster Tile ────────────────────────────────────────── */
.roster-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px;
}

/* Active flight card */
.flight-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

.active-card {
  border-color: var(--accent-green);
  box-shadow: 0 0 16px rgba(0,214,143,0.1);
}

.flight-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--border);
}

.flight-badge {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.badge-active {
  background: var(--bg-badge-active);
  color: var(--accent-green);
  border: 1px solid rgba(0,214,143,0.3);
}

.badge-upcoming {
  background: var(--bg-badge-upcoming);
  color: var(--accent);
  border: 1px solid var(--border);
}

.flight-number {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-header);
  letter-spacing: 0.05em;
}

.flight-type {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-left: auto;
}

.flight-route {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  gap: 8px;
}

.route-airport {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 40px;
}

.route-airport-right {
  align-items: flex-end;
}

.airport-code {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-header);
  letter-spacing: 0.05em;
  line-height: 1;
}

.airport-name {
  font-size: 0.6rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-arrow-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
}

.route-arrow {
  width: 100%;
  height: 14px;
  color: var(--accent);
  opacity: 0.7;
}

.route-times {
  display: flex;
  justify-content: space-between;
}

.route-time {
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Flight progress bar */
.progress-bar-wrapper {
  height: 3px;
  background: var(--border);
  margin: 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), var(--accent));
  transition: width 1s linear;
  border-radius: 0 2px 2px 0;
}

/* Upcoming flights */
.upcoming-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.upcoming-header {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--text-secondary);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  flex-shrink: 0;
}

.flights-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Upcoming flight item */
.flight-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--bg-tile-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: default;
  transition: border-color var(--transition);
}

.flight-item:hover {
  border-color: var(--border-strong);
}

.flight-item-date {
  font-size: 0.62rem;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 52px;
}

.flight-item-number {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-header);
  min-width: 60px;
  font-family: 'Courier New', monospace;
}

.flight-item-route {
  font-size: 0.72rem;
  color: var(--text-primary);
  flex: 1;
  font-family: 'Courier New', monospace;
  white-space: nowrap;
}

.flight-item-time {
  font-size: 0.65rem;
  color: var(--text-secondary);
  white-space: nowrap;
  font-family: 'Courier New', monospace;
}

.no-roster-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  color: var(--text-secondary);
  text-align: center;
}

.no-roster-msg svg {
  width: 32px;
  height: 32px;
  opacity: 0.4;
}

.no-roster-msg p {
  font-size: 0.8rem;
  opacity: 0.7;
}

.no-roster-msg small {
  font-size: 0.65rem;
  opacity: 0.5;
}

/* ─── Settings Modal ─────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
  cursor: pointer;
}

.modal-content {
  position: relative;
  z-index: 1;
  background: var(--bg-modal);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: min(560px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-in 0.22s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  gap: 10px;
}

/* Settings sections */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-section-title {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--text-secondary);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Preset grid */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.preset-btn {
  padding: 6px 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: all var(--transition);
}

.preset-btn:hover,
.preset-btn.active {
  background: var(--bg-input-focus);
  border-color: var(--accent);
  color: var(--accent);
}

/* Form */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.form-group input {
  height: 34px;
  padding: 0 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}

.form-group input:focus {
  background: var(--bg-input-focus);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(74,158,255,0.15);
}

.form-hint {
  font-size: 0.62rem;
  color: var(--text-secondary);
  opacity: 0.8;
}

/* Buttons */
.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all var(--transition);
  align-self: flex-start;
}

.action-btn svg {
  width: 14px;
  height: 14px;
}

.action-btn:hover {
  background: var(--bg-input-focus);
  border-color: var(--accent);
  color: var(--accent);
}

.reset-btn {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all var(--transition);
}

.reset-btn:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.save-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all var(--transition);
  flex: 1;
  justify-content: center;
  max-width: 220px;
}

.save-btn svg {
  width: 15px;
  height: 15px;
}

.save-btn:hover {
  background: #6ab3ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(74,158,255,0.3);
}

.save-btn:active {
  transform: translateY(0);
}

/* ─── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-header);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 10px 20px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  z-index: 2000;
  transition: transform 0.3s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-modal);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

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

/* ─── Weather Icon Colors ────────────────────────────────── */
.wi-clear-day    { color: #fbbf24; }
.wi-clear-night  { color: #a78bfa; }
.wi-cloudy       { color: #94a3b8; }
.wi-fog          { color: #7b8fa8; }
.wi-rain         { color: #60a5fa; }
.wi-snow         { color: #e0e8ff; }
.wi-thunder      { color: #f5a623; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  :root {
    --header-h: 48px;
    --font-base: 13px;
  }

  .dashboard-title {
    display: none;
  }

  .header-center {
    display: none;
  }

  .time-value {
    font-size: 0.82rem;
  }
}

@media (max-width: 600px) {
  :root {
    --tile-gap: 2px;
  }

  #dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
    overflow-y: auto;
  }

  .time-block:last-child {
    display: none;
  }

  .weather-temp {
    font-size: 1.6rem;
  }

  .weather-icon-large {
    width: 48px;
    height: 48px;
  }

  .preset-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ─── Scrollbar (WebKit) ─────────────────────────────────── */
.modal-body::-webkit-scrollbar,
.flights-list::-webkit-scrollbar {
  width: 4px;
}

.modal-body::-webkit-scrollbar-thumb,
.flights-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ─── Animations ─────────────────────────────────────────── */
@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.loading-pulse {
  animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
