/* ============================================================
   KITA PLANER – App Layout & Component Styles
   ============================================================ */

/* ── App shell ───────────────────────────────────────────── */
#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Full-page auth screen */
.auth-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  background: linear-gradient(145deg, #E8EEFF 0%, #F5F5F7 40%, #FFF0F5 100%);
}
@media (prefers-color-scheme: dark) {
  .auth-screen { background: linear-gradient(145deg, #1a1a2e 0%, #1C1C1E 40%, #1e1a20 100%); }
}

/* ── Main app layout (sidebar + content) ─────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 1fr;
  min-height: 100dvh;
  gap: 0;
}
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; }
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--glass-deep);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  overflow: hidden;
}
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease);
    box-shadow: var(--shadow-xl);
  }
  .sidebar.open { transform: translateX(0); }
}

/* Sidebar brand */
.sb-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sb-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.sb-brand-logo svg { width: 22px; height: 22px; fill: none; stroke: white; stroke-width: 2; }
.sb-brand-name { font-size: 16px; font-weight: 700; color: var(--text); }
.sb-brand-sub  { font-size: 11px; color: var(--text-sec); }

/* Sidebar nav */
.sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-3) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sb-nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-ter);
  padding: var(--sp-3) var(--sp-2) var(--sp-1);
  margin-top: var(--sp-2);
}
.sb-nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-3);
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-sec);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: all 0.15s var(--ease);
  position: relative;
}
.sb-nav-item .icon {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.04);
  flex-shrink: 0;
  transition: all 0.15s var(--ease);
}
.sb-nav-item svg { width: 16px; height: 16px; }
.sb-nav-item:hover { color: var(--text); background: rgba(0,0,0,0.04); }
.sb-nav-item.active {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-light);
}
.sb-nav-item.active .icon { background: rgba(0,122,255,0.12); color: var(--accent); }
.sb-nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  min-width: 20px;
  text-align: center;
}

/* Sidebar user */
.sb-user {
  border-top: 1px solid var(--border);
  padding: var(--sp-4) var(--sp-4);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.sb-user-info { flex: 1; min-width: 0; }
.sb-user-name { font-size: 14px; font-weight: 600; color: var(--text); }
.sb-user-role { font-size: 12px; color: var(--text-sec); }
.sb-user-btn  { opacity: 0.6; transition: opacity 0.15s; cursor: pointer; background: none; border: none; color: var(--text); padding: 4px; border-radius: var(--r-sm); }
.sb-user-btn:hover { opacity: 1; }

/* ── Mobile header ───────────────────────────────────────── */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--glass);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-3) var(--sp-4);
  align-items: center;
  justify-content: space-between;
  padding-top: calc(var(--sp-3) + env(safe-area-inset-top, 0));
}
@media (max-width: 1024px) { .mobile-header { display: flex; } }

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: calc(var(--z-sidebar) - 1);
}
.sidebar-overlay.show { display: block; }

/* Bottom nav (mobile) */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  background: var(--glass);
  border-top: 1px solid var(--border);
  padding: var(--sp-2) var(--sp-4) calc(var(--sp-2) + env(safe-area-inset-bottom, 0));
  display: none;
  justify-content: space-around;
  gap: var(--sp-1);
}
@media (max-width: 640px) { .bottom-nav { display: flex; } }

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-md);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-ter);
  cursor: pointer;
  border: none;
  background: none;
  text-decoration: none;
  transition: color 0.15s;
  min-width: 52px;
}
.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-item.active { color: var(--accent); }

/* ── Main content ────────────────────────────────────────── */
.main-content {
  margin-left: 260px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
@media (max-width: 1024px) { .main-content { margin-left: 0; } }
@media (max-width: 640px)  { .main-content { padding-bottom: 80px; } }

.content-area {
  flex: 1;
  padding: var(--sp-6);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}
@media (max-width: 768px)  { .content-area { padding: var(--sp-4); } }

/* ── Page header ─────────────────────────────────────────── */
.page-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}
.page-hd-left { flex: 1; min-width: 0; }
.page-hd h1  { font-family: var(--font-d); font-size: 26px; font-weight: 700; letter-spacing: -0.4px; color: var(--text); }
.page-hd .subtitle { color: var(--text-sec); font-size: 14px; margin-top: 2px; }
.page-hd-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }

/* ── Dashboard cards ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.stat-card {
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition: transform 0.12s, box-shadow 0.12s;
}
a.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.10); }
.stat-card .value { font-size: 32px; font-weight: 700; font-family: var(--font-d); line-height: 1; }
.stat-card .label { font-size: 13px; font-weight: 500; color: var(--text-sec); }
.stat-card .icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  margin-bottom: var(--sp-1);
}
.stat-card .icon svg { width: 20px; height: 20px; }

/* ── Dashboard-Widget-Header (einheitlich) ───────────────── */
.dash-widget-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  min-height: 52px;
  box-sizing: border-box;
}
.dash-widget-hd h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

/* ── Schedule view ───────────────────────────────────────── */
/* ── Schedule toolbar (unified bar) ──────────────────────── */
.sched-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.sched-bar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--glass);
  border: 1px solid var(--border-med);
  border-radius: 14px;
  padding: 4px;
  box-shadow: var(--shadow-xs);
}
.sched-nav-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.12s;
}
.sched-nav-btn:hover { background: rgba(0,0,0,0.06); }
.sched-bar-week {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 12px;
  min-width: 180px;
}
.sched-kw {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.sched-dates {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.sched-today-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border-med);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  margin-left: 2px;
  transition: background 0.12s;
}
.sched-today-btn:hover { background: var(--accent-light); }
.sched-bar-filter {
  flex: 1;
  min-width: 140px;
  max-width: 200px;
}
.sched-filter-sel {
  width: 100%;
  height: 42px;
  background: var(--glass);
  border: 1px solid var(--border-med);
  border-radius: 12px;
  padding: 0 34px 0 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%2386868B' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
  box-shadow: var(--shadow-xs);
}
.sched-bar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}
.sched-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border-med);
  background: var(--glass);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sec);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
  box-shadow: var(--shadow-xs);
}
.sched-action-btn:hover { background: var(--bg-sec); color: var(--text); }
.sched-action-accent { color: var(--accent) !important; border-color: var(--accent) !important; background: var(--accent-light) !important; }
.sched-action-accent:hover { background: rgba(0,122,255,0.15) !important; }

/* Schedule group accordion */
.group-section {
  margin-bottom: 16px;
  border-radius: 18px;
  overflow: clip;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  border: 1px solid var(--border);
  background: var(--glass);
  border-left: 4px solid var(--grp-color, #007AFF);
}
.group-section-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 14px;
  background: transparent;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}
.group-section-hd:hover { background: rgba(0,0,0,0.02); }
.grp-avatar {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}
.grp-hd-info { flex: 1; }
.group-section-hd h3 { font-size: 15px; font-weight: 700; color: var(--text); margin: 0; }
.grp-hd-meta { font-size: 12px; color: var(--text-ter); margin-top: 1px; }
.grp-chevron-wrap {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.04);
}
.group-chevron { transition: transform 0.2s var(--ease); color: var(--text-sec); }
.group-section.collapsed .group-chevron { transform: rotate(-90deg); }
.group-section-body { display: block; }
.group-section.collapsed .group-section-body { display: none; }

/* Schedule table */
.schedule-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.schedule-table thead th {
  background: rgba(255,255,255,0.55);
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid rgba(0,0,0,0.06);
  text-align: center;
  white-space: nowrap;
}
.schedule-table thead th:last-child { border-right: none; }
.th-staff {
  text-align: left !important;
  padding-left: 14px !important;
  width: 200px;
  color: var(--text-ter);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-right: 2px solid var(--border);
}
.schedule-table thead th.col-reset { width: 44px; }
.schedule-table thead th.today { background: rgba(0,122,255,0.07); }
.schedule-table thead th.today .th-day-label { color: var(--accent); }
.schedule-table thead th.holiday { background: rgba(255,59,48,0.06); }
.th-day-label {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  color: var(--text);
}
.th-day-abbr {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-ter);
}
.schedule-table thead th.today .th-day-abbr { color: var(--accent); }
.th-day-date { font-size: 16px; font-weight: 800; color: var(--text); line-height: 1; }
.th-day-month { font-size: 12px; font-weight: 600; color: var(--text-sec); }
.th-day-badge {
  display: inline-block;
  margin-top: 3px;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.th-day-badge-err  { background: rgba(255,59,48,0.12); color: var(--err); }
.th-day-badge-warn { background: rgba(255,149,0,0.12); color: var(--warn); }

.schedule-table tbody td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid rgba(0,0,0,0.06);
  vertical-align: middle;
  position: relative;
}
.schedule-table tbody td:last-child { border-right: none; }
.schedule-table tbody tr:last-child td { border-bottom: none; }
/* Alternating row colors */
.schedule-table tbody tr:nth-child(even) td { background-color: rgba(0,0,0,0.018); }
.schedule-table tbody tr:nth-child(even) td.slot-cell.today { background: rgba(0,122,255,0.055); }
.schedule-table tbody tr:nth-child(even) td.slot-cell.holiday { background: rgba(255,59,48,0.055); }

/* Staff cell */
.staff-cell { padding: 6px 10px; border-right: 2px solid var(--border) !important; }
.staff-row { display: flex; align-items: center; gap: 10px; }
.staff-avatar {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.staff-info { min-width: 0; }
.staff-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-meta { display: flex; align-items: center; gap: 5px; margin-top: 2px; flex-wrap: wrap; }
.staff-meta .hours {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-ter);
}
.hours-over  { color: var(--warn) !important; }
.hours-under { color: var(--err) !important; }
.hours-ok    { color: var(--ok) !important; }
.staff-note  { font-size: 11px; color: var(--text-ter); margin-top: 3px; font-style: italic; }

/* Slot cell */
.slot-cell {
  padding: 0;
  height: 58px;
  cursor: pointer;
  transition: background 0.12s;
}
.slot-cell.holiday  { background: rgba(255,59,48,0.04); cursor: default; }
.slot-cell.today    { background: rgba(0,122,255,0.04); }
.slot-cell.closure  { background: repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(0,0,0,0.02) 6px, rgba(0,0,0,0.02) 12px); cursor: default; }
.slot-cell.has-conflict { background: rgba(255,149,0,0.08); }
.slot-cell:not(.holiday):not(.closure):hover { background: rgba(0,122,255,0.06); }

.slot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 4px;
  padding: 6px 8px;
}
.slot-add-hint {
  opacity: 0;
  font-size: 22px;
  color: var(--text-ter);
  transition: opacity 0.15s;
  font-weight: 300;
}
.slot-cell:not(.holiday):not(.closure):hover .slot-add-hint { opacity: 1; }

.slot-time { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.slot-note { font-size: 11px; color: var(--text-sec); }

/* Break info below shift pill */
.break-info { font-size: 10px; color: var(--text-ter); margin-top: 2px; white-space: nowrap; }

/* VB badge in staff cell (on its own line now) */
.vb-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 20px;
  background: rgba(52,199,89,0.12);
  color: #1a8f3c;
}

/* Dienst-Label badge (Frühdienst / Spätdienst) */
.dienst-label-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

/* Aushilfe-out indicator in home group */
.aushilfe-out-badge {
  font-size: 10px;
  font-weight: 600;
  color: #3d3a8f;
  margin-top: 2px;
  opacity: 0.8;
}

/* Events row */
.events-row td { padding: 4px 6px; border-top: 1px solid rgba(0,0,0,0.06); background: rgba(0,0,0,0.015); border-bottom: 0 !important; border-right: 1px solid rgba(0,0,0,0.06) !important; }
.events-row td:last-child { border-right: none !important; }
.events-label-cell {
  font-size: 10px; font-weight: 700; color: var(--text-ter);
  padding-left: 14px !important; padding-right: 10px !important;
  white-space: nowrap; border-right: 2px solid var(--border) !important;
  vertical-align: middle;
}
.events-cell {
  vertical-align: middle;
  text-align: center;
  position: relative;
  transition: background 0.12s;
  padding: 4px 6px !important;
}
.events-cell:hover { background: rgba(0,122,255,0.06); }
.events-cell.today:hover { background: rgba(0,122,255,0.10); }
.events-cell:hover .ev-day-add-btn { opacity: 1; }
.ev-day-add-btn {
  opacity: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1px solid var(--border-med);
  background: var(--glass);
  cursor: pointer;
  color: var(--text-ter);
  vertical-align: middle;
  transition: opacity 0.12s, background 0.12s, color 0.12s, border-color 0.12s;
}
.ev-day-add-btn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); opacity: 1; }
.event-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid;
  margin: 1px 2px 1px 0;
  white-space: nowrap;
  vertical-align: middle;
}
.event-pill-editable { cursor: pointer; transition: opacity 0.12s; }
.event-pill-editable:hover { opacity: 0.75; }
.event-pill-note { font-size: 9px; font-weight: 400; opacity: 0.7; margin-left: 2px; }

/* Aushilfe rows */
.aushilfe-row td { background: rgba(88,86,214,0.03); }
.aushilfe-name { color: var(--text-sec) !important; }
.aushilfe-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  background: rgba(88,86,214,0.12);
  color: #3d3a8f;
  letter-spacing: 0.02em;
}
.pill-aushilfe { opacity: 0.75; border: 1px dashed currentColor !important; }

/* Aushilfe toggle in modal */
.aushilfe-toggle-wrap {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.06);
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  cursor: pointer;
}
.toggle-row input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.toggle-label { font-size: 13px; font-weight: 500; color: var(--text); }

/* Drag handle for sortable lists */
.drag-handle {
  cursor: grab;
  color: var(--text-ter);
  padding: 0 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.drag-handle:active { cursor: grabbing; }
.grp-row.dragging { opacity: 0.4; }
.grp-row.drag-over { border-top: 2px solid var(--accent); }


/* Group row in employee modal – proper flex layout */
.group-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.group-row .group-sel { flex: 1; min-width: 0; }
.group-row .grp-hours { width: 88px; flex-shrink: 0; }

/* Reset cell */
.reset-cell { padding: 0; text-align: center; width: 52px; }
.reset-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--border-med);
  background: none;
  color: var(--text-ter);
  cursor: pointer;
  display: grid;
  place-items: center;
  margin: auto;
  transition: all 0.15s;
}
.reset-btn:hover { border-color: var(--err); color: var(--err); background: var(--err-light); }

/* FK summary row */
.fk-summary-row td { background: var(--bg-sec); border-top: 1px solid var(--border); }
.fk-label-cell {
  padding: 6px 10px !important;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-sec);
  white-space: nowrap;
  border-right: 2px solid var(--border) !important;
  vertical-align: middle;
}
.fk-cell { text-align: center; padding: 6px 4px !important; }
.fk-cell-today { background: rgba(0,122,255,0.04); }
.fk-cell-holiday { background: rgba(255,59,48,0.04); }
.fk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.fk-badge-ok   { background: rgba(52,199,89,0.12); color: #1a8f3c; }
.fk-badge-warn { background: rgba(255,149,0,0.12); color: var(--warn); }
.fk-badge-zero { background: rgba(0,0,0,0.05); color: var(--text-ter); }

/* ── Employee list ───────────────────────────────────────── */
.emp-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: var(--sp-5);
  align-items: start;
}
@media (max-width: 1100px) { .emp-grid { grid-template-columns: 1fr; } }
.emp-form-sticky { position: sticky; top: var(--sp-6); }

/* ── Employee group overview chips ────────────────────────── */
.emp-grp-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--sp-4);
}
.emp-grp-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--glass);
  border: 1px solid var(--border-med);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.emp-grp-chip:hover   { background: rgba(0,122,255,0.06); border-color: var(--accent); }
.emp-grp-chip.active  { background: var(--accent-light); border-color: var(--accent); }

/* ── Employee compact table ───────────────────────────────── */
.emp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.emp-table thead th {
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-sec);
  background: rgba(0,0,0,0.02);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.emp-grp-hd-row td, .emp-grp-hd-cell {
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-sec);
  background: rgba(0,0,0,0.015);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.emp-tr {
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--border);
}
.emp-tr:last-child { border-bottom: none; }
.emp-tr:hover { background: rgba(0,122,255,0.04); }
.emp-tr-inactive { opacity: 0.55; }

.emp-td-name {
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}
.emp-td-grp  { padding: 9px 14px; color: var(--text-sec); }
.emp-td-num  { padding: 9px 14px; text-align: right; white-space: nowrap; }
.emp-td-arrow { padding: 9px 10px 9px 4px; color: var(--text-ter); width: 20px; }

/* Avatar sm size */
.avatar.avatar-sm {
  width: 30px;
  height: 30px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Legacy list styles kept for non-table contexts */
.emp-list-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
  cursor: pointer;
}
.emp-list-item:last-child { border-bottom: none; }
.emp-list-item:hover { background: rgba(0,122,255,0.03); }
.emp-info { flex: 1; min-width: 0; }
.emp-name { font-size: 15px; font-weight: 700; color: var(--text); }
.emp-sub  { font-size: 13px; color: var(--text-sec); margin-top: 2px; }
.emp-tags { display: flex; gap: var(--sp-1); flex-wrap: wrap; margin-top: var(--sp-2); }

/* Group tag row */
.group-row {
  display: grid;
  grid-template-columns: 1fr 120px 32px;
  gap: var(--sp-2);
  align-items: center;
}
.sum-display {
  padding: 10px 14px;
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-sec);
  text-align: center;
}

/* ── Absence view ────────────────────────────────────────── */
.absence-month-header {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-sec);
  padding: var(--sp-3) var(--sp-5);
  background: rgba(0,0,0,0.02);
  border-bottom: 1px solid var(--border);
}
.absence-item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.absence-item:last-child { border-bottom: none; }
.absence-item:hover { background: rgba(0,0,0,0.015); }
.absence-color-bar {
  width: 4px;
  align-self: stretch;
  border-radius: 2px;
  flex-shrink: 0;
}
.absence-info { flex: 1; min-width: 0; }
.absence-name { font-size: 15px; font-weight: 600; color: var(--text); }
.absence-dates { font-size: 13px; color: var(--text-sec); margin-top: 2px; }
.absence-note { font-size: 12px; color: var(--text-ter); margin-top: 2px; font-style: italic; }
.absence-type-badge { flex-shrink: 0; }

/* ── Settings ────────────────────────────────────────────── */
.settings-tabs {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.settings-pill-nav {
  flex-wrap: wrap;
  display: inline-flex;
}
.settings-panel { animation: page-enter 0.18s var(--ease-out) both; }
@keyframes page-enter { from { opacity: 0; transform: translateY(6px); } }

.settings-card {
  overflow: hidden;
  border-radius: 16px;
}
.settings-card-hd {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.settings-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.settings-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.settings-card-ft {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-sec);
}

/* Settings list rows */
.settings-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.settings-list-row:last-child { border-bottom: none; }
.settings-list-row:hover { background: var(--bg-sec); }

.grp-color-swatch {
  width: 4px;
  height: 36px;
  border-radius: 2px;
  flex-shrink: 0;
}

.color-picker-input {
  width: 40px;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--glass);
}

/* Template chips */
.tpl-chips-wrap { min-height: 56px; }
.tpl-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  border: 1px solid rgba(0,122,255,0.2);
  border-radius: 20px;
  padding: 5px 5px 5px 12px;
  font-size: 13px;
}
.tpl-chip-label { font-weight: 600; color: var(--accent); }
.tpl-chip-time  { color: var(--text-sec); }
.tpl-chip-del {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,122,255,0.15);
  border: none;
  box-shadow: none;
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.tpl-chip-del:hover { background: rgba(255,59,48,0.15); color: var(--err); }

.settings-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--text-sec);
  font-size: 14px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sched-bar-week { min-width: 150px; }
  .sched-dates { font-size: 12px; }
  .th-staff { width: 120px; }
  .slot-cell { height: 58px; }
  .staff-avatar { display: none; }
  .th-day-date { font-size: 18px; }
}

@media (max-width: 480px) {
  .page-hd { margin-bottom: var(--sp-4); }
  .page-hd h1 { font-size: 22px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Conflict indicator ──────────────────────────────────── */
.conflict-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--warn);
}

/* ── Skeleton loading ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(0,0,0,0.06) 25%,
    rgba(0,0,0,0.10) 50%,
    rgba(0,0,0,0.06) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Print / PDF Export ──────────────────────────────────── */
@media print {
  @page { size: A4 landscape; margin: 7mm 9mm; }

  /* Farben im Druck erzwingen */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  /* Alles ausblenden außer Dienstplan */
  .sidebar, .mobile-header, .bottom-nav, .sidebar-overlay,
  .sched-bar, .page-hd, #toast-container, .modal-overlay,
  .slot-add-hint, .slot-del, .group-chevron, .min-staff-warn,
  .reset-cell, .reset-btn, .events-row, .fk-summary-row,
  .grp-chevron-wrap { display: none !important; }

  body, html { background: white !important; }
  #app { display: block !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
  .content-area  { padding: 0 !important; max-width: none !important; }
  #schedule-body { padding: 0 !important; }

  /* Druckkopf */
  #schedule-body::before {
    content: "Obermayr Krippe & Kindergarten – Dienstplan " attr(data-kw);
    display: block;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #000;
    border-bottom: 1.5px solid #000;
    padding-bottom: 3px;
  }

  /* Gruppen */
  .group-section {
    border: none !important;
    box-shadow: none !important;
    background: white !important;
    margin-bottom: 5px !important;
    border-radius: 0 !important;
    page-break-inside: avoid;
  }
  .group-section-body { display: block !important; }
  .glass { background: white !important; box-shadow: none !important; border: none !important; }

  /* Gruppenüberschrift */
  .group-section-hd {
    padding: 3px 6px !important;
    background: #f3f3f5 !important;
    border-bottom: 1px solid #ccc !important;
    border-radius: 0 !important;
  }
  .group-section-hd h3 { font-size: 9px !important; }
  .grp-hd-meta { font-size: 8px !important; }
  .grp-avatar { width: 12px !important; height: 12px !important; border-radius: 3px !important; font-size: 6px !important; }

  /* Tabelle */
  .schedule-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 8px !important;
    table-layout: fixed !important;
  }
  .table-wrap { overflow: visible !important; }

  /* Spaltenköpfe – kein Today-Highlight im Druck */
  .schedule-table thead th {
    padding: 3px 4px !important;
    font-size: 8px !important;
    font-weight: 700 !important;
    border: 1px solid #ccc !important;
    background: #f3f3f5 !important;
    text-align: center !important;
    color: #000 !important;
  }
  .schedule-table thead th:first-child { text-align: left !important; width: 100px !important; }
  .schedule-table thead th.today    { background: #f3f3f5 !important; color: #000 !important; }
  .schedule-table thead th.holiday  { background: #ffe8e8 !important; color: #cc0000 !important; }

  /* Tagesnamen kompakt */
  .th-day-abbr { font-size: 7px !important; letter-spacing: 0 !important; }
  .th-day-date { font-size: 10px !important; }
  .th-staff { border-right: none !important; }
  .staff-cell { border-right: none !important; }
  .th-day-month { font-size: 7px !important; }
  .th-day-badge { font-size: 6px !important; padding: 1px 4px !important; }
  .staff-avatar { display: none !important; }

  /* Zeilen */
  .schedule-table tbody td {
    padding: 2px 3px !important;
    border: 1px solid #ddd !important;
    vertical-align: middle !important;
    height: 20px !important;
  }
  .schedule-table tbody td:first-child { font-size: 7.5px !important; font-weight: 600 !important; }

  /* Heute-Zelle: kein Blau im Druck */
  .slot-cell.today { background: white !important; }
  .slot-cell { height: auto !important; min-height: 0 !important; cursor: default !important; }
  .slot-cell.holiday { background: #fff0f0 !important; }

  /* Staff cell kompakt */
  .staff-cell { padding: 2px 5px !important; }
  .staff-name { font-size: 8px !important; font-weight: 700 !important; }
  .staff-meta { font-size: 7px !important; margin-top: 0 !important; }
  .staff-note { display: none !important; }
  .vb-badge   { display: none !important; }

  /* Schicht-Pills in Farbe */
  .pill-shift {
    font-size: 7.5px !important;
    padding: 1px 5px !important;
    border-radius: 3px !important;
    background: #d4edda !important;
    color: #155724 !important;
    display: inline-block !important;
    white-space: nowrap !important;
  }
  .slot-inner { padding: 2px 3px !important; gap: 2px !important; }
  .break-info { font-size: 6px !important; }
  .dienst-label-badge { font-size: 6px !important; }

  /* Abwesenheits-Pills: Originalfarben behalten */
  .pill-abs {
    font-size: 7px !important;
    padding: 1px 5px !important;
    border-radius: 3px !important;
    display: inline-flex !important;
    gap: 2px !important;
  }
  .pill-abs-urlaub    { background: #dce8ff !important; color: #003fa3 !important; }
  .pill-abs-krank     { background: #ffe0de !important; color: #a50000 !important; }
  .pill-abs-schule    { background: #f0e0ff !important; color: #5c008c !important; }
  .pill-abs-fortbildung { background: #d9f9f7 !important; color: #006b64 !important; }
}

/* ── Stats / Auswertung view ─────────────────────────────── */
.stats-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
}

.stats-table thead th {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sec);
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sec);
}

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

.stats-table tbody tr:last-child { border-bottom: none; }
.stats-table tbody tr:hover { background: var(--bg-sec); }
.stats-table tfoot td { padding: 10px 12px; }

.stat-cell {
  text-align: center;
  padding: 10px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.stat-cell-hd {
  text-align: center;
  padding: 10px 12px;
}

/* Vacation/hours inline mini stats in employee modal */
.stat-mini {
  text-align: center;
  flex: 1;
}

.stat-mini-val {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

/* Colour helpers */
.hours-warn { color: var(--warn, #FF9500); }

/* Today view */
.today-row { display:flex; align-items:center; gap:12px; padding:12px 16px; border-bottom:1px solid var(--border); }
.today-row:last-child { border-bottom:none; }
.today-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.today-name { font-size:14px; font-weight:600; }
.today-empty { padding:24px; text-align:center; color:var(--text-sec); font-size:14px; }

/* Employee dashboard day cards */
.day-card { display:flex; flex-direction:column; align-items:center; gap:4px; padding:12px 8px; border-radius:12px; border:1px solid var(--border); text-align:center; background:var(--glass); min-height:72px; justify-content:center; }
.day-card-name { font-size:11px; font-weight:700; color:var(--text-sec); letter-spacing:.06em; }
.day-card-today { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-light); }
.day-card-present { background:rgba(52,199,89,0.08); border-color:rgba(52,199,89,0.25); }
.day-card-absent { background:rgba(255,59,48,0.06); border-color:rgba(255,59,48,0.2); }
.day-card-holiday { background:rgba(255,149,0,0.08); border-color:rgba(255,149,0,0.2); }
.day-card-free { opacity:.5; }

/* Pending badge override — absence requests use error colour */
#nav-badge-abwesenheiten { background:var(--err); }

/* Timesheet */
.ts-sheet { overflow:hidden; }
.ts-header { display:flex; justify-content:space-between; align-items:flex-start; padding:24px 28px 20px; border-bottom:1px solid var(--border); }
.ts-title { font-size:22px; font-weight:700; }
.ts-subtitle { font-size:14px; color:var(--text-sec); margin-top:2px; }
.ts-table { width:100%; border-collapse:collapse; }
.ts-table th { padding:10px 16px; font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--text-sec); border-bottom:2px solid var(--border); background:var(--bg-sec); }
.ts-table td { padding:8px 16px; border-bottom:1px solid var(--border); font-size:13px; }
.ts-table tbody tr:hover { background:var(--bg-sec); }
.ts-weekend td { color:var(--text-ter); background:rgba(0,0,0,0.02); }
.ts-holiday td { background:rgba(255,149,0,0.05); }
.ts-absence td { background:rgba(0,122,255,0.04); }
.ts-free td { opacity:.5; }
.ts-total-row td { border-top:2px solid var(--border); background:var(--bg-sec); }
.ts-num { text-align:right; font-variant-numeric:tabular-nums; }
.ts-signature { display:flex; gap:40px; justify-content:flex-end; padding:28px 28px 24px; border-top:1px solid var(--border); }
.ts-sig-box { text-align:center; }
.ts-sig-line { width:180px; height:1px; background:var(--border-med); margin-bottom:8px; }

/* Print overrides for timesheet */
@media print {
  .ts-sheet { box-shadow:none !important; border:none !important; background:white !important; }
  .ts-table td, .ts-table th { border-color:#ddd !important; }
}

/* ── Min-staff warning ───────────────────────────────────── */
.min-staff-warn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #FF9500;
  background: rgba(255,149,0,0.12);
  border-radius: 20px;
  padding: 2px 8px;
  margin-left: 8px;
}

/* ── Preview banner ──────────────────────────────────────── */
.preview-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255,149,0,0.15);
  border-bottom: 1px solid rgba(255,149,0,0.3);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #FF9500;
  position: sticky;
  top: 0;
  z-index: 90;
}
.preview-banner-end {
  background: none;
  border: none;
  color: #FF9500;
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
