/* Admin-Bereich CSS — Farben kommen aus theme-*.css */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --ci-yellow: #FFD700;
  --ci-blue:   #1a3a7a;
  --ci-white:  #ffffff;

  /* Interner Bereich — helles Farbschema (Sidebar bleibt dunkel) */
  --bg:            #f1f5f9;   /* Seitenhintergrund */
  --surface:       #ffffff;   /* Cards */
  --surface-2:     #f8fafc;   /* Panels innerhalb von Cards, Tabellenkopf */
  --surface-hover: #f1f5f9;
  --border:        #e2e8f0;
  --border-strong: #cbd5e1;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --heading:       #1a3a7a;
  --link:          #2563eb;
  --sidebar-bg:    #ffffff;
}

/* ── Reset & Base ── */
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; margin: 0; background: var(--bg); color: var(--text); }

/* ═══════════════════════════════════════════════
   APP SHELL — Sidebar Layout
═══════════════════════════════════════════════ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 228px;
  min-width: 228px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.25;
}

.sidebar-logo-main {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ci-yellow);
  letter-spacing: .03em;
}

.sidebar-logo-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: .01em;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  color: #475569;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background .12s, color .12s;
  position: relative;
}

.sidebar-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.sidebar-link.active {
  background: #e0e7ff;
  color: var(--heading);
  font-weight: 600;
}

.sidebar-link.active .sidebar-icon { opacity: 1; }

.sidebar-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: .65;
}

.sidebar-badge {
  margin-left: auto;
  background: #dc2626;
  color: #fff;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  line-height: 1.6;
}

.sidebar-footer {
  padding: 12px 10px 16px;
  border-top: 1px solid var(--border);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background .12s, color .12s;
}

.sidebar-logout:hover {
  background: #fee2e2;
  color: #b91c1c;
}

/* ── Content Area ── */
.content-area {
  flex: 1;
  background: var(--bg);
  min-width: 0;
  overflow-x: hidden;
}

.content-area main {
  padding: 28px 32px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1200px) {
  .content-area main { padding: 20px 16px; }
  .col-hide-md { display: none !important; }
}

/* ── Auth Pages (Login, Passwort-Reset) ── */
.auth-main {
  min-height: 100vh;
  background: var(--bg);
  padding: 24px;
  max-width: 680px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════
   PUBLIC LAYOUT (Öffentliche Seiten)
═══════════════════════════════════════════════ */
.public-header {
  background: var(--ci-blue);
  color: var(--ci-white);
  padding: 14px 24px;
  display: flex;
  align-items: center;
}

.public-header .logo-text { font-size: 1.1rem; font-weight: 700; letter-spacing: .02em; color: #fff; }
.public-header .logo-text span { color: var(--ci-yellow); }

.public-hero { background: var(--ci-yellow); color: var(--ci-blue); text-align: center; padding: 32px 24px 24px; }
.public-hero h1 { margin: 0 0 8px; font-size: 1.8rem; font-weight: 800; }
.public-hero p  { margin: 0; font-size: 1rem; opacity: .85; }

main.public { max-width: 680px; margin: 0 auto; padding: 24px; }

/* ═══════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
}

.card h1 { margin: 0 0 20px; font-size: 1.35rem; color: var(--heading); font-weight: 700; }
.card h2 { font-size: 1rem; color: var(--text-muted); border-bottom: 1px solid var(--border); padding-bottom: 6px; margin: 20px 0 10px; }

/* ═══════════════════════════════════════════════
   FORMULARE
═══════════════════════════════════════════════ */
.form-section { background: var(--ci-blue); color: #fff; padding: 6px 12px; border-radius: 6px; margin: 20px 0 10px; font-size: 0.85rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 12px; }

label { display: block; margin-bottom: 4px; font-size: 0.875rem; font-weight: 500; color: #334155; }

input[type=text], input[type=email], input[type=tel], input[type=date],
input[type=url], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 7px;
  font-size: 0.9rem; font-family: inherit; background: var(--surface); color: var(--text);
}

input:focus, select:focus, textarea:focus { outline: none; border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96,165,250,.2); }
textarea { resize: vertical; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; cursor: pointer; }
.checkbox-label input[type=checkbox] { width: auto; }

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn {
  display: inline-block; padding: 7px 14px; border-radius: 7px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); text-decoration: none; font-size: 0.875rem;
  cursor: pointer; font-family: inherit; transition: filter .12s, background .12s;
}
.btn-primary  { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-primary:hover  { filter: brightness(1.1); background: #2563eb; }
.btn-yellow   { background: var(--ci-yellow); color: var(--ci-blue); border-color: var(--ci-yellow); font-weight: 700; }
.btn-yellow:hover   { filter: brightness(.92); }
.btn:hover { background: var(--surface-hover); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-danger   { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover   { background: #b91c1c; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }

/* ═══════════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════════ */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-danger   { background: rgba(220,38,38,.15); color: #b91c1c; border: 1px solid rgba(220,38,38,.3); }
.alert-success  { background: rgba(22,163,74,.15); color: #15803d; border: 1px solid rgba(22,163,74,.3); }
.alert-info     { background: rgba(14,165,233,.15); color: #0369a1; border: 1px solid rgba(14,165,233,.3); }

/* ═══════════════════════════════════════════════
   SUCHLEISTE
═══════════════════════════════════════════════ */
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.search-bar input  { width: auto; flex: 1; min-width: 200px; }
.search-bar select { width: auto; }

/* ═══════════════════════════════════════════════
   TABELLE
═══════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }
table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 0.875rem; }
th { text-align: left; padding: 10px 10px; background: var(--surface-2); border-bottom: 2px solid var(--border); font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
td { padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-hover); }
td a { color: var(--link); text-decoration: none; }
td a:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td { display: block; }
  .table-wrap thead { display: none; }
  .table-wrap tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(15,23,42,.06);
  }
  .table-wrap tr:hover td { background: transparent; }
  .table-wrap td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }
  .table-wrap tr td:last-child { border-bottom: none; }
  .table-wrap td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .05em;
    flex-shrink: 0;
  }
  .table-wrap td[data-label=""] { display: none; }
  .table-wrap td[data-label="Aktionen"] { flex-wrap: wrap; align-items: flex-start; }
  .table-wrap .actions { flex-wrap: wrap; justify-content: flex-end; min-width: 0; flex: 1; }
}

.detail-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.detail-table th { text-align: left; padding: 7px 10px; color: var(--text-muted); font-weight: 500; width: 45%; white-space: nowrap; background: transparent; }
.detail-table td { padding: 7px 10px; }
.detail-table tr { border-bottom: 1px solid var(--border); }
.detail-table tr:last-child { border-bottom: none; }

/* ═══════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════ */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.73rem; font-weight: 600; }
.badge-aktiv       { background: #dcfce7; color: #15803d; }
.badge-passiv      { background: #fef3c7; color: #a16207; }
.badge-ausgetreten { background: #fee2e2; color: #b91c1c; }
.badge-angemeldet  { background: #e0f2fe; color: #0369a1; }

/* ── Aktionen in Tabelle ── */
.actions { display: flex; flex-direction: row; gap: 4px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }
.actions .btn { white-space: nowrap; }

/* ═══════════════════════════════════════════════
   DASHBOARD — STAT GRID
═══════════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 4px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  transition: box-shadow .15s, background .15s;
  box-shadow: 0 1px 2px rgba(15,23,42,.05);
}

.stat-card:hover {
  background: var(--surface-hover);
  box-shadow: 0 4px 10px rgba(15,23,42,.08);
  cursor: pointer;
}

.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }

/* ═══════════════════════════════════════════════
   HILFSSTILE
═══════════════════════════════════════════════ */
.public-form-section { background: var(--ci-blue); color: #fff; padding: 6px 12px; border-radius: 6px; margin: 20px 0 10px; font-size: 0.85rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.text-muted { color: var(--text-muted); }
.required { color: #dc2626; }
