/* ============================================================
   SCHULBETREUUNG – Main Stylesheet
   ============================================================ */

:root {
  --primary:      #1e3a5f;
  --primary-dark: #142840;
  --primary-light:#2a5490;
  --accent:       #f59e0b;
  --accent-dark:  #d97706;
  --success:      #22c55e;
  --danger:       #ef4444;
  --warning:      #f59e0b;
  --info:         #3b82f6;
  --bg:           #f1f5f9;
  --card:         #ffffff;
  --text:         #1e293b;
  --text-muted:   #64748b;
  --border:       #e2e8f0;
  --sidebar-w:    260px;
}

/* ─── Base ─────────────────────────────────────────────────── */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }

/* ─── Layout ────────────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  overflow-y: auto;
  transition: transform .3s ease;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-brand h1 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: .5px;
}
.sidebar-brand .badge-role {
  font-size: 10px;
  background: rgba(255,255,255,.15);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 4px;
  display: inline-block;
}
.sidebar-user {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
  color: rgba(255,255,255,.7);
}
.sidebar-user strong { color: #fff; display: block; font-size: 14px; }

.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  padding: 12px 20px 4px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,.75);
  font-size: 13.5px;
  transition: all .2s;
  border-radius: 0;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.sidebar-nav a.active { border-left: 3px solid var(--accent); }
.sidebar-nav a i { width: 18px; text-align: center; font-size: 15px; }
.sidebar-nav .badge-count {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-footer a {
  color: rgba(255,255,255,.6);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-footer a:hover { color: #fff; }

/* ─── Main content ──────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
}
.topbar-title { font-size: 18px; font-weight: 600; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.page-content { padding: 24px 28px; flex: 1; }

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.card-header-custom {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header-custom h5 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.card-body-custom { padding: 20px; }

/* ─── Stat cards ─────────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.bg-primary-soft { background: rgba(30,58,95,.1); color: var(--primary); }
.stat-icon.bg-success-soft { background: rgba(34,197,94,.1); color: var(--success); }
.stat-icon.bg-warning-soft { background: rgba(245,158,11,.1); color: var(--accent); }
.stat-icon.bg-danger-soft  { background: rgba(239,68,68,.1);  color: var(--danger); }
.stat-icon.bg-info-soft    { background: rgba(59,130,246,.1); color: var(--info); }

.stat-value { font-size: 26px; font-weight: 700; line-height: 1; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn { border-radius: 6px; font-weight: 500; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

/* ─── Tables ─────────────────────────────────────────────────── */
.table-custom { width: 100%; border-collapse: collapse; }
.table-custom th {
  background: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.table-custom td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table-custom tr:last-child td { border-bottom: none; }
.table-custom tr:hover td { background: #f8fafc; }

/* ─── Status badges ──────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.status-approved  { background: rgba(34,197,94,.15);  color: #15803d; }
.status-pending   { background: rgba(245,158,11,.15); color: #92400e; }
.status-blocked   { background: rgba(239,68,68,.15);  color: #b91c1c; }
.status-open      { background: rgba(59,130,246,.15); color: #1d4ed8; }
.status-filled    { background: rgba(34,197,94,.15);  color: #15803d; }
.status-cancelled { background: rgba(239,68,68,.15);  color: #b91c1c; }

/* ─── Week schedule grid ─────────────────────────────────────── */
.week-grid {
  display: grid;
  grid-template-columns: auto repeat(5, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.week-grid .cell {
  background: #fff;
  padding: 10px 12px;
  min-height: 50px;
  display: flex;
  align-items: center;
}
.week-grid .header-cell {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  justify-content: center;
  padding: 12px;
}
.week-grid .row-label {
  background: #f8fafc;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.week-grid .time-chip {
  background: var(--primary);
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.week-grid .time-chip.mittag { background: var(--accent); color: #fff; }
.week-grid .no-entry { color: #cbd5e1; font-size: 18px; text-align: center; }

/* ─── Attendance list (print) ────────────────────────────────── */
.attendance-list { font-size: 13px; }
.attendance-list th, .attendance-list td { padding: 8px 10px; }
.attendance-list .check-box {
  width: 20px; height: 20px;
  border: 2px solid #333;
  display: inline-block;
  border-radius: 3px;
}

/* ─── Login page ─────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo h1 {
  font-size: 22px;
  color: var(--primary);
  font-weight: 700;
  margin: 0;
}
.auth-logo p { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }

/* ─── Notification bell ──────────────────────────────────────── */
.notif-btn { position: relative; }
.notif-badge {
  position: absolute;
  top: -3px; right: -5px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

/* ─── Mobile toggle ──────────────────────────────────────────── */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text);
  cursor: pointer;
}

/* ─── Alerts / notices ───────────────────────────────────────── */
.week-locked-notice {
  background: #fef9c3;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  padding: 12px 16px;
  color: #78350f;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─── Print styles ────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .no-print, .btn, nav { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  .card { border: 1px solid #ccc !important; box-shadow: none !important; }
  body { font-size: 12px; }
  .attendance-list th, .attendance-list td { padding: 5px 8px; }
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 20px; }
  .week-grid { grid-template-columns: auto repeat(5, 1fr); font-size: 11px; }
  .week-grid .cell { padding: 6px; }
}

/* ─── Utilities ──────────────────────────────────────────────── */
.text-primary-custom { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.bg-primary-custom { background: var(--primary) !important; }
.fw-600 { font-weight: 600; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.gap-8 { gap: 8px; }
.rounded-lg { border-radius: 10px; }
.shadow-sm-custom { box-shadow: 0 1px 3px rgba(0,0,0,.05); }
