/* ============================================================
   VisionX Media – Internes Dashboard
   Design: "Financial Command Center"
   Schwarz / Anthrazit / Crimson-Rot · Archivo + Spline Sans Mono
   ============================================================ */

:root {
  /* Farben */
  --bg: #09090b;
  --bg-sidebar: #0c0c0f;
  --surface: #131316;
  --surface-2: #18181d;
  --surface-3: #1f1f25;
  --border: #232329;
  --border-strong: #33333c;
  --text: #f2f2f4;
  --dim: #9c9ca8;
  --faint: #66666f;

  --red: #e8364a;
  --red-bright: #ff5063;
  --red-soft: rgba(232, 54, 74, 0.12);
  --red-glow: rgba(232, 54, 74, 0.35);
  --green: #41d398;
  --green-soft: rgba(65, 211, 152, 0.12);
  --amber: #f0b24f;
  --amber-soft: rgba(240, 178, 79, 0.12);

  /* Typografie */
  --font-sans: 'Archivo', system-ui, sans-serif;
  --font-mono: 'Spline Sans Mono', ui-monospace, monospace;

  /* Layout */
  --sidebar-w: 248px;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; }

body {
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  /* Atmosphäre: dezenter roter Schein + Tiefe statt flachem Schwarz */
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(232, 54, 74, 0.07), transparent 60%),
    radial-gradient(700px 600px at -10% 110%, rgba(232, 54, 74, 0.05), transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Feines Bildrauschen über allem – verhindert "flaches" Schwarz */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.text-up { color: var(--green); }
.text-down { color: var(--red-bright); }
.text-amber { color: var(--amber); }

/* ============================================================
   Grund-Layout: Sidebar + Main
   ============================================================ */
.shell { display: flex; min-height: 100vh; }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content {
  padding: 28px 32px 64px;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1c1c22, #101013);
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 18px var(--red-glow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
}
.brand-mark em { color: var(--red); font-style: normal; }
.brand-mark-lg { width: 56px; height: 56px; font-size: 22px; border-radius: 14px; }

.brand-text {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.3px;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text small {
  font-weight: 500;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--faint);
}

.nav { flex: 1; padding: 14px 12px; overflow-y: auto; }

.nav-section {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--faint);
  padding: 16px 10px 7px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9.5px 12px;
  margin: 2px 0;
  border-radius: var(--radius-sm);
  color: var(--dim);
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: 0.2px;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.is-active {
  color: var(--text);
  background: linear-gradient(90deg, var(--red-soft), transparent 85%);
  border-left-color: var(--red);
}
.nav-link.is-active svg { color: var(--red-bright); }

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red-bright);
  border: 1px solid rgba(232, 54, 74, 0.3);
  font-weight: 700;
  font-size: 14px;
}
.sidebar-user-info { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar-user-info strong { font-size: 13px; }
.sidebar-user-info small { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }

.btn-logout {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--dim);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-logout:hover { color: var(--red-bright); border-color: rgba(232, 54, 74, 0.4); background: var(--red-soft); }
.btn-logout svg { width: 15px; height: 15px; }

.sidebar-backdrop { display: none; }

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  height: 64px;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.82);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.topbar-title::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--red);
  margin-left: 9px;
  vertical-align: middle;
  box-shadow: 0 0 10px var(--red-glow);
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-date { color: var(--faint); font-size: 12.5px; font-family: var(--font-mono); }

.month-picker input {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  cursor: pointer;
}
.month-picker input:hover { border-color: var(--red); }

.btn-burger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 7px;
  cursor: pointer;
}

/* Augen-Button: Privatmodus (Beträge ausblenden) */
.btn-eye {
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--dim);
  padding: 7px 9px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-eye:hover { color: var(--text); border-color: var(--faint); }
.btn-eye.is-on {
  color: var(--red-bright);
  border-color: rgba(232, 54, 74, 0.5);
  background: var(--red-soft);
}
.btn-eye svg { width: 17px; height: 17px; }

/* Countdown-Anzeige für den Auto-Refresh */
.refresh-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--faint);
  font-size: 11.5px;
}
.refresh-pill svg { width: 13px; height: 13px; }

/* ============================================================
   Privatmodus: Beträge & Diagramme unkenntlich machen
   (rein optisch, für Bildschirm-Demos – kein Sicherheitsfeature)
   ============================================================ */
html.privacy-mode .kpi-value,
html.privacy-mode .kpi-meta,
html.privacy-mode .rank-value,
html.privacy-mode .rank-detail,
html.privacy-mode .breakdown li strong,
html.privacy-mode td.num,
html.privacy-mode .delta,
html.privacy-mode .chart-box {
  filter: blur(9px);
  user-select: none;
  pointer-events: none;
  transition: filter 0.25s;
}

/* ============================================================
   KPI-Karten
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }

.kpi {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  position: relative;
  overflow: hidden;
  animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
}
/* Gestaffeltes Einblenden beim Laden */
.kpi:nth-child(1) { animation-delay: 0.02s; }
.kpi:nth-child(2) { animation-delay: 0.06s; }
.kpi:nth-child(3) { animation-delay: 0.1s; }
.kpi:nth-child(4) { animation-delay: 0.14s; }
.kpi:nth-child(5) { animation-delay: 0.18s; }
.kpi:nth-child(6) { animation-delay: 0.22s; }
.kpi:nth-child(7) { animation-delay: 0.26s; }
.kpi:nth-child(8) { animation-delay: 0.3s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.kpi-hero {
  border-color: rgba(232, 54, 74, 0.35);
  background:
    radial-gradient(220px 120px at 90% -20%, rgba(232, 54, 74, 0.16), transparent 70%),
    linear-gradient(160deg, var(--surface-2), var(--surface));
}
.kpi-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red), transparent 70%);
}

.kpi-positive { border-color: rgba(65, 211, 152, 0.3); }
.kpi-negative { border-color: rgba(232, 54, 74, 0.45); }

.kpi-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--dim);
}

.kpi-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.kpi-value-pct { font-size: 24px; }

.kpi-meta {
  font-size: 12px;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.delta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--surface-3);
  color: var(--dim);
}
.delta.up { background: var(--green-soft); color: var(--green); }
.delta.down { background: var(--red-soft); color: var(--red-bright); }
.delta.up::before { content: '▲ '; font-size: 8.5px; }
.delta.down::before { content: '▼ '; font-size: 8.5px; }

/* ============================================================
   Karten & Grids
   ============================================================ */
.grid { display: grid; gap: 18px; }
.grid-21 { grid-template-columns: 2fr 1fr; }
.grid-11 { grid-template-columns: 1fr 1fr; }
.grid-111 { grid-template-columns: 1fr 1fr 1fr; }

.card {
  background: linear-gradient(170deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  min-width: 0;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) 0.15s backwards;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.card-head h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text);
}
.card-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.count-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  color: var(--dim);
  border-radius: 20px;
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: 1px;
}

.card-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--red-bright);
  letter-spacing: 0.3px;
}
.card-link:hover { text-decoration: underline; }

.legend { font-size: 11.5px; color: var(--faint); display: flex; align-items: center; gap: 10px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.dot-red { background: var(--red); }
.dot-green { background: var(--green); }
.dot-grey { background: #5b5b66; }

.chart-box { position: relative; height: 300px; }
.chart-box-donut { height: 240px; }

.empty { color: var(--faint); font-size: 13.5px; padding: 14px 0; }
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state h2 { font-size: 48px; color: var(--red); margin-bottom: 8px; }
.empty-state p { color: var(--dim); margin-bottom: 20px; }

/* ============================================================
   Banner & Flash
   ============================================================ */
.banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
}
.banner svg { width: 22px; height: 22px; }
.banner strong { display: block; }
.banner-danger {
  background: linear-gradient(90deg, rgba(232, 54, 74, 0.16), rgba(232, 54, 74, 0.05));
  border: 1px solid rgba(232, 54, 74, 0.45);
  color: #ffd9dd;
}
.banner-danger svg { color: var(--red-bright); }
.banner-info {
  background: linear-gradient(90deg, rgba(90, 167, 255, 0.12), rgba(90, 167, 255, 0.04));
  border: 1px solid rgba(90, 167, 255, 0.35);
  color: #d6e7ff;
}
.banner-info svg { color: #7db5ff; }

.flash {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  animation: rise 0.3s ease backwards;
}
.flash-success { background: var(--green-soft); border: 1px solid rgba(65, 211, 152, 0.35); color: var(--green); }
.flash-error { background: var(--red-soft); border: 1px solid rgba(232, 54, 74, 0.4); color: var(--red-bright); }

/* ============================================================
   Buttons & Chips
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--red), #c41f33);
  color: #fff;
  box-shadow: 0 2px 14px rgba(232, 54, 74, 0.28);
}
.btn-primary:hover { filter: brightness(1.12); box-shadow: 0 2px 20px rgba(232, 54, 74, 0.45); }
.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--dim);
}
.btn-ghost:hover { color: var(--text); border-color: var(--faint); }
.btn-block { width: 100%; justify-content: center; }

.filter-group { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5.5px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--dim);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  transition: all 0.15s;
}
.chip:hover { color: var(--text); }
.chip.is-active {
  background: var(--red-soft);
  border-color: rgba(232, 54, 74, 0.5);
  color: var(--red-bright);
}

.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--dim);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-icon svg { width: 14px; height: 14px; }
.btn-icon:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-3); }
.btn-icon-danger:hover { color: var(--red-bright); border-color: rgba(232, 54, 74, 0.5); background: var(--red-soft); }
.btn-icon-success:hover { color: var(--green); border-color: rgba(65, 211, 152, 0.5); background: var(--green-soft); }
.btn-icon-warn:hover { color: var(--amber); border-color: rgba(240, 178, 79, 0.5); background: var(--amber-soft); }

/* ============================================================
   Tabellen
   ============================================================ */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.table-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--faint);
  margin: 22px 0 10px;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--faint);
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
td.mono, td.num { white-space: nowrap; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.022); }
tbody tr:last-child td { border-bottom: none; }

th.num, td.num { text-align: right; }
th.actions, td.actions { text-align: right; white-space: nowrap; width: 1%; }
td.actions > * { display: inline-flex; vertical-align: middle; margin-left: 5px; }
td.actions form { display: inline-flex; }

.row-note { display: block; color: var(--faint); font-size: 11.5px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.row-inactive { opacity: 0.45; }
.row-highlight { background: var(--red-soft); }
.row-highlight:hover { background: var(--red-soft) !important; }

.contact-cell { font-size: 12px; }
.contact-cell a { color: var(--dim); display: block; }
.contact-cell a:hover { color: var(--red-bright); }
.contact-cell small { color: var(--faint); }

/* ============================================================
   Tags / Status-Pills
   ============================================================ */
.tag {
  display: inline-block;
  padding: 2.5px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.tag-status-active, .tag-inv-paid { background: var(--green-soft); color: var(--green); border: 1px solid rgba(65, 211, 152, 0.3); }
.tag-status-paused, .tag-inv-open { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(240, 178, 79, 0.3); }
.tag-status-cancelled, .tag-inv-overdue, .tag-overdue { background: var(--red-soft); color: var(--red-bright); border: 1px solid rgba(232, 54, 74, 0.35); }
.tag-open { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(240, 178, 79, 0.3); }
.tag-abo { background: rgba(90, 167, 255, 0.12); color: #7db5ff; border: 1px solid rgba(90, 167, 255, 0.3); }
.tag-oneoff { background: var(--surface-3); color: var(--dim); border: 1px solid var(--border-strong); }
.tag-cat { background: var(--surface-3); color: var(--dim); border: 1px solid var(--border-strong); }
.tag-estimate { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(240, 178, 79, 0.3); }
.tag-real { background: var(--green-soft); color: var(--green); border: 1px solid rgba(65, 211, 152, 0.3); }

/* ============================================================
   Formulare
   ============================================================ */
.form-panel {
  display: none;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.form-panel.is-open { display: block; animation: rise 0.25s ease; }
.form-panel h3 { font-size: 14px; font-weight: 700; margin-bottom: 16px; letter-spacing: 0.3px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-wide { grid-column: 1 / -1; }
.field > span {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--dim);
}

.field input,
.field select,
.field textarea,
.field output {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  padding: 9.5px 12px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }

.field-readonly output {
  background: var(--surface-3);
  color: var(--red-bright);
  font-weight: 600;
  border-style: dashed;
}

.form-actions { display: flex; gap: 10px; margin-top: 16px; align-items: center; }
.form-hint { font-size: 12px; color: var(--faint); margin-top: 10px; }

/* ============================================================
   Listen (Ranking, Breakdown)
   ============================================================ */
.rank-list { list-style: none; display: flex; flex-direction: column; }
.rank-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-areas: "name value tag" "detail value tag";
  column-gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.rank-list li:last-child { border-bottom: none; }
.rank-name { grid-area: name; font-weight: 600; font-size: 13.5px; }
.rank-detail { grid-area: detail; color: var(--faint); font-size: 11.5px; }
.rank-value { grid-area: value; font-family: var(--font-mono); font-size: 14px; }
.rank-list .tag { grid-area: tag; }

.breakdown { list-style: none; margin-bottom: 10px; }
.breakdown li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--dim);
}
.breakdown li strong { font-family: var(--font-mono); color: var(--text); font-weight: 600; }
.breakdown li:last-child { border-bottom: none; }
.breakdown-total {
  border-top: 1px solid var(--border-strong);
  color: var(--text) !important;
  font-weight: 600;
}
.breakdown-total strong { font-size: 15px; }

/* ============================================================
   Rechte-Schalter (Mitarbeiterverwaltung)
   ============================================================ */
.perm-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 6px;
}

.perm-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.perm-group-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--faint);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }

.toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 20px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  transition: background 0.18s, border-color 0.18s;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--faint);
  transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.3, 1.4), background 0.18s;
}
.toggle input:checked + .toggle-track {
  background: var(--red-soft);
  border-color: rgba(232, 54, 74, 0.55);
}
.toggle input:checked + .toggle-track::after {
  transform: translateX(16px);
  background: var(--red-bright);
  box-shadow: 0 0 8px var(--red-glow);
}
.toggle input:disabled + .toggle-track { opacity: 0.4; }
.toggle input:disabled ~ .toggle-text { opacity: 0.4; }
.toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px var(--red-soft); }

.toggle-text { font-size: 12.5px; color: var(--dim); }
.toggle input:checked ~ .toggle-text { color: var(--text); }

/* ============================================================
   Login-Seite
   ============================================================ */
.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background-image:
    radial-gradient(800px 480px at 50% -10%, rgba(232, 54, 74, 0.12), transparent 60%),
    radial-gradient(600px 500px at 100% 110%, rgba(232, 54, 74, 0.06), transparent 55%);
}

.login-wrap { width: min(400px, 92vw); display: flex; flex-direction: column; gap: 26px; padding: 40px 0; }

.login-brand { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.login-brand h1 { font-size: 28px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.login-brand h1 span { color: var(--red); }
.login-brand p { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: 2.4px; }

.login-card {
  background: linear-gradient(170deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(232, 54, 74, 0.07);
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
}

.login-foot { text-align: center; color: var(--faint); font-size: 11.5px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-111 { grid-template-columns: 1fr; }
  .grid-21 { grid-template-columns: 1fr; }
  .grid-11 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.3, 1);
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.6);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 45;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .sidebar-backdrop.is-open { opacity: 1; pointer-events: auto; }
  .btn-burger { display: grid; place-items: center; }
  .topbar { padding: 0 18px; }
  .topbar-date { display: none; }
  .content { padding: 20px 16px 56px; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .kpi-grid, .kpi-grid-4 { grid-template-columns: 1fr; }
  .kpi-value { font-size: 23px; }
  .chart-box { height: 240px; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
}
