/* personal-os · Dashboard-Styles
 * Dark-Mode ist die Grundlage; per prefers-color-scheme: light wird eine
 * helle Variante aktiviert. Keine externen Fonts/Bilder — alles self-contained.
 */

:root {
  --bg: #0f1216;
  --bg-soft: #141922;
  --bg-elevated: #161a20;
  --card-bg: #1b2028;
  --card-border: #2a303a;
  --text: #e8eaed;
  --text-muted: #9aa3af;
  --accent: #4fb0ff;
  --accent-strong: #7cc4ff;
  --accent-contrast: #06121d;
  --green: #3ecf8e;
  --yellow: #e8c547;
  --red: #ef5b5b;
  --neutral: #7d8794;
  --danger-bg: #3a2430;
  --danger-fg: #f5c6c6;
  --danger-border: #5a2f38;
  --success-bg: #1e3a2e;
  --success-fg: #a9e8c4;
  --success-border: #2d5a44;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  --sidebar-w: 232px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f4f7;
    --bg-soft: #e9edf3;
    --bg-elevated: #ffffff;
    --card-bg: #ffffff;
    --card-border: #d8dee7;
    --text: #1a1f27;
    --text-muted: #5f6b7a;
    --accent: #1c74d4;
    --accent-strong: #155bab;
    --accent-contrast: #ffffff;
    --green: #17945f;
    --yellow: #a67c00;
    --red: #c93636;
    --neutral: #6b7684;
    --danger-bg: #fdeaea;
    --danger-fg: #8c1f1f;
    --danger-border: #f3c4c4;
    --success-bg: #e6f6ee;
    --success-fg: #14603f;
    --success-border: #b9e2cd;
    --shadow: 0 2px 10px rgba(20, 30, 45, 0.08);
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.small { font-size: 0.82rem; }
.center { text-align: center; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }

.no-data {
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

/* ---------- Layout: Sidebar + Inhalt ---------- */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-soft);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 12px;
  gap: 14px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 10px;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-mark { color: var(--accent); }

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}

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

.nav-item.active {
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
}

.nav-icon { width: 1.3em; text-align: center; }

.sidebar-foot { padding: 0 4px; }

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 30;
}

.main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--card-border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.last-updated {
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.nav-toggle { display: none; }

.view {
  padding: 20px;
  flex: 1;
  min-width: 0;
}

.page-footer {
  text-align: center;
  padding: 20px;
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    z-index: 40;
    left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .nav-toggle { display: inline-flex; }
  .view { padding: 14px; }
  .last-updated { display: none; }
}

/* ---------- Buttons ---------- */

.btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-secondary { background: transparent; }
.btn-block { width: 100%; }

.btn-small {
  padding: 8px 12px;
  font-size: 0.82rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon {
  width: 38px; height: 38px;
  padding: 0;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---------- Banner ---------- */

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  font-size: 0.88rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.banner-error {
  background: var(--danger-bg);
  color: var(--danger-fg);
  border-bottom: 1px solid var(--danger-border);
}

.banner-close {
  background: none; border: none;
  color: inherit;
  font-size: 1.2rem; line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.75;
}

.banner-close:hover { opacity: 1; }

/* ---------- Cards / Raster ---------- */

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.02rem;
  font-weight: 600;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.portfolio-cat-heading {
  margin-top: 18px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.mini-card {
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.mini-card h3 { text-transform: capitalize; color: var(--text); }

.card-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.card-link:hover { text-decoration: underline; }

/* ---------- Leerzustand ---------- */

.empty-state {
  text-align: center;
  padding: 22px 12px;
  color: var(--text-muted);
}

.empty-icon { font-size: 1.8rem; margin-bottom: 6px; opacity: 0.8; }
.empty-headline { margin: 0 0 4px; font-weight: 600; color: var(--text); }

/* ---------- Kennzahlen ---------- */

.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.metric {
  flex: 1 1 110px;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.metric-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.metric.tone-green .metric-value { color: var(--green); }
.metric.tone-yellow .metric-value { color: var(--yellow); }
.metric.tone-red .metric-value { color: var(--red); }

.big-number {
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.big-number.tone-red { color: var(--red); }

.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 6px 0 0;
}

.warn-box {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(239, 91, 91, 0.15);
  color: var(--red);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- Status-Pill / Fortschritt ---------- */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
}

.status-green   { background: rgba(62, 207, 142, 0.15); color: var(--green); }
.status-yellow  { background: rgba(232, 197, 71, 0.16); color: var(--yellow); }
.status-red     { background: rgba(239, 91, 91, 0.15);  color: var(--red); }
.status-neutral { background: rgba(125, 135, 148, 0.16); color: var(--neutral); }

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 4px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.progress-fill.status-green   { background: var(--green); }
.progress-fill.status-yellow  { background: var(--yellow); }
.progress-fill.status-red     { background: var(--red); }
.progress-fill.status-accent  { background: var(--accent); }
.progress-fill.status-neutral { background: var(--neutral); }

/* ---------- Fear & Greed (Finanzen: Sentiment) ---------- */

.fg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

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

.fg-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.fg-value { font-size: 0.95rem; }
.fg-value strong { font-size: 1.2rem; }

/* ---------- Listen ---------- */

.plain-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plain-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
}

.plain-list.small li { font-size: 0.78rem; padding: 5px 8px; }

.li-main {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.li-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

/* Programme & Apps: Name und Beschreibung teilen sich hier keine Zeile.
 * Grund: .li-meta ist nowrap und schluckt in der schmalen Kachel (min. 280px)
 * die gesamte Breite — der Link daneben schrumpfte auf 0px und war unsichtbar.
 * Deshalb darf die Zeile umbrechen, die Beschreibung rutscht darunter. */
.plain-list.apps-list li {
  flex-wrap: wrap;
  row-gap: 2px;
}

.plain-list.apps-list .li-main {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.plain-list.apps-list .li-meta {
  flex: 1 1 100%;
  white-space: normal;
  text-align: right;
}

/* ---------- Wochenkalender (Kantine) ---------- */

.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.day-card {
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.day-card.day-today {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.day-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--card-border);
}

.day-weekday { font-weight: 700; }
.day-date { color: var(--text-muted); font-size: 0.78rem; }

.day-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.68rem;
  font-weight: 700;
}

.day-meals { display: flex; flex-direction: column; gap: 8px; }

.meal-type {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}

.meal-items {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  font-size: 0.84rem;
}

.meal-items li { padding: 1px 0; }

/* ---------- Timeline ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.tl-item {
  display: grid;
  grid-template-columns: 78px 18px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--card-border);
}

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

.tl-date { display: flex; flex-direction: column; line-height: 1.2; }
.tl-day { font-weight: 700; font-size: 0.8rem; }
.tl-full { color: var(--text-muted); font-size: 0.75rem; }

.tl-marker {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  justify-self: center;
}

.tl-body { display: flex; flex-direction: column; min-width: 0; }

.tl-title {
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text);
}

a.tl-title:hover { color: var(--accent); text-decoration: underline; }

.tl-meta {
  color: var(--text-muted);
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge.tone-green   { background: rgba(62, 207, 142, 0.18); color: var(--green); }
.badge.tone-yellow  { background: rgba(232, 197, 71, 0.18); color: var(--yellow); }
.badge.tone-red     { background: rgba(239, 91, 91, 0.18);  color: var(--red); }
.badge.tone-neutral { background: rgba(125, 135, 148, 0.18); color: var(--neutral); }

@media (max-width: 560px) {
  .tl-item { grid-template-columns: 64px 12px 1fr auto; }
}

/* Veranstaltungen-Seite: Titel-Treffer gegen favorisierte Bands (Konzerte-Seite) */
.tl-item.tl-favorite {
  background: rgba(232, 197, 71, 0.08);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px rgba(232, 197, 71, 0.35) inset;
  padding-left: 6px;
  padding-right: 6px;
}

/* ---------- Konzerte (event_planning · Eventim) ---------- */

.kz-month { display: flex; flex-direction: column; gap: 12px; }

.kz-month-header {
  margin: 4px 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  position: sticky;
  top: 0;
}

.kz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.kz-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kz-card.kz-favorite {
  border-color: var(--yellow);
  box-shadow: 0 0 0 1px var(--yellow) inset;
  background: rgba(232, 197, 71, 0.06);
}

.kz-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.kz-date-chip {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

.kz-day { font-weight: 700; }
.kz-full { color: var(--text-muted); }
.kz-time {
  color: var(--accent-strong);
  font-weight: 600;
}

.fav-btn {
  background: none;
  border: 1px solid var(--card-border);
  border-radius: 50%;
  width: 30px; height: 30px;
  flex-shrink: 0;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s ease, border-color 0.12s ease, transform 0.05s ease;
}

.fav-btn:hover { border-color: var(--yellow); color: var(--yellow); }
.fav-btn:active { transform: scale(0.92); }

.fav-btn.fav-active {
  color: var(--yellow);
  border-color: var(--yellow);
  background: rgba(232, 197, 71, 0.14);
}

.kz-card-body { display: flex; flex-direction: column; gap: 6px; }

.kz-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
  text-decoration: none;
}

a.kz-title:hover { color: var(--accent); text-decoration: underline; }

.kz-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.kz-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kz-rating {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
}

.kz-desc {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.kz-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.kz-fact {
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.kz-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.kz-link {
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.kz-link:hover { text-decoration: underline; }

/* ---------- Tabellen ---------- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

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

.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-soft); }

.data-table td.tone-green { color: var(--green); }
.data-table td.tone-red { color: var(--red); }

/* ---------- Diagramme (Inline-SVG) ---------- */

.chart {
  width: 100%;
  height: auto;
  overflow: visible;
  display: block;
}

.chart-label { fill: var(--text-muted); font-size: 11px; font-family: var(--font); }
.chart-value { fill: var(--text); font-size: 11px; font-family: var(--font); font-weight: 600; }
.chart-axis  { fill: var(--text-muted); font-size: 10px; font-family: var(--font); }
.chart-grid  { stroke: var(--card-border); stroke-width: 1; }

.chart-bar { fill: var(--accent); }
.chart-bar.tone-green  { fill: var(--green); }
.chart-bar.tone-yellow { fill: var(--yellow); }
.chart-bar.tone-red    { fill: var(--red); }

.chart-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-path.tone-green  { stroke: var(--green); }
.chart-path.tone-yellow { stroke: var(--yellow); }
.chart-path.tone-red    { stroke: var(--red); }

/* Gestrichelt = Vergleichsreihe (Sprit: entlang der Pendelstrecke).
   Muster passend zum Legenden-Swatch: 5 Strich, 3 Lücke. */
.chart-path.dashed {
  stroke-dasharray: 5 3;
  stroke-linecap: butt;
}

.chart-dot { fill: var(--accent); }
.chart-dot.tone-green  { fill: var(--green); }
.chart-dot.tone-yellow { fill: var(--yellow); }
.chart-dot.tone-red    { fill: var(--red); }

.chart-line { max-height: 260px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.legend-item { display: inline-flex; align-items: center; gap: 6px; }

.legend-swatch {
  width: 12px; height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.legend-swatch.tone-green  { background: var(--green); }
.legend-swatch.tone-yellow { background: var(--yellow); }
.legend-swatch.tone-red    { background: var(--red); }

/* Gestrichelt = Vergleichsreihe (Sprit: entlang der Pendelstrecke) */
.legend-swatch.dashed {
  background: repeating-linear-gradient(
    to right,
    currentColor 0 5px,
    transparent 5px 8px
  );
}

.legend-swatch.dashed              { color: var(--accent); }
.legend-swatch.dashed.tone-green   { color: var(--green); }
.legend-swatch.dashed.tone-yellow  { color: var(--yellow); }
.legend-swatch.dashed.tone-red     { color: var(--red); }

/* ---------- Tankstellen-Karte (Sprit, Leaflet/OSM) ----------
   Leaflets Standard-Kacheln sind hell -- bewusst nicht künstlich eingefärbt
   (siehe Aufgabenbeschreibung), stattdessen nur in einen passenden Rahmen
   eingebettet. Feste Höhe ist Pflicht, sonst rendert Leaflet die Karte
   grau/leer (siehe invalidateSize() in app.js). */
.sprit-map {
  height: 320px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  overflow: hidden;
}

.sprit-map .leaflet-popup-content-wrapper,
.sprit-map .leaflet-popup-tip {
  background: var(--card-bg);
  color: var(--text);
}

.sprit-map-popup { font-size: 0.85rem; }
.sprit-map-popup strong { display: block; margin-bottom: 4px; }

.sprit-map-popup-list {
  margin: 0;
  padding-left: 16px;
}

.sprit-map-popup-list li { margin: 2px 0; }

.gauge {
  width: 100%;
  max-width: 260px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.gauge-track {
  fill: none;
  stroke: var(--bg-soft);
  stroke-width: 16;
  stroke-linecap: round;
}

.gauge-value {
  fill: none;
  stroke: var(--accent);
  stroke-width: 16;
  stroke-linecap: round;
}

.gauge-value.tone-green  { stroke: var(--green); }
.gauge-value.tone-yellow { stroke: var(--yellow); }
.gauge-value.tone-red    { stroke: var(--red); }

.gauge-number {
  fill: var(--text);
  font-size: 30px;
  font-weight: 700;
  font-family: var(--font);
}

.gauge-label {
  fill: var(--text-muted);
  font-size: 12px;
  font-family: var(--font);
}

/* ---------- Logs ---------- */

.log-box {
  margin: 0;
  max-height: 340px;
  overflow: auto;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.45;
}

.log-line {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 1px 0;
  color: var(--danger-fg);
}

@media (prefers-color-scheme: light) {
  .log-line { color: var(--danger-fg); }
}

/* ---------- Changelog ---------- */

.changelog-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.changelog-item {
  position: relative;
  padding-left: 18px;
  line-height: 1.5;
  color: var(--text-muted);
}

.changelog-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Upload ---------- */

.dropzone {
  margin-top: 14px;
  border: 2px dashed var(--card-border);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
  background: rgba(79, 176, 255, 0.06);
  outline: none;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(79, 176, 255, 0.12);
}

.dropzone-icon { font-size: 2rem; margin-bottom: 6px; }
.dropzone p { margin: 4px 0; }

.field-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--danger-bg);
  color: var(--danger-fg);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.preview {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
}

.preview-list { margin: 0 0 16px; }

.preview-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--card-border);
  font-size: 0.9rem;
}

.preview-row:last-child { border-bottom: none; }
.preview-row dt { color: var(--text-muted); }
.preview-row dd { margin: 0; font-weight: 600; }

.preview-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.upload-result {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.upload-result.success {
  background: var(--success-bg);
  color: var(--success-fg);
  border: 1px solid var(--success-border);
}

.upload-result.error {
  background: var(--danger-bg);
  color: var(--danger-fg);
  border: 1px solid var(--danger-border);
}

/* ---------- Login-Seite (/login) ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.login-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 8px; }

.login-card h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-card .muted { margin: 0 0 20px; font-size: 0.92rem; }

#login-form { display: flex; flex-direction: column; gap: 14px; }

.code-input {
  width: 100%;
  padding: 14px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 1.9rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
}

.code-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
  letter-spacing: 0.4em;
}

.code-input:focus { outline: none; border-color: var(--accent); }

.login-hint { margin: 16px 0 0; }
.login-hint code { color: var(--text); }

@media (max-width: 480px) {
  .card { padding: 14px; }
  .page-title { font-size: 1.1rem; }
}

/* ---------- Veranstaltungen (concert_discovery) — Monats-Timeline ---------- */
/* Eigener "vt-"-Namensraum (statt der bestehenden .tl-*/.kz-*-Klassen), damit
   diese additive Erweiterung keine bestehenden Regeln anderer Seiten anfasst. */

.vt-month { display: flex; flex-direction: column; gap: 10px; }

.vt-month-header {
  margin: 4px 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.vt-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vt-item {
  display: grid;
  grid-template-columns: 78px 18px 1fr auto;
  align-items: start;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--card-border);
}

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

.vt-item.vt-favorite {
  background: rgba(232, 197, 71, 0.08);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px rgba(232, 197, 71, 0.35) inset;
  padding-left: 6px;
  padding-right: 6px;
}

.vt-date { display: flex; flex-direction: column; line-height: 1.2; padding-top: 2px; }
.vt-day { font-weight: 700; font-size: 0.8rem; }
.vt-full { color: var(--text-muted); font-size: 0.75rem; }

.vt-marker {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  justify-self: center;
  margin-top: 6px;
}

.vt-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 1px; }

.vt-title {
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text);
}

a.vt-title:hover { color: var(--accent); text-decoration: underline; }

.vt-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.vt-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.vt-detail {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.vt-score { margin-top: 2px; }

@media (max-width: 560px) {
  .vt-item { grid-template-columns: 64px 12px 1fr auto; }
}

/* ---------- Formular-Bausteine (Rechner auf "Familie & Steuern") ---------- */

.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.form-label {
  flex: 0 0 auto;
  min-width: 180px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.form-input,
.form-select {
  font-family: inherit;
  font-size: 0.92rem;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: var(--bg-elevated);
  color: var(--text);
}

.form-input { width: 130px; }
.form-select { min-width: 160px; }

.form-input:focus,
.form-select:focus,
.form-range:focus {
  outline: none;
  border-color: var(--accent);
}

.form-range {
  flex: 1;
  min-width: 120px;
  accent-color: var(--accent);
}

.form-range-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 220px;
}

.form-range-group .form-input { width: 100px; }

@media (max-width: 560px) {
  .form-label { min-width: 100%; }
}

.disclaimer-box {
  margin-top: 4px;
  padding: 12px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.disclaimer-box strong { color: var(--text); }
