/* =====================================================
   Snow&Fun Hohenberg e.V.  theme.css v2.0
   Wird als LETZTES Stylesheet in jeder Seite geladen und
   vereinheitlicht Seiten mit eigenen Styles (Topbar, Schrift).
   ===================================================== */

@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("/intern/assets/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("/intern/assets/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-style: normal; font-display: swap; src: url("/intern/assets/fonts/barlow-condensed-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: normal; font-display: swap; src: url("/intern/assets/fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 500 600; font-style: normal; font-display: swap; src: url("/intern/assets/fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-style: normal; font-display: swap; src: url("/intern/assets/fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }

body {
  font-family: "Source Sans 3", "Source Sans Pro", Arial, system-ui, sans-serif;
  color: #0F1F3A;
  -webkit-text-size-adjust: 100%;
}

/* Eingaben mind. 16px: verhindert automatisches Zoomen auf dem iPhone */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select, textarea {
  font-size: max(16px, 1em);
}

/* ---------- Topbar: weiss mit Band blau/rot ---------- */
.topbar {
  background: #FFFFFF !important;
  color: #0F1F3A !important;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: none !important;
  min-height: 60px;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, #1E90D5 0, #1E90D5 50%, #CC2222 50%, #CC2222 100%);
  pointer-events: none;
}

.topbar-inner { padding-bottom: 14px !important; padding-top: 8px; min-height: 52px; }

.topbar-title {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif !important;
  font-weight: 700 !important;
  font-size: 22px !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #0F1F3A !important;
}

.topbar-sub { color: #5B6778 !important; font-size: 14px !important; }

.topbar > svg { stroke: #1672AE; }

/* Icon-Buttons und Links in der Topbar: dunkel auf hellblau, 44px */
.topbar a:not(.btn),
.topbar button:not(.btn):not(.add-btn),
.topbar .back-btn,
.topbar .topbar-help {
  color: #0F1F3A !important;
  background: #E9F4FC !important;
  border: none !important;
  border-radius: 9px !important;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px !important;
  font-size: 15px !important;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
}

.topbar .topbar-back { padding: 0 !important; width: 44px; }

.topbar .add-btn,
.topbar .btn-primary {
  background: #1672AE !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 9px !important;
  min-height: 44px;
  padding: 0 14px !important;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif !important;
  font-weight: 700 !important;
  font-size: 17px !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar select,
.topbar input {
  background-color: #FFFFFF !important;
  color: #0F1F3A !important;
  border: 1.5px solid #C9D9E8 !important;
  border-radius: 9px !important;
  min-height: 44px;
}

.topbar input::placeholder { color: #5B6778 !important; }

/* Elemente mit fest eingetragenem Weiss-auf-Blau in der Topbar */
.topbar [style*="255,255,255"],
.topbar [style*="255, 255, 255"],
.topbar [style*="color:#fff"],
.topbar [style*="color: #fff"],
.topbar [style*="color:white"],
.topbar [style*="color: white"] {
  color: #0F1F3A !important;
}


/* Topbar mit innerem Wrapper (.topbar-inner) */
.topbar:has(> .topbar-inner) { padding: 0 !important; display: block; }
.topbar-inner {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) 12px 14px !important;
}
.topbar-inner .topbar-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .safe-top:empty { display: none; }

/* Oeffentlicher Schichtplan (Helfer-Link) */
.page-wrap > .header {
  background: #FFFFFF !important;
  color: #0F1F3A !important;
  position: relative;
  padding: 14px 16px 18px !important;
}
.page-wrap > .header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, #1E90D5 0, #1E90D5 50%, #CC2222 50%, #CC2222 100%);
}
.page-wrap > .header .header-title {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-weight: 800;
  font-size: 26px;
  line-height: 1;
  text-transform: uppercase;
}
.page-wrap > .header .header-sub,
.page-wrap > .header .header-meta { color: #5B6778; opacity: 1 !important; }
.page-wrap > .header [style*="255,255,255"] {
  color: #0F1F3A !important;
  background: #E9F4FC !important;
  border-color: #DBE8F3 !important;
}
.page-wrap > .header button { min-height: 40px; }
@media print { .page-wrap > .header::after { display: none; } }


/* ---------- Hinweis "Neue Version verfuegbar" (app-update.js) ---------- */
.app-update-hinweis {
  position: fixed;
  left: 12px; right: 12px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 300;
  max-width: 576px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  background: #FFFFFF;
  border: 1.5px solid #DBE8F3;
  border-top: 4px solid #1E90D5;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15,60,100,0.18);
  font-family: "Source Sans 3", Arial, sans-serif;
  color: #0F1F3A;
  animation: appUpdateEin 0.25s ease;
}
body:has(.bottom-nav) .app-update-hinweis { bottom: calc(84px + env(safe-area-inset-bottom)); }
.app-update-text { flex: 1; font-size: 16px; font-weight: 600; line-height: 1.3; }
.app-update-knopf {
  min-height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: 9px;
  background: #1672AE;
  color: #FFFFFF;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
}
@keyframes appUpdateEin { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@media print { .app-update-hinweis { display: none; } }


/* =====================================================
   DESKTOP ab 1024 px (desktop-nav.js setzt body.hat-seitenleiste)
   ===================================================== */
.sf-seitenleiste { display: none; }

@media (min-width: 1024px) {
  body.hat-seitenleiste { padding-left: 256px; background: #F7FAFD; }

  .sf-seitenleiste {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 256px;
    overflow-y: auto;
    background: #FFFFFF;
    border-right: 1.5px solid #DBE8F3;
    padding: 18px 14px 14px;
    z-index: 150;
    font-family: "Source Sans 3", Arial, sans-serif;
  }
  .sf-seitenleiste::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 4px;
    background: linear-gradient(90deg, #1E90D5 0, #1E90D5 50%, #CC2222 50%, #CC2222 100%);
  }
  .sf-sl-logo { display: block; margin: 6px 8px 14px; }
  .sf-sl-logo img { height: 50px; width: auto; display: block; }
  .sf-sl-gruppe {
    font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #5B6778;
    margin: 14px 12px 4px;
  }
  .sf-sl-punkt {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    color: #0F1F3A;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
  }
  .sf-sl-punkt svg { color: #5B6778; flex-shrink: 0; }
  .sf-sl-punkt:hover { background: #F2F7FB; }
  .sf-sl-punkt.aktiv { background: #E9F4FC; color: #1672AE; font-weight: 700; }
  .sf-sl-punkt.aktiv svg { color: #1672AE; }
  .sf-sl-benutzer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1.5px solid #DBE8F3;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .sf-sl-profil { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; color: #0F1F3A; padding: 4px; border-radius: 10px; }
  .sf-sl-profil:hover { background: #F2F7FB; }
  .sf-sl-avatar { width: 40px; height: 40px; border-radius: 50%; background: #1672AE; color: #FFFFFF; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .sf-sl-name { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
  .sf-sl-name span { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sf-sl-name small { font-size: 13px; color: #5B6778; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sf-sl-icon { width: 40px; height: 40px; border-radius: 9px; border: none; background: transparent; color: #5B6778; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
  .sf-sl-icon:hover { background: #E9F4FC; color: #0F1F3A; }

  /* Seitenkopf: Titel gross, Aktionen rechts, kein Zurueck-Knopf */
  body.hat-seitenleiste .topbar { padding: 14px 32px 18px !important; min-height: 84px; }
  body.hat-seitenleiste .topbar-inner { padding: 14px 32px 18px !important; }
  body.hat-seitenleiste .topbar .topbar-back,
  body.hat-seitenleiste .topbar .back-btn { display: none !important; }
  body.hat-seitenleiste .topbar-title { font-size: 34px !important; font-weight: 800 !important; letter-spacing: 0.02em; }

  /* Mehr Breite */
  body.hat-seitenleiste .page-content { max-width: 1120px; padding: 28px 32px 96px; }
  body.hat-seitenleiste .content { max-width: 1120px; padding-left: 32px; padding-right: 32px; }
  body.hat-seitenleiste .detail-content { max-width: 1120px; padding-left: 32px; padding-right: 32px; }
  body.hat-seitenleiste .tab-chips,
  body.hat-seitenleiste .action-chips,
  body.hat-seitenleiste .filter-bar { padding-left: 32px; padding-right: 32px; }
  body.hat-seitenleiste .module-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

  /* Navigation unten ist durch die Seitenleiste ersetzt */
  body.hat-seitenleiste .bottom-nav { display: none !important; }
  body.hat-seitenleiste .app-update-hinweis { left: 280px; bottom: 24px !important; }

  /* Plus-Knopf mit Beschriftung unten rechts */
  body.hat-seitenleiste .fab {
    width: auto;
    height: 52px;
    right: 32px;
    bottom: 32px !important;
    padding: 0 22px 0 18px;
    border-radius: 12px;
    gap: 8px;
  }
  body.hat-seitenleiste .fab::after {
    content: "Neu";
    font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
    font-weight: 700;
    font-size: 19px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  /* Fenster in der Bildschirmmitte statt von unten */
  .sheet-bg { align-items: center; padding: 24px; }
  .sheet { border-radius: 20px; max-width: 640px; max-height: 88vh; padding-top: 22px; }
  .sheet .sheet-handle { display: none; }
  body.hat-seitenleiste .sheet-bg { padding-left: 280px; }
  /* Vollbild-Detailansichten (Inventar, Projekte, Preislisten, Getraenkeabrechnung) lassen die Seitenleiste frei */
  body.hat-seitenleiste .detail-view,
  body.hat-seitenleiste .detail-panel { left: 256px !important; }
  body.hat-seitenleiste .detail-view > .topbar { padding-left: 32px !important; padding-right: 32px !important; }
}

/* ---------- Ueberschriften in Hilfeseiten & Altseiten ---------- */
.hero h1, .kapitel-titel, .chapter-title, .section-title {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
}

/* ---------- Druck: Band ausblenden ---------- */
@media print {
  .topbar::after { display: none; }
}
