/* ================================================================
   FWS Oberberg Eigenleistungs-Portal — Corporate Design
   Basiert auf dem Corporate Design Manual FWS Oberberg (Stand 2025)
   Hausschrift: Alegreya Sans | Primärfarben: Rot, Orange, Grün
   ================================================================ */


/* ================================================================
   SKIP NAVIGATION LINK (WCAG 2.4.1)
   ================================================================ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: #1a1a2e;
  color: #ffffff;
  z-index: 9999;
  font-weight: 700;
  outline: 3px solid #F59D08;
  text-decoration: none;
}

/* ================================================================
   DESIGN TOKENS — FWS Oberberg (einzige Quelle)
   Farb-Rollen, Typo-, Spacing-, Radius- & Schatten-Skala.
   CI-treu: kein CI-fremdes Blau; Info neutral; Charts = CI-Infografik.
   Siehe design-review/ (Design-System-Pass).
   ================================================================ */
:root {
  /* Marke */
  --c-red:        #D41031;   /* CI Rot · Marke/CTA */
  --c-red-700:    #A00D26;   /* Rot Hover (dunkler, kontraststark) */
  --c-red-900:    #7D181C;   /* Dunkelrot · Sidebar */
  --c-red-50:     #FBEAEA;   /* Marken-Tint (aktive Nav, Badges) */
  --c-orange:     #F59D08;   /* CI Orange · Portal-Aktion */
  --c-orange-700: #C87D06;   /* Orange Hover */
  --c-orange-50:  #FDEFDA;   /* Orange-Tint */
  --c-sage:       #B8C098;   /* CI Grün · dekorativ */
  --c-sage-700:   #8A9570;   /* Grün dunkel */
  --c-sage-100:   #EEF1E6;   /* Grün-Tint */

  /* Neutral & Flächen (Text = CI 80 % Schwarz) */
  --ink:            #333333; /* Text */
  --ink-muted:      #6B655C; /* Sekundär */
  --ink-subtle:     #8F8880; /* Tertiär/Meta */
  --surface:        #FFFFFF; /* Card-BG / Text auf Farbe */
  --bg:             #F8F6F0; /* Seiten-BG (warmes Papier) */
  --surface-sunken: #F3F1EA; /* eingelassene Flächen */
  --border:         #E2DFD8; /* Standard-Rahmen */
  --border-strong:  #CCC9C0; /* kräftigerer Rahmen / Inputs */

  /* Status (Info neutral statt blau; Punkt + Text, nie nur Farbe) */
  --success: #2E7D32;  --success-bg: #E8F0E3;
  --warning: #B3660A;  --warning-bg: #FDEFDA;   /* offen / teilweise */
  --danger:  #C62828;  --danger-bg:  #FBEAEA;
  --info:    #4A453E;  --info-bg:    #F3F1EA;    /* neutral */

  /* Charts (CI-Infografik-Palette, feste Reihenfolge) */
  --chart-1: #D41031; --chart-2: #F59D08; --chart-3: #7D181C;
  --chart-4: #334C68; --chart-5: #B8C098; --chart-6: #5D6FB4;

  /* Typografie · Alegreya Sans */
  --font: 'Alegreya Sans', system-ui, -apple-system, sans-serif;
  --fs-xs:   0.75rem;   /* 12px · Tabellen-Header, Labels */
  --fs-sm:   0.875rem;  /* 14px · Sekundär, Meta */
  --fs-base: 1rem;      /* 16px · Body */
  --fs-lg:   1.125rem;  /* 18px */
  --fs-xl:   1.375rem;  /* 22px · Card-Titel */
  --fs-2xl:  1.75rem;   /* 28px · Abschnitt */
  --fs-3xl:  2.25rem;   /* 36px · Seiten-H1 */
  --fs-stat: 2.5rem;    /* 40px · Kennzahlen */
  --lh-tight: 1.15; --lh-snug: 1.35; --lh-normal: 1.55;
  --tracking-caps: 0.04em;

  /* Spacing · 4px-Basis */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  /* Radius / Elevation / Fokus */
  --r-sm: 4px; --r: 6px; --r-lg: 10px;
  --sh-sm: 0 1px 2px rgba(51,40,30,0.06);
  --sh:    0 2px 8px rgba(51,40,30,0.08);
  --sh-md: 0 6px 20px rgba(51,40,30,0.10);
  --focus: 0 0 0 3px rgba(212,16,49,0.30);

  /* Layout (unverändert) */
  --container-max: 1200px;
  --container-pad: 1.25rem 2.375rem;
  --col-gap:       2rem;
  --sidebar-width: 240px;
  --header-height: 68px;
  --transition:    150ms ease;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: 400;
  color: var(--ink);
  background-color: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--c-red); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--c-red-700); }

img { max-width: 100%; height: auto; display: block; }

/* ================================================================
   TYPOGRAFIE (CI: Alegreya Sans, 80% Schwarz)
   Headlines: Bold + Versalien; Subheadlines: Light; Body: Regular
   ================================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 0.5em;
}

/* CI: Headlines in Versalien */
h1 {
  font-size: var(--fs-3xl);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5, h6 { font-size: var(--fs-base); }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

small { font-size: var(--fs-sm); }
.text-muted { color: var(--ink-subtle); }
.text-sm    { font-size: var(--fs-sm); }
.text-xs    { font-size: var(--fs-xs); }

/* ================================================================
   LAYOUT
   ================================================================ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--container-pad);
}

.page-content {
  padding: 2rem;
  max-width: 100%;
}

/* ================================================================
   HEADER (Family layout)
   CI: weißer Header, Logo oben, roter Akzent
   ================================================================ */
.site-header {
  background: var(--surface);
  color: var(--ink);
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--sh-sm);
  border-bottom: 3px solid var(--c-red);
}

.site-header .brand {
  display: flex;
  align-items: center;
  margin-right: auto;
  text-decoration: none;
  flex-shrink: 0;
}

.site-header .brand img {
  height: 42px;
  width: auto;
}

.site-header .brand-sub {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--ink-subtle);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  list-style: none;
}

.header-nav a {
  color: var(--ink-muted);
  padding: 0.5rem 0.875rem;
  border-radius: var(--r);
  font-size: var(--fs-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.header-nav a:hover {
  background: var(--surface-sunken);
  color: var(--ink);
}

.header-nav a.active {
  background: var(--c-red-50);
  color: var(--c-red);
  font-weight: 700;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--ink-subtle);
  min-width: 0;
  flex-shrink: 1;
}

.header-user > span {
  margin-right: 0.5rem;
}

/* Header icon buttons (logout + hamburger) */
.header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  color: var(--ink-muted);
  font-size: 1.25rem;
  border-radius: var(--r);
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}
.header-icon-btn:hover {
  background: var(--surface-sunken);
  color: var(--ink);
}

/* Hamburger (mobile) */
.hamburger {
  display: none;
}

/* ================================================================
   BUTTONS (CI: keine rechten Winkel → var(--r))
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1.25rem;
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.4;
  border-radius: var(--r);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }

/* Primary — CI Rot */
.btn-primary {
  background: var(--c-red);
  color: var(--surface);
  border-color: var(--c-red);
}
.btn-primary:hover { background: var(--c-red-700); border-color: var(--c-red-700); color: var(--surface); text-decoration: none; }

/* Accent — CI Orange (Portal-Aktion): DUNKLER Text für Kontrast (WCAG AA) */
.btn-accent {
  background: var(--c-orange);
  color: var(--ink);
  border-color: var(--c-orange);
}
.btn-accent:hover { background: var(--c-orange-700); border-color: var(--c-orange-700); color: var(--ink); text-decoration: none; }

/* Outline */
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-outline:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }

/* Outline Rot */
.btn-outline-accent {
  background: transparent;
  color: var(--c-red);
  border-color: var(--c-red);
}
.btn-outline-accent:hover { background: var(--c-red); color: var(--surface); text-decoration: none; }

/* Danger */
.btn-danger {
  background: var(--danger);
  color: var(--surface);
  border-color: var(--danger);
}
.btn-danger:hover { opacity: 0.85; color: var(--surface); text-decoration: none; }

/* Success */
.btn-success {
  background: var(--success);
  color: var(--surface);
  border-color: var(--success);
}
.btn-success:hover { opacity: 0.85; color: var(--surface); text-decoration: none; }

/* Sizes */
.btn-sm { padding: 0.3rem 0.875rem; font-size: var(--fs-sm); }
.btn-lg { padding: 0.75rem 2rem; font-size: var(--fs-xl); }

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-header h2, .card-header h3 {
  margin-bottom: 0;
  font-size: var(--fs-xl);
  text-transform: none;
  letter-spacing: 0;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* Stat cards (Dashboard) */
.stat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--sh-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-card .stat-label {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}

.stat-card .stat-value {
  font-family: var(--font);
  font-size: var(--fs-stat);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.05;
}

.stat-card .stat-sub {
  font-size: var(--fs-sm);
  color: var(--ink-subtle);
}

/* Kennzahl bleibt in Ink — Farbe kommt aus Status-Punkt/Balken, nicht aus der Zahl */
.stat-card.accent .stat-value,
.stat-card.success .stat-value,
.stat-card.warning .stat-value { color: var(--ink); }

/* ================================================================
   PROGRESS BAR
   ================================================================ */
.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.progress-bar-outer {
  height: 12px;
  background: var(--surface-sunken);
  border-radius: 999px; /* Ausnahme vom CI-Radius: Balken, kein Button */
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  border-radius: 999px;
  background: var(--c-orange); /* unter Ziel */
  transition: width 0.6s ease;
  min-width: 4px;
}

.progress-bar-inner.complete {
  background: var(--success); /* Ziel erreicht */
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-sm);
  color: var(--ink-subtle);
}

.progress-pct {
  font-weight: 700;
  color: var(--ink-muted);
}

.progress-pct.complete {
  color: var(--success);
}

/* ================================================================
   STATUS BADGES
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.25rem 0.625rem;
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Status nicht nur per Farbe: farbiger Punkt + Text (WCAG 1.4.1) */
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-submitted  { background: var(--warning-bg);  color: var(--warning); }
.badge-approved   { background: var(--success-bg);   color: var(--success); }
.badge-partially  { background: var(--warning-bg);  color: var(--warning); }
.badge-rejected   { background: var(--danger-bg);   color: var(--danger); }
.badge-active     { background: var(--success-bg);     color: var(--success); }
.badge-inactive   { background: var(--surface-sunken);           color: var(--ink-subtle); }
.badge-new        { background: var(--info-bg);        color: var(--info); }

/* ================================================================
   ALERTS / FLASH MESSAGES
   ================================================================ */
.alert {
  padding: 0.875rem 1.25rem;
  border-radius: var(--r);
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: var(--fs-base);
}

.alert-success { background: var(--success-bg); border-color: #a5d6a7; color: var(--success); }
.alert-error, .alert-danger { background: var(--danger-bg); border-color: #ef9a9a; color: var(--danger); }
.alert-warning { background: var(--warning-bg); border-color: #ffcc80; color: var(--warning); }
.alert-info    { background: var(--info-bg);    border-color: var(--border-strong); color: var(--info); }

.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: inherit;
  opacity: 0.6;
  flex-shrink: 0;
}
.alert-close:hover { opacity: 1; }

/* ================================================================
   FORMS
   ================================================================ */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-weight: 700;
  font-size: var(--fs-sm);
  margin-bottom: 0.375rem;
  color: var(--ink);
}

label .required { color: var(--danger); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="tel"],
input[type="search"],
select,
textarea {
  display: block;
  width: 100%;
  padding: 0.5625rem 0.875rem;
  font-family: var(--font);
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  line-height: 1.5;
}

/* Ein Fokus-Stil: roter Rahmen + weicher roter Ring. Rot-Rahmen sonst NUR bei echtem Fehler. */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--c-red);
  box-shadow: var(--focus);
}

/* Sichtbarer Tastatur-Fokus für alle übrigen Elemente (Links, Buttons) */
:focus-visible {
  outline: 2px solid var(--c-red);
  outline-offset: 2px;
}
/* Felder tragen Rahmen + Ring, kein zusätzliches Outline (sah aus wie Fehler) */
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
}

input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-sunken);
  color: var(--ink-subtle);
  cursor: not-allowed;
}

textarea { resize: vertical; min-height: 100px; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23333333' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-hint {
  font-size: var(--fs-sm);
  color: var(--ink-subtle);
  margin-top: 0.25rem;
}

.invalid-feedback {
  color: var(--danger);
  font-size: var(--fs-sm);
  margin-top: 0.25rem;
}

input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: var(--danger);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* Checkbox / Radio */
.check-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.check-group input[type="checkbox"],
.check-group input[type="radio"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: var(--c-red);
}

/* ================================================================
   TABLES
   ================================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  background: var(--surface);
}

thead th {
  background: var(--surface-sunken);
  color: var(--ink-muted);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  white-space: nowrap;
  border-bottom: 1px solid var(--border-strong);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-sunken); }

tbody td {
  padding: 0.875rem 1rem;
  vertical-align: middle;
}

.table-actions {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 1.5rem;
  list-style: none;
  flex-wrap: wrap;
}

.pagination li a,
.pagination li span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--border-strong);
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.pagination li a:hover { background: var(--surface-sunken); text-decoration: none; }
.pagination li.active span { background: var(--c-red); color: var(--surface); border-color: var(--c-red); }
.pagination li.disabled span { opacity: 0.4; cursor: not-allowed; }

/* ================================================================
   AUTH PAGES
   ================================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--c-red);
}

.auth-logo img {
  height: 52px;
  width: auto;
  margin: 0 auto 0.75rem;
}

.auth-logo .school-name {
  font-family: var(--font);
  font-size: var(--fs-lg);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.auth-logo .portal-name {
  font-size: var(--fs-sm);
  font-weight: 300;
  color: var(--ink-subtle);
  letter-spacing: 0.03em;
}

.auth-card h1 {
  font-size: var(--fs-2xl);
  margin-bottom: 1.5rem;
  text-align: center;
}

.auth-links {
  margin-top: 1.25rem;
  text-align: center;
  font-size: var(--fs-sm);
}

/* ================================================================
   DASHBOARD GRIDS
   ================================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ================================================================
   SKILLS GRID
   ================================================================ */
/* Einklappbare Kategorie (Tätigkeitsprofil) */
details.skills-group {
  margin-bottom: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.skills-group-summary {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-left: 3px solid var(--c-red);
}
.skills-group-summary::-webkit-details-marker { display: none; }
.skills-group-summary::before {
  content: "▸";
  color: var(--ink-subtle);
  font-size: 0.85em;
  transition: transform var(--transition);
  flex-shrink: 0;
}
details.skills-group[open] .skills-group-summary::before { transform: rotate(90deg); }
.skills-group-summary:hover { background: var(--surface-sunken); }
.skills-group-summary:focus-visible { outline: 2px solid var(--c-red); outline-offset: -2px; }

.skills-group-title {
  flex: 1;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--ink);
}
.skills-group-count {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ink-subtle);
}
.skills-group-count.is-active {
  color: var(--c-sage-700);
  background: var(--c-sage-100);
  padding: 3px 10px;
  border-radius: 999px;
}
.skills-group-body {
  padding: var(--sp-4);
  border-top: 1px solid var(--border);
}

@media (prefers-reduced-motion: reduce) {
  .skills-group-summary::before { transition: none; }
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.75rem;
}

/* Tätigkeitsprofil: tappbare Chips statt gedrängtem Checkbox-Raster (≥44px) */
.skill-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--fs-sm);
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition), border-color var(--transition);
}
.skill-item:hover {
  border-color: var(--ink-subtle);
  background: var(--surface-sunken);
}
.skill-item:has(input:checked) {
  background: var(--c-sage-100);
  border-color: var(--c-sage-700);
  font-weight: 600;
}
.skill-item:has(input:focus-visible) {
  outline: 2px solid var(--c-red);
  outline-offset: 2px;
}
.skill-item input[type="checkbox"] {
  accent-color: var(--c-sage-700);
}

/* ================================================================
   FILTER BAR
   ================================================================ */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface);
  padding: 1.25rem 1.5rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 160px;
}

.filter-group label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0;
}

.filter-bar select,
.filter-bar input:not([type="checkbox"]):not([type="radio"]) {
  width: auto;
  min-width: 160px;
  padding: 0.4rem 0.75rem;
}
/* Checkboxen (z. B. im Kategorie-Dropdown) dürfen nicht auf Filter-Breite wachsen */
.filter-bar input[type="checkbox"],
.filter-bar input[type="radio"] {
  width: 1rem;
  height: 1rem;
  min-width: 0;
  flex: none;
  accent-color: var(--c-red);
}
/* Selects brauchen rechts Freiraum für den Chevron (sonst überlappt er den Text) */
.filter-bar select {
  padding-right: 2.25rem;
}

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--ink-subtle);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: var(--fs-lg);
  margin-bottom: 1.5rem;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  :root {
    --container-pad: 1rem;
  }

  .hamburger { display: flex; }

  .site-header .brand-sub { display: none; }

  .header-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 3px solid var(--c-red);
    flex-direction: column;
    padding: 0.75rem 1rem;
    gap: 0.25rem;
    box-shadow: var(--sh-md);
  }

  .header-nav.open { display: flex; }

  .content-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 1rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .table-actions { flex-direction: column; }

  .header-user span {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
  }
}

/* ================================================================
   UTILITY CLASSES
   ================================================================ */
.d-flex { display: flex; flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
/* Margin-Utilities: !important, damit sie Komponenten-Margins (z. B. .page-title) sicher überschreiben */
.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }
.w-100 { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }

/* CI: Seitentitel in Versalien */
.page-title {
  font-family: var(--font);
  font-size: var(--fs-3xl);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
  color: var(--ink);
}

.section-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--ink);
}

/* ================================================================
   ELTERN-DASHBOARD — kombinierte Fortschritts-Karte
   ================================================================ */
.dash-progress__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.dash-progress__metric {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-1);
}
.dash-progress__value {
  font-size: var(--fs-stat);
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}
.dash-progress__target {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
}
.dash-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.dash-next__label {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--ink-muted);
  margin-bottom: 2px;
}

/* Summen-Zeile (Formular Live-Vorschau): Label links, große Zahl rechts */
.hours-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--sp-3) var(--sp-4);
}
.hours-summary__label {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--ink-muted);
}
.hours-summary__value {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

/* ================================================================
   TABELLE → GESTAPELTE KARTEN (Mobil, touch-freundlich)
   table.stack-sm mit data-label je td
   ================================================================ */
@media (max-width: 640px) {
  table.stack-sm thead {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  table.stack-sm,
  table.stack-sm tbody,
  table.stack-sm tr,
  table.stack-sm td { display: block; width: 100%; }
  table.stack-sm tr {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--sp-3) var(--sp-4);
    margin-bottom: var(--sp-3);
    background: var(--surface);
  }
  table.stack-sm tr:hover { background: var(--surface); }
  table.stack-sm td {
    border: none;
    padding: var(--sp-1) 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-3);
    text-align: right;
  }
  table.stack-sm td::before {
    content: attr(data-label);
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    color: var(--ink-muted);
    text-align: left;
    flex-shrink: 0;
  }
  table.stack-sm td:first-child { font-weight: 700; }
}

/* ================================================================
   STICKY MOBILE-CTA (primäre Aktion, ≥48px, unten fixiert)
   ================================================================ */
.mobile-cta { display: none; }
@media (max-width: 640px) {
  .mobile-cta {
    display: block;
    position: sticky;
    bottom: 0;
    z-index: 50;
    padding: var(--sp-3) var(--sp-4);
    margin: var(--sp-5) calc(-1 * var(--sp-4)) 0;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--border);
  }
  .mobile-cta .btn { width: 100%; min-height: 48px; }
  /* Desktop-CTA im Fluss auf Mobil ausblenden, wenn sticky vorhanden */
  .hide-on-mobile { display: none; }
}

/* ================================================================
   REDUCED MOTION (WCAG 2.3.3) — gezielt, kein globaler Kill-Switch:
   Hover-/Fokus-Feedback bleibt erhalten, nur bewegungsintensive
   Übergänge (Balken-Füllung, Sidebar-Slide) werden entschärft.
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  .progress-bar-inner { transition: none; }
  .admin-sidebar { transition: none; }
  .mobile-cta { backdrop-filter: none; }
}
