/* ===== CSS Custom Properties ===== */
:root {
  --sand: #F5E6C8;
  --blue: #4F6B3A;
  --blue-dark: #33461F;
  --orange: #D9A23F;
  --orange-dark: #A87A22;
  --white: #FAFAFA;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --card-bg: #ffffff;
  --body-bg: #f3f4f6;
  --tab-bg: #ffffff;
  --tab-border: #e5e7eb;
  --success: #16a34a;
  --danger: #dc2626;
  --tab-height: 64px;
  --header-height: 0px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --white: #1a1a2e;
    --text: #f0f0f0;
    --text-muted: #9ca3af;
    --border: #374151;
    --card-bg: #1f2937;
    --body-bg: #111827;
    --tab-bg: #1f2937;
    --tab-border: #374151;
    --bg-secondary: #2d3748;
  }
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--body-bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Login ===== */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  padding: 1rem;
}

.login-card {
  background: var(--card-bg);
  border-radius: 1.5rem;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-logo { font-size: 3rem; margin-bottom: 0.75rem; }
.login-logo img { display: block; margin: 0 auto; width: 4.5rem; height: 4.5rem; }

.login-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.login-subtitle { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.9rem; }

.login-error {
  background: #fef2f2;
  color: var(--danger);
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

/* ===== Tab Navigation ===== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tab-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--tab-bg);
  border-top: 1px solid var(--tab-border);
  display: flex;
  align-items: stretch;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.6rem;
  min-height: 44px;
  padding: 6px 2px;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn.active { color: var(--blue); }
.tab-btn:active { opacity: 0.7; }

.tab-icon { font-size: 1.2rem; line-height: 1; }
.tab-label { font-size: 0.58rem; font-weight: 500; white-space: nowrap; }

@media (min-width: 640px) {
  .tab-bar {
    top: 0;
    bottom: auto;
    height: 56px;
    padding-bottom: 0;
    border-top: none;
    border-bottom: 1px solid var(--tab-border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  }
  .tab-btn { flex-direction: row; gap: 6px; font-size: 0.8rem; }
  .tab-icon { font-size: 1rem; }
  .tab-label { font-size: 0.8rem; }
  .main-content {
    padding-bottom: 1rem !important;
    padding-top: calc(56px + 1rem) !important;
  }
}

/* ===== Main Content ===== */
.main-content {
  padding: 1rem 1rem calc(var(--tab-height) + var(--safe-bottom) + 1rem);
  max-width: 680px;
  margin: 0 auto;
}

.tab-section { display: none; }
.tab-section.active { display: block; }

/* ===== Cards ===== */
.card {
  background: var(--card-bg);
  border-radius: 0.3rem;
  padding: 1.25rem;
  margin-bottom: 0.875rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.card-title-row .card-title { margin-bottom: 0; }

/* ===== Page Header ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-top: 0.25rem;
}

.page-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.overview-greeting {
  flex: 1;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  opacity: 0.88;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: 0.625rem;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); opacity: 0.85; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange-dark); }
.btn-secondary { background: var(--bg-secondary); color: var(--text-muted); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.btn-sm { min-height: 36px; padding: 0.4rem 0.875rem; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 0.5rem; min-height: 36px; min-width: 36px; border-radius: 0.5rem; }

/* ===== FAB ===== */
.fab {
  position: fixed;
  bottom: calc(var(--tab-height) + var(--safe-bottom) + 1rem);
  right: 1.25rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 1.5rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(79,107,58,0.4);
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.tab-section.active .fab { display: flex; }

@media (min-width: 640px) {
  .fab { bottom: 1.5rem; }
}

/* ===== Countdown ===== */
.countdown-card {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  text-align: center;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.countdown-label { font-size: 0.85rem; opacity: 0.85; margin-bottom: 0.3rem; }
.countdown-value { font-size: 2rem; font-weight: 600; letter-spacing: -1px; }
.countdown-date { font-size: 0.8rem; opacity: 0.75; margin-top: 0.25rem; }
.countdown-card .countdown-value.past { color: var(--orange); }

.countdown-progress-wrap {
  margin-top: 0.85rem;
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
}

.countdown-progress-bar {
  height: 100%;
  background: #fff;
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* ===== Timeline ===== */
.timeline { list-style: none; padding: 0; }

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

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

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  margin-top: 5px;
}

.timeline-item.aktiv .timeline-dot { background: var(--orange); box-shadow: 0 0 0 3px rgba(244,162,97,0.3); }
.timeline-item.vorbei .timeline-dot { background: var(--blue); }
.timeline-dot.heimweg { background: var(--text-muted); border: 2px dashed var(--text-muted); background-clip: padding-box; }
.timeline-item.vorbei .timeline-dot.heimweg { background: var(--blue); border-color: var(--blue); }

.timeline-info { flex: 1; min-width: 0; }
.timeline-date { font-size: 0.75rem; color: var(--text-muted); }
.timeline-ort { font-size: 0.95rem; font-weight: 600; }
.timeline-item.aktiv .timeline-ort { color: var(--orange); }

/* ===== Accommodation Cards ===== */
.unterkunft-card {
  background: var(--card-bg);
  border-radius: 1rem;
  margin-bottom: 0.875rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  overflow: hidden;
}

.unterkunft-header {
  padding: 1rem 1.25rem 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.unterkunft-flag { font-size: 2rem; line-height: 1; flex-shrink: 0; }

.unterkunft-meta { flex: 1; min-width: 0; }
.unterkunft-ort { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.unterkunft-name { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

.unterkunft-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-booking { background: #eff6ff; color: #1d4ed8; }
.badge-airbnb { background: #fff1f2; color: #be185d; }
.badge-offen { background: #fef3c7; color: #92400e; }
.badge-person { background: #f0fdf4; color: var(--success); }
.badge-current { background: #fff7ed; color: var(--orange-dark); }
.badge-past { background: #f9fafb; color: var(--text-muted); }

.unterkunft-dates {
  padding: 0 1.25rem 0.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.unterkunft-date-block label { font-size: 0.7rem; color: var(--text-muted); display: block; }
.unterkunft-date-block strong { font-size: 0.9rem; }
.unterkunft-naechte { font-size: 0.8rem; color: var(--text-muted); padding: 0 1.25rem 0.5rem; }

.unterkunft-actions {
  padding: 0 1.25rem 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.unterkunft-actions .btn { flex: 1; min-width: 120px; font-size: 0.8rem; }

.unterkunft-adresse {
  padding: 0 1.25rem 0.75rem;
  font-size: 0.85rem;
  color: var(--blue);
}

.unterkunft-fahrt {
  padding: 0.6rem 1.25rem;
  background: var(--body-bg);
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.details-toggle {
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
}

.details-toggle:hover { background: var(--body-bg); }
.details-chevron { transition: transform 0.2s; }
.details-toggle.open .details-chevron { transform: rotate(180deg); }

.details-body {
  display: none;
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid var(--border);
}

.details-body.open { display: block; }

.detail-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child { border-bottom: none; }
.detail-row label { color: var(--text-muted); min-width: 120px; flex-shrink: 0; }
.detail-row span { color: var(--text); word-break: break-word; flex: 1; }
.zusatz-row .zusatz-del-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 0.7rem; padding: 0 0.2rem; opacity: 0.4; line-height: 1;
}
.zusatz-row:hover .zusatz-del-btn { opacity: 1; color: var(--danger); }
.zusatz-add-wrap { padding-top: 0.4rem; }
.zusatz-add-btn {
  background: none; border: none; color: var(--primary); cursor: pointer;
  font-size: 0.78rem; padding: 0.2rem 0; opacity: 0.75;
}
.zusatz-add-btn:hover { opacity: 1; }
.zusatz-form { padding-top: 0.3rem; }
.zusatz-new-row input {
  flex: 1; min-width: 0; font-size: 0.82rem; padding: 0.25rem 0.5rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--card-bg); color: var(--text);
}
.zusatz-new-row input:focus { border-color: var(--primary); outline: none; }
.zusatz-form-actions { display: flex; gap: 0.4rem; padding-top: 0.35rem; }

/* ===== Tacho ===== */
.tacho-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.tacho-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.3rem; display: block; }

.tacho-input-wrap { display: flex; align-items: center; gap: 0.4rem; }
.tacho-input { flex: 1; }
.tacho-unit { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }

.tacho-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  text-align: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.tacho-stat-val   { font-size: 1.2rem; font-weight: 700; color: var(--blue); }
.tacho-stat-label { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; }
.tacho-delta-over  .tacho-stat-val { color: var(--orange); }
.tacho-delta-under .tacho-stat-val { color: #22c55e; }
.tacho-delta-ok    .tacho-stat-val { color: var(--blue); }

/* ===== Routes ===== */
.routen-gesamt-card {}

.routen-gesamt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  text-align: center;
}

.routen-gesamt-grid .gesamt-val { font-size: 1.4rem; font-weight: 800; color: var(--blue); }
.routen-gesamt-grid .gesamt-label { font-size: 0.75rem; color: var(--text-muted); }

.routen-rest-bar {
  background: var(--card-bg);
  border: 2px solid var(--blue);
  border-radius: 1rem;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
}

.routen-rest-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue);
  margin-bottom: 0.5rem;
}

.routen-rest-stats {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.routen-rest-etappen {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}

.route-erledigt {
  opacity: 0.5;
}

.route-done-badge {
  display: inline-block;
  background: #22c55e;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.1em 0.5em;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.route-card {
  background: var(--card-bg);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.route-strecke {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.route-arrow { color: var(--text-muted); }
.route-meta { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.info-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: 0.875rem;
  color: #9a3412;
}

@media (prefers-color-scheme: dark) {
  .info-box { background: #431407; border-color: #7c2d12; color: #fdba74; }
}

/* ===== Aktivitäten ===== */
.filter-bar { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }

.filter-btn {
  padding: 0.4rem 0.875rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  min-height: 36px;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}

.filter-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }

.stopp-section { margin-bottom: 1.25rem; }

.stopp-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.stopp-header h3 { font-size: 1rem; font-weight: 700; flex: 1; }
.stopp-chevron { color: var(--text-muted); font-size: 0.8rem; transition: transform 0.2s; }
.stopp-header.open .stopp-chevron { transform: rotate(180deg); }

.aktivitaet-item {
  background: var(--card-bg);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.aktivitaet-item.erledigt { opacity: 0.5; }

.aktivitaet-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.aktivitaet-check.checked { background: var(--blue); border-color: var(--blue); color: #fff; }

.aktivitaet-info { flex: 1; min-width: 0; }
.aktivitaet-name { font-size: 0.9rem; font-weight: 600; }
.aktivitaet-item.erledigt .aktivitaet-name { text-decoration: line-through; }
.aktivitaet-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.15rem; }
.aktivitaet-meta { display: flex; gap: 0.5rem; margin-top: 0.25rem; flex-wrap: wrap; }

.tageszeit-btns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.tageszeit-btn {
  padding: 0.35rem 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: 0.4rem;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.tageszeit-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.uhrzeit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.uhrzeit-sub-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.badge-kat-geplant { background: #eff6ff; color: #1d4ed8; font-size: 0.7rem; padding: 0.1rem 0.5rem; border-radius: 999px; font-weight: 600; }
.badge-kat-optional { background: #fefce8; color: #854d0e; font-size: 0.7rem; padding: 0.1rem 0.5rem; border-radius: 999px; font-weight: 600; }

.aktivitaet-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }

/* ===== Packliste ===== */
.progress-card { }
.progress-label { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.progress-bar-wrap { height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--blue), var(--orange)); border-radius: 999px; transition: width 0.4s ease; }

.packliste-kategorie { margin-bottom: 1rem; }

.packliste-kat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  cursor: pointer;
  user-select: none;
}

.packliste-kat-header h3 { font-size: 0.9rem; font-weight: 700; color: var(--text); flex: 1; }
.packliste-kat-count { font-size: 0.75rem; color: var(--text-muted); }

.pack-kat-checkbox {
  width: 1.1rem;
  height: 1.1rem;
  margin-right: 0.55rem;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}

.packliste-items { }

.pack-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

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

.pack-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 2px solid var(--border);
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.pack-checkbox.checked { background: var(--blue); border-color: var(--blue); color: #fff; }

.pack-name { flex: 1; font-size: 0.875rem; }
.pack-item.erledigt .pack-name { text-decoration: line-through; color: var(--text-muted); }

.pack-personal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.25rem 0 0.5rem;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
  border-radius: 0.4rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #1d4ed8;
}
.pack-personal-icon { font-size: 1rem; }
.pack-personal-sub { margin-left: auto; font-size: 0.75rem; font-weight: 400; color: #3b82f6; }

/* ===== Kosten ===== */
.sub-tabs {
  display: flex;
  gap: 0.375rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  margin-bottom: 1rem;
  scrollbar-width: none;
}

.sub-tabs::-webkit-scrollbar { display: none; }

.sub-tab-btn {
  padding: 0.4rem 0.875rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}

.sub-tab-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }

.kosten-overview-mini { }
.kosten-overview-mini .overview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}

.kosten-overview-mini .overview-row:last-child { border-bottom: none; }
.kosten-overview-mini .overview-total { font-weight: 700; font-size: 1rem; }
.kosten-overview-mini .overview-label { color: var(--text-muted); }
.kosten-overview-mini .overview-val { font-weight: 600; color: var(--text); }

.ausgleich-card { }
.ausgleich-person {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.ausgleich-person:last-child { border-bottom: none; }
.ausgleich-name { font-weight: 600; font-size: 0.9rem; }
.ausgleich-diff { font-size: 0.875rem; font-weight: 600; }
.ausgleich-diff.pos { color: var(--success); }
.ausgleich-diff.neg { color: var(--danger); }

.ausgleich-transfers { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.ausgleich-transfers h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-muted); }
.transfer-item { font-size: 0.875rem; padding: 0.25rem 0; }

.expense-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.expense-table th { text-align: left; padding: 0.5rem 0.25rem; color: var(--text-muted); font-size: 0.75rem; font-weight: 600; border-bottom: 2px solid var(--border); }
.expense-table td { padding: 0.5rem 0.25rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.expense-table tr:last-child td { border-bottom: none; }
.expense-actions-cell { display: flex; gap: 0.25rem; justify-content: flex-end; }

.kat-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
}

.kat-bar-label { font-size: 0.8rem; min-width: 130px; color: var(--text); display: flex; align-items: center; gap: 0.3rem; }
.kat-leer-details { margin-top: 0.75rem; border-top: 1px solid var(--border); padding-top: 0.5rem; }
.kat-leer-summary {
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0;
  user-select: none;
}
.kat-leer-summary::before { content: '▶'; font-size: 0.6rem; transition: transform 0.15s; }
details[open] .kat-leer-summary::before { transform: rotate(90deg); }
.kat-leer-body { padding-top: 0.5rem; }

.kat-icon-edit-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.05rem 0.2rem;
  transition: border-color 0.15s;
  flex-shrink: 0;
}
.kat-icon-edit-btn:hover { border-color: var(--border); background: var(--body-bg); }
.kat-icon-input {
  width: 2.4rem;
  font-size: 1rem;
  text-align: center;
  border: 1.5px solid var(--primary);
  border-radius: 5px;
  background: var(--card-bg);
  color: var(--text);
  padding: 0.05rem 0.1rem;
  outline: none;
}
.kat-bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.kat-bar-fill { height: 100%; background: var(--blue); border-radius: 999px; }
.kat-bar-val { font-size: 0.8rem; font-weight: 600; min-width: 60px; text-align: right; color: var(--text); }

/* ===== Infos ===== */
.info-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.info-table th { text-align: left; padding: 0.5rem 0.375rem; color: var(--text-muted); font-size: 0.75rem; font-weight: 600; border-bottom: 2px solid var(--border); }
.info-table td { padding: 0.5rem 0.375rem; border-bottom: 1px solid var(--border); }
.info-table tr:last-child td { border-bottom: none; }

.info-list { list-style: none; padding: 0; }
.info-list li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.info-list li:last-child { border-bottom: none; }

.notizen-feed {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.notizen-leer { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.notiz-eintrag {
  background: var(--body-bg);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
}
.notiz-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}
.notiz-autor {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
}
.notiz-datum {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex: 1;
}
.notiz-icon-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.72rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  line-height: 1.2;
  transition: color 0.15s, background 0.15s;
}
.notiz-edit-btn:hover { color: var(--primary); border-color: var(--primary); background: rgba(99,102,241,0.08); }
.notiz-del-btn:hover { color: var(--danger); border-color: var(--danger); background: rgba(220,38,38,0.07); }
.notiz-edit-textarea {
  width: 100%;
  min-height: 60px;
  font-size: 0.85rem;
  font-family: inherit;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  resize: vertical;
  margin-bottom: 0.4rem;
}
.notiz-edit-actions { display: flex; gap: 0.4rem; }
.notiz-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.notizen-new { border-top: 1px solid var(--border); padding-top: 0.65rem; }
.notizen-textarea {
  width: 100%;
  min-height: 60px;
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--body-bg);
  color: var(--text);
  resize: vertical;
  margin-bottom: 0.5rem;
}
.notizen-new-actions { display: flex; align-items: center; gap: 0.75rem; }
.notizen-status { font-size: 0.8rem; color: var(--success); }

/* ===== Wetter ===== */
.wetter-content { }
.wetter-tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.wetter-tag-card {
  background: var(--card-bg);
  border-radius: 0.75rem;
  padding: 0.875rem 0.75rem;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.wetter-tag-datum { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.wetter-tag-icon { font-size: 2rem; margin: 0.25rem 0; }
.wetter-tag-temp { font-size: 0.95rem; font-weight: 700; }
.wetter-tag-temp .max { color: var(--orange); }
.wetter-tag-temp .min { color: var(--blue); }
.wetter-tag-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.3rem; }
.wetter-tag-desc { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; }

.wetter-error { padding: 1rem; text-align: center; color: var(--text-muted); font-size: 0.875rem; }

/* ===== Settings Modal ===== */
.modal-settings { max-height: 85vh; overflow-y: auto; }

.settings-section { margin-bottom: 1.25rem; }
.settings-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.settings-info-row {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.backup-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 400px; overflow-y: auto; padding-right: 2px; }
.backup-loading { font-size: 0.85rem; color: var(--text-muted); padding: 0.5rem 0; }

.backup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
}
.backup-item-date { font-size: 0.88rem; font-weight: 600; }
.backup-item-size { font-size: 0.72rem; color: var(--text-muted); }

.backup-status {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.3rem;
}
.backup-status-ok  { background: #dcfce7; color: #15803d; }
.backup-status-err { background: #fee2e2; color: #b91c1c; }

@media (prefers-color-scheme: dark) {
  .backup-status-ok  { background: #14532d; color: #86efac; }
  .backup-status-err { background: #7f1d1d; color: #fca5a5; }
}

/* ===== Modals ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}

@media (min-width: 480px) {
  .modal-overlay { align-items: center; }
}

.modal {
  background: var(--card-bg);
  border-radius: 1.25rem 1.25rem 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  animation: slideUp 0.2s ease;
}

@media (min-width: 480px) {
  .modal { border-radius: 1.25rem; }
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-muted); padding: 0.25rem; border-radius: 0.25rem; min-height: 36px; min-width: 36px; display: flex; align-items: center; justify-content: center; }

/* ===== Forms ===== */
.form-group { margin-bottom: 0.875rem; }

.neue-kat-wrap {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.3rem; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--body-bg);
  color: var(--text);
  min-height: 44px;
  transition: border-color 0.15s;
}

.form-input:focus, .form-select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79,107,58,0.18); }

.form-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
.form-actions .btn { flex: 1; }

/* ===== Tricount: Salden ===== */
.saldo-card {
  background: var(--card-bg);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 0.625rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.saldo-card-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
}
.saldo-card-clickable:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.12); transform: translateY(-1px); }
.saldo-card-clickable:active { transform: translateY(0); }

/* Person-Detail-Modal */
.modal-person-detail { max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-person-detail .modal-header { flex-shrink: 0; }
.person-detail-summary { flex-shrink: 0; margin-bottom: 0.75rem; }
.pd-summary-row { display: flex; gap: 0.5rem; justify-content: space-between; }
.pd-stat { flex: 1; background: var(--body-bg); border-radius: 8px; padding: 0.5rem 0.6rem; text-align: center; }
.pd-stat-val { font-size: 1rem; font-weight: 700; }
.pd-stat-val.pos { color: var(--success); }
.pd-stat-val.neg { color: var(--danger); }
.pd-stat-label { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }
.person-detail-body { overflow-y: scroll; -webkit-overflow-scrolling: touch; flex: 1; min-height: 0; }
.pd-kat-section { background: var(--body-bg); border-radius: 8px; overflow: hidden; margin-bottom: 0.5rem; }
.pd-kat-section:last-child { margin-bottom: 0; }
.pd-kat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--border);
  color: var(--text);
  width: 100%;
  border: none;
  cursor: pointer;
  text-align: left;
}
.pd-kat-right { display: flex; align-items: center; gap: 0.5rem; }
.pd-kat-sum { font-variant-numeric: tabular-nums; }
.pd-kat-chevron { font-size: 0.65rem; color: var(--text-muted); }
.pd-kat-items-collapsed { display: none; }
.pd-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.4rem;
  align-items: baseline;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}
.pd-item-desc { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-item-date { color: var(--text-muted); font-size: 0.72rem; white-space: nowrap; }
.pd-item-betrag { font-weight: 600; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }

.saldo-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
  color: #fff;
}

.saldo-avatar.pos { background: var(--success); }
.saldo-avatar.neg { background: var(--danger); }
.saldo-avatar.zero { background: var(--text-muted); }

.saldo-info { flex: 1; min-width: 0; }
.saldo-name { font-weight: 700; font-size: 0.95rem; }
.saldo-details { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.1rem; }

.saldo-betrag {
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
}

.saldo-betrag.pos { color: var(--success); }
.saldo-betrag.neg { color: var(--danger); }
.saldo-betrag.zero { color: var(--text-muted); }

.saldo-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  margin-top: 0.4rem;
  overflow: hidden;
}

.saldo-bar { height: 100%; border-radius: 999px; max-width: 100%; }
.saldo-bar.pos { background: var(--success); }
.saldo-bar.neg { background: var(--danger); }

.kosten-gesamt-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.kosten-stat-card {
  background: var(--card-bg);
  border-radius: 0.875rem;
  padding: 0.875rem 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.kosten-stat-val { font-size: 1.25rem; font-weight: 800; color: var(--blue); }
.kosten-stat-label { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ===== Ausgaben Filterleiste ===== */
.ausgaben-filter-bar {
  display: flex;
  gap: 0.375rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  margin-bottom: 0.875rem;
  scrollbar-width: none;
  align-items: center;
}

.ausgaben-filter-bar::-webkit-scrollbar { display: none; }

.ausgaben-filter-bar .filter-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.ausgaben-filter-bar .add-kat-btn {
  flex-shrink: 0;
  padding: 0.3rem 0.625rem;
  border-radius: 999px;
  border: 1px dashed var(--border);
  background: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  min-height: 34px;
  white-space: nowrap;
}

.ausgaben-filter-bar .add-kat-btn:hover { border-color: var(--blue); color: var(--blue); }

/* ===== Tricount: Ausgaben-Liste ===== */
.expense-item {
  background: var(--card-bg);
  border-radius: 0.875rem;
  padding: 0.875rem 1rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
}

.expense-kat-icon {
  width: 38px;
  height: 38px;
  border-radius: 0.625rem;
  background: var(--body-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.expense-item-body { flex: 1; min-width: 0; }
.expense-item-title { font-weight: 600; font-size: 0.9rem; }
.expense-item-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }
.expense-item-split { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }

.expense-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; flex-shrink: 0; }
.expense-item-betrag { font-weight: 800; font-size: 1rem; white-space: nowrap; }
.expense-item-actions { display: flex; gap: 0.25rem; }

/* ===== Tricount: Ausgleich ===== */
.transfer-suggest {
  background: var(--card-bg);
  border-radius: 0.875rem;
  padding: 1rem 1.25rem;
  margin-bottom: 0.625rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.transfer-suggest-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.transfer-person-chip {
  background: var(--body-bg);
  border-radius: 0.5rem;
  padding: 0.3rem 0.625rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.transfer-arrow { color: var(--text-muted); font-size: 1rem; }
.transfer-betrag { font-size: 1.1rem; font-weight: 800; color: var(--blue); margin-left: auto; }

.transfer-suggest .btn { width: 100%; }

.settlement-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.settlement-history-item:last-child { border-bottom: none; }
.settlement-history-left { flex: 1; }
.settlement-history-who { font-weight: 600; }
.settlement-history-date { font-size: 0.72rem; color: var(--text-muted); }
.settlement-history-betrag { font-weight: 700; color: var(--success); white-space: nowrap; }

/* ===== Tricount: Expense Form Erweiterungen ===== */
.teilnehmer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.teilnehmer-chip {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
  user-select: none;
}

.teilnehmer-chip.selected {
  border-color: var(--blue);
  background: #eff6ff;
  color: var(--blue);
}

@media (prefers-color-scheme: dark) {
  .teilnehmer-chip.selected { background: #1e3a5f; color: #60a5fa; }
}

.split-type-toggle {
  display: flex;
  gap: 0.5rem;
}

.split-type-btn {
  flex: 1;
  padding: 0.5rem;
  border: 2px solid var(--border);
  border-radius: 0.625rem;
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
  transition: all 0.15s;
}

.split-type-btn.active {
  border-color: var(--blue);
  background: #eff6ff;
  color: var(--blue);
}

@media (prefers-color-scheme: dark) {
  .split-type-btn.active { background: #1e3a5f; color: #60a5fa; }
}

.custom-splits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.custom-split-item label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; display: block; margin-bottom: 0.2rem; }
.custom-split-item input { width: 100%; }

.split-sum-info {
  font-size: 0.8rem;
  padding: 0.4rem 0.625rem;
  border-radius: 0.4rem;
  font-weight: 600;
}

.split-sum-info.ok { background: #f0fdf4; color: var(--success); }
.split-sum-info.err { background: #fef2f2; color: var(--danger); }

/* ===== Wetter Tageszeiten ===== */
.wetter-tageszeiten {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.25rem;
}


.wetter-tageszeit-card {
  background: linear-gradient(160deg, #4a90c4 0%, #2e6fa3 100%);
  border-radius: 0.625rem;
  padding: 0.625rem 0.5rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.wetter-tageszeit-card .wetter-tageszeit-label,
.wetter-tageszeit-card .wetter-tageszeit-zeit,
.wetter-tageszeit-card .wetter-tageszeit-temp,
.wetter-tageszeit-card .wetter-tageszeit-desc,
.wetter-tageszeit-card .wetter-tageszeit-wind {
  color: #fff;
}

.wetter-tageszeit-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.wetter-tageszeit-zeit {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.wetter-tageszeit-icon {
  font-size: 2.1rem;
  line-height: 1;
  display: block;
  text-align: center;
  margin: 0.15rem auto;
}

.wetter-tageszeit-temp {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}

.wetter-tageszeit-desc {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  word-break: break-word;
}

.wetter-tageszeit-wind {
  font-size: 0.62rem;
  color: var(--text-muted);
}

/* ===== Aktivitäten Tag-Gruppen ===== */
.aktivitaet-tag-section {
  margin-bottom: 0.25rem;
}

.aktivitaet-tag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.5rem 0.4rem 0;
  border-bottom: 1px solid var(--border-color, #eee);
  margin-bottom: 0.25rem;
}

.aktivitaet-tag-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.aktivitaet-add-tag-btn {
  font-size: 0.85rem;
  padding: 0.1rem 0.4rem;
  min-height: unset;
  line-height: 1.4;
  color: var(--primary);
  opacity: 0.7;
}
.aktivitaet-add-tag-btn:hover { opacity: 1; }

.aktivitaet-tag-items { padding-left: 0; }

.aktivitaet-tag-empty {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.4rem 0 0.5rem 0.25rem;
  font-style: italic;
}

/* ===== Nextcloud Card ===== */
/* ===== App Tiles ===== */
.app-tiles-card { padding-bottom: 1rem; }

.app-tiles-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

@keyframes tile-wiggle {
  0%, 100% { transform: rotate(-1.2deg); }
  50%       { transform: rotate(1.2deg); }
}

.app-tiles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}

.app-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  aspect-ratio: 1;
  background: var(--tc, var(--bg-secondary, #eee));
  border-radius: 14px;
  text-decoration: none;
  padding: 0.4rem 0.25rem;
  transition: transform 0.12s, filter 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.app-tile:active { transform: scale(0.91); filter: brightness(0.88); }

.app-tiles-grid.edit-mode .app-tile {
  animation: tile-wiggle 0.35s ease-in-out infinite;
  cursor: default;
}
.app-tiles-grid.edit-mode .app-tile:nth-child(even) {
  animation-delay: 0.18s;
}

.tile-remove-btn {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c0392b;
  color: #fff;
  border: 1.5px solid #fff;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.tile-add-btn {
  background: none !important;
  border: 1.5px dashed rgba(128,128,128,0.35);
  animation: none !important;
  cursor: pointer;
}
.tile-add-btn .app-tile-icon { color: var(--text-muted); font-style: normal; opacity: 0.6; }
.tile-add-btn .app-tile-name { color: var(--text-muted); opacity: 0.6; }
.tile-add-btn:hover { border-color: rgba(128,128,128,0.6); background: rgba(128,128,128,0.06) !important; }

.tile-active-edit { outline: 2px solid rgba(255,255,255,0.7); }

/* Tile edit panel */
.tile-edit-panel {
  margin-top: 0.75rem;
  padding: 0.875rem;
  background: var(--bg-secondary, #f3f4f6);
  border-radius: 10px;
}
.tile-edit-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}
.tile-edit-emoji {
  width: 3rem;
  height: 3rem;
  font-size: 1.35rem;
  text-align: center;
  border: 1.5px solid var(--border-color, #ddd);
  border-radius: 10px;
  background: var(--card-bg);
  flex-shrink: 0;
  padding: 0;
}
.tile-edit-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.tile-edit-input { font-size: 0.85rem !important; padding: 0.45rem 0.6rem !important; }
.tile-edit-color {
  width: 2.6rem;
  height: 3rem;
  border: 1.5px solid var(--border-color, #ddd);
  border-radius: 10px;
  cursor: pointer;
  padding: 0.2rem;
  flex-shrink: 0;
  background: none;
}
.tile-edit-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.app-tile-icon { font-size: 1.55rem; line-height: 1; }

.tile-logo {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  border-radius: 0.25rem;
  filter: drop-shadow(0 1px 5px rgba(0,0,0,0.38)) drop-shadow(0 4px 14px rgba(0,0,0,0.26)) drop-shadow(0 8px 22px rgba(0,0,0,0.15));
}

.app-tile-name {
  font-size: 0.6rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  word-break: break-word;
  hyphens: auto;
}

/* ===== Nextcloud ===== */
.nextcloud-card { padding: 0.6rem 1rem; }

.nextcloud-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0;
}

.nextcloud-header-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  padding: 0.25rem 0.25rem;
  margin: -0.25rem -0.25rem;
  transition: background 0.15s;
}
.nextcloud-header-link:hover { background: var(--body-bg); }

.nextcloud-icon { font-size: 1.75rem; line-height: 1; }

.nextcloud-title { font-weight: 700; font-size: 1rem; }
.nextcloud-sub { font-size: 0.75rem; color: var(--text-muted); }

.nextcloud-pencil-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.3;
  padding: 0.25rem;
  line-height: 1;
  transition: opacity 0.2s;
  align-self: flex-start;
}
.nextcloud-pencil-btn:hover { opacity: 0.75; }

.nextcloud-actions { display: flex; flex-direction: column; gap: 0.5rem; }

.nextcloud-pass-display {
  margin-top: 0.6rem;
  padding: 0.55rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  font-family: monospace;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  color: var(--text);
  text-align: center;
  word-break: break-all;
}

/* Nachweis / Attachments */
.nachweis-existing {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--bg-secondary, #f5f5f5);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}
.nachweis-existing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.nachweis-info { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.nachweis-icon { flex-shrink: 0; }
.nachweis-name { font-size: 0.8rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.nachweis-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }
.btn-danger-ghost { color: var(--danger, #e53935); }
.btn-danger-ghost:hover { background: rgba(229,57,53,.08); }
.nachweis-upload-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1.5px dashed var(--border-color, #ddd);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.nachweis-upload-label:hover { border-color: var(--primary, #1976d2); background: rgba(25,118,210,.04); }
.nachweis-upload-text { font-size: 0.85rem; color: var(--text-muted); }
.nachweis-selected { font-size: 0.82rem; color: var(--text-secondary, #555); margin-top: 0.35rem; padding: 0 0.25rem; }
.nachweis-badge { text-decoration: none; font-size: 0.9rem; margin-left: 0.25rem; opacity: 0.7; }
.nachweis-badge:hover { opacity: 1; }
.nachweis-modal-preview {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 6px;
  cursor: zoom-in;
  display: block;
}
.expense-item-clickable { cursor: pointer; }
.expense-item-clickable:hover .expense-item-title { text-decoration: underline; text-decoration-color: var(--border); }

.sprit-stats-card {
  background: var(--card-bg);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.sprit-stats-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}
.sprit-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}
.sprit-stat {
  background: var(--body-bg);
  border-radius: 0.625rem;
  padding: 0.6rem 0.75rem;
  text-align: center;
}
.sprit-stat-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.sprit-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.sprit-stat-good .sprit-stat-val { color: var(--success); }
.sprit-stat-bad  .sprit-stat-val { color: var(--danger); }

.sprit-details-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.sprit-field-label { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.sprit-badge { font-size: 0.72rem; color: var(--text-muted); margin-left: 0.4rem; white-space: nowrap; }

/* ===== Utilities ===== */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }

/* ===== Twemoji ===== */
img.emoji {
  height: 1em;
  width: 1em;
  margin: 0 0.05em 0 0.1em;
  vertical-align: -0.1em;
  display: inline-block;
}

/* ===== Lightbox ===== */
.lightbox-overlay {
  align-items: center !important;
  background: rgba(0,0,0,0.9) !important;
  padding: 0 !important;
  cursor: zoom-out;
}
.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 1.3rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 201;
  transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }
.lightbox-img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  object-fit: contain;
  display: block;
  cursor: default;
}
.lightbox-pdf {
  width: min(90vw, 820px);
  height: 88vh;
  border: none;
  border-radius: 8px;
  background: #fff;
  cursor: default;
}

/* Nachweis Thumbnail in Ausgabenliste */
.nachweis-thumb-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  margin-top: 0.4rem;
  display: inline-block;
}
.nachweis-thumb {
  height: 60px;
  width: auto;
  max-width: 90px;
  border-radius: 6px;
  border: 1.5px solid var(--border-color, #ddd);
  object-fit: cover;
  display: block;
  transition: opacity 0.15s, transform 0.15s;
}
.nachweis-thumb:hover { opacity: 0.82; transform: scale(1.05); }
.nachweis-pdf-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  background: #f5f0ff;
  color: #6b21a8;
  border: 1.5px solid #d8b4fe;
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  transition: background 0.15s;
}
.nachweis-pdf-icon:hover { background: #ede9fe; }

/* ===== Länder-Accordion (Infos-Tab) ===== */
.land-accordion {
  border-bottom: 1px solid var(--border-color, #eee);
}
.land-accordion:last-child { border-bottom: none; }
.land-accordion-header {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 0.25rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}
.land-accordion-header::-webkit-details-marker { display: none; }
.land-accordion-header::after {
  content: '›';
  margin-left: auto;
  transition: transform 0.2s;
  font-size: 1.1rem;
  color: var(--text-muted);
}
details[open] .land-accordion-header::after { transform: rotate(90deg); }
.land-accordion-body { padding-bottom: 0.75rem; }
.land-table {
  width: 100%;
  border-collapse: collapse;
}
.land-table td {
  padding: 0.35rem 0.25rem;
  vertical-align: top;
  font-size: 0.88rem;
  border: none;
  line-height: 1.5;
}
.land-icon {
  width: 2rem;
  text-align: center;
  font-size: 1rem;
  padding-top: 0.38rem !important;
}
.land-table a { color: var(--primary, #1976d2); }

/* ===== Kilometer-Log pro Etappe ===== */
.route-card-header { cursor: pointer; user-select: none; }
.route-tacho-chevron {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: normal;
  color: var(--text-muted);
  flex-shrink: 0;
}
.route-meta { margin-bottom: 0.5rem !important; }
.etappe-tacho-row {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.22s ease, margin-bottom 0.22s ease;
  margin-bottom: 0;
}
.route-card.tacho-expanded .etappe-tacho-row {
  max-height: 120px;
  margin-bottom: 0.75rem;
}
.etappe-tacho-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  display: block;
}
.etappe-km-compare {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
  padding: 0.4rem 0.65rem;
  background: var(--bg-secondary, #f5f5f5);
  border-radius: 8px;
  font-size: 0.8rem;
}
.km-compare-item { color: var(--text-muted); }
.km-compare-item strong { color: var(--text); }
.km-delta-badge {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 20px;
  white-space: nowrap;
}
.km-delta-over  { background: rgba(249,115,22,0.15);  color: var(--orange, #f97316); }
.km-delta-under { background: rgba(22,163,74,0.15);   color: #22c55e; }
.km-delta-ok    { background: rgba(79,107,58,0.18);  color: var(--blue, #2E86AB); }

.station-placeholder { color: var(--text-muted); font-size: 0.875rem; padding: 0.5rem 0; }

/* ===== Posten-Zuordnung Modal ===== */
.modal-posten { max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-posten .modal-header { flex-shrink: 0; }
.modal-posten .form-actions { flex-shrink: 0; }
.posten-scroll-area { flex: 1; min-height: 0; overflow-y: scroll; -webkit-overflow-scrolling: touch; }

.posten-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 0.5rem 0 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
  gap: 0.5rem;
  flex-shrink: 0;
}
.posten-info-name { font-weight: 600; }
.posten-info-total {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-size: 0.85rem;
}
.posten-gesamt-input {
  width: 5.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.15rem 0.4rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  text-align: right;
}
.posten-gesamt-input:focus { border-color: var(--primary); outline: none; }

.posten-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.posten-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem 0.6rem;
  background: var(--body-bg);
  border-radius: 8px;
}
.posten-row-top {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.posten-row-bottom {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.posten-name-input {
  flex: 1;
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  min-width: 0;
}
.posten-preis-input {
  width: 6.5rem;
  flex-shrink: 0;
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  text-align: right;
}
.posten-person-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  flex: 1;
  min-width: 0;
}
.posten-chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.4;
  min-width: 2.2rem;
  text-align: center;
}
.posten-chip:hover { border-color: var(--primary); color: var(--primary); }
.posten-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.posten-chip-alle { min-width: 3rem; font-weight: 700; }
.posten-delete-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem 0.3rem;
  border-radius: 4px;
  line-height: 1;
}
.posten-delete-btn:hover { color: var(--danger); background: rgba(220,53,69,0.08); }
.posten-add-strip {
  display: flex;
  justify-content: center;
  padding: 0.25rem 0 0.5rem;
}
.btn-xs {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
}
.posten-delta-bar {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  margin-bottom: 0.6rem;
  font-size: 0.82rem;
}
.posten-delta-bar.delta-ok { background: rgba(40,167,69,0.1); }
.posten-delta-bar.delta-pos { background: rgba(255,153,0,0.1); }
.posten-delta-bar.delta-neg { background: rgba(220,53,69,0.08); }
.posten-delta-amounts { display: flex; gap: 1rem; flex-wrap: wrap; }
.posten-delta-gap { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.posten-delta-status { font-weight: 600; }
.posten-delta-status.ok { color: var(--success); }
.posten-delta-status.pos { color: #e07b00; }
.posten-delta-status.neg { color: var(--danger); }

.posten-summary {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-bottom: 0.5rem;
}
.posten-summary-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.posten-summary-grid { display: flex; flex-direction: column; gap: 0.25rem; }
.posten-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.15rem 0;
}
.posten-summary-person { font-weight: 500; }
.posten-summary-betrag { color: var(--text); font-weight: 600; }
.posten-unassigned { color: var(--danger); font-size: 0.78rem; }

/* ===== Scan-Posten Aufschlüsselung ===== */
.sp-section { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 0.875rem; }
.sp-toggle-header { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 0.55rem 0.75rem; background: var(--body-bg); border: none; cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--text); text-align: left; gap: 0.5rem; }
.sp-header-chevron { color: var(--text-muted); font-size: 0.65rem; }
.sp-body { padding: 0.4rem; display: flex; flex-direction: column; gap: 0.3rem; }
.sp-body-hidden { display: none; }
.sp-person-block { border-radius: 6px; overflow: hidden; background: var(--card-bg); }
.sp-person-toggle { width: 100%; display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.6rem; background: none; border: none; cursor: pointer; font-size: 0.82rem; }
.sp-person-name { flex: 1; font-weight: 600; color: var(--text); text-align: left; }
.sp-person-total { font-variant-numeric: tabular-nums; color: var(--primary); font-weight: 600; }
.sp-chevron { font-size: 0.6rem; color: var(--text-muted); }
.sp-items { padding: 0.2rem 0.6rem 0.45rem 0.6rem; display: flex; flex-direction: column; gap: 0.15rem; border-top: 1px solid var(--border); }
.sp-items-hidden { display: none; }
.sp-item { display: flex; align-items: baseline; gap: 0.4rem; font-size: 0.78rem; padding: 0.1rem 0; }
.sp-item-name { flex: 1; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sp-split-info { font-size: 0.7rem; opacity: 0.7; }
.sp-item-amt { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); }

/* ===== DDay: Unterkunft bearbeiten ===== */
.unterkunft-edit-row { display: flex; gap: .5rem; padding: 0 1.25rem 1rem; flex-wrap: wrap; }
.unterkunft-edit-row .btn { flex: 1; min-width: 8rem; font-size: .8rem; }
.unterkunft-offen-hint {
  margin: 0 1.25rem .75rem; padding: .6rem .75rem; border-radius: .6rem;
  background: #fef3c7; color: #92400e; font-size: .85rem;
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.modal-unterkunft { max-height: 90vh; overflow-y: auto; }
.page-header-add { margin-left: auto; }
@media (prefers-color-scheme: dark) {
  .unterkunft-offen-hint, .badge-offen { background: #422006; color: #fcd34d; }
}

/* ===== DDay: Gezeiten ===== */
.gezeiten-table { font-size: .8rem; margin-bottom: .75rem; }
.gezeiten-table td, .gezeiten-table th { vertical-align: top; padding: .45rem .3rem; }
.gezeiten-table td:last-child, .gezeiten-table th:last-child { text-align: right; white-space: nowrap; }
.gezeiten-hinweise li { font-size: .82rem; }
.gezeiten-quelle { font-size: .72rem; color: var(--text-muted); margin-top: .5rem; }
.gezeiten-table td:first-child { white-space: nowrap; }

/* ===== DDay: Tab-Leiste mit 8 Tabs ===== */
.tab-btn { min-width: 0; }
@media (max-width: 420px) {
  .tab-label { font-size: 0.52rem; }
  .tab-icon { font-size: 1.1rem; }
}

/* ===== DDay: Offline-Banner & Toasts ===== */
.offline-banner {
  position: sticky; top: 0; z-index: 300;
  background: #7c2d12; color: #fff; text-align: center;
  font-size: .8rem; font-weight: 600; padding: .45rem .75rem;
}
body.is-offline .fab, body.is-offline #add-unterkunft-btn, body.is-offline #add-bier-btn,
body.is-offline #add-expense-btn, body.is-offline #scan-beleg-btn { opacity: .45; }
.toast-container {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tab-height) + var(--safe-bottom) + 12px);
  z-index: 400; display: flex; flex-direction: column; gap: .4rem;
  width: min(92vw, 420px); pointer-events: none;
}
.toast {
  background: #1f2937; color: #fff; border-radius: .75rem; padding: .65rem .9rem;
  font-size: .85rem; box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: opacity .4s, transform .4s;
}
.toast-warn { background: #92400e; }
.toast-out { opacity: 0; transform: translateY(8px); }
@media (min-width: 640px) { .toast-container { bottom: 24px; } }

/* ===== DDay: Heute / Als Nächstes ===== */
.heute-item {
  display: flex; align-items: center; gap: .6rem; padding: .5rem .25rem;
  border-bottom: 1px solid var(--border);
}
.heute-item:last-child { border-bottom: none; }
.heute-zeit { width: 2.9rem; flex-shrink: 0; font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; }
.heute-body { flex: 1; min-width: 0; }
.heute-name { font-size: .88rem; line-height: 1.3; }
.heute-optional { font-size: .68rem; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 .35rem; }
.heute-tag {
  display: inline-block; font-size: .68rem; font-weight: 700; color: var(--blue-dark);
  background: rgba(79,107,58,.14); border-radius: 999px; padding: .05rem .5rem; margin-bottom: .15rem;
}
.heute-tag-jetzt { color: #fff; background: var(--blue); }
.heute-next { background: rgba(79,107,58,.07); border-radius: .6rem; }
.heute-jetzt { background: rgba(217,162,63,.14); border-radius: .6rem; }
.heute-vorbei { opacity: .45; }
.heute-ohne { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin: .6rem 0 .1rem; }
.heute-actions { display: flex; gap: .25rem; flex-shrink: 0; }
.heute-btn {
  display: inline-flex; align-items: center; gap: 1px; background: var(--body-bg); border: 1px solid var(--border);
  border-radius: .5rem; padding: .3rem .4rem; font-size: .9rem; cursor: pointer; text-decoration: none; color: var(--text);
}
.heute-btn small, .ticket-btn small { font-size: .65rem; font-weight: 700; margin-left: 1px; }

/* ===== DDay: Auto ===== */
.auto-info { margin-bottom: .6rem; }
.auto-wann { font-weight: 600; font-size: .9rem; }
.auto-notiz { font-size: .85rem; margin-top: .15rem; }
.auto-genau { font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }
.auto-btns { display: flex; gap: .5rem; margin-bottom: .75rem; }
.auto-btns .btn:not(.btn-icon) { flex: 1; }
.auto-parken { display: flex; gap: .5rem; margin-top: .5rem; }
.auto-parken .form-input { flex: 1; min-width: 0; }
.auto-parken .btn { white-space: nowrap; }

/* ===== DDay: Tickets ===== */
.badge-gebucht { font-size: .68rem; font-weight: 600; color: #166534; background: #dcfce7; border-radius: 999px; padding: .05rem .45rem; }
.ticket-btn { opacity: .55; }
.ticket-btn.hat-tickets { opacity: 1; }
.tickets-gebucht-row { display: flex; align-items: center; gap: .6rem; font-weight: 600; margin-bottom: .75rem; cursor: pointer; }
.tickets-gebucht-row input { width: 1.2rem; height: 1.2rem; accent-color: var(--blue); }
.tickets-liste { margin-bottom: .75rem; }
.ticket-item { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.ticket-vorschau {
  width: 4rem; height: 4rem; flex-shrink: 0; border: 1px solid var(--border); border-radius: .5rem;
  overflow: hidden; background: var(--body-bg); cursor: pointer; padding: 0;
}
.ticket-vorschau img { width: 100%; height: 100%; object-fit: cover; }
.ticket-pdf { font-size: .75rem; font-weight: 700; }
.ticket-info { flex: 1; min-width: 0; }
.ticket-name { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-von { font-size: .72rem; color: var(--text-muted); }
#tickets-upload-label.busy { opacity: .5; pointer-events: none; }

/* ===== DDay: Wetter Sonne ===== */
.wetter-stadt-zeile { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; font-size: .78rem; font-weight: 600; color: var(--text-muted); margin-bottom: .5rem; }
.sonne-zeile { font-size: .78rem; color: var(--text-muted); font-weight: 600; }

/* ===== DDay: Bierpass ===== */
.bier-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: .5rem; }
.bier-stat { text-align: center; background: var(--body-bg); border-radius: .75rem; padding: .6rem .3rem; }
.bier-stat-name { font-size: .75rem; font-weight: 600; color: var(--text-muted); }
.bier-stat-val { font-size: 1.35rem; font-weight: 800; color: var(--blue); }
.bier-stat-sub { font-size: .68rem; color: var(--text-muted); }
.bier-filter { overflow-x: auto; flex-wrap: nowrap; }
.bier-card {
  display: flex; gap: .75rem; background: var(--card-bg); border-radius: 1rem; padding: .75rem;
  margin-bottom: .75rem; box-shadow: 0 1px 4px rgba(0,0,0,0.06); position: relative;
}
.bier-rang { position: absolute; top: .4rem; left: .5rem; z-index: 1; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.bier-bild {
  width: 5.5rem; height: 7rem; flex-shrink: 0; border-radius: .6rem; overflow: hidden; border: none; padding: 0;
  background: linear-gradient(160deg, #f6d365, #d9a23f); display: flex; align-items: center; justify-content: center; font-size: 2.2rem;
}
.bier-bild[data-bier-bild] { cursor: zoom-in; }
.bier-bild img { width: 100%; height: 100%; object-fit: cover; }
.bier-info { flex: 1; min-width: 0; }
.bier-name { font-weight: 700; font-size: 1rem; }
.bier-meta { font-size: .75rem; color: var(--text-muted); margin-top: .1rem; }
.bier-schnitt { font-size: .8rem; font-weight: 700; margin-top: .25rem; }
.sterne { color: #d9a23f; letter-spacing: 1px; }
.bier-trinker { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.bier-chip { font-size: .72rem; background: var(--body-bg); border: 1px solid var(--border); border-radius: 999px; padding: .1rem .5rem; }
.bier-chip-ich { border-color: var(--blue); }
.bier-notiz { font-size: .78rem; font-style: italic; margin-top: .3rem; }
.bier-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.bier-bewerten { display: inline-flex; }
.stern-btn { background: none; border: none; color: #d1d5db; font-size: 1.15rem; line-height: 1; padding: .1rem; cursor: pointer; }
.stern-btn.an { color: #d9a23f; }
.stern-btn.gross { font-size: 1.8rem; }
.bier-edit { margin-left: auto; }
.bier-foto-label { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; cursor: pointer; }
.bier-foto-vorschau {
  width: 4.5rem; height: 5.5rem; border-radius: .6rem; overflow: hidden; flex-shrink: 0;
  background: var(--body-bg); border: 2px dashed var(--border); display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.bier-foto-vorschau img { width: 100%; height: 100%; object-fit: cover; }
.bier-foto-text { font-size: .85rem; font-weight: 600; color: var(--blue); }
@media (prefers-color-scheme: dark) {
  .badge-gebucht { background: #14532d; color: #bbf7d0; }
  .stern-btn { color: #4b5563; }
}
.bier-sorte-filter { margin: -.25rem 0 .75rem; }

.heute-mehr {
  display: block; width: 100%; margin-top: .4rem; padding: .45rem; border: none; border-radius: .6rem;
  background: var(--body-bg); color: var(--blue); font-weight: 600; font-size: .8rem; cursor: pointer;
}
.bier-preis { color: var(--text); font-weight: 600; }
