@import url('/css/fonts.css');

/* ─── Design-Tokens (echte Live-Tokens von clip-awards.de) ────── */
:root {
  /* Flächen */
  --bg-page: #0e0e10;
  --bg-darker: #09090b;
  --bg-sidebar: #101013;
  --bg-card: #141417;
  --bg-elevated: #1f1f23;
  --border-subtle: #ffffff1a;
  --border-strong: #ffffff29;

  /* Marke — echtes Gold der Hauptseite */
  --brand-yellow: #e5bd4e;
  --brand-yellow-soft: #f6e3a1;
  --brand-gold: #c49a3d;
  --on-gold: #171204;
  --gold-sheen: linear-gradient(160deg, #c49a3d, #e5bd4e 38%, #edd078 50%, #e5bd4e 62%, #c49a3d);
  --winner-bg: #1a1508;
  --brand-purple: #9147ff;
  --brand-purple-dark: #7d3dff;

  /* Status */
  --ok: #00f593;
  --err: #ff3b3b;
  --live: #ff3b3b;
  --warn: #e5bd4e;

  /* Text */
  --text: #efeff1;
  --text-2: #adadb8;
  --text-3: #6c6c7c;
  --text-faint: #56565f;

  --ease-smooth: cubic-bezier(0.65, 0, 0.35, 1);
  --transition: 0.3s var(--ease-smooth);

  --font-display: 'Unbounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-sans: 'Sora', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* ── Typo-/Layout-Skala (aktueller Stand der Hauptseite) ── */
  --ca-fs-display-1: clamp(44px, 8vw, 104px);
  --ca-fs-display-2: clamp(30px, 4.5vw, 52px);
  --ca-fs-title: clamp(22px, 2.6vw, 32px);
  --ca-fs-lead: 19px;
  --ca-fs-body: 15px;
  --ca-fs-caption: 13px;
  --ca-fs-micro: 11px;
  --ca-lh-tight: 1.02;
  --ca-lh-snug: 1.2;
  --ca-lh-body: 1.55;
  --ca-tk-display: -0.02em;
  --ca-tk-eyebrow: 0.18em;
  --ca-tk-label: 0.1em;
  --ca-site-max: 1120px;
  --ca-page-gutter: clamp(16px, 3vw, 24px);
  --ca-panel-pad: clamp(16px, 2vw, 26px);
  --ca-section-space: clamp(40px, 5vw, 64px);
  --ca-num: tabular-nums slashed-zero;

  /* ── Aliase (Alt-Namen → neue Tokens) ── */
  --bg-primary: var(--bg-page);
  --bg-secondary: var(--bg-card);
  --bg-tertiary: var(--bg-elevated);
  --bg-hover: #26262c;
  --gold: var(--brand-yellow);
  --gold-light: var(--brand-yellow);
  --gold-dim: #e5bd4e1f;
  --text-primary: var(--text);
  --text-secondary: var(--text-2);
  --border: var(--border-subtle);
  --border-light: var(--border-strong);

  /* Rollen-Farben */
  --c-gast: #4fc3f7;
  --c-gast-bg: rgba(79, 195, 247, 0.1);
  --c-nominiert: #ce93d8;
  --c-nominiert-bg: rgba(206, 147, 216, 0.1);
  --c-team: #81c784;
  --c-team-bg: rgba(129, 199, 132, 0.1);
  --c-sponsor: #ffb74d;
  --c-sponsor-bg: rgba(255, 183, 77, 0.1);
  --c-begleitung: #90a4ae;
  --c-begleitung-bg: rgba(144, 164, 174, 0.08);

  /* Status-Farben (Gast-Status) */
  --s-zugesagt: var(--ok);
  --s-abgesagt: #ff3b3b;
  --s-deadline: #ffa726;
  --s-unbeantwortet: #ffd54f;

  /* Scharfe Kanten überall – radius-Tokens laufen leer. */
  --radius: 0px;
  --radius-lg: 0px;
  --shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text);
  font-size: var(--ca-fs-body);
  line-height: var(--ca-lh-body);
  font-variant-numeric: tabular-nums;
}

/* ─── Legacy-Utilities: Ecken sind jetzt überall scharf ───
   Die Klassen bleiben inert erhalten (kein clip-path mehr). */
.chamfer-sm, .chamfer-md, .chamfer-lg { border-radius: 0; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: var(--border-strong); }

/* ─── Eyebrow-Strip (ersetzt die frühere ◆-Raute) ─── */
.eyebrow {
  display: inline-flex; align-items: stretch;
  background: var(--bg-card);
  font-family: var(--font-sans);
  font-size: var(--ca-fs-micro); font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-2);
}
.eyebrow .seg { display: flex; align-items: center; gap: 7px; padding: 7px 12px; }
.eyebrow .seg + .seg { border-left: 1px solid var(--border-subtle); }
.eyebrow .seg.on { background: var(--gold-dim); color: var(--brand-yellow); }

/* ─── Sync-Indikator ─── */
.sync-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
  transition: background 0.4s;
}
.sync-dot.online  { background: var(--ok); box-shadow: 0 0 0 2px rgba(0,245,147,0.3); animation: syncPulse 2s infinite; }
.sync-dot.offline { background: var(--text-3); box-shadow: none; animation: none; }
@keyframes syncPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(0,245,147,0.3); }
  50%       { box-shadow: 0 0 0 5px rgba(0,245,147,0); }
}

/* ─── App-Shell: feste Sidebar links, Inhalt rechts ─── */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ─── Sidebar ─── */
.sidebar {
  width: 232px; flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
  z-index: 120;
  scrollbar-width: thin;
}
.sidebar-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 12px;
}
.sidebar-wordmark {
  font-family: var(--font-display);
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: -0.02em;
  color: var(--brand-yellow); line-height: var(--ca-lh-snug);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-user .avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--gold-dim); border: 1px solid var(--brand-yellow);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-yellow); font-weight: 600; font-size: 0.9rem;
}
.sidebar-user-meta { flex: 1; min-width: 0; }
.sidebar-user .u-name {
  font-size: 0.82rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user .u-role {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: var(--ca-tk-label);
  color: var(--text-3);
}
.sidebar-user .u-logout {
  font-size: 11px; color: var(--text-3); text-decoration: none;
  white-space: nowrap; flex-shrink: 0;
}
.sidebar-user .u-logout:hover { color: var(--text); }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; padding: 4px 0 16px; }
.nav-group { margin-top: 14px; }
.nav-group .eyebrow { margin: 0 16px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 16px 8px 14px;
  border: 0; border-left: 2px solid transparent;
  background: transparent; color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 13.5px; font-weight: 500; line-height: 1.3;
  text-align: left; cursor: pointer; text-decoration: none;
  transition: background 0.15s var(--ease-smooth), color 0.15s var(--ease-smooth), border-color 0.15s var(--ease-smooth);
}
.nav-item:hover { background: var(--bg-card); color: var(--text); }
.nav-item.active {
  background: var(--bg-card);
  color: var(--brand-yellow);
  border-left-color: var(--brand-yellow);
}
.nav-item[hidden], .nav-group[hidden] { display: none; }

/* Externe Links (unten, kleiner, mit ↗) */
.nav-group-extern { margin-top: auto; padding-top: 18px; }
.nav-ext { font-size: 12.5px; color: var(--text-3); }
.nav-ext .ext-mark { margin-left: auto; font-size: 11px; color: var(--text-faint); }
.nav-ext.disabled { opacity: 0.45; cursor: not-allowed; }

/* Off-Canvas-Overlay (Mobil) */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55); z-index: 225;
}
.sidebar-overlay.open { display: block; }

/* ─── Header ─── */
.app-header {
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo { height: 36px; object-fit: contain; }
.sidebar-head .header-logo { height: 30px; }
.header-title {
  font-family: var(--font-display);
  font-size: 0.85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: -0.02em;
  color: var(--brand-yellow); flex: 1;
}

.header-user {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-2); font-size: 0.85rem;
}

/* Hamburger (nur mobil sichtbar) */
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  border: 0; background: transparent; color: var(--text);
  cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }

/* ─── Layout ─── */
.app-layout { display: flex; flex: 1; }

.main-content { flex: 1; width: 100%; overflow-x: hidden; padding: var(--ca-page-gutter); }

/* ─── Stats Bar ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  padding: 16px;
  text-align: center;
}
.stat-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: var(--ca-lh-snug); letter-spacing: var(--ca-tk-display); font-variant-numeric: var(--ca-num); }
.stat-label { font-size: var(--ca-fs-micro); color: var(--text-2); margin-top: 4px; text-transform: uppercase; letter-spacing: var(--ca-tk-label); }
.stat-card.highlight { background: var(--winner-bg); }
.stat-card.highlight .stat-value { color: var(--brand-yellow); }
.stat-card.green .stat-value { color: var(--ok); }
.stat-card.red .stat-value { color: var(--s-abgesagt); }

/* ─── Toolbar ─── */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}

.search-input {
  background: var(--bg-card); border: 0;
  color: var(--text);
  padding: 9px 14px; font-size: 14px; outline: none;
  min-width: 220px; flex: 1; max-width: 360px;
  transition: box-shadow 0.15s, background 0.15s;
}
.search-input:focus { box-shadow: inset 0 -1px 0 0 var(--brand-yellow); background: var(--bg-elevated); }
.search-input::placeholder { color: var(--text-3); }

.role-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.role-tab {
  padding: 7px 14px; cursor: pointer;
  border: none; background: var(--bg-elevated);
  color: var(--text-2); font-size: 0.8rem; font-weight: 600;
  transition: all 0.15s; white-space: nowrap;
}
.role-tab:hover { background: var(--bg-hover); color: var(--text); }
.role-tab.active { background: var(--gold-dim); color: var(--brand-yellow); }
.role-tab.r-gast.active { background: var(--c-gast-bg); color: var(--c-gast); }
.role-tab.r-nominiert.active { background: var(--c-nominiert-bg); color: var(--c-nominiert); }
.role-tab.r-team.active { background: var(--c-team-bg); color: var(--c-team); }
.role-tab.r-sponsor.active { background: var(--c-sponsor-bg); color: var(--c-sponsor); }
.role-tab.r-begleitung.active { background: var(--c-begleitung-bg); color: var(--c-begleitung); }

/* ─── Buttons (kompakt & scharf, Sora statt Unbounded) ─── */
.btn {
  height: 36px; padding: 0 14px; border: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex; align-items: center; gap: 7px;
  transition: filter 0.15s;
  white-space: nowrap; text-decoration: none; line-height: 1.2;
}
.btn:hover { filter: brightness(1.25); }
.btn-primary { background: var(--brand-yellow); color: var(--on-gold); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-secondary { background: var(--bg-elevated); color: var(--text); }
.btn-danger { background: rgba(255,59,59,0.14); color: var(--err); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-icon { padding: 0 7px; justify-content: center; }
.btn-icon svg { width: 14px; height: 14px; display: block; }

/* ─── Table ─── */
.table-wrap { overflow-x: auto; background: var(--bg-card); }

table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--bg-elevated); padding: 10px 12px;
  text-align: left; font-size: var(--ca-fs-micro); font-weight: 600;
  color: var(--text-2); text-transform: uppercase;
  letter-spacing: var(--ca-tk-label); border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap; cursor: pointer; user-select: none;
}
thead th:hover { color: var(--text); }

tbody tr { transition: background 0.1s; border-bottom: 1px solid var(--border-subtle); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover) !important; }

td { padding: 9px 12px; vertical-align: middle; }
td.td-id { color: var(--text-2); font-size: 0.8rem; width: 60px; }
td.td-name { font-weight: 500; }
td.td-kuenstler { color: var(--brand-yellow); font-weight: 600; }
td.td-actions { white-space: nowrap; text-align: right; width: 1px; }

/* Zeilen-Färbung nach Rolle */
tr.r-gast td { background: rgba(79, 195, 247, 0.04); }
tr.r-nominiert td { background: rgba(206, 147, 216, 0.04); }
tr.r-team td { background: rgba(129, 199, 132, 0.04); }
tr.r-sponsor td { background: rgba(255, 183, 77, 0.04); }
tr.r-begleitung td { background: rgba(144, 164, 174, 0.03); opacity: 0.85; }

/* ─── Badges (Chips: scharf, Flächen-Tint statt Rahmen) ─── */
.badge {
  display: inline-block; padding: 2px 10px;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.badge-gast { background: var(--c-gast-bg); color: var(--c-gast); }
.badge-nominiert { background: var(--c-nominiert-bg); color: var(--c-nominiert); }
.badge-team { background: var(--c-team-bg); color: var(--c-team); }
.badge-sponsor { background: var(--c-sponsor-bg); color: var(--c-sponsor); }
.badge-begleitung { background: var(--c-begleitung-bg); color: var(--c-begleitung); }
.badge-gold { background: var(--gold-dim); color: var(--brand-yellow); }

/* Lila-Ribbon (VIP, LIVE, GEWINNER – sparsam einsetzen) */
.ribbon {
  display: inline-block; padding: 2px 9px;
  background: var(--brand-purple); color: #fff;
  font-family: var(--font-sans);
  font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  transform: rotate(-2deg); white-space: nowrap;
}

.status-dot {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.8rem; white-space: nowrap;
}
.status-dot::before {
  content: ''; display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
}
.status-dot.zugesagt::before { background: var(--ok); }
.status-dot.abgesagt::before { background: var(--err); }
.status-dot.deadline::before { background: var(--s-deadline); }
.status-dot.unbeantwortet::before { background: var(--s-unbeantwortet); }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 0.85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: var(--ca-tk-display);
}
.modal-close { background: none; border: none; color: var(--text-2); cursor: pointer; font-size: 1.3rem; padding: 4px; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-subtle); display: flex; gap: 8px; justify-content: flex-end; }

/* ─── Form (flach: Fläche statt Rahmen, Gold-Unterkante im Fokus) ─── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 0.8rem; color: var(--text-2); font-weight: 500; }
input, select, textarea {
  background: var(--bg-elevated); border: 0;
  color: var(--text);
  padding: 10px 14px; font-size: 14px; outline: none;
  font-family: inherit; transition: box-shadow 0.15s, background 0.15s; width: 100%;
}
input:focus, select:focus, textarea:focus { box-shadow: inset 0 -1px 0 0 var(--brand-yellow); background: var(--bg-hover); }
select option { background: var(--bg-elevated); }
textarea { resize: vertical; min-height: 70px; }

/* ─── Empty State ─── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-2);
}
.empty-icon { font-size: 1.6rem; margin-bottom: 12px; color: var(--brand-yellow); }
.empty-title { font-size: 1.1rem; color: var(--text); margin-bottom: 8px; }

/* ─── Abspann (flache Zeilenliste mit Hairlines) ─── */
.abspann-list { display: flex; flex-direction: column; }
.abspann-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}
.abspann-item:hover { background: var(--bg-card); }
.abspann-drag { cursor: grab; color: var(--text-2); font-size: 1rem; }
.abspann-position { color: var(--text-2); font-size: 0.8rem; min-width: 160px; }
.abspann-name { flex: 1; font-weight: 500; color: var(--text); }
.abspann-name.empty { color: var(--text-2); font-style: italic; }
.abspann-category {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-subtle);
}
.abspann-category-title {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-card); padding: 7px 12px;
  font-family: var(--font-sans);
  font-size: var(--ca-fs-micro); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-2); margin-bottom: 8px;
}

/* ─── Loading ─── */
.loading { text-align: center; padding: 40px; color: var(--text-2); }
.spinner {
  display: inline-block; width: 24px; height: 24px;
  border: 2px solid var(--border-subtle); border-top-color: var(--brand-yellow);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast ─── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px; z-index: 300;
}
.toast {
  background: var(--bg-elevated);
  padding: 12px 18px;
  font-size: 0.9rem;
  animation: toastIn 0.2s ease;
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--ok); }
.toast.error { border-left: 3px solid var(--err); }
.toast.info { border-left: 3px solid var(--brand-yellow); }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── Import ─── */
.drop-zone {
  border: 2px dashed var(--border-subtle);
  padding: 40px; text-align: center; cursor: pointer;
  color: var(--text-2); transition: all 0.2s;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--brand-yellow); color: var(--text); background: var(--gold-dim);
}
.drop-icon { font-size: 1.8rem; margin-bottom: 8px; color: var(--brand-yellow); }

/* ─── Print: Sidebar ausblenden, Inhalt volle Breite ─── */
@media print {
  .sidebar, .sidebar-overlay, .app-header, .toolbar, td.td-actions, .no-print { display: none !important; }
  .app-shell, .app-main, .app-layout { display: block; }
  .main-content { padding: 0; overflow: visible; }
  body { background: #fff; color: #000; }
  table { font-size: 11px; }
  thead th { background: #eee; color: #000; }
  .badge { border: 1px solid #ccc; color: #333; background: #f5f5f5; }
  tr.r-gast td { background: #e3f2fd; }
  tr.r-nominiert td { background: #ede7f6; }
  tr.r-team td { background: #e8f5e9; }
  tr.r-sponsor td { background: #fff3e0; }
  tr.r-begleitung td { background: #f5f5f5; }
}

/* ─── Mobile Bottom Nav ─── */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-darker);
  border-top: 1px solid var(--border-subtle);
  z-index: 150;
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.mobile-nav-inner {
  display: flex; align-items: stretch;
}
.mobile-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 14px 4px 12px;
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  cursor: pointer; border: none; background: none;
  gap: 4px; transition: color 0.15s; text-decoration: none;
  border-top: 2px solid transparent;
}
.mobile-nav-item.active { color: var(--brand-yellow); border-top-color: var(--brand-yellow); }
.mobile-nav-item:hover { color: var(--text); }
.mobile-nav-item[hidden] { display: none; }

/* ─── Responsive ─── */
/* <=900px: Sidebar als Off-Canvas-Drawer (Hamburger im Header) */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    height: 100%; width: 262px;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease-smooth);
    z-index: 230;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .nav-toggle { display: inline-flex; }
}

@media (max-width: 768px) {
  .mobile-nav { display: block; }
  .app-layout { padding-bottom: 64px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  td.hide-mobile, th.hide-mobile { display: none; }
  .header-user span#userName { display: none; }
  .toolbar { gap: 8px; }
  .toolbar .role-tabs { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .toolbar > div[style*="margin-left:auto"] { margin-left: 0 !important; }
  .main-content { padding: 16px; }
  #toast-container { bottom: 74px; right: 12px; left: 12px; }
  .toast { max-width: 100%; }
  .btn-sm { height: 30px; }
}

.settings-section { background: var(--bg-card); padding: var(--ca-panel-pad); }
.settings-section-title {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-elevated); padding: 7px 12px;
  font-family: var(--font-sans);
  font-size: var(--ca-fs-micro); text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-2); font-weight: 600; margin-bottom: 16px;
}

.page { display: none; }
.page.active { display: block; }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.section-title {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-card); padding: 7px 12px;
  font-family: var(--font-sans);
  font-size: var(--ca-fs-micro); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--brand-yellow);
}
.section-title .live-pulse {
  font-family: var(--font-sans);
  text-transform: none; letter-spacing: 0; font-weight: 400;
  margin-left: 10px; vertical-align: middle;
}

/* ─────────────────────────────────────────────────────────────
   Web-Module – einheitliche Admin-Bausteine (Live, Voting, Report,
   Catering, Warteliste, Checklisten, Social, Broadcasts, Rollen)
   ───────────────────────────────────────────────────────────── */

/* Karte (modulübergreifend): flache surface-1-Fläche, scharf */
.card {
  background: var(--bg-card);
  padding: var(--ca-panel-pad);
  margin-bottom: 16px;
}
.card-title {
  font-family: var(--font-sans);
  font-size: var(--ca-fs-micro); text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-2); font-weight: 600; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
}
.card-title .count {
  font-family: var(--font-sans);
  font-size: 0.75rem; color: var(--text-2); font-weight: 500;
  text-transform: none; letter-spacing: 0; font-variant-numeric: var(--ca-num);
}

/* Modul-Grid (zweispaltig, responsiv) */
.mod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.mod-grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 880px) { .mod-grid { grid-template-columns: 1fr; } }

/* KPI-Kacheln (Live, Report, Catering) */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--bg-elevated);
  padding: 16px; text-align: center;
}
.kpi .kpi-val { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--brand-yellow); line-height: var(--ca-lh-snug); letter-spacing: var(--ca-tk-display); font-variant-numeric: var(--ca-num); }
.kpi .kpi-lbl { font-size: var(--ca-fs-micro); color: var(--text-2); margin-top: 6px; text-transform: uppercase; letter-spacing: var(--ca-tk-label); }
.kpi.kpi-hero .kpi-val { font-size: 2.2rem; }
.kpi.kpi-muted .kpi-val { color: var(--text-2); }

/* Fortschritts-/Verteilungsbalken (scharf, flach) */
.bar { height: 10px; background: var(--bg-page); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-gold), var(--brand-yellow)); transition: width 0.4s; }
.bar-lg { height: 14px; margin-top: 12px; }

/* Balkenzeile mit Label + Wert (Voting, Report, Live-Rollen) */
.bline { margin-bottom: 12px; }
.bline:last-child { margin-bottom: 0; }
.bline .bmeta { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 5px; }
.bline .bmeta .bl { color: var(--text); word-break: break-word; padding-right: 10px; }
.bline .bmeta .br { color: var(--brand-yellow); font-variant-numeric: var(--ca-num); white-space: nowrap; }

/* Live-Feed (Dashboard): flache Zeilen mit Hairlines */
.feed { display: flex; flex-direction: column; max-height: 60vh; overflow: auto; }
.feed-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-subtle);
}
.feed-row:last-child { border-bottom: none; }
.feed-row.fresh { animation: feedFlash 1.6s ease-out; }
@keyframes feedFlash { 0% { background: var(--gold-dim); } 100% { background: transparent; } }
.feed-row .who { flex: 1; min-width: 0; }
.feed-row .who .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-row .who .det { color: var(--text-2); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-row .time { color: var(--text-2); font-size: 0.8rem; font-variant-numeric: var(--ca-num); white-space: nowrap; }

/* Sparkline (Dashboard) */
.spark { display: flex; align-items: flex-end; gap: 4px; height: 80px; margin-top: 6px; }
.spark .sb { flex: 1; background: linear-gradient(180deg, var(--brand-yellow), var(--brand-gold)); min-height: 2px; transition: height 0.4s; }
.spark-labels { display: flex; justify-content: space-between; color: var(--text-2); font-size: 0.7rem; margin-top: 6px; }

/* Pulse-Indikator ("Live aktualisiert") */
.live-pulse { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 0.8rem; }
.live-pulse::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px rgba(0,245,147,0.3); animation: syncPulse 2s infinite; }

/* Modul-Fehlerbanner */
.mod-err { background: rgba(255,59,59,0.1); color: var(--err); padding: 10px 14px; margin-bottom: 14px; font-size: 0.9rem; }
.mod-err a { color: var(--brand-yellow); }
.mod-msg { font-size: 0.9rem; margin-top: 10px; min-height: 1.2em; }
.mod-msg.ok { color: var(--ok); }
.mod-msg.bad { color: var(--err); }

/* Warteliste-Item: flache Zeile mit Hairline */
.wl-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--border-subtle); transition: opacity 0.3s; }
.wl-item:last-child { border-bottom: none; }
.wl-item.busy { opacity: 0.5; }
.wl-rank { font-family: var(--font-display); font-variant-numeric: var(--ca-num); font-weight: 800; font-size: 1rem; color: var(--brand-yellow); min-width: 2.4rem; text-align: center; }
.wl-name { font-weight: 600; }
.wl-meta { color: var(--text-2); font-size: 0.83rem; margin-top: 2px; }
.pill { display: inline-block; background: var(--bg-page); border: 1px solid var(--border-subtle); border-radius: 99px; padding: 1px 9px; font-size: 0.75rem; color: var(--text-2); margin-left: 6px; }

/* Checklisten */
.chk-item { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--border-subtle); }
.chk-item:last-of-type { border-bottom: none; }
.chk-item:hover { background: var(--bg-hover); }
.chk-item label { display: flex; align-items: center; gap: 10px; flex: 1; cursor: pointer; min-width: 0; }
.chk-item input[type=checkbox] { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--brand-yellow); cursor: pointer; }
.chk-item .txt { font-size: 0.92rem; word-break: break-word; }
.chk-item.done .txt { color: var(--text-2); text-decoration: line-through; }
.chk-del { background: none; border: none; color: var(--text-2); font-size: 1rem; padding: 4px 6px; cursor: pointer; opacity: 0.6; }
.chk-del:hover { color: var(--err); background: rgba(255,59,59,0.1); opacity: 1; }
.chk-add { display: flex; gap: 8px; border-top: 1px solid var(--border-subtle); padding-top: 12px; margin-top: 8px; }
.chk-add input { flex: 1; }

/* Social-Wall */
.social-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.social-tile { position: relative; background: var(--bg-elevated); border: 1px solid var(--border-subtle); overflow: hidden; aspect-ratio: 1; cursor: pointer; transition: transform 0.15s, border-color 0.15s; }
.social-tile:hover { transform: translateY(-2px); border-color: var(--brand-yellow); }
.social-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.social-tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px; font-size: 0.78rem; background: linear-gradient(0deg, rgba(0,0,0,0.85), transparent); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.social-tile .social-actions { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; gap: 6px; opacity: 0; transition: opacity 0.15s; }
.social-tile:hover .social-actions { opacity: 1; }
.social-tile .social-del { background: rgba(9,9,11,0.8); border: 1px solid var(--border-subtle); color: var(--err); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; }
.social-tile .social-approve { background: rgba(9,9,11,0.85); border: 1px solid var(--border-subtle); color: var(--text); height: 28px; padding: 0 10px; cursor: pointer; font-size: 0.75rem; font-weight: 600; }
.social-tile .social-approve.show { color: var(--on-gold); background: var(--brand-yellow); border-color: var(--brand-yellow); }
.social-tile .social-approve:disabled { opacity: 0.5; cursor: default; }
/* Freigabe-Status-Badge: immer sichtbar, oben links. */
.social-tile .social-badge { position: absolute; top: 6px; left: 6px; padding: 2px 8px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em; z-index: 1; }
.social-tile .social-badge.ok { background: rgba(0,245,147,0.16); color: var(--ok); border: 1px solid rgba(0,245,147,0.4); }
.social-tile .social-badge.pend { background: rgba(229,189,78,0.15); color: var(--brand-yellow); border: 1px solid rgba(229,189,78,0.45); }
/* Noch nicht freigegebene Kacheln dezent abdunkeln + markieren. */
.social-tile.pending { border-color: rgba(229,189,78,0.5); }
.social-tile.pending img { opacity: 0.62; }
.lightbox { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; flex-direction: column; background: rgba(9,9,11,0.94); z-index: 250; padding: 32px; cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 80vh; box-shadow: var(--shadow); }
.lightbox .lb-cap { margin-top: 14px; color: var(--text); font-size: 1rem; max-width: 80vw; text-align: center; }
.lightbox .lb-close { position: fixed; top: 18px; right: 24px; color: var(--text-2); font-size: 2rem; cursor: pointer; }

/* Broadcast-Segmente */
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg label { flex: 1; min-width: 8rem; position: relative; margin: 0; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg label span { display: block; text-align: center; background: var(--bg-elevated); padding: 10px; cursor: pointer; font-weight: 500; transition: all 0.15s; color: var(--text); }
.seg label input:checked + span { background: var(--gold-dim); color: var(--brand-yellow); }

/* Generische Modul-Tabelle nutzt vorhandene table-Styles via .table-wrap */
.mod-table { width: 100%; border-collapse: collapse; }
.mod-table th, .mod-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; font-size: 0.9rem; }
.mod-table th { color: var(--text-2); text-transform: uppercase; letter-spacing: var(--ca-tk-label); font-size: var(--ca-fs-micro); font-weight: 600; background: var(--bg-elevated); }
.mod-table tbody tr:hover { background: var(--bg-hover); }
.mod-table td.num, .mod-table th.num { text-align: right; font-variant-numeric: var(--ca-num); }
.mod-table .muted { color: var(--text-2); }

/* Rollen-Matrix (Rollen & Bereiche) */
.mod-table td.ctr, .mod-table th.ctr { text-align: center; }
.perm-check { width: 16px; height: 16px; accent-color: var(--brand-yellow); cursor: pointer; }
.perm-check:disabled { cursor: default; opacity: 0.55; }
.perm-role { font-weight: 600; white-space: nowrap; }
.perm-role .perm-note { color: var(--text-3); font-weight: 500; font-size: 0.72rem; margin-left: 6px; text-transform: none; letter-spacing: 0; }

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