@charset "UTF-8";
.hidden { display: none !important; }

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Bochum brand colors */
  --cyan: #0AB4FF;
  --blue: #0F2864;
  --orange: #F49100;

  /* Surface & text */
  --bg: #F6F6F6;
  --card-bg: #FFFFFF;
  --surface: #FAFAFA;
  --text: #1A1A1A;
  --text-secondary: #4a5568;
  --text-muted: #94A3B8;
  --line: #E2E8F0;

  /* Shadows */
  --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.14);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.10);

  /* Radii */
  --radius-card: 10px;
  --radius-control: 8px;
  --radius-pill: 999px;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Migration aliases */
  --primary: var(--cyan);
  --primary-hover: #0099e0;
  --primary-light: rgba(0, 180, 255, 0.10);
  --radius: var(--radius-card);
  --radius-sm: var(--radius-control);
  --radius-xs: 6px;
  --radius-full: var(--radius-pill);
  --border: var(--line);
  --border-light: #f1f5f9;

  /* Status colors */
  --color-online: #76B729;
  --color-stale: #FF9800;

  /* Counting colors */
  --color-in: #0F2864;
  --color-out: #0AB4FF;
  --color-total: #76B729;
  --color-net: #F49100;
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100%;
  font-family: var(--font-sans); font-size: 16px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 700; line-height: 1.25; }
.kpi-value, .overview-card-value, .ranking-value, .dev-card-value { font-variant-numeric: tabular-nums; }
a { color: var(--primary); text-decoration: none; }

/* ============================================================
   APP SHELL
   ============================================================ */
#app {
  display: flex; flex-direction: column; min-height: 100vh;
  max-width: 1440px; margin: 0 auto; padding: 0 16px;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  position: sticky; top: 0; z-index: 1000;
  height: 70px; background: var(--cyan);
  border-bottom: 0; margin-bottom: 16px; flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  width: 100vw; margin-left: calc(-50vw + 50%);
}
.header-inner {
  height: 70px; max-width: 1440px; margin: 0 auto;
  padding: 0 24px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
}
.header-left { display: flex; align-items: center; gap: 20px; }
.header-logo { height: 36px; width: auto; display: block; }
.header-inner h1 {
  font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center;
  color: #1A1A1A; white-space: nowrap;
}
.header-right { display: flex; align-items: center; gap: 10px; }
.header-meta { font-size: 0.8rem; color: #1A1A1A; display: flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 500; }
.header-loading { display: flex; align-items: center; gap: 6px; }
.header-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.header-dot--ok { background: #76B729; }
.header-dot--warn { background: #F49100; }

/* Theme Toggle */
.theme-toggle {
  width: 36px; height: 36px; display: flex; align-items: center;
  justify-content: center; border: 0; border-radius: var(--radius-pill);
  background: rgba(26, 26, 26, 0.10); color: #1A1A1A;
  cursor: pointer; transition: background 0.15s;
}
.theme-toggle:hover { background: rgba(26, 26, 26, 0.18); }
.theme-icon { width: 20px; height: 20px; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content { display: grid; grid-template-columns: 1fr 380px; gap: 16px; flex: 1; min-height: 480px; }

/* ============================================================
   MAP
   ============================================================ */
#map {
  height: 100%; min-height: 420px; max-height: calc(100vh - 240px);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-card); z-index: 1;
}
.leaflet-container { font-family: var(--font-sans); }

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar {
  display: flex; flex-direction: column; background: var(--card-bg);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  overflow: hidden; min-height: 420px; max-height: calc(100vh - 200px);
}
.sidebar-header { padding: 16px 16px 12px; border-bottom: 1px solid var(--border-light); flex-shrink: 0; }
.sidebar-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sidebar-title-row h2 { font-size: 1.05rem; font-weight: 700; }
.station-count { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }

/* Filters */
.filters { display: flex; flex-direction: column; gap: 8px; }
.filter-input, .filter-select {
  width: 100%; font-size: 0.85rem;
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--card-bg);
  color: var(--text); transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
.filter-input:focus, .filter-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Station list */
.station-list { flex: 1; overflow-y: auto; padding: 4px 0; }
.station-list::-webkit-scrollbar { width: 6px; }
.station-list::-webkit-scrollbar-track { background: transparent; }
.station-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.station-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }

/* Station item */
.station-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 16px; cursor: pointer;
  transition: background 0.15s; border-left: 3px solid transparent;
}
.station-item:hover { background: var(--surface); }
.station-item.active { background: var(--primary-light); border-left-color: var(--primary); }
.station-item.active .station-item-name { color: var(--primary); }

.station-item-info { flex: 1; min-width: 0; }
.station-item-name { font-weight: 700; font-size: 0.92rem; color: var(--text); }
.station-item-sub {
  font-size: 0.78rem; color: var(--text-muted); margin-top: 2px;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.station-item-counts {
  display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap;
}
.count-tag {
  font-size: 0.75rem; font-weight: 700; padding: 2px 10px;
  border-radius: var(--radius-pill); white-space: nowrap; letter-spacing: 0.04em;
}
.count-tag--in { background: #E3F2FD; color: #1565C0; }
.count-tag--out { background: #FFF3E0; color: #E65100; }
.count-tag--total { background: #E8F5E9; color: #2E7D32; }
.status-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  margin-top: 5px; box-shadow: 0 0 4px rgba(0,0,0,0.15);
}
.status-dot.online { background: var(--color-online); }
.status-dot.stale { background: var(--color-stale); }
.status-dot.problem { background: #EAB308; }
.status-dot.inactive { background: #EF4444; }

/* ============================================================
   DETAIL SECTION
   ============================================================ */
.detail-section { margin-top: 16px; margin-bottom: 20px; }
.detail-placeholder { text-align: center; padding: 60px 20px 48px; color: var(--text-muted); }
.placeholder-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.6; }
.placeholder-text { font-size: 1.05rem; font-weight: 500; }

.detail-header { margin-bottom: 16px; }
.detail-title-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px;
}
.detail-title-row h2 { font-size: 1.3rem; font-weight: 700; }
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.75rem; font-weight: 700; padding: 4px 12px;
  border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: 0.08em;
}
.status-badge.online { background: rgba(76, 175, 80, 0.12); color: var(--color-online); }
.status-badge.stale { background: rgba(255, 152, 0, 0.12); color: var(--color-stale); }
.status-badge.problem { background: rgba(234, 179, 8, 0.12); color: #92400E; }
.status-badge.inactive { background: rgba(239, 68, 68, 0.12); color: var(--color-error, #EF4444); }
.status-badge.online::before, .status-badge.stale::before, .status-badge.problem::before, .status-badge.inactive::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.status-badge.online::before { background: var(--color-online); }
.status-badge.stale::before { background: var(--color-stale); }
.status-badge.problem::before { background: #EAB308; }
.status-badge.inactive::before { background: #EF4444; }

.detail-meta-row { display: flex; gap: 16px; font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; flex-wrap: wrap; }

/* KPI Grid */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 14px 16px; border: 0; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }
.kpi-card--primary { }
.kpi-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.kpi-value { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.kpi-value.kpi-loading { color: var(--text-muted); font-weight: 400; }
.kpi-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
@media (max-width: 768px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

/* Station Ranking */
.station-ranking { border-top: 1px solid var(--border-light); padding: 10px 16px 12px; flex-shrink: 0; }
.ranking-header { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.ranking-item { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; font-size: 0.82rem; }
.ranking-label { color: var(--text-secondary); }
.ranking-value { font-weight: 700; color: var(--text); }

/* Overview card (today totals) */
.detail-overview {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.overview-card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 16px 18px; text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.overview-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.overview-card-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; margin-bottom: 4px; }
.overview-card-value { font-size: 1.6rem; font-weight: 700; }
.overview-card--in .overview-card-value { color: var(--color-in); }
.overview-card--out .overview-card-value { color: var(--color-out); }
.overview-card--total .overview-card-value { color: var(--color-total); }
.overview-card--net .overview-card-value { color: var(--color-net); }

/* Time range pills */
.detail-ranges { display: flex; gap: 6px; margin-bottom: 16px; }
.pill {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 7px 14px; border: 0;
  border-radius: var(--radius-pill); background: rgba(0, 180, 255, 0.12);
  color: var(--text); cursor: pointer;
  transition: all 0.15s; user-select: none;
}
.pill:hover { background: rgba(0, 180, 255, 0.20); }
.pill.active { background: var(--cyan); color: #1A1A1A; }
.datepicker-sep {
  width: 1px;
  height: 24px;
  margin: 0 4px;
  background: var(--line);
}
.datepicker-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
}
.date-input {
  min-height: 31px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card-bg);
  color: var(--text);
  font: inherit;
  color-scheme: light;
}
.date-input:focus {
  outline: 2px solid rgba(10, 180, 255, 0.35);
  outline-offset: 1px;
  border-color: var(--cyan);
}
.compare-label {
  font-size: 0.75rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer; user-select: none;
}
.compare-label input { cursor: pointer; }
.year-select {
  font-size: 0.78rem; padding: 3px 6px;
  border: 1px solid var(--border); border-radius: var(--radius-xs);
  background: var(--card-bg); color: var(--text-secondary);
  outline: none; cursor: pointer;
}
.year-select:focus { border-color: var(--primary); }

/* Toggle buttons for mode */
.detail-modes { display: flex; gap: 6px; margin-bottom: 16px; }
.mode-btn {
  font-size: 0.82rem; font-weight: 700;
  padding: 8px 18px; border: 0;
  border-radius: var(--radius-pill); background: rgba(0, 180, 255, 0.12);
  color: var(--text); cursor: pointer;
  transition: all 0.15s; user-select: none;
}
.mode-btn:hover { background: rgba(0, 180, 255, 0.20); }
.mode-btn.active { background: var(--cyan); color: #1A1A1A; }

/* ============================================================
   CHART AREA
   ============================================================ */
.chart-container {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 18px; margin-bottom: 16px;
}
.chart-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.chart-title { font-weight: 700; font-size: 0.92rem; color: var(--text); }
.chart-legend-inline { display: flex; gap: 12px; font-size: 0.78rem; }
.chart-legend-item { display: flex; align-items: center; gap: 4px; }
.chart-legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.chart-legend-dot--in { background: var(--color-in); }
.chart-legend-dot--out { background: var(--color-out); }
.chart-legend-dot--total { background: var(--color-total); }
.chart-legend-dot--cmp-in { background: #00847E; }
.chart-legend-dot--cmp-out { background: #94559C; }
.chart-legend-dot--cmp-total { background: #FFCC01; }

.chart-body { position: relative; height: 300px; }
.chart-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.chart-empty { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 0.82rem; color: var(--text-muted); text-align: center; padding: 20px; }

/* Data source link */
.chart-source {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0 0; gap: 8px; font-size: 0.8rem;
  border-top: 1px solid var(--border-light); margin-top: 10px;
}
.chart-source a { color: var(--text-muted); text-decoration: none; opacity: 0.75; transition: color 0.15s; }
.chart-source a:hover { color: var(--primary); opacity: 1; }
.csv-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.78rem; font-weight: 500; padding: 2px 8px;
  border: none; background: none; color: var(--text-muted);
  cursor: pointer; transition: color 0.15s; line-height: 1.4;
}
.csv-btn:hover { color: var(--primary); }
.csv-btn svg { width: 14px; height: 14px; }

/* ============================================================
   SPINNER
   ============================================================ */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 28px; height: 28px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner--small { width: 16px; height: 16px; border-width: 2px; }

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer { margin-top: auto; padding: 24px 0; background: var(--cyan); border-top: 0; flex-shrink: 0; width: 100vw; margin-left: calc(-50vw + 50%); }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.footer-main { font-size: 0.85rem; color: #1A1A1A; text-align: center; }
.footer-brand { font-weight: 700; }
.footer-data { display: block; font-size: 0.78rem; margin-top: 2px; color: rgba(26, 26, 26, 0.75); }
.footer-links { margin-top: 4px; }
.footer-links a { color: #1A1A1A; font-size: 0.78rem; text-decoration: underline; }
.footer-links a:hover { color: rgba(26, 26, 26, 0.7); }

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] {
  --bg: #0B1220;
  --card-bg: #111827;
  --surface: #1A2332;
  --text: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --line: rgba(148, 163, 184, 0.22);
  --border-light: rgba(148, 163, 184, 0.14);
  --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .app-header,
[data-theme="dark"] .app-footer,
[data-theme="dark"] .tab-button.active,
[data-theme="dark"] .pill.active,
[data-theme="dark"] .mode-btn.active {
  color: #1A1A1A;
}

[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.15);
  color: #1A1A1A;
}
[data-theme="dark"] .theme-toggle:hover { background: rgba(255, 255, 255, 0.25); }

/* Subtle border on cards in dark mode (shadows less visible) */
[data-theme="dark"] .chart-container,
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .overview-card,
[data-theme="dark"] .development-card,
[data-theme="dark"] .development-chart-card,
[data-theme="dark"] .development-station-card,
[data-theme="dark"] .development-table-wrapper,
[data-theme="dark"] #sidebar,
[data-theme="dark"] #map {
  border: 1px solid rgba(148, 163, 184, 0.14);
}

/* Leaflet dark mode */
[data-theme="dark"] .leaflet-tile {
  filter: brightness(0.6) invert(1) contrast(3) hue-rotate(200deg) saturate(0.3) brightness(0.7);
}
[data-theme="dark"] .leaflet-container {
  background: #0B1220;
}

/* Legend Button + Modal */
.filter-footer { display: flex; justify-content: flex-end; padding-top: 2px; }
.legend-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: 1px solid var(--border);
  border-radius: var(--radius-xs); background: var(--card-bg);
  color: var(--text-muted); font-size: 0.82rem;
  font-weight: 700; cursor: pointer; transition: all 0.2s; line-height: 1;
}
.legend-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.legend-modal-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex;
  align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.28); backdrop-filter: blur(2px);
}
.legend-modal {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18); width: 92vw; max-width: 460px;
  max-height: 80vh; display: flex; flex-direction: column; overflow: hidden;
}
.legend-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 12px; border-bottom: 1px solid var(--border-light);
}
.legend-modal-header h3 { font-size: 0.92rem; font-weight: 600; color: var(--text); }
.legend-close {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border: none; background: none; color: var(--text-muted); font-size: 1.3rem;
  cursor: pointer; border-radius: var(--radius-xs); line-height: 1;
}
.legend-close:hover { background: var(--surface); color: var(--text); }
.legend-modal-body { flex: 1; overflow-y: auto; padding: 14px 20px 8px; }
.legend-modal-footer { padding: 10px 20px 14px; border-top: 1px solid var(--border-light); }
.legend-modal-footer p { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; }
.legend-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.legend-item:last-child { border-bottom: none; }
.legend-color {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 4px rgba(0,0,0,0.15);
}
.legend-color--online { background: #76B729; }
.legend-color--problem { background: #EAB308; }
.legend-color--stale { background: #FF9800; }
.legend-color--inactive { background: #EF4444; }
.legend-text { flex: 1; }
.legend-text strong { font-size: 0.85rem; color: var(--text); }
.legend-text p { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .detail-overview { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  #app { padding: 0 12px; }
  .header-inner h1 { font-size: 1.15rem; }
  .main-content { grid-template-columns: 1fr; min-height: 0; }
  #map { height: 300px; min-height: 300px; }
  #sidebar { max-height: none; min-height: auto; }
  .station-list { max-height: 380px; }
  .detail-overview { grid-template-columns: repeat(2, 1fr); }
  .detail-title-row h2 { font-size: 1.15rem; }
  .detail-ranges { flex-wrap: wrap; }
  .chart-body { height: 240px; }
}
@media (max-width: 640px) {
  .header-inner { padding: 0 16px; }
  .header-logo { height: 28px; }
  .header-inner h1 { font-size: 1rem; }
  .header-left { gap: 12px; }
  .header-meta { font-size: 0.72rem; }
}
@media (max-width: 480px) {
  .header-inner { flex-wrap: wrap; gap: 4px; height: auto; padding: 8px 12px; }
  .app-header { height: auto; }
  .header-right { margin-left: auto; }
  .filter-row { grid-template-columns: 1fr; }
  #map { height: 240px; min-height: 240px; }
  .detail-overview { grid-template-columns: 1fr 1fr; }
}

/* ── Entwicklung-Tab ── */
.app-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 480px;
  gap: 8px;
  background: transparent;
  padding: 0;
  border-bottom: 0;
  margin-bottom: 16px;
  width: max-content;
}

.tab-button {
  height: 38px;
  padding: 0 18px;
  width: 100%;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-button:hover {
  background: rgba(0, 180, 255, 0.12);
  color: var(--text);
}

.tab-button.active {
  background: var(--cyan);
  color: #1A1A1A;
}

@media (max-width: 480px) {
  .app-tabs {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.development-section {
  padding: 24px 16px;
}

.development-header { margin-bottom: 20px; }
.development-header h2 { margin: 0 0 4px; font-size: 22px; }
.development-header .subtitle { color: var(--text-muted); font-size: 14px; margin: 0; }

.development-filters {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 0;
  box-shadow: var(--shadow-card);
}
.development-filters label { font-size: 13px; color: var(--text-secondary); display: flex; flex-direction: column; gap: 4px; }
.development-filters select,
.development-filters .btn {
  font-size: 14px; padding: 6px 12px; border-radius: var(--radius-control);
  border: 1px solid var(--line); background: var(--card-bg); color: var(--text);
}
.development-filters .btn {
  background: var(--cyan); color: #1A1A1A; border: 0; cursor: pointer; font-weight: 700;
}
.development-filters .btn:hover { opacity: 0.88; }

.development-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }

.development-card {
  padding: 20px; background: var(--card-bg); border-radius: var(--radius-card);
  border: 0; box-shadow: var(--shadow-card);
}
.dev-card--primary {}
.dev-card-label { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.dev-card-value { font-size: 24px; font-weight: 700; color: var(--text); word-break: break-word; }
.dev-card-value .delta-up,
.dev-card-value .delta-down,
.dev-card-value .delta-flat,
.dev-card-value .delta-none { white-space: nowrap; }
.dev-card-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.development-chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.development-chart-grid--single {
  grid-template-columns: 1fr;
}

.development-month-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .development-month-grid { grid-template-columns: 1fr; }
}
.development-chart-card {
  background: var(--card-bg); border-radius: var(--radius-card); border: 0;
  box-shadow: var(--shadow-card); padding: 20px; overflow: hidden; min-width: 0;
}
.development-chart-card h3 { margin: 0 0 12px; font-size: 16px; }
.development-chart-card canvas { height: 320px !important; width: 100% !important; max-width: 100%; }

/* Station chart — full-width card below the 2-column grid */
.development-station-card {
  background: var(--card-bg); border-radius: var(--radius-card); border: 0;
  box-shadow: var(--shadow-card); padding: 20px; margin-bottom: 24px; overflow: hidden;
}
.development-station-card h3 { margin: 0 0 12px; font-size: 16px; }
.development-station-card canvas { height: 380px !important; width: 100% !important; max-width: 100%; }

.development-table-wrapper {
  overflow-x: auto; background: var(--card-bg); border-radius: var(--radius-card);
  border: 0; box-shadow: var(--shadow-card); padding: 4px;
}
.development-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.development-table th,
.development-table td {
  padding: 10px 14px; text-align: right; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.development-table th {
  background: var(--surface); font-weight: 700;
  color: var(--text-secondary); text-align: right;
  position: sticky; top: 0;
}
.development-table td.station-name { text-align: left; font-weight: 600; }
.development-table tr:hover td { background: var(--surface); }

/* Delta indicators */
.delta-up { color: #76B729; font-weight: 700; }
.delta-down { color: #EF4444; font-weight: 700; }
.delta-flat { color: #718096; font-weight: 700; }
.delta-none { color: var(--line); }

.no-data { color: var(--text-muted); font-style: italic; text-align: center; padding: 40px; }
.loading { text-align: center; padding: 60px; color: var(--text-muted); }
.error { text-align: center; padding: 40px; color: #EF4444; }

/* Responsive */
@media (max-width: 768px) {
  .development-section { padding: 12px; }
  .development-chart-grid { grid-template-columns: 1fr; }
  .development-filters { flex-direction: column; align-items: stretch; }
  .development-filters select { width: 100%; }
  .development-kpi-grid { grid-template-columns: 1fr; }
  .development-chart-card canvas { height: 240px !important; }
  .development-station-card canvas { height: 280px !important; }
  .development-filters .btn { width: 100%; text-align: center; }
}

.dev-chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; font-size: 0.82rem; }
.dev-legend-item { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-weight: 600; color: var(--text); transition: opacity 0.15s; }
.dev-legend-item:hover { opacity: 0.7; }

/* Share button */
.development-filters .btn-share {
  font-size: 14px; font-weight: 700; padding: 6px 12px;
  min-width: 96px; border-radius: var(--radius-control);
  background: rgba(0, 180, 255, 0.12); border: 0; color: var(--text);
  cursor: pointer; transition: all 0.15s;
}
.development-filters .btn-share:hover {
  background: rgba(0, 180, 255, 0.25);
}
.development-filters .btn-share--ok {
  background: var(--cyan); color: #1A1A1A;
}

/* ── Vergleichen-Tab ── */
.compare-section {
  display: flex; gap: 16px; flex: 1; min-height: 480px;
}
.compare-sidebar {
  width: 380px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--card-bg); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); overflow: hidden;
}
.compare-header { padding: 16px; border-bottom: 1px solid var(--line); }
.compare-header h2 { font-size: 1.05rem; font-weight: 700; }
.compare-series-list { flex: 1; overflow-y: auto; padding: 8px; }
.compare-series-card {
  background: var(--surface); border-radius: var(--radius-control);
  padding: 12px; margin-bottom: 8px; border: 1px solid var(--line);
}
.compare-series-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; font-size: 0.85rem; font-weight: 700; color: var(--text);
}
.compare-remove-btn {
  width: 24px; height: 24px; border: 0; border-radius: 50%;
  background: transparent; color: var(--text-muted); font-size: 1.1rem;
  cursor: pointer; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.compare-remove-btn:hover { background: rgba(0,0,0,0.06); color: var(--text); }
.compare-series-card label { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.compare-series-card select { width: 100%; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--card-bg); color: var(--text); }
.compare-add-btn {
  margin: 4px 12px 8px; padding: 8px; border: 2px dashed var(--line);
  border-radius: var(--radius-control); background: transparent;
  color: var(--text-muted); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
}
.compare-add-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.compare-add-btn:disabled { opacity: 0.4; cursor: default; }

.compare-controls { padding: 12px; border-top: 1px solid var(--line); }
.compare-controls label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.compare-controls select { font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--card-bg); color: var(--text); }
.compare-year-row { display: flex; align-items: center; gap: 6px; }
.compare-year-row select { width: 80px; }
.compare-action-row { display: flex; gap: 8px; margin-top: 8px; }
.compare-action-row .btn { font-size: 13px; padding: 6px 14px; }
.compare-action-row .btn-share { background: transparent; border: 1px solid var(--line); color: var(--text); font-weight: 600; }
.compare-action-row .btn-share:hover { border-color: var(--cyan); color: var(--cyan); }

.compare-chart-area {
  flex: 1; display: flex; flex-direction: column;
}

@media (max-width: 900px) {
  .compare-section { flex-direction: column; }
  .compare-sidebar { width: 100%; }
}

/* ============================================================
   GRANULARITY + CHART LAYOUT ROWS (v0.3)
   ============================================================ */
.granularity-row,
.chart-layout-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.granularity-label,
.chart-layout-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 2px;
  white-space: nowrap;
}

/* Der Markenlink im Footer darf die Footer-Farbe nicht verlieren:
   global gilt `a { color: var(--primary) }`, und Cyan auf Cyan waere
   unlesbar. */
.footer-main a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.footer-main a:hover { color: rgba(26, 26, 26, 0.7); }
