/* =============================================
   beki-kita – Design-System (BEKI v4)
   ============================================= */
:root {
  --navy:        #1e3d73;
  --navy-dark:   #16306a;
  --navy-deeper: #0d2347;
  --teal:        #3a8c68;
  --teal-dark:   #2e7555;
  --teal-bright: #4fb487;
  --bg:          #f0f4f8;
  --surface:     #ffffff;
  --surface-2:   #f7fafd;
  --border:      #c9d4e3;
  --border-dark: #b8c8db;
  --text:        #162033;
  --text-dark:   #162033;
  --text-muted:  #526273;
  --text-light:  #8b9aae;
  --line:        #c9d4e3;
  --mark:        #d1f0e4;
  --mark-strong: #4fb487;
  --soft:        #f7fafd;

  /* Status */
  --success-text: #3a8c68; --success-bg: #d1f0e4; --success-bg-light: #edf9f2;
  --warning-text: #d97706; --warning-bg: #fef3c7;
  --danger-text:  #dc2626; --danger-bg:  #fee2e2;  --danger-bg-light: #fef2f2;
  --info-text:    #3a6cb0; --info-bg:    #e0eaf8;

  --sidebar-width: 272px;
  --header-height: 76px;
}

/* =============================================
   DARK MODE
   ============================================= */
[data-theme="dark"] {
  --bg:          #0f1623;
  --surface:     #1a2236;
  --surface-2:   #1e2840;
  --border:      #2d3a50;
  --border-dark: #384559;
  --text:        #e2e8f0;
  --text-dark:   #f0f4f8;
  --text-muted:  #8fa3b8;
  --text-light:  #5a7080;
  --line:        #1e2c40;

  --navy:        #2a5298;
  --navy-dark:   #3361b5;
  --teal:        #3a9c76;
  --teal-dark:   #2e8562;

  --success-bg:       #0d2e1e;
  --success-bg-light: #0f2e1e;
  --warning-bg:       #2e1f00;
  --danger-bg:        #2e0e0e;
  --danger-bg-light:  #2e0e0e;
  --info-bg:          #0e1e38;
}
[data-theme="dark"] body          { background: var(--bg); color: var(--text); }
[data-theme="dark"] .app-header   { background: #141e30; border-bottom-color: #2a5298; }
[data-theme="dark"] .app-footer   { background: #141e30; border-top-color: var(--border); color: var(--text-light); }
[data-theme="dark"] .modal        { background: var(--surface); }
[data-theme="dark"] .modal-overlay{ background: rgba(0,0,0,.75); }
[data-theme="dark"] .form-input,
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background: var(--surface-2); border-color: var(--border); color: var(--text);
}
[data-theme="dark"] .btn-outline  { background: var(--surface); border-color: var(--border); color: var(--text-muted); }
[data-theme="dark"] .btn-outline:hover { border-color: var(--navy); color: var(--text); background: var(--surface-2); }
[data-theme="dark"] .data-table th { background: #1e2e48; color: var(--text); }
[data-theme="dark"] .data-table td { border-color: var(--border); }
[data-theme="dark"] .data-table tr:hover td { background: var(--surface-2); }
[data-theme="dark"] .roadmap-card       { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .roadmap-card.done  { background: #0d2519; border-color: #1a4a30; }
[data-theme="dark"] .roadmap-card.active{ background: #0e1e38; border-color: #2a5298; }
[data-theme="dark"] .stat-card          { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .welcome-banner     { background: linear-gradient(135deg,#1a2e50,#1a3d28); }
[data-theme="dark"] .doc-card, [data-theme="dark"] .obs-card { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .schedule-tab-btn   { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }
[data-theme="dark"] .schedule-tab-btn.active { background: var(--navy); color: #fff; }
[data-theme="dark"] .nav-section-label        { color: rgba(255,255,255,.4); }
[data-theme="dark"] .nav-section-label:hover  { color: rgba(255,255,255,.6); }

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

button, input, textarea, select { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =============================================
   ANIMATIONEN
   ============================================= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =============================================
   AUTH (Login)
   ============================================= */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #2a5298 100%);
  padding: 20px;
}
.auth-container  { width: 100%; max-width: 400px; }
.auth-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 40px 36px;
  box-shadow: 0 24px 60px rgba(8, 18, 50, .22);
  animation: fadeIn .3s ease;
}
.auth-logo           { text-align: center; margin-bottom: 32px; }
.auth-logo img       { display: block; margin: 0 auto; }
.auth-logo .logo-icon{ font-size: 2.8rem; display: block; margin-bottom: 8px; }
.auth-logo h1        { font-size: 1.9rem; color: var(--navy); font-weight: 800; }
.auth-logo p         { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.auth-footer         { text-align: center; color: rgba(255,255,255,.5); font-size: 11.5px; margin-top: 20px; }

/* =============================================
   FORMS
   ============================================= */
.form-group         { margin-bottom: 16px; }
.form-group label   {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #4b5a6e;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 5px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #7fa2c7;
  box-shadow: 0 0 0 3px rgba(30,61,115,.08);
}
.form-group textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.65;
}
.form-group small { display: block; font-size: 11.5px; color: var(--text-light); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn-primary          { background: var(--navy); color: #fff; }
.btn-primary:hover    { background: var(--navy-dark); }
.btn-primary:disabled { background: #c8d0dc; cursor: not-allowed; }

.btn-secondary        { background: var(--teal); color: #fff; padding: 10px 20px; border-radius: 11px; }
.btn-secondary:hover  { background: var(--teal-dark); }

.btn-outline {
  border: 1px solid var(--border);
  background: var(--surface);
  color: #405165;
  padding: 11px 14px;
  border-radius: 10px;
}
.btn-outline:hover { border-color: var(--navy); color: var(--navy); background: var(--soft); }

.btn-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: #405165;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
}
.btn-pill:hover { border-color: var(--navy); color: var(--navy); }

.btn-full { width: 100%; }
.btn-icon { background: none; border: none; padding: 4px 8px; border-radius: 6px; font-size: 1rem; color: var(--text-muted); }
.btn-icon:hover { background: var(--surface-2); color: var(--text); }

/* =============================================
   MESSAGES / ALERTS
   ============================================= */
.error-message {
  background: var(--danger-bg-light);
  border: 1px solid #fca5a5;
  color: var(--danger-text);
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* =============================================
   APP LAYOUT
   ============================================= */
.app-page { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(160deg, #0d2347 0%, #1e3d73 58%, #1a5c4a 100%);
  display: flex;
  flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  box-shadow: 3px 0 20px rgba(13,35,71,.28);
  transition: width .25s ease;
}
.sidebar-header {
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
  height: var(--header-height);
  padding: 0 12px;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(0,0,0,.08);
  flex-shrink: 0;
  box-sizing: border-box;
}
.sidebar-logo {
  max-width: 180px;
  max-height: 56px;
  width: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.sidebar-nav    { flex: 1; padding: 10px 0; overflow-y: auto; }
.nav-section    { margin-bottom: 2px; }
.nav-section-label {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.64);
  padding: 6px 14px 2px;
  background: none; border: none; cursor: pointer;
  transition: color .15s;
}
.nav-section-label:hover { color: rgba(255,255,255,.85); }
.nav-chevron {
  font-size: 11px;
  transition: transform .22s ease;
  display: inline-block;
}
.nav-section.collapsed .nav-chevron { transform: rotate(-90deg); }
.nav-section-body {
  overflow: hidden;
  max-height: 500px;
  transition: max-height .25s ease, opacity .2s ease;
  opacity: 1;
}
.nav-section.collapsed .nav-section-body {
  max-height: 0;
  opacity: 0;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px;
  font-size: 14px;
  color: rgba(255,255,255,.82);
  border-left: 3px solid transparent;
  border-radius: 0;
  margin: 0;
  transition: background .15s, color .15s, border-color .15s;
  text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-item:hover   { background: rgba(255,255,255,.13); color: #fff; border-left-color: rgba(79,180,135,.72); text-decoration: none; }
.nav-item.active  { background: rgba(255,255,255,.18); border-left-color: rgba(79,180,135,.95); color: #fff; }
.nav-icon         { width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.user-info    { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar  {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--navy);
  border: 2px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-name  { display: block; font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { display: block; font-size: 11px; color: rgba(255,255,255,.5); }
.btn-logout {
  background: none; border: none;
  color: rgba(255,255,255,.5); font-size: 1.1rem;
  padding: 6px; border-radius: 6px;
}
.btn-logout:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ---- Main ---- */
.app-main     { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.header-welcome       { flex: 1; min-width: 0; overflow: hidden; }
.header-welcome-title { font-size: 14px; font-weight: 700; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-welcome-sub   { font-size: 11.5px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

.header-institut-logo {
  margin-left: auto;
  height: 44px;
  width: auto;
  object-fit: contain;
}
.app-header   {
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 3px solid var(--navy);
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 10px rgba(30,61,115,.10);
  flex-shrink: 0;
}
.sidebar-toggle { display: none; background: none; border: none; font-size: 1.3rem; padding: 4px; color: var(--text-muted); }
.page-title     { font-size: 16px; font-weight: 800; color: var(--text-dark); flex: 1; }
.header-badge   {
  background: var(--info-bg); color: var(--info-text);
  padding: 4px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.app-content    { flex: 1; padding: 24px; padding-bottom: 40px; animation: fadeIn .2s ease; }

/* Footer */
.app-footer {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 7px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-light);
  z-index: 50;
  flex-shrink: 0;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-left  { display: flex; align-items: center; gap: 10px; }
.footer-right { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.footer-logo  { height: 28px; width: auto; object-fit: contain; }
.settings-version {
  font-size: 13px; font-weight: 700; color: var(--navy);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 3px 12px; border-radius: 999px;
  white-space: nowrap;
}
.settings-support-link {
  font-size: 12.5px; font-weight: 600; color: var(--teal);
  text-decoration: none; white-space: nowrap;
}
.settings-support-link:hover { text-decoration: underline; }

/* =============================================
   PAGES
   ============================================= */
.page.hidden   { display: none; }
.page-header   { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-header h3{ font-size: 18px; font-weight: 800; color: var(--text-dark); }

/* Stats */
.stats-grid  { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card   {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 2px 12px rgba(30,61,115,.06);
  transition: box-shadow .15s, transform .15s;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(30,61,115,.1); transform: translateY(-1px); }
.stat-icon-wrap  {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--info-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.stat-info       {}
.stat-value      { font-size: 22px; font-weight: 800; color: var(--navy); line-height: 1.2; }
.stat-label      { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Welcome */
.welcome-banner    {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 2px 10px rgba(30,61,115,.05);
}
.welcome-banner h3 { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.welcome-banner p  { color: var(--text-muted); font-size: 13.5px; line-height: 1.55; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(30,61,115,.05);
  transition: all .16s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--mark-strong);
  box-shadow: 0 6px 20px rgba(30,61,115,.10);
}

/* Table */
.table-container { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: 0 2px 10px rgba(30,61,115,.05); }
.data-table      { width: 100%; border-collapse: collapse; }
.data-table th   {
  background: var(--surface-2);
  font-size: 10px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table td            { padding: 12px 16px; font-size: 13.5px; border-bottom: 1px solid var(--line); color: var(--text); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--surface-2); }
.loading  { text-align: center; color: var(--text-light); padding: 36px !important; font-size: 13px; }

/* Badges */
.role-badge    {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
}
.role-admin    { background: var(--danger-bg);  color: var(--danger-text);  }
.role-leitung  { background: var(--warning-bg); color: var(--warning-text); }
.role-erzieher { background: var(--info-bg);    color: var(--info-text);    }
.role-eltern   { background: var(--success-bg); color: var(--success-text); }

.status-badge          {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.status-badge.active   { background: var(--success-bg-light); color: var(--success-text); }
.status-badge.inactive { background: var(--surface-2); color: var(--text-light); }

/* Coming soon */
.coming-soon      { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 60px 24px; text-align: center; box-shadow: 0 2px 12px rgba(30,61,115,.06); }
.coming-soon-icon { font-size: 3rem; display: block; margin-bottom: 16px; }
.coming-soon h3   { font-size: 17px; font-weight: 800; margin-bottom: 8px; color: var(--text-dark); }
.coming-soon p    { color: var(--text-muted); font-size: 13px; }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,20,50,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }
.modal         {
  background: var(--surface);
  border-radius: 18px;
  width: min(460px, 92vw);
  box-shadow: 0 24px 60px rgba(8,18,50,.22);
  animation: fadeUp .2s ease;
}
.modal-header  { display: flex; align-items: center; justify-content: space-between; padding: 20px 28px; border-bottom: 1px solid var(--line); }
.modal-header h3 { font-size: 15px; font-weight: 800; color: var(--text-dark); }
.modal-close   { background: none; border: none; font-size: 1.4rem; color: var(--text-muted); line-height: 1; padding: 2px 6px; border-radius: 6px; }
.modal-close:hover { color: var(--text-dark); background: var(--surface-2); }
.modal-body    { padding: 24px 28px; }
.modal-footer  { padding: 16px 28px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* Globaler Input-Stil (beki-suite) */
.modal-body input[type="text"],
.modal-body input[type="date"],
.modal-body input[type="time"],
.modal-body input[type="email"],
.modal-body input[type="password"],
.modal-body input[type="number"],
.modal-body select,
.modal-body textarea,
.form-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 8px 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus,
.form-input:focus {
  outline: none;
  border-color: #7fa2c7;
  box-shadow: 0 0 0 3px rgba(30,61,115,.08);
}
.modal-body textarea, .form-input textarea { min-height: 80px; resize: vertical; line-height: 1.6; }
.form-label {
  display: block;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: #64758a;
  margin-bottom: 5px;
}

/* =============================================
   MODAL TABS
   ============================================= */
.modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0;
  padding: 0 28px;
  flex-shrink: 0;
}
.tab-btn {
  background: none; border: none;
  padding: 11px 14px;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.tab-btn:hover  { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab-panel      { display: none; }
.tab-panel.active { display: block; }

/* Wide modal for children */
.modal-wide { width: min(780px, 96vw); }

/* Checkbox row */
.check-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.check-row:last-child { border-bottom: none; }
.check-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--teal); flex-shrink: 0; }
.check-row label { font-size: 13.5px; color: var(--text); cursor: pointer; }
.check-row small { font-size: 11.5px; color: var(--text-light); display: block; margin-top: 2px; }

/* Contact list */
.contact-list      { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.contact-card      {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
}
.contact-card-authorized { border-color: var(--teal); background: var(--success-bg-light); }
.contact-card-main { display: flex; align-items: center; gap: 10px; }
.contact-card-info { flex: 1; min-width: 0; }
.contact-card-info h4 { font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.contact-card-info p  { font-size: 12px; color: var(--text-muted); }
.contact-card-status  { flex-shrink: 0; }
.contact-card-actions { display: flex; gap: 4px; flex-shrink: 0; }
.pickup-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.pickup-yes { background: var(--success-bg); color: var(--success-text); }
.pickup-no  { background: var(--surface); border: 1px solid var(--border); color: var(--text-light); }
.contact-edit-form {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.contact-add-form {
  background: var(--surface-2); border: 1px dashed var(--border-dark);
  border-radius: 10px; padding: 14px;
}
.contact-add-form h4  { font-size: 13px; font-weight: 700; margin-bottom: 12px; color: var(--navy); }

/* =============================================
   DOKUMENTATION
   ============================================= */
.doc-filter-bar {
  display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center;
}
.doc-filter-bar select,
.doc-filter-bar input { width: auto; min-width: 160px; }

.doc-tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.doc-tab-btn {
  background: none; border: none;
  padding: 10px 20px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.doc-tab-btn:hover  { color: var(--navy); }
.doc-tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }
.doc-tab-panel      { display: none; }
.doc-tab-panel.active { display: block; }

/* Observation / Doc cards */
.obs-list, .doc-list { display: flex; flex-direction: column; gap: 12px; }

.obs-card, .doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 2px 8px rgba(30,61,115,.05);
}
.obs-card-header, .doc-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.obs-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.obs-card-name { font-size: 14px; font-weight: 700; color: var(--text-dark); }
.obs-card-date { font-size: 12px; color: var(--text-muted); }
.obs-card-body { font-size: 13.5px; color: var(--text); line-height: 1.55; white-space: pre-wrap; }
.obs-card-footer{
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--text-light);
}
.obs-card-actions { display: flex; gap: 4px; }

/* Category badges */
.cat-badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.cat-Motorik     { background: #fff3e0; color: #e65100; }
.cat-Sprache     { background: var(--info-bg); color: var(--info-text); }
.cat-Soziales    { background: var(--success-bg-light); color: var(--success-text); }
.cat-Kreativität { background: #f3e5f5; color: #6a1b9a; }
.cat-Kognition   { background: #e8f5e9; color: #2e7d32; }
.cat-Sonstiges   { background: var(--surface-2); color: var(--text-muted); }

/* Incident type badges */
.inc-Unfall     { background: var(--danger-bg);  color: var(--danger-text);  }
.inc-Verletzung { background: #fff3e0; color: #e65100; }
.inc-Verhalten  { background: var(--warning-bg); color: var(--warning-text); }
.inc-Sonstiges  { background: var(--surface-2);  color: var(--text-muted);   }

.doc-card-title { font-size: 14px; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; }
.doc-card-sub   { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.doc-card-text  { font-size: 13.5px; color: var(--text); line-height: 1.55; white-space: pre-wrap; }
.doc-empty      { color: var(--text-light); font-size: 13px; padding: 24px 0; text-align: center; }

/* =============================================
   EINGEWÖHNUNG
   ============================================= */
.ew-child-section   { margin-bottom: 28px; }
.ew-child-name      { font-size: 14px; font-weight: 800; color: var(--navy); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.ew-timeline        { display: flex; flex-direction: column; gap: 10px; }
.ew-phase-card      { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: 10px; padding: 14px 16px; transition: box-shadow .15s; }
.ew-phase-card:hover{ box-shadow: 0 4px 14px rgba(30,61,115,.1); }
.ew-phase-header    { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.ew-phase-label     { font-size: 13.5px; font-weight: 700; color: var(--text-dark); }
.ew-date-range      { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.status-badge.warning { background: #fef3c7; color: #d97706; }

/* =============================================
   ENTWICKLUNGSZIELE
   ============================================= */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.goal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 14px 16px;
  transition: box-shadow .15s;
}
.goal-card:hover        { box-shadow: 0 4px 14px rgba(30,61,115,.1); }
.goal-card.goal-erreicht { border-color: #b2d8c4; background: linear-gradient(160deg,#f8fff9,#fff); }
.goal-card.goal-in_arbeit{ border-color: #fde68a; background: linear-gradient(160deg,#fffdf0,#fff); }
.goal-card-header  { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.goal-cat-icon     { font-size: 16px; }
.goal-cat-label    { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.goal-title        { font-size: 14px; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; }
.goal-date         { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.goal-progress-wrap  { display: flex; align-items: center; gap: 8px; }
.goal-progress-bar   { width: 100px; height: 7px; background: var(--border); border-radius: 999px; overflow: hidden; }
.goal-progress-fill  { height: 100%; background: var(--teal); border-radius: 999px; transition: width .3s ease; }
.goal-progress-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.goal-stat           { font-size: 12px; color: var(--text-muted); }

/* =============================================
   GRUPPENÜBERSICHT
   ============================================= */
.group-section        { margin-bottom: 32px; }
.group-section-title  {
  font-size: 15px; font-weight: 800; color: var(--navy);
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.group-child-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  cursor: pointer; transition: all .15s;
  position: relative;
}
.group-child-card:hover {
  border-color: var(--navy); transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(30,61,115,.12);
}
.group-child-card .child-name  { font-size: 14px; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; }
.group-child-card .child-age   { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.group-child-card .child-badges{ display: flex; gap: 5px; flex-wrap: wrap; }
.group-child-card .att-status-dot {
  position: absolute; top: 12px; right: 12px;
  width: 10px; height: 10px; border-radius: 50%;
}
.dot-anwesend { background: var(--teal); }
.dot-abwesend { background: var(--text-light); }
.dot-krank    { background: var(--warning-text); }
.dot-urlaub   { background: var(--info-text); }
.dot-offen    { background: var(--border-dark); }

/* Attendance time inputs */
.att-times {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--line);
  display: none; gap: 8px;
}
.att-times.visible { display: flex; }
.att-times label   { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; display: block; margin-bottom: 3px; }
.att-times input   {
  width: 90px; padding: 5px 8px;
  border: 1px solid var(--border); border-radius: 7px;
  font-size: 13px; color: var(--text);
}
.att-times input:focus { outline: none; border-color: var(--teal); }

/* =============================================
   ANWESENHEIT
   ============================================= */
.attendance-toolbar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.date-input {
  padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 9px;
  font-size: 14px; color: var(--text); background: var(--surface);
}
.date-input:focus { outline: none; border-color: var(--teal); }

.attendance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.att-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(30,61,115,.05);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.att-card-anwesend { border-color: var(--teal); background: linear-gradient(160deg,#f0faf5,#fff); box-shadow: 0 2px 10px rgba(58,140,104,.12); }
.att-card-krank    { border-color: #d97706; background: linear-gradient(160deg,#fffdf0,#fff); box-shadow: 0 2px 10px rgba(217,119,6,.1); }
.att-card-abwesend { border-color: var(--text-light); background: var(--surface-2); }
.att-card-urlaub   { border-color: #3a6cb0; background: linear-gradient(160deg,#f0f5ff,#fff); box-shadow: 0 2px 10px rgba(58,108,176,.1); }
.att-card-name   { font-size: 14px; font-weight: 700; margin-bottom: 10px; color: var(--text-dark); }
.att-status-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.att-btn {
  flex: 1; min-width: 56px;
  padding: 6px 8px; border-radius: 7px;
  font-size: 12px; font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  cursor: pointer; transition: all .15s; text-align: center;
}
.att-btn:hover                 { border-color: var(--navy); color: var(--navy); }
.att-btn.active-anwesend       { background: var(--success-bg-light); border-color: var(--teal); color: var(--teal); }
.att-btn.active-abwesend       { background: var(--surface-2); border-color: var(--text-muted); color: var(--text-muted); }
.att-btn.active-krank          { background: var(--warning-bg); border-color: var(--warning-text); color: var(--warning-text); }
.att-btn.active-urlaub         { background: var(--info-bg); border-color: var(--info-text); color: var(--info-text); }

.att-summary { display: flex; gap: 16px; flex-wrap: wrap; }
.att-summary-item { font-size: 13px; font-weight: 600; }

/* =============================================
   MORGENEMPFANG (QUICKCHECK)
   ============================================= */
.qc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.qc-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 18px 16px 14px;
  transition: border-color .15s, box-shadow .15s;
  display: flex; flex-direction: column; gap: 12px;
}
.qc-card-anwesend { border-color: var(--teal);  background: linear-gradient(160deg,#f0faf5,#fff); }
.qc-card-krank    { border-color: #d97706;       background: linear-gradient(160deg,#fffdf0,#fff); }
.qc-card-abwesend { border-color: var(--text-light); background: var(--surface-2); }
.qc-card-urlaub   { border-color: #3a6cb0;       background: linear-gradient(160deg,#f0f5ff,#fff); }

.qc-card-top   { display: flex; align-items: center; gap: 12px; }
.qc-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; flex-shrink: 0;
}
.qc-card-anwesend .qc-avatar { background: var(--teal); }
.qc-card-krank    .qc-avatar { background: #d97706; }
.qc-card-abwesend .qc-avatar { background: var(--text-light); }
.qc-card-urlaub   .qc-avatar { background: #3a6cb0; }
.qc-name { font-size: 14px; font-weight: 700; color: var(--text-dark); line-height: 1.3; }

.qc-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.qc-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.qc-btn:hover   { border-color: var(--navy); background: #eef4ff; }
.qc-btn-icon    { font-size: 20px; line-height: 1; }
.qc-btn-label   { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.qc-btn.qc-active .qc-btn-label { color: inherit; }

.qc-btn.qc-anwesend { background: #d4ede2; border-color: var(--teal);        color: var(--teal);        }
.qc-btn.qc-krank    { background: #fef3c7; border-color: #d97706;             color: #d97706;            }
.qc-btn.qc-abwesend { background: var(--surface-2); border-color: #6b7a8d;   color: #4b5a6e;            }
.qc-btn.qc-urlaub   { background: #dce6f5; border-color: #3a6cb0;             color: #3a6cb0;            }

.qc-arrival { display: flex; align-items: center; gap: 10px; }
.qc-arrival.hidden { display: none; }
.qc-arr-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.qc-arr-input {
  flex: 1; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: #f8fafc; font-size: 13px; color: var(--text);
  font-family: inherit;
}
.qc-arr-input:focus { border-color: var(--teal); outline: none; }

@media (max-width: 480px) {
  .qc-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .qc-card { padding: 14px 12px 10px; }
  .qc-btn  { padding: 8px 4px; }
  .qc-btn-icon { font-size: 18px; }
}

/* =============================================
   PORTFOLIO
   ============================================= */
.portfolio-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 100%);
  color: #fff;
  border-radius: 14px;
  padding: 28px 28px 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.portfolio-title-block { display: flex; align-items: center; gap: 18px; }
.portfolio-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.portfolio-name { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.portfolio-meta { margin: 0; font-size: 13px; opacity: .85; }
.portfolio-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.portfolio-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 16px;
}
.portfolio-section-title {
  font-size: 14px; font-weight: 700; color: var(--navy);
  margin: 0 0 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.portfolio-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px 20px;
}
.portfolio-info-item { display: flex; flex-direction: column; gap: 2px; }
.info-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); }

.portfolio-contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.portfolio-contact-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
}
.portfolio-contact-card p { margin: 4px 0 0; color: var(--text-muted); }

.portfolio-cat-block { margin-bottom: 14px; }
.portfolio-cat-title { margin-bottom: 8px; }

.portfolio-entry {
  padding: 10px 14px;
  background: var(--surface-2);
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  margin-bottom: 8px;
}
.portfolio-entry-meta {
  font-size: 11px; color: var(--text-light);
  margin-bottom: 4px; font-style: normal;
}
.portfolio-entry-text { font-size: 13px; color: var(--text); }

/* Print styles */
@media print {
  .sidebar, .app-header, .page-header .btn, #portfolioChildSel,
  #portfolioPrintBtn, .nav-item { display: none !important; }
  .app-main  { margin-left: 0 !important; }
  .app-content { padding: 0 !important; }
  .portfolio-section { break-inside: avoid; border: 1px solid #ccc; }
  .portfolio-header { background: var(--navy) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* =============================================
   PINNWAND
   ============================================= */
.pin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: box-shadow .15s;
}
.pin-card:hover { box-shadow: 0 3px 14px rgba(30,61,115,.08); }
.pin-card-pinned {
  border-color: #f5c842;
  background: linear-gradient(160deg, #fffdf0 0%, #fff 100%);
}
.pin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.pin-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); }
.pin-icon  { font-size: 14px; }
.pin-content {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 10px;
}
.pin-meta { font-size: 11.5px; color: var(--text-light); }

/* =============================================
   NACHRICHTEN
   ============================================= */
.msg-tab-btn {
  padding: 7px 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.msg-tab-btn.active,
.msg-tab-btn:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.msg-row {
  display: grid;
  grid-template-columns: 160px 1fr 130px 36px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all .12s;
  font-size: 13px;
}
.msg-row:hover { border-color: var(--navy); background: #f5f8ff; }
.msg-row-unread { background: #f0f6ff; border-color: #c5d8f5; }
.msg-row-who    { color: var(--text-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-row-subject{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row-date   { font-size: 11.5px; color: var(--text-light); text-align: right; white-space: nowrap; }

/* Ungelesen-Badge in Sidebar */
.nav-badge {
  margin-left: auto;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

/* =============================================
   DARK-MODE TOGGLE (SIDEBAR)
   ============================================= */
.btn-darkmode {
  background: none;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 16px;
  cursor: pointer;
  color: rgba(255,255,255,.7);
  transition: border-color .15s, background .15s;
  line-height: 1;
}
.btn-darkmode:hover { border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.1); }

/* =============================================
   EINSTELLUNGEN
   ============================================= */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
}
.settings-card-title {
  font-size: 14px; font-weight: 800; color: var(--navy);
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: 13.5px; font-weight: 600; color: var(--text-dark); margin-bottom: 2px; }
.settings-hint  { font-size: 12px; color: var(--text-muted); }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border); border-radius: 999px;
  cursor: pointer; transition: background .2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; left: 3px; top: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--teal); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* =============================================
   ROADMAP
   ============================================= */
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.roadmap-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px 16px;
  transition: box-shadow .15s;
}
.roadmap-card.done {
  border-color: #b2d8c4;
  background: linear-gradient(160deg, #f8fff9 0%, #fff 100%);
}
.roadmap-card.planned {
  border-color: var(--border);
  background: var(--surface-2);
  opacity: .85;
}
.roadmap-card.active {
  border-color: #3a6cb0;
  background: linear-gradient(160deg, #f0f5ff 0%, #fff 100%);
}
.roadmap-card:hover { box-shadow: 0 4px 16px rgba(30,61,115,.08); }

.roadmap-phase-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--teal);
  color: #fff;
  margin-bottom: 8px;
}
.roadmap-phase-badge.planned,
.roadmap-card.planned .roadmap-phase-badge {
  background: var(--text-light);
}
.roadmap-phase-badge.active,
.roadmap-card.active .roadmap-phase-badge {
  background: #3a6cb0;
}
.roadmap-phase-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.roadmap-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.roadmap-items li {
  font-size: 13px;
  color: var(--text-muted);
  padding-left: 20px;
  position: relative;
}
.roadmap-items li::before {
  content: '○';
  position: absolute;
  left: 0;
  color: var(--text-light);
  font-size: 12px;
}
.roadmap-items li.done { color: var(--text); }
.roadmap-items li.done::before {
  content: '✓';
  color: var(--teal);
  font-weight: 700;
}
.roadmap-wip {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: #fef3c7;
  color: #d97706;
  vertical-align: middle;
  letter-spacing: .03em;
}

/* =============================================
   DIENSTPLAN
   ============================================= */
.schedule-tab-btn {
  padding: 7px 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.schedule-tab-btn.active,
.schedule-tab-btn:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.schedule-grid-wrap { overflow-x: auto; }

.schedule-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface);
}
.schedule-table th,
.schedule-table td {
  border: 1px solid var(--line);
  padding: 0;
  vertical-align: top;
  min-width: 90px;
}
.schedule-table thead th {
  background: var(--surface-2);
  padding: 8px 6px;
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 12px;
}
.schedule-table thead th.sch-today {
  background: #e8f5ef;
  color: var(--teal);
}
.sch-name-col { width: 140px; min-width: 130px; }
.sch-day-name { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.sch-day-date { font-size: 13px; font-weight: 700; color: var(--text); margin-top: 2px; }

.sch-name-cell {
  padding: 8px 12px;
  font-size: 13px;
  background: var(--surface-2);
  border-right: 2px solid var(--border-dark);
  line-height: 1.4;
}
.sch-week-total { font-size: 11px; color: var(--teal); margin-top: 3px; font-weight: 600; }

.sch-cell {
  padding: 6px 5px;
  text-align: center;
  min-height: 52px;
  transition: background .1s;
}
.sch-cell.sch-today { background: #f5fff9; }
.sch-cell-empty:hover { background: #f0f4f8; }
.sch-cell-absent { background: #fff8f0; }

.sch-add-hint {
  color: var(--border-dark);
  font-size: 18px;
  font-weight: 300;
  display: block;
  padding: 8px 0;
  transition: color .15s;
}
.sch-cell-empty:hover .sch-add-hint { color: var(--navy); }

/* Shift pills */
.sch-shift {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  margin: 2px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .1s;
}
.sch-shift:hover { opacity: .8; }
.shift-regulaer    { background: #dce6f5; color: #1e3d73; }
.shift-fruehdienst { background: #d4ede2; color: #2e7555; }
.shift-spaetdienst { background: #fef3c7; color: #b45309; }
.shift-bereitschaft{ background: #f3e5f5; color: #6a1b9a; }

/* Absence pills */
.sch-absence {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.absence-urlaub     { background: #fef3c7; color: #b45309; }
.absence-krank      { background: #fee2e2; color: #dc2626; }
.absence-fortbildung{ background: #dce6f5; color: #1e3d73; }
.absence-sonstiges  { background: #f4f7fb; color: var(--text-muted); }

/* Ist-Einträge (grün, unterscheidbar von Schicht-Pills) */
.ist-entry { background: #d4ede2 !important; color: #1a6644 !important; cursor: pointer; }
.ist-entry:hover { opacity: .82; }

/* =============================================
   ARBEITSZEITKONTO
   ============================================= */
.konto-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.konto-header label { font-weight: 700; font-size: 13px; }
.konto-header select { min-width: 200px; }
.konto-wrap { overflow-x: auto; }
.konto-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.konto-table thead th {
  background: var(--surface-2);
  padding: 10px 12px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.konto-table thead th:first-child,
.konto-table thead th:nth-child(2) { text-align: left; }
.konto-table tbody tr { border-bottom: 1px solid var(--line); }
.konto-table tbody tr:nth-child(even) { background: var(--surface-2); }
.konto-table tbody tr:hover { background: #eef4ff; }
.konto-kw    { font-weight: 700; color: var(--text-muted); padding: 9px 12px; white-space: nowrap; }
.konto-range { font-size: 12px; padding: 9px 12px; color: var(--text-muted); white-space: nowrap; }
.konto-num   { text-align: right; padding: 9px 14px; font-variant-numeric: tabular-nums; }
.konto-ist     { font-weight: 700; color: var(--navy); }
.konto-balance { font-weight: 800; }
.konto-pos { color: #2e7555; }
.konto-neg { color: #dc2626; }

/* =============================================
   TEAM
   ============================================= */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.staff-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 18px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all .15s;
}
.staff-card:hover {
  border-color: var(--navy);
  box-shadow: 0 4px 16px rgba(30,61,115,.1);
  transform: translateY(-1px);
}
.staff-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  color: #fff; font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.staff-info { flex: 1; min-width: 0; }
.staff-info h4 { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.staff-details { margin: 2px 0; font-size: 12px; color: var(--text-muted); }

/* =============================================
   OFFLINE / PWA
   ============================================= */
.offline-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: #b45309;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  animation: fadeIn .2s ease;
}
.pending-badge {
  background: rgba(255,255,255,.25);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.sync-indicator {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9998;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  animation: fadeIn .2s ease;
}
.offline-toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  background: #1e293b;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  white-space: nowrap;
  animation: fadeUp .2s ease;
}
.offline-toast.toast--success { background: #3a8c68; }

/* =============================================
   SPEISEPLAN
   ============================================= */
.meal-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 2px 12px rgba(30,61,115,.06);
}
.meal-header-row,
.meal-row {
  display: grid;
  grid-template-columns: 130px repeat(5, 1fr);
}
.meal-header-row {
  background: var(--surface-2);
  border-bottom: 2px solid var(--border);
}
.meal-row { border-bottom: 1px solid var(--line); }
.meal-row:last-child { border-bottom: none; }

.meal-type-col {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}
.meal-type-icon { font-size: 20px; }
.meal-type-label { text-transform: uppercase; letter-spacing: .04em; font-size: 10px; }

.meal-day-header {
  padding: 10px 8px;
  text-align: center;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.meal-day-header:last-child { border-right: none; }
.meal-day-name  { font-size: 13px; font-weight: 700; color: var(--navy); }
.meal-day-date  { font-size: 11px; color: var(--text-muted); }

.meal-cell {
  padding: 10px 10px;
  border-right: 1px solid var(--line);
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
.meal-cell:last-child { border-right: none; }

.meal-cell--filled { background: #fff; }
.meal-cell--empty  { background: var(--surface-2); align-items: center; justify-content: center; }

.meal-cell-title { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.3; }
.meal-cell-desc  { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.meal-cell-allergens { margin-top: 2px; }
.allergen-tag {
  display: inline-block;
  background: #fff3d7;
  color: #b45309;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #fde68a;
}
.meal-allergy-warn {
  font-size: 10.5px;
  font-weight: 700;
  color: #dc2626;
  background: #fee2e2;
  border-radius: 6px;
  padding: 2px 6px;
  display: inline-block;
}
.meal-cell-actions {
  display: flex;
  gap: 4px;
  margin-top: auto;
  padding-top: 4px;
}
.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.btn-icon:hover { background: var(--surface-2); border-color: var(--navy); }
.btn-icon--danger:hover { background: #fee2e2; border-color: #dc2626; }

.meal-add-btn {
  background: none;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  width: 100%;
}
.meal-add-btn:hover { border-color: var(--teal); color: var(--teal); background: #f0faf5; }
.meal-empty-text { font-size: 14px; color: var(--border-dark); }

/* Allergieliste */
.allergy-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.allergy-item:last-child { border-bottom: none; }
.allergy-name  { font-size: 13px; font-weight: 700; color: var(--text); min-width: 140px; }
.allergy-tags  { font-size: 12.5px; color: #b45309; background: #fff3d7; padding: 2px 10px; border-radius: 999px; border: 1px solid #fde68a; }
.empty-state-small { font-size: 13px; color: var(--text-muted); padding: 8px 0; }
.section-card  { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.section-card-header { padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }

@media (max-width: 768px) {
  .meal-header-row,
  .meal-row { grid-template-columns: 90px repeat(5, 1fr); }
  .meal-type-col { padding: 8px 6px; }
  .meal-cell     { padding: 8px 6px; min-height: 60px; }
  .meal-day-name { font-size: 11px; }
}

/* =============================================
   AUSWERTUNGEN & STATISTIKEN
   ============================================= */
.stats-tab-btn {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.stats-tab-btn:hover  { border-color: var(--navy); color: var(--navy); }
.stats-tab-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stats-kpi-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(30,61,115,.05);
  transition: all .15s;
}
.stats-kpi-card:hover { box-shadow: 0 4px 16px rgba(30,61,115,.1); transform: translateY(-1px); }
.stats-kpi-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stats-kpi-value { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1.1; }
.stats-kpi-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.stats-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.stats-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(30,61,115,.05);
}
.stats-card-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin: 0 0 14px;
  text-transform: uppercase; letter-spacing: .04em;
}

/* Gestapelter Anwesenheitsbalken */
.att-stacked-bar {
  display: flex; height: 20px; border-radius: 999px; overflow: hidden;
  background: var(--line); margin-bottom: 10px;
}
.att-seg { height: 100%; transition: width .3s ease; }
.att-seg--anwesend { background: #3a8c68; }
.att-seg--krank    { background: #dc2626; }
.att-seg--abwesend { background: #6b7a8d; }
.att-seg--urlaub   { background: #3a6cb0; }
.att-bar-empty { font-size: 12px; color: var(--text-muted); padding: 2px 10px; }
.att-legend { font-size: 11.5px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 4px; }
.att-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.att-dot--anwesend { background: #3a8c68; }
.att-dot--krank    { background: #dc2626; }
.att-dot--abwesend { background: #6b7a8d; }
.att-dot--urlaub   { background: #3a6cb0; }

/* Gruppenbalken */
.stats-group-list { display: flex; flex-direction: column; gap: 10px; }
.stats-group-item { display: flex; align-items: center; gap: 10px; }
.stats-group-name { font-size: 13px; font-weight: 600; color: var(--text); min-width: 100px; }
.stats-bar-wrap   { flex: 1; background: var(--line); border-radius: 999px; height: 10px; overflow: hidden; }
.stats-bar        { height: 100%; border-radius: 999px; transition: width .3s ease; }
.stats-group-count { font-size: 13px; font-weight: 700; color: var(--navy); min-width: 20px; text-align: right; }

/* Tabelle */
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stats-table thead th {
  padding: 10px 12px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
  background: var(--surface-2); border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.stats-td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.stats-td--name  { font-weight: 700; color: var(--text); }
.stats-td--group { color: var(--text-muted); font-size: 12px; }
.stats-td--num   { text-align: center; font-weight: 700; }
.stats-td--green  { color: #3a8c68; }
.stats-td--red    { color: #dc2626; }
.stats-td--muted  { color: #6b7a8d; }
.stats-td--blue   { color: #3a6cb0; }
.stats-td--navy   { color: var(--navy); }
.stats-td--teal   { color: var(--teal); text-align: center; font-weight: 700; }
.stats-td--orange { color: #d97706;    text-align: center; font-weight: 700; }
.stats-table tbody tr:hover { background: var(--surface-2); }

/* Balken in Tabellenzelle */
.stats-bar-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.stats-bar-inner { height: 8px; border-radius: 999px; flex-shrink: 0; min-width: 2px; transition: width .3s ease; }
.stats-bar-pct   { font-size: 12px; font-weight: 700; white-space: nowrap; }

.stats-meta { font-size: 13px; color: var(--text-muted); }

@media (max-width: 900px) {
  .stats-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row-2    { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-kpi-grid { grid-template-columns: 1fr; }
}

/* =============================================
   TERMINKALENDER
   ============================================= */
.cal-view-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff; font-size: 13px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; transition: all .15s;
}
.cal-view-btn:hover  { border-color: var(--navy); color: var(--navy); }
.cal-view-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Monatsraster */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 2px 12px rgba(30,61,115,.06);
}
.cal-header-cell {
  padding: 10px 0;
  text-align: center;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
  background: var(--surface-2);
  border-bottom: 2px solid var(--border);
}
.cal-cell {
  min-height: 100px;
  padding: 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell--empty   { background: var(--surface-2); }
.cal-cell--weekend { background: #fafbfd; }
.cal-cell--today   { background: #eef4ff; }
.cal-cell--today .cal-day-num {
  background: var(--navy); color: #fff;
  border-radius: 50%; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}
.cal-day-num {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  margin-bottom: 4px; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}
.cal-events-wrap { display: flex; flex-direction: column; gap: 2px; }
.cal-event-pill {
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 10.5px; font-weight: 600; color: #fff;
  cursor: pointer; display: flex; gap: 3px; align-items: center;
  overflow: hidden; white-space: nowrap;
  transition: opacity .1s;
}
.cal-event-pill:hover { opacity: .85; }
.cal-event-time { opacity: .85; font-weight: 400; flex-shrink: 0; }
.cal-event-name { overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: 10px; color: var(--text-light); padding: 1px 4px; }

/* Listenansicht */
.cal-list { display: flex; flex-direction: column; gap: 4px; }
.cal-list-date {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
  padding: 12px 0 4px; border-bottom: 1px solid var(--line);
  margin-top: 8px;
}
.cal-list-date:first-child { margin-top: 0; }
.cal-list-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
  cursor: pointer; transition: all .15s;
}
.cal-list-item:hover { box-shadow: 0 2px 10px rgba(30,61,115,.08); transform: translateY(-1px); border-color: var(--navy); }
.cal-list-color { width: 4px; border-radius: 999px; flex-shrink: 0; align-self: stretch; min-height: 20px; }
.cal-list-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.cal-list-meta  { font-size: 12px; color: var(--text-muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cal-list-desc  { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.4; }
.cal-target-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}

/* Detail-Modal */
.event-detail-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; color: var(--text); }
.event-detail-desc { margin-top: 12px; font-size: 13.5px; color: var(--text-muted); line-height: 1.55; padding-top: 12px; border-top: 1px solid var(--line); }

@media (max-width: 720px) {
  .cal-grid         { grid-template-columns: repeat(7, minmax(40px, 1fr)); overflow-x: auto; }
  .cal-cell         { min-height: 60px; padding: 4px; }
  .cal-event-pill   { font-size: 9px; padding: 1px 3px; }
  .cal-event-time   { display: none; }
}

/* =============================================
   EXPORT & BACKUP
   ============================================= */
.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.export-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(30,61,115,.05);
  transition: all .15s;
}
.export-card:hover { box-shadow: 0 4px 16px rgba(30,61,115,.1); transform: translateY(-1px); }
.export-card-icon  { font-size: 32px; flex-shrink: 0; }
.export-card-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.export-card-desc  { font-size: 12.5px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.4; }
.export-btn        { width: 100%; }

.export-backup-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 2px 8px rgba(30,61,115,.05);
}
.export-backup-header {
  display: flex; gap: 16px; align-items: flex-start;
  margin-bottom: 16px;
}
.export-backup-icon  { font-size: 36px; flex-shrink: 0; }
.export-backup-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.export-backup-desc  { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.export-hint         { font-size: 12px; color: var(--text-light); margin-top: 10px; }
.export-hint code    { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }

/* =============================================
   ANMELDEANFRAGEN (Admin)
   ============================================= */
.enr-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px 14px 0 0;
  padding: 14px 20px;
  border-bottom: none;
}
.enr-panel-title { font-size: 15px; font-weight: 800; color: var(--navy); margin: 0; }

.enr-filter-btn {
  padding: 5px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all .15s;
}
.enr-filter-btn:hover  { border-color: var(--navy); color: var(--navy); }
.enr-filter-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

#enrList {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 14px 14px;
  overflow: hidden;
}

.enr-card {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.enr-card:last-child    { border-bottom: none; }
.enr-card:hover         { background: var(--surface-2); }
.enr-card-head          { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.enr-child-name         { font-size: 15px; font-weight: 800; color: var(--text-dark); }
.enr-child-meta         { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.enr-contact-row        { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; }
.enr-notes              { font-size: 12.5px; color: var(--text-muted); background: var(--surface-2); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; line-height: 1.6; }
.enr-card-foot          { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.enr-created            { font-size: 11.5px; color: var(--text-light); }

.enr-badge              { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.enr-badge-offen        { background: #fef3c7; color: #d97706; }
.enr-badge-akzeptiert   { background: var(--success-bg); color: var(--success-text); }
.enr-badge-abgelehnt    { background: var(--danger-bg);  color: var(--danger-text);  }

/* =============================================
   ELTERN-DASHBOARD
   ============================================= */
.eltern-kind-header {
  display: flex; align-items: center; gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(30,61,115,.05);
  flex-wrap: wrap;
}
.eltern-kind-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  color: #fff; font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.eltern-kind-info  { flex: 1; min-width: 0; }
.eltern-kind-name  { font-size: 20px; font-weight: 800; color: var(--text-dark); margin: 0 0 6px; }
.eltern-kind-meta  { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); }
.eltern-status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 700;
  border: 1px solid;
  white-space: nowrap; flex-shrink: 0;
}
.eltern-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.eltern-card-title {
  font-size: 11px; font-weight: 800; color: var(--navy);
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.eltern-status-big  { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.eltern-detail      { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.eltern-event-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.eltern-event-row:last-child  { border-bottom: none; }
.eltern-event-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.eltern-event-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.eltern-event-date  { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.eltern-info-row {
  display: flex; gap: 10px; padding: 6px 0;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.eltern-info-row:last-child  { border-bottom: none; }
.eltern-info-label  { font-weight: 700; color: var(--text-dark); min-width: 100px; flex-shrink: 0; }

/* ---- Elternbeiträge ---- */
.contrib-filter-btn {
  padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 12.5px; font-weight: 700; color: var(--text-muted); cursor: pointer;
  transition: all .15s;
}
.contrib-filter-btn:hover  { border-color: var(--navy); color: var(--navy); }
.contrib-filter-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* =============================================
   Digitale Bestätigungen
   ============================================= */
.conf-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 13px; padding: 16px 18px; margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(30,61,115,.05);
  transition: border-color .15s, box-shadow .15s;
}
.conf-card:hover { border-color: #b8c6de; box-shadow: 0 4px 16px rgba(30,61,115,.09); }

.conf-tab {
  padding: 7px 18px; border-radius: 999px;
  border: 1.5px solid var(--border); background: #fff;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all .15s;
}
.conf-tab:hover  { border-color: var(--navy); color: var(--navy); }
.conf-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.conf-type-badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .03em;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border);
}
.conf-done-badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700;
  background: #d4ede2; color: #1a6644;
}

.contrib-badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
}
.contrib-offen        { background: #fff3d7; color: #92500a; }
.contrib-bezahlt      { background: #d4ede2; color: #1f6b43; }
.contrib-ueberfaellig { background: #fee2e2; color: #dc2626; }

.contrib-summary-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 18px; min-width: 110px;
  text-align: center;
}
.contrib-summary-val   { font-size: 22px; font-weight: 800; color: var(--navy); line-height: 1.2; }
.contrib-summary-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; font-weight: 600; }

.btn-icon-success { color: var(--teal) !important; }

/* ---- Abmeldung (Eltern) ---- */
.absence-pills {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
}
.absence-pill {
  padding: 8px 18px; border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all .15s;
}
.absence-pill:hover  { border-color: var(--navy); color: var(--navy); }
.absence-pill.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.absence-pill.active.urlaub  { background: #3a6cb0; border-color: #3a6cb0; }
.absence-pill.active.sonstiges { background: var(--teal); border-color: var(--teal); }

.absence-date-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap;
}
.absence-date-row label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.absence-date-row input { width: 150px; }

.absence-list-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.absence-list-item:last-child { border-bottom: none; }
.absence-type-badge {
  display: inline-flex; align-items: center; padding: 2px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.absence-krank    { background: #fef3c7; color: #92500a; }
.absence-urlaub   { background: #dce6f5; color: #1e3d73; }
.absence-sonstiges{ background: #f0faf5; color: #2e6b4f; }

/* Staff: Abmeldungs-Widget */
.abmeldungen-list { display: flex; flex-direction: column; gap: 8px; }
.abmeldung-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px;
}
.abmeldung-name { font-weight: 700; color: var(--text-dark); }
.abmeldung-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Kind-Zuweisung im User-Modal */
.child-assign-list  { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; padding: 2px; }
.child-assign-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 9px;
  border: 1px solid var(--border); cursor: pointer;
  transition: all .15s; font-size: 13.5px; color: var(--text);
}
.child-assign-item:hover    { border-color: var(--navy); background: var(--soft); }
.child-assign-item input[type=checkbox] { accent-color: var(--teal); width: 15px; height: 15px; flex-shrink: 0; }

/* =============================================
   VERSIONIERTE EINWILLIGUNGEN
   ============================================= */
.con-row {
  border: 1.5px solid var(--border);
  border-radius: 11px;
  margin-bottom: 8px;
  background: #fff;
  overflow: hidden;
  transition: border-color .15s;
}
.con-row-open { border-color: var(--teal); }
.con-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
}
.con-info { flex: 1; min-width: 0; }
.con-label { font-size: 13.5px; font-weight: 700; color: var(--text); }
.con-desc  { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.con-meta  { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; min-width: 140px; }
.con-valid { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.con-ver   { font-size: 10.5px; color: var(--text-light); white-space: nowrap; }
.con-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Consent badges */
.con-badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em; white-space: nowrap;
}
.cs-erteilt    { background: #d4ede2; color: #2e7555; }
.cs-widerrufen { background: #fee2e2; color: #dc2626; }
.cs-fehlt      { background: #f1f5f9; color: #6b7a8d; }
.cs-abgelaufen { background: #fee2e2; color: #dc2626; }
.cs-bald       { background: #fef3c7; color: #d97706; }

/* Inline form */
.con-form {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 14px 16px;
}
.con-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

/* Consent history modal table */
.ch-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
}
.ch-table th {
  text-align: left; padding: 8px 10px; font-size: 10.5px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); border-bottom: 1.5px solid var(--border);
  background: var(--surface-2);
}
.ch-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  color: var(--text-muted); vertical-align: middle;
}
.ch-table tr:last-child td { border-bottom: none; }

@media (max-width: 600px) {
  .con-row-main { flex-wrap: wrap; }
  .con-meta     { align-items: flex-start; }
  .con-form-row { grid-template-columns: 1fr; }
}

/* =============================================
   GRUPPENVERWALTUNG
   ============================================= */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.groups-grid--inactive { opacity: .8; }
.groups-section-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin: 4px 0 12px;
}
.group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(30,61,115,.05);
  transition: all .15s;
}
.group-card:hover { box-shadow: 0 4px 16px rgba(30,61,115,.1); transform: translateY(-2px); }
.group-card-header {
  height: 72px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.group-initials {
  font-size: 26px; font-weight: 800; color: rgba(255,255,255,.9);
  text-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.group-inactive-tag {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.35); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 999px;
}
.group-card-body { padding: 14px 16px; }
.group-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.group-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.4; }
.group-meta { margin-bottom: 12px; }
.group-count-badge {
  display: inline-block;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 12px; font-weight: 700;
  padding: 2px 10px; border-radius: 999px;
}
.group-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-sm { padding: 5px 12px !important; font-size: 12px !important; }
.btn-danger { color: #dc2626 !important; border-color: #fca5a5 !important; }
.btn-danger:hover { background: #fee2e2 !important; border-color: #dc2626 !important; }

/* Farbauswahl */
.color-picker-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.color-swatch {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer; transition: all .15s;
  flex-shrink: 0;
}
.color-swatch:hover   { transform: scale(1.15); }
.color-swatch.selected { border-color: #fff; box-shadow: 0 0 0 3px rgba(0,0,0,.3); transform: scale(1.1); }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .sidebar        { transform: translateX(-100%); transition: transform .3s ease; }
  .sidebar.open   { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  .app-main       { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .app-footer     { left: 0; }
  .form-row       { grid-template-columns: 1fr; }
  .stats-grid     { grid-template-columns: 1fr 1fr; }
  .app-content    { padding: 16px; }
  /* Touch-Targets vergrößern */
  .nav-item       { padding: 12px 14px; min-height: 44px; }
  .btn            { min-height: 44px; }
  .btn-sm         { min-height: 36px !important; }
  /* Meal-Grid auf Mobile scrollbar */
  .meal-grid      { overflow-x: auto; min-width: 560px; }
  #mealPlanTable  { overflow-x: auto; }
}
@media (max-width: 480px) {
  .stats-grid     { grid-template-columns: 1fr; }
  .auth-card      { padding: 28px 20px; }
  .page-header    { flex-wrap: wrap; gap: 10px; }
  .stats-kpi-grid { grid-template-columns: 1fr 1fr; }
  .groups-grid    { grid-template-columns: 1fr 1fr; }
  .modal          { padding: 22px 16px; }
}

/* iOS Safe Area (Notch / Dynamic Island / Home Bar) */
@supports (padding: env(safe-area-inset-top)) {
  .app-header  { padding-top: env(safe-area-inset-top); }
  .sidebar     { padding-bottom: env(safe-area-inset-bottom); }
  .app-content { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .auth-page   { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
}
