/* =====================================================
   Snow&Fun Hohenberg e.V.  Design Tokens & Components
   app.css v1.0 | Mobile-First Design System
   ===================================================== */

/*  FONTS  */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&display=swap');

/*  TOKENS  */
:root {
  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;

  /* Primrfarben */
  --primary:       #1358A5;
  --primary-dark:  #0C447C;
  --primary-light: #e6f0fb;

  /* Hintergrnde */
  --bg:            #f0f4fa;
  --surface:       #eef1f6;
  --card:          #ffffff;

  /* Status */
  --success:       #3B6D11;
  --warning:       #EF9F27;
  --error:         #E24B4A;
  --muted:         #7a96b8;
  --disabled:      #b0c2db;

  /* Text */
  --text:          #1a1f2e;
  --text-muted:    #7a96b8;
  --text-light:    #94a3b8;

  /* Badge Fills & Texts */
  --badge-blue-fill:   #e6f0fb;
  --badge-blue-text:   #0C447C;
  --badge-green-fill:  #eaf3de;
  --badge-green-text:  #27500A;
  --badge-yellow-fill: #faeeda;
  --badge-yellow-text: #633806;
  --badge-red-fill:    #fcebeb;
  --badge-red-text:    #791F1F;
  --badge-gray-fill:   #f1efe8;
  --badge-gray-text:   #444441;

  /* Status Dots */
  --dot-green:  #3B6D11;
  --dot-yellow: #EF9F27;
  --dot-red:    #E24B4A;
  --dot-gray:   #b0c2db;
  --dot-blue:   #1358A5;

  /* Radien */
  --r-chip:   5px;
  --r-input:  8px;
  --r-btn:    9px;
  --r-card:   11px;
  --r-sheet:  18px;
  --r-pill:   20px;
  --r-full:   50%;

  /* Abstnde */
  --card-p:   12px;
  --gap:      8px;
  --gap-lg:   10px;

  /* Borders */
  --border:   0.5px solid rgba(0,0,0,0.07);
  --border-input: 1.5px solid #e2e8f0;

  /* Fortschrittsbalken */
  --progress-h: 4px;
}

/*  RESET  */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  font-family: var(--font-sans);
  color: var(--text);
  overscroll-behavior: none;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }

/*  SAFE AREAS  */
.safe-top    { padding-top: max(13px, env(safe-area-inset-top)); }
.safe-bottom { padding-bottom: max(16px, env(safe-area-inset-bottom)); }

/*  TOPBAR  */
.topbar {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: max(13px, env(safe-area-inset-top));
}

.topbar-title {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.topbar-logo {
  height: 36px;
  width: auto;
}

.topbar-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.18);
  border: none;
  border-radius: var(--r-input);
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
}

.topbar-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.18);
  border: none;
  border-radius: var(--r-input);
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  gap: 5px;
  font-size: 13px;
}

/*  BOTTOM NAV  */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: var(--border);
  display: flex;
  z-index: 98;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px 8px;
  cursor: pointer;
  gap: 3px;
  border: none;
  background: none;
  font-family: var(--font-sans);
}

.nav-icon {
  width: 22px;
  height: 22px;
  color: var(--muted);
  stroke-width: 1.5;
}

.nav-label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}

.nav-item.active .nav-icon,
.nav-item.active .nav-label {
  color: var(--primary);
}

.nav-item.active .nav-label {
  font-weight: 500;
}

/*  FAB  */
.fab {
  position: fixed;
  bottom: calc(64px + env(safe-area-inset-bottom) + 12px);
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: var(--primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 8px rgba(19,88,165,0.35);
  z-index: 90;
  transition: transform 0.15s, box-shadow 0.15s;
}

.fab:active {
  transform: scale(0.95);
  box-shadow: 0 1px 4px rgba(19,88,165,0.25);
}

/*  KARTEN  */
.card {
  background: var(--card);
  border: var(--border);
  border-radius: var(--r-card);
  padding: var(--card-p);
  margin-bottom: var(--gap);
}

/*  BUTTONS  */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--r-btn);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--card);
  color: var(--primary);
  border: 0.5px solid var(--primary);
}

.btn-destructive {
  background: var(--error);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 7px;
}

.btn-lg {
  padding: 13px 20px;
  font-size: 15px;
  width: 100%;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: var(--font-sans);
}

.btn-icon-blue {
  background: var(--badge-blue-fill);
  color: var(--primary-dark);
}

.btn-icon-green {
  background: var(--badge-green-fill);
  color: var(--badge-green-text);
}

.btn-icon-red {
  background: var(--badge-red-fill);
  color: var(--badge-red-text);
}

.btn-icon-gray {
  background: var(--surface);
  color: var(--text-muted);
}

/*  BADGES / PILLS  */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-blue   { background: var(--badge-blue-fill);   color: var(--badge-blue-text); }
.badge-green  { background: var(--badge-green-fill);  color: var(--badge-green-text); }
.badge-yellow { background: var(--badge-yellow-fill); color: var(--badge-yellow-text); }
.badge-red    { background: var(--badge-red-fill);    color: var(--badge-red-text); }
.badge-gray   { background: var(--badge-gray-fill);   color: var(--badge-gray-text); }
.badge-dark   { background: var(--primary);           color: #fff; }

/*  STATUS DOTS  */
.dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  display: inline-block;
  flex-shrink: 0;
}

.dot-green  { background: var(--dot-green); }
.dot-yellow { background: var(--dot-yellow); }
.dot-red    { background: var(--dot-red); }
.dot-gray   { background: var(--dot-gray); }
.dot-blue   { background: var(--dot-blue); }

/*  SECTION LABEL  */
.section-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 18px 0 8px;
}

.section-label:first-child { margin-top: 4px; }

/*  SEITENINHALT  */
.page-content {
  padding: 12px 14px;
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 80px;
}

/*  CHIPS (Filter)  */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  border: 0.5px solid transparent;
  background: var(--surface);
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--font-sans);
  transition: background 0.12s, color 0.12s;
}

.chip.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
  font-weight: 500;
}

/*  FORMULARE  */
.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: var(--border-input);
  border-radius: var(--r-input);
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--card);
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

/*  SHEETS / MODALS  */
.sheet-bg {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  background: var(--card);
  width: 100%;
  max-width: 600px;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: 0 16px max(24px, env(safe-area-inset-bottom));
  animation: slideUp 0.22s ease;
  max-height: 92vh;
  overflow-y: auto;
}

.sheet-full {
  max-height: 100dvh;
  border-radius: 0;
  padding-top: max(16px, env(safe-area-inset-top));
}

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

.sheet-handle {
  width: 32px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin: 10px auto 16px;
}

.sheet-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/*  LEER-ZUSTAND  */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-icon {
  color: var(--disabled);
  margin-bottom: 12px;
}

.empty-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

/*  FORTSCHRITTSBALKEN  */
.progress-bar {
  height: var(--progress-h);
  border-radius: 2px;
  background: var(--surface);
  overflow: hidden;
}

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

/*  SPINNER  */
.spinner {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/*  LINIE TRENNER  */
.divider {
  border: none;
  border-top: var(--border);
  margin: 12px 0;
}

/*  BESTTIGUNG INLINE (kein confirm())  */
.confirm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--badge-red-fill);
  border-radius: var(--r-input);
  margin-top: 8px;
  font-size: 12px;
  color: var(--badge-red-text);
}

/*  CHEVRON LISTE  */
.chevron-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: var(--border);
  cursor: pointer;
}

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

.chevron-list-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-input);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary-light);
  color: var(--primary);
}

.chevron-list-text {
  flex: 1;
}

.chevron-list-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.chevron-list-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/*  MODULE GRID (2-Spalten)  */
.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-lg);
}

.module-card {
  background: var(--card);
  border: var(--border);
  border-radius: var(--r-card);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s;
}

.module-card:active { transform: scale(0.97); }

.module-card-icon {
  width: 28px;
  height: 28px;
  font-size: 28px;
  color: var(--primary);
  margin: 0 auto 8px;
}

.module-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.module-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/*  LOGIN FORMULAR  */
.login-input {
  width: 100%;
  padding: 12px 14px;
  border: var(--border-input);
  border-radius: 10px;
  font-size: 15px;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--card);
  outline: none;
  transition: border-color 0.15s;
}

.login-input:focus { border-color: var(--primary); }

/*  TOPBAR TABS (alte Tab-Bar ersetzt durch Bottom-Nav)  */
.tab-chips {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--card);
  border-bottom: var(--border);
}

.tab-chips::-webkit-scrollbar { display: none; }

/* Aktions-Chip-Leiste (horizontal scrollbar mit Auslauf) */
.action-chips {
  display: flex;
  gap: 7px;
  padding: 10px 14px 10px 14px;
  padding-right: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--card);
  border-bottom: var(--border);
}
.action-chips::-webkit-scrollbar { display: none; }

/*  UTILITY  */
.text-muted    { color: var(--text-muted); }
.text-primary  { color: var(--primary); }
.text-success  { color: var(--success); }
.text-warning  { color: var(--warning); }
.text-error    { color: var(--error); }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

.fs-10 { font-size: 10px; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-18 { font-size: 18px; }
.fs-22 { font-size: 22px; }

.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap    { display: flex; align-items: center; gap: 8px; }
.flex-col    { display: flex; flex-direction: column; }
.flex-1      { flex: 1; }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }

.w-full { width: 100%; }
