:root {
  --al-bg: #f4f6f8;
  --al-sidebar: #142433;
  --al-sidebar-active: #1f3a52;
  --al-accent: #1b7f5c;
  --al-accent-dark: #145f45;
  --al-text: #1c2b36;
  --al-muted: #667685;
  --al-border: #e1e6ea;
  --al-card: #ffffff;
  --al-danger: #c0392b;
  --al-warning: #b8860b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--al-bg);
  color: var(--al-text);
}

.al-layout { display: flex; min-height: 100vh; }

.al-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--al-sidebar);
  color: #cfe0d8;
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.al-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 20px 20px;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 12px;
}

.al-brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--al-accent); }

.al-nav-section { padding: 14px 20px 6px 20px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: #7d93a3; }

.al-nav a {
  display: block;
  padding: 8px 20px;
  color: #cfe0d8;
  text-decoration: none;
  font-size: 0.92rem;
}

.al-nav a:hover, .al-nav a.active {
  background: var(--al-sidebar-active);
  color: #fff;
  border-left: 3px solid var(--al-accent);
  padding-left: 17px;
}

.al-main { flex: 1; min-width: 0; }

.al-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--al-card);
  border-bottom: 1px solid var(--al-border);
}

.al-topbar .who { font-size: 0.9rem; color: var(--al-muted); }

.al-content { padding: 28px; max-width: 1200px; }

h1 { font-size: 1.6rem; margin: 0 0 4px 0; }
h2 { font-size: 1.2rem; margin: 0 0 12px 0; }
.al-subtitle { color: var(--al-muted); margin-bottom: 24px; }

.al-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 28px; }

.al-card {
  background: var(--al-card);
  border: 1px solid var(--al-border);
  border-radius: 10px;
  padding: 16px 18px;
}

.al-card .label { color: var(--al-muted); font-size: 0.82rem; }
.al-card .value { font-size: 1.7rem; font-weight: 700; margin-top: 6px; }

.al-panel {
  background: var(--al-card);
  border: 1px solid var(--al-border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 22px;
}

table.al-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.al-table th {
  text-align: left;
  color: var(--al-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--al-border);
  padding: 8px 10px;
}
table.al-table td { padding: 10px; border-bottom: 1px solid var(--al-border); vertical-align: middle; }
table.al-table tr:hover td { background: #fafcfb; }

.al-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.al-badge.aktiv { background: #e4f5ec; color: var(--al-accent-dark); }
.al-badge.geplant { background: #eef1f4; color: var(--al-muted); }
.al-badge.beendet { background: #e9edf1; color: #445; }
.al-badge.abgebrochen, .al-badge.unentschuldigt { background: #fbe6e3; color: var(--al-danger); }
.al-badge.warn { background: #fdf1da; color: var(--al-warning); }

.al-btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--al-accent);
  color: #fff !important;
  text-decoration: none;
  font-size: 0.88rem;
  border: none;
  cursor: pointer;
}
.al-btn:hover { background: var(--al-accent-dark); }
.al-btn.secondary { background: #eef1f4; color: var(--al-text) !important; }
.al-btn.secondary:hover { background: #e1e6ea; }

.al-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--al-border); margin-bottom: 20px; }
.al-tabs a {
  padding: 10px 16px;
  color: var(--al-muted);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
}
.al-tabs a.active { color: var(--al-accent-dark); border-bottom-color: var(--al-accent); font-weight: 600; }

.al-form label { display: block; font-size: 0.85rem; color: var(--al-muted); margin: 12px 0 4px; }
.al-form input, .al-form select, .al-form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--al-border);
  border-radius: 6px;
  font-size: 0.92rem;
}

.al-empty { color: var(--al-muted); padding: 20px; text-align: center; }

.al-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--al-sidebar);
}
.al-login-card {
  background: #fff;
  border-radius: 12px;
  padding: 36px;
  width: 340px;
}
.al-login-card h1 { text-align: center; }
.al-login-card .al-btn { width: 100%; margin-top: 14px; text-align: center; }

.al-filterbar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.al-filterbar a {
  padding: 6px 14px;
  border-radius: 999px;
  background: #eef1f4;
  color: var(--al-text);
  text-decoration: none;
  font-size: 0.85rem;
}
.al-filterbar a.active { background: var(--al-accent); color: #fff; }

.al-messages { margin-bottom: 16px; }
.al-messages li { list-style: none; padding: 10px 14px; border-radius: 8px; background: #e4f5ec; margin-bottom: 6px; font-size: 0.9rem; }

/* Anwesenheit: farbcodierte Statusspalten */
.al-status-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.al-status-table th, .al-status-table td { padding: 6px 6px; border-bottom: 1px solid var(--al-border); text-align: center; vertical-align: middle; }
.al-status-table th { color: var(--al-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.02em; }
.al-status-table td.al-tn-name { text-align: left; font-weight: 600; white-space: nowrap; }
.al-status-cell { display: inline-block; width: 30px; height: 30px; border-radius: 6px; cursor: pointer; position: relative; border: 2px solid transparent; opacity: 0.35; }
.al-status-cell input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.al-status-cell.checked { opacity: 1; border-color: rgba(0,0,0,0.25); }
.al-status-anwesend { background: #3fae72; }
.al-status-entschuldigt { background: #4a90d9; }
.al-status-krank { background: #9b6fd1; }
.al-status-unentschuldigt { background: #c0392b; }
.al-status-verspaetung { background: #d99a2b; }
.al-status-unklar { background: #8a8f98; }
.al-status-feiertag { background: #1c2b36; }
.al-status-zeit-input { width: 84px !important; padding: 4px 6px !important; font-size: 0.8rem !important; }
.al-status-bemerkung-input { width: 140px !important; padding: 4px 6px !important; font-size: 0.8rem !important; }
.al-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; font-size: 0.82rem; color: var(--al-muted); }
.al-legend span.dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
