/* Selenny® Airfield – Light / Dark UI */

/* ─── Light Mode (Standard) ──────────────────────────────────── */
:root, [data-theme="light"] {
  --bg-primary: #f5f7f5;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #eef2ef;
  --bg-hover: #e2e8e3;
  --border: #c5cec7;
  --border-focus: #059669;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --accent: #047857;
  --accent-hover: #065f46;
  --accent-glow: rgba(4, 120, 87, 0.2);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #10b981;
  --sidebar-width: 220px;
  --titlebar-height: 44px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.08);
  --bar-gradient-from: #059669;
  --bar-gradient-to: #10b981;
  --sidebar-bg: #ffffff;
  --sidebar-active-text: #ffffff;
  --modal-backdrop: rgba(0, 0, 0, 0.3);
  --toast-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  --scrollbar-thumb: #c7ccc8;
  --runway-grass: #c8e6c9;
  --runway-surface: #9e9e9e;
  --runway-marking: #ffffff;
  --runway-label: #6e7370;
}

/* ─── Dark Mode ──────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg-primary: #080f0a;
  --bg-secondary: #0e1610;
  --bg-card: #152018;
  --bg-input: #111c14;
  --bg-hover: #1e2e22;
  --border: #243a28;
  --border-focus: #059669;
  --text-primary: #e8f0ea;
  --text-secondary: #7a9a82;
  --text-muted: #4a6a52;
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-glow: rgba(16, 185, 129, 0.3);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #10b981;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.3);
  --bar-gradient-from: #10b981;
  --bar-gradient-to: #059669;
  --sidebar-bg: #0e1610;
  --sidebar-active-text: #ffffff;
  --modal-backdrop: rgba(0, 0, 0, 0.6);
  --toast-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --scrollbar-thumb: #243a28;
  --runway-grass: #1a3a1a;
  --runway-surface: #3a4a3c;
  --runway-marking: rgba(255,255,255,0.7);
  --runway-label: #4a6a52;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  height: 100vh;
}

/* ─── Sidebar ─────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  -webkit-app-region: drag;
}

.sidebar-header {
  padding: 60px 16px 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  -webkit-app-region: no-drag;
}

.logo-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  line-height: 1.2;
}

.logo-sub {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 1px;
}

.nav-items {
  list-style: none;
  padding: 0 8px;
  flex: 1;
  -webkit-app-region: no-drag;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  -webkit-app-region: no-drag;
}

/* ─── Sidebar Telefonnummern ──────────────────────────────────── */
.sidebar-phones {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  -webkit-app-region: no-drag;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.phone-item {
  display: flex;
  flex-direction: column;
  padding: 3px 6px;
  margin: 0 -6px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

a.phone-item {
  cursor: pointer;
}

a.phone-item:hover {
  background: var(--bg-hover);
}

.phone-label {
  font-size: 11px;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 1px;
}

.phone-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'SF Mono', 'Menlo', monospace;
  user-select: text;
}

[data-theme="dark"] .phone-number {
  text-shadow: 0 0 6px var(--accent-glow);
}

/* ─── Windsack / Wetter-Widget ───────────────────────────────── */
.weather-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.windsock-container {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.windsock-svg {
  width: 72px;
  height: 72px;
}

.weather-data {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  flex: 1;
}

.weather-item {
  display: flex;
  flex-direction: column;
}

.weather-item-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.weather-item-value {
  font-size: 20px;
  font-weight: 700;
  font-family: 'SF Mono', 'Menlo', monospace;
  color: #39ff14;
  text-shadow: 0 0 6px rgba(57, 255, 20, 0.4);
}

[data-theme="light"] .weather-item-value {
  color: #1d1d1f;
  text-shadow: none;
}

.weather-raw {
  font-size: 11px;
  font-family: 'SF Mono', 'Menlo', monospace;
  color: var(--text-muted);
  margin-top: 4px;
  word-break: break-all;
}

.flight-cat-vfr { color: #22c55e; }
.flight-cat-mvfr { color: #3b82f6; }
.flight-cat-ifr { color: #ef4444; }
.flight-cat-lifr { color: #9333ea; }

/* ─── Wetter-Stations-Tabs ────────────────────────────────────── */
.wx-station-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.wx-tab {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.wx-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.wx-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ─── Flugleiter-Leiste ──────────────────────────────────────── */
.flugleiter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.flugleiter-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.flugleiter-input {
  flex: 1;
  max-width: 250px;
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #39ff14;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.flugleiter-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

[data-theme="light"] .flugleiter-input {
  color: #1d1d1f;
}

.flugleiter-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.flugleiter-time {
  font-size: 16px;
  font-weight: 700;
  font-family: 'SF Mono', 'Menlo', monospace;
  color: #39ff14;
  text-shadow: 0 0 6px rgba(57, 255, 20, 0.4);
}

[data-theme="light"] .flugleiter-time {
  color: #1d1d1f;
  text-shadow: none;
}

/* ─── Platzrunden-Leiste ─────────────────────────────────────── */
.circuit-bar-container {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.circuit-card {
  background: var(--bg-card);
  border: 2px solid var(--purple);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
  transition: all 0.2s;
}

.circuit-card.minimized {
  min-width: 180px;
}

.circuit-card.expanded {
  width: 100%;
}

.circuit-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.circuit-header:hover {
  background: var(--bg-hover);
}

.circuit-reg {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--purple);
}

.circuit-count {
  font-size: 22px;
  font-weight: 900;
  color: #39ff14;
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
  font-family: 'SF Mono', 'Menlo', monospace;
  min-width: 30px;
  text-align: center;
}

.circuit-pilot {
  font-size: 12px;
  color: var(--text-secondary);
}

.circuit-time {
  font-size: 11px;
  font-family: 'SF Mono', 'Menlo', monospace;
  color: var(--text-muted);
  margin-left: auto;
}

.circuit-body {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.circuit-touchdowns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.circuit-td-badge {
  padding: 3px 8px;
  background: rgba(139, 92, 246, 0.15);
  border-radius: 4px;
  font-size: 12px;
  font-family: 'SF Mono', 'Menlo', monospace;
  color: var(--purple);
  font-weight: 600;
}

.circuit-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ─── Pisten-Grafik ──────────────────────────────────────────── */
.runway-bg {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.plane-toggle {
  position: absolute;
  top: 6px;
  right: 10px;
  z-index: 10;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.plane-toggle input {
  display: none;
}

.plane-toggle-label {
  font-size: 18px;
  opacity: 0.3;
  transition: opacity 0.2s;
}

.plane-toggle input:checked + .plane-toggle-label {
  opacity: 1;
}

.runway-svg {
  width: 100%;
  height: 60px;
  display: block;
}

/* ─── Rechnungsvorschau ──────────────────────────────────────── */
.invoice-preview {
  display: flex;
  justify-content: center;
  padding: 16px;
  background: #444;
  border-radius: var(--radius);
  max-height: 70vh;
  overflow-y: auto;
}

.inv-paper {
  width: 595px;
  min-height: 750px;
  background: #ffffff;
  color: #1a1a1a;
  padding: 50px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 11px;
  line-height: 1.5;
}

[data-theme="light"] .invoice-preview {
  background: #d1d1d6;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  transition: color 0.15s;
  margin-bottom: 8px;
}
.theme-toggle:hover { color: var(--text-primary); }

.version {
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── Main ────────────────────────────────────────────────────── */
#content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#titlebar {
  height: var(--titlebar-height);
  -webkit-app-region: drag;
  flex-shrink: 0;
}

#view-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 32px;
  position: relative;
}

#icao-watermark {
  position: fixed;
  bottom: 30px;
  left: var(--sidebar-width);
  right: 0;
  text-align: center;
  font-size: 280px;
  font-weight: 900;
  letter-spacing: 30px;
  color: var(--text-primary);
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
}

[data-theme="light"] #icao-watermark {
  opacity: 0.04;
}

/* ─── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Typography ──────────────────────────────────────────────── */
.view-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.view-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 2px 12px var(--accent-glow); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { opacity: 0.9; }

.btn-sm { padding: 5px 10px; font-size: 12px; }

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-icon:hover { color: var(--text-primary); background: var(--bg-hover); }

/* ─── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

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

.card-title {
  font-size: 15px;
  font-weight: 600;
}

/* ─── Stats Cards ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
}

.stat-value.accent { color: var(--accent); }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }

/* ─── Table ───────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
}

tr:hover td {
  background: var(--bg-hover);
}

tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-info { background: rgba(5, 150, 105, 0.15); color: var(--accent); }

/* ─── Forms ───────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.form-group.full-width {
  grid-column: 1 / -1;
}

label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

input, select, textarea {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea { resize: vertical; min-height: 60px; }

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  grid-column: 1 / -1;
  position: sticky;
  bottom: -24px;
  margin: 16px -24px -24px;
  padding: 16px 24px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 1;
}

/* ─── Toolbar ─────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar input, .toolbar select {
  min-width: 140px;
}

.search-input {
  position: relative;
}

.search-input input {
  padding-left: 32px;
  width: 240px;
}

.search-input svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

/* ─── Modal ───────────────────────────────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

#modal-overlay.hidden { display: none; }

#modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-width: 500px;
  max-width: 900px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: 0 20px 60px var(--modal-backdrop);
  display: flex;
  flex-direction: column;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.modal-actions {
  position: sticky;
  bottom: -24px;
  margin: 16px -24px -24px;
  padding: 16px 24px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  z-index: 1;
}

/* ─── Toast ───────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  box-shadow: var(--toast-shadow);
  animation: toast-in 0.3s ease-out;
  min-width: 280px;
}

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

@keyframes rwy-glow-pulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.08; }
}

@keyframes wind-sway {
  0%, 100% { transform: var(--wind-base-rotate, rotate(0deg)) rotate(-3deg); }
  50% { transform: var(--wind-base-rotate, rotate(0deg)) rotate(3deg); }
}

@keyframes neon-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Bar Chart (CSS only) ────────────────────────────────────── */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 200px;
  padding: 16px 0;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  max-width: 40px;
  background: linear-gradient(to top, var(--bar-gradient-from), var(--bar-gradient-to));
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
  min-height: 2px;
}

.bar-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
}

.bar-value {
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* ─── Expiring Indicators ─────────────────────────────────────── */
.expiring-soon {
  color: var(--warning);
}

.expired {
  color: var(--danger);
}

/* ─── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 14px;
}

/* ─── Fee Table ───────────────────────────────────────────────── */
.fee-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.fee-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.fee-block-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fee-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}

.fee-row .fee-amount {
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── Utilities ───────────────────────────────────────────────── */
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.font-mono { font-family: 'SF Mono', 'Menlo', monospace; }
.cursor-pointer { cursor: pointer; }

kbd {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10px;
  font-family: 'SF Mono', 'Menlo', monospace;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  line-height: 1.4;
  vertical-align: middle;
}

/* ─── Autocomplete Dropdown ──────────────────────────────────── */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-list {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 220px;
  overflow-y: auto;
  z-index: 2000;
  box-shadow: var(--toast-shadow);
  display: none;
}

.autocomplete-list.visible {
  display: block;
}

.autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

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

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: var(--bg-hover);
}

.autocomplete-item .ac-type {
  color: var(--text-primary);
  font-weight: 500;
}

.autocomplete-item .ac-meta {
  color: var(--text-muted);
  font-size: 11px;
}

.autocomplete-item .ac-mtow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  font-family: 'SF Mono', 'Menlo', monospace;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE / MOBILE
   ═══════════════════════════════════════════════════════════════════════════ */

/* Burger-Button (nur mobil sichtbar) */
.burger-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1001;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Overlay für Sidebar-Close */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

/* ─── Tablet (< 1024px) ──────────────────────────────────────── */
@media (max-width: 1024px) {
  .view-title {
    font-size: 20px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .flex.gap-16 {
    flex-direction: column;
  }

  .weather-data {
    gap: 12px;
  }

  .weather-item-value {
    font-size: 16px;
  }
}

/* ─── Mobile (< 768px) ───────────────────────────────────────── */
@media (max-width: 768px) {
  /* Burger sichtbar */
  .burger-btn {
    display: flex;
  }

  /* Sidebar: versteckt, slide-in */
  #sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: left 0.25s ease;
    box-shadow: none;
  }

  #sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }

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

  /* Content: volle Breite */
  #content {
    margin-left: 0;
    padding-top: 0;
  }

  #view-container {
    padding: 60px 12px 20px;
  }

  /* ICAO Wasserzeichen kleiner */
  #icao-watermark {
    font-size: 120px;
    letter-spacing: 10px;
    left: 0;
  }

  /* View-Titel */
  .view-title {
    font-size: 18px;
    flex-direction: column;
    align-items: flex-start;
  }

  .view-title .flex {
    flex-wrap: wrap;
    width: 100%;
  }

  .view-title .btn {
    font-size: 11px;
    padding: 6px 10px;
  }

  .view-title kbd {
    display: none;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-value {
    font-size: 20px;
  }

  /* Tabellen horizontal scrollbar */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 600px;
  }

  th, td {
    padding: 8px 10px;
    font-size: 12px;
  }

  /* Wetter-Widget */
  .weather-bar {
    flex-wrap: wrap;
    padding: 12px;
    gap: 12px;
  }

  .windsock-container {
    width: 48px;
    height: 48px;
  }

  .windsock-svg {
    width: 48px;
    height: 48px;
  }

  .weather-item-value {
    font-size: 14px;
  }

  .weather-item-label {
    font-size: 9px;
  }

  /* Piste */
  .runway-svg {
    height: 40px;
  }

  /* Flugleiter-Leiste */
  .flugleiter-bar {
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 6px;
  }

  .flugleiter-input {
    max-width: 150px;
    font-size: 13px;
  }

  .flugleiter-time {
    font-size: 13px;
  }

  /* Wetter-Tabs */
  .wx-station-tabs {
    flex-wrap: wrap;
  }

  .wx-tab {
    font-size: 11px;
    padding: 5px 10px;
  }

  /* Toolbar */
  .toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .toolbar input, .toolbar select {
    min-width: 100px;
    font-size: 12px;
  }

  /* Buttons größer für Touch */
  .btn {
    min-height: 40px;
    padding: 10px 16px;
  }

  .btn-icon {
    width: 40px;
    height: 40px;
  }

  /* Platzrunden */
  .circuit-bar-container {
    flex-direction: column;
  }

  .circuit-card.minimized {
    min-width: 100%;
  }

  /* Cards */
  .card {
    padding: 14px;
  }

  /* Modal */
  #modal-content {
    min-width: auto;
    max-width: 95vw;
    padding: 16px;
    margin: 8px;
    max-height: 90vh;
  }

  .modal-title {
    font-size: 16px;
  }

  /* Fee-Info */
  .fee-info {
    grid-template-columns: 1fr;
  }

  /* Sidebar Telefonnummern */
  .phone-number {
    font-size: 12px;
  }

  /* Sidebar Header */
  .sidebar-header {
    padding: 20px 16px 16px;
  }
}

/* ─── Print ──────────────────────────────────────────────────── */
@media print {
  body, html { overflow: visible !important; height: auto !important; background: #fff !important; }
  * { visibility: hidden !important; }
  #destatis-print-overlay, #destatis-print-overlay * { visibility: visible !important; }
  #destatis-print-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 20px !important;
    background: #fff !important;
  }
  #sidebar, .burger-btn, .sidebar-overlay, #toast-container, .no-print { display: none !important; }
}

/* ─── Destatis Matrix responsive ──────────────────────────────── */
@media (max-width: 768px) {
  .destatis-matrix-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
  }
  .destatis-name-full {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
  }
}

@media (max-width: 400px) {
  .destatis-matrix-name {
    max-width: 70px;
    font-size: 10px;
  }
  .destatis-name-full {
    max-width: 100px;
    font-size: 11px;
  }
}

/* ─── Kleines Mobil (< 400px) ─────────────────────────────────── */
@media (max-width: 400px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-buttons {
    flex-direction: column;
  }

  #view-container {
    padding: 56px 8px 16px;
  }

  .view-title {
    font-size: 16px;
  }
}
