@font-face{font-family:Inter;src:url('fonts/inter.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap;}
/* ==========================================================================
   DLRG Design Tokens – gemeinsame Basis für alle DLRG-Apps
   Hinweis: Farbwerte sind Näherungen an das DLRG-Rot/-Gelb. Bitte einmalig
   mit dem offiziellen Corporate-Design-Handbuch abgleichen und hier anpassen –
   alle Apps ziehen die Änderung automatisch mit.
   ========================================================================== */

:root {
  /* Marke */
  /* Werte übernommen aus den bestehenden Apps (Equipment, Fahrtenbuch, Kostenordnung, Protokoll) */
  --dlrg-red:         #E2001A;
  --dlrg-red-dark:    #B8001A;
  --dlrg-red-light:   #FDE8EA;
  --dlrg-yellow:      #F9B000;
  --dlrg-yellow-dark: #C68A00;
  --dlrg-yellow-light:#FFF3D6;

  /* Neutrale Farben */
  --gray-900: #1F2937;
  --gray-700: #374151;
  --gray-500: #6B7280;
  --gray-300: #D1D5DB;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;
  --gray-50:  #F9FAFB;
  --white:    #FFFFFF;

  /* Status */
  --success: #1E7B34;  --success-bg: #E6F4EA;
  --warning: #8A6100;  --warning-bg: #FFF6BF;
  --danger:  #B3050F;  --danger-bg:  #FDE8EA;
  --info:    #0B5CAD;  --info-bg:    #E5F0FB;

  /* Semantische Rollen (in Apps diese verwenden, nicht die Rohfarben) */
  --color-primary:        var(--dlrg-red);
  --color-primary-hover:  var(--dlrg-red-dark);
  --color-on-primary:     var(--white);
  --color-accent:         var(--dlrg-yellow);
  --color-on-accent:      var(--gray-900);
  --color-bg:             var(--gray-50);
  --color-surface:        var(--white);
  --color-text:           var(--gray-900);
  --color-text-muted:     var(--gray-500);
  --color-border:         var(--gray-200);
  --color-border-strong:  var(--gray-300);
  --color-focus:          #0B5CAD;

  /* Typografie */
  --font-sans: Inter, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --text-xs: .75rem;  --text-sm: .875rem; --text-md: 1rem;
  --text-lg: 1.25rem; --text-xl: 1.5rem;  --text-2xl: 2rem;
  --weight-regular: 400; --weight-medium: 600; --weight-bold: 700;
  --leading: 1.5;

  /* Abstände (4px-Raster) */
  --space-1: .25rem; --space-2: .5rem;  --space-3: .75rem; --space-4: 1rem;
  --space-5: 1.5rem; --space-6: 2rem;   --space-7: 3rem;

  /* Form */
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px; --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.06);
  --shadow-2: 0 4px 12px rgba(0,0,0,.12);

  /* Layout */
  --header-height: 56px;
  --touch-min: 44px;           /* Mindestgröße für Touch-Ziele */
  --content-max: 1100px;
}

/* Dunkles Theme: automatisch oder per <html data-theme="dark"> */
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #121417; --color-surface: #1C2025;
    --color-text: #EDEFF1; --color-text-muted: #9AA1AA;
    --color-border: #2E343B; --color-border-strong: #444C55;
    --color-primary: #FF4D58; --color-primary-hover: #FF7079;
    --color-on-primary: #1A1D21; --color-focus: #6FB1F5;
    --success-bg: #12301B; --warning-bg: #3A2F00; --danger-bg: #3A1216; --info-bg: #11283F;
    --success: #6BD58A; --warning: #FFD500; --danger: #FF8089; --info: #7DB9F5;
    --dlrg-red-light: #3A1216; --dlrg-yellow-light: #3A2F00;
  }
}
:root[data-theme="dark"] {
  --color-bg: #121417; --color-surface: #1C2025;
  --color-text: #EDEFF1; --color-text-muted: #9AA1AA;
  --color-border: #2E343B; --color-border-strong: #444C55;
  --color-primary: #FF4D58; --color-primary-hover: #FF7079;
  --color-on-primary: #1A1D21; --color-focus: #6FB1F5;
  --success-bg: #12301B; --warning-bg: #3A2F00; --danger-bg: #3A1216; --info-bg: #11283F;
  --success: #6BD58A; --warning: #FFD500; --danger: #FF8089; --info: #7DB9F5;
  --dlrg-red-light: #3A1216; --dlrg-yellow-light: #3A2F00;
}
/* ==========================================================================
   DLRG Komponenten – benötigt dlrg-tokens.css
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-sans); font-size: var(--text-md);
  line-height: var(--leading); color: var(--color-text); background: var(--color-bg);
}
h1,h2,h3,h4 { line-height: 1.25; margin: 0 0 var(--space-3); font-weight: var(--weight-bold); }
h1 { font-size: var(--text-xl); } h2 { font-size: var(--text-lg); } h3 { font-size: 1.0625rem; }
p { margin: 0 0 var(--space-4); }
a { color: var(--color-primary); }
a:hover { color: var(--color-primary-hover); }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.muted { color: var(--color-text-muted); }
.container { max-width: var(--content-max); margin: 0 auto; padding: var(--space-5) var(--space-4); }
.stack > * + * { margin-top: var(--space-4); }
.row { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- App-Header (rot, gelber Akzentstreifen) ---- */
.app-header {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: var(--space-3);
  box-sizing: border-box; min-height: calc(var(--header-height) + 4px); padding: 0 14px;
  background: var(--dlrg-red); color: var(--white);
  border-bottom: 4px solid var(--dlrg-yellow); box-shadow: var(--shadow-1);
}
.app-header__logo { height: 34px; width: auto; display: block; }
.app-header__title { font-size: var(--text-lg); font-weight: var(--weight-bold); margin: 0; flex: 1; }
.app-header a, .app-header button { color: inherit; }
.app-header .btn--ghost { color: var(--white); border-color: rgba(255,255,255,.6); }
.app-header .btn--ghost:hover { background: rgba(255,255,255,.15); }

/* ---- Navigation ---- */
.nav { display: flex; gap: var(--space-1); flex-wrap: wrap; padding: var(--space-2) var(--space-4);
  background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.nav a { display: inline-flex; align-items: center; min-height: var(--touch-min); padding: 0 var(--space-4);
  border-radius: var(--radius-md); color: var(--color-text); text-decoration: none; font-weight: var(--weight-medium); }
.nav a:hover { background: var(--color-bg); }
.nav a[aria-current="page"] { background: var(--dlrg-red-light); color: var(--color-primary); box-shadow: inset 0 -3px 0 var(--color-primary); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--touch-min); padding: 0 var(--space-5); border-radius: var(--radius-md);
  border: 2px solid transparent; font: inherit; font-weight: var(--weight-medium);
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s;
}
.btn--primary { background: var(--color-primary); color: var(--color-on-primary); }
.btn--primary:hover { background: var(--color-primary-hover); color: var(--color-on-primary); }
.btn--accent  { background: var(--color-accent); color: var(--color-on-accent); }
.btn--accent:hover { background: var(--dlrg-yellow-dark); color: var(--color-on-accent); }
.btn--secondary { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn--secondary:hover { background: var(--dlrg-red-light); }
.btn--ghost { background: transparent; color: var(--color-text); border-color: var(--color-border-strong); }
.btn--ghost:hover { background: var(--color-bg); }
.btn--sm { min-height: 36px; padding: 0 var(--space-3); font-size: var(--text-sm); }
.btn--block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ---- Karten ---- */
.card { background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: var(--space-5); }
.card--accent { border-top: 4px solid var(--dlrg-red); }
.card__title { margin-bottom: var(--space-2); }

/* ---- Formulare ---- */
.field { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-4); }
.field label { font-weight: var(--weight-medium); }
.field .hint { font-size: var(--text-sm); color: var(--color-text-muted); }
.field .error { font-size: var(--text-sm); color: var(--danger); font-weight: var(--weight-medium); }
.input, .select, .textarea {
  width: 100%; min-height: var(--touch-min); padding: var(--space-2) var(--space-3);
  font: inherit; color: var(--color-text); background: var(--color-surface);
  border: 2px solid var(--color-border-strong); border-radius: var(--radius-md);
}
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--color-focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-focus) 30%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.check { display: flex; align-items: center; gap: var(--space-3); min-height: var(--touch-min); }
.check input { width: 22px; height: 22px; accent-color: var(--color-primary); }

/* ---- Badges / Hinweise ---- */
.badge { display: inline-block; padding: 2px var(--space-3); border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: var(--weight-bold); background: var(--color-bg); color: var(--color-text); }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--danger  { background: var(--danger-bg);  color: var(--danger); }
.badge--info    { background: var(--info-bg);    color: var(--info); }
.badge--brand   { background: var(--dlrg-red); color: var(--white); }

.alert { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  border-left: 6px solid currentColor; font-weight: var(--weight-medium); }
.alert--success { background: var(--success-bg); color: var(--success); }
.alert--warning { background: var(--warning-bg); color: var(--warning); }
.alert--danger  { background: var(--danger-bg);  color: var(--danger); }
.alert--info    { background: var(--info-bg);    color: var(--info); }

/* ---- Tabellen ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; font-size: 14px; text-align: left; border-bottom: 1px solid var(--color-border); }
.table th { background: var(--color-bg); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-muted); }
.table tbody tr:hover { background: var(--color-bg); }
.table tr:last-child td { border-bottom: 0; }

/* ---- Modal (mit <dialog>) ---- */
dialog.modal { border: 0; border-radius: var(--radius-lg); padding: var(--space-5); max-width: 480px; width: calc(100% - 2rem);
  background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-2); border-top: 6px solid var(--dlrg-red); }
dialog.modal::backdrop { background: rgba(0,0,0,.5); }

/* ---- Footer ---- */
.app-footer { padding: var(--space-5) var(--space-4); text-align: center; font-size: var(--text-sm); color: var(--color-text-muted); }

@media (max-width: 600px) {
  h1 { font-size: var(--text-lg); }
  .container { padding: var(--space-4) var(--space-3); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ==========================================================================
   App-Frame (Standard-Layout aller DLRG-Apps): Header · Sidebar · Inhalt · Bottom-Nav
   ========================================================================== */
.app-header { gap: var(--space-3); }
/* Logo: immer erstes Element links im Header, feste Höhe 38px, weißer Chip */
.app-header__logo-chip { display:flex; align-items:center; justify-content:center; background:#fff; border-radius: 6px; padding: 2px 5px; height: 38px; flex-shrink:0; }
.app-header__logo-chip img { height: 34px; width:auto; display:block; }
.app-header__brand { display:flex; flex-direction:column; line-height:1.2; min-width:0; }
.app-header__brand strong { font-size: 15px; font-weight: 800; white-space:nowrap; }
.app-header__brand span { font-size: 11px; color: rgba(255,255,255,.85); white-space:nowrap; }
.app-header__spacer { flex: 1; }
.app-header__user { font-size: var(--text-sm); font-weight: var(--weight-medium); color: rgba(255,255,255,.9); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:160px; }
.app-header .btn--header { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); color:#fff; min-height:34px; height:34px; padding:0 12px; font-size:13px; font-weight:600; border-radius:8px; gap:6px; }
.app-header .btn--header:hover { background: rgba(255,255,255,.28); }
.app-header__menu { display:none; background:transparent; border:0; color:#fff; width:var(--touch-min); height:var(--touch-min); cursor:pointer; }

.app-shell { display:flex; min-height: calc(100vh - 60px); }
.app-main { flex:1; min-width:0; padding: var(--space-5); }
.app-main > .container { padding: 0; margin: 0; max-width: var(--content-max); }

.sidebar { width: 252px; flex-shrink:0; background: var(--color-surface); border-right: 1px solid var(--color-border); display:flex; flex-direction:column; }
.side-nav { flex:1; padding: var(--space-3); display:flex; flex-direction:column; gap: 2px; overflow-y:auto; }
.side-nav a { display:flex; align-items:center; gap: var(--space-3); min-height: var(--touch-min); padding: 0 var(--space-3);
  border-radius: var(--radius-md); border-left: 4px solid transparent; color: var(--gray-700); text-decoration:none; font-size: var(--text-sm); font-weight: var(--weight-medium); }
.side-nav a svg { width:20px; height:20px; flex-shrink:0; stroke: currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; color: var(--color-text-muted); }
.side-nav a:hover { background: var(--gray-100); color: var(--color-text); }
.side-nav a[aria-current="page"] { background: var(--dlrg-red-light); color: var(--color-primary); border-left-color: var(--color-primary); }
.side-nav a[aria-current="page"] svg { color: var(--color-primary); }
.side-section { margin-top: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-1); border-top: 1px solid var(--color-border);
  font-size: 11px; font-weight: var(--weight-bold); letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); }
.side-user { display:flex; align-items:center; gap: var(--space-3); padding: var(--space-4); border-top: 1px solid var(--color-border); background: var(--gray-50); }
.side-user__avatar { width:32px; height:32px; border-radius:50%; background: var(--color-primary); color:#fff; display:flex; align-items:center; justify-content:center; font-weight: var(--weight-bold); font-size: var(--text-sm); flex-shrink:0; }
.side-user__name { font-size: var(--text-sm); font-weight: var(--weight-medium); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.side-user__role { font-size: var(--text-xs); color: var(--color-text-muted); }

.page-head { display:flex; align-items:flex-start; justify-content:space-between; gap: var(--space-4); margin-bottom: var(--space-5); flex-wrap:wrap; }
.page-head h1 { margin: 0 0 var(--space-1); }
.page-head p { margin:0; color: var(--color-text-muted); }

.bottom-nav { display:none; position:fixed; left:0; right:0; bottom:0; z-index:50; background: var(--color-surface); border-top:1px solid var(--color-border);
  padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav__items { display:flex; height:64px; }
.bottom-nav a { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; color: var(--gray-500); text-decoration:none; font-size:10px; font-weight: var(--weight-medium); }
.bottom-nav a svg { width:20px; height:20px; stroke: currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.bottom-nav a[aria-current="page"] { color: var(--color-primary); }

/* Login-Maske (einheitlich für alle Apps): roter Kopfbereich mit Logo + App-Name, zentrierte Karte */
.login-page { min-height:100vh; display:flex; flex-direction:column; background: var(--color-bg); }
.login-header { height:64px; background: var(--color-primary); border-bottom:3px solid var(--dlrg-yellow); color:#fff; display:flex; align-items:center; gap:12px; padding:0 24px; flex-shrink:0; }
.login-header__chip { display:flex; align-items:center; background:#fff; border-radius:6px; padding:2px 5px; height:44px; }
.login-header__chip img { height:40px; width:auto; object-fit:contain; display:block; }
.login-header__name { font-size:20px; font-weight:600; }
.login-main { flex:1; display:flex; align-items:center; justify-content:center; padding: var(--space-4); }
.login-wrap { width:100%; max-width:420px; }
.login-box { padding: var(--space-6, 32px); }
.login-box h1 { font-size: var(--text-xl, 24px); margin-bottom: var(--space-1); }
.login-box .login-sub { color: var(--color-text-muted); margin-bottom: var(--space-4); }
.login-box .alert { margin-bottom: var(--space-4); }
.login-footer { margin-top: var(--space-4); font-size: var(--text-xs); color: var(--color-text-muted); text-align:center; }
@media (max-width:767px) { .login-header { padding:0 16px; } .login-header__name { font-size:17px; } .login-box { padding: var(--space-5, 24px); } }

/* Mobil: Sidebar wird zum ausklappbaren Menü, Bottom-Nav erscheint */
@media (max-width: 1023px) {
  .app-header__menu { display:flex; align-items:center; justify-content:center; }
  .sidebar { position:fixed; inset:60px auto 0 0; z-index:40; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-2); }
  .sidebar.is-open { transform:none; }
  .bottom-nav { display:block; }
  .app-main { padding: var(--space-4) var(--space-3) calc(64px + var(--space-5)); }
}
@media (max-width: 640px) { .app-header__user, .app-header__brand span { display:none; } }

/* ==========================================================================
   Weitere Bausteine (Vorlage 06.11.2026): Leerzustand, Skelett, Toast, Tabellen-Aktionen
   ========================================================================== */
.empty { text-align:center; padding: var(--space-7) var(--space-4); color: var(--color-text-muted); }
.empty svg { width:40px; height:40px; stroke: currentColor; fill:none; stroke-width:1.5; margin-bottom: var(--space-3); }
.empty h3 { color: var(--color-text); margin-bottom: var(--space-1); }
.skeleton { background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius-md); min-height: 16px; }
@keyframes sk { to { background-position: -200% 0; } }
.toast-stack { position: fixed; top: 72px; right: var(--space-4); z-index: 100; display:flex; flex-direction:column; gap: var(--space-2); }
.toast { min-width: 260px; max-width: 360px; padding: var(--space-3) var(--space-4); background: var(--color-surface); border:1px solid var(--color-border); border-left: 4px solid var(--info); border-radius: var(--radius-md); box-shadow: var(--shadow-2); font-size: var(--text-sm); }
.toast--success { border-left-color: var(--success); } .toast--danger { border-left-color: var(--danger); } .toast--warning { border-left-color: var(--warning); }
.table .actions { display:flex; gap: var(--space-1); justify-content:flex-end; }
.icon-btn { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius: var(--radius-md); border:1px solid var(--color-border-strong); background: var(--color-surface); color: var(--gray-700); cursor:pointer; }
.icon-btn:hover { background: var(--gray-100); } .icon-btn svg { width:18px; height:18px; stroke: currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.icon-btn--danger { color: var(--danger); }
.btn svg { width:18px; height:18px; stroke: currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.btn--sm { min-height:36px; }

/* Kennzahl-Kachel: Beschriftung oben, Wert darunter, linksbündig */
.stat-tile { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: 16px 20px; }
.stat-tile__label { font-size: 13px; font-weight: 500; color: var(--color-text-muted); }
.stat-tile__value { font-size: 28px; font-weight: 700; line-height: 1.2; margin-top: 4px; }
.card__title, .card > h2:first-child, .card > h3:first-child { font-size: 16px; font-weight: 600; }
