/* ─────────────────────────────────────────────────────
   OMERTA — Dark Theme
   Palette: Deep Black · Charcoal · Crimson Red · Gold
───────────────────────────────────────────────────── */

:root {
  /* Backgrounds */
  --bg-primary:    #080808;
  --bg-secondary:  #0f0f0f;
  --bg-card:       #141414;
  --bg-elevated:   #1c1c1c;
  --bg-hover:      #222222;

  /* Borders */
  --border:        #272727;
  --border-subtle: #1a1a1a;

  /* Text */
  --text-primary:  #f2f2f2;
  --text-secondary:#909090;
  --text-muted:    #505050;

  /* Deep Crimson — Primary accent */
  --red:           #8b1a1a;
  --red-bright:    #a52020;
  --red-dim:       #6B0000;
  --red-bg:        rgba(107,0,0,0.18);
  --red-glow:      rgba(107,0,0,0.3);

  /* Gold — Financial / secondary accent */
  --gold:          #d4a843;
  --gold-dim:      #9a7420;
  --gold-bg:       rgba(212,168,67,0.08);

  /* Status colors */
  --orange:        #f97316;
  --orange-bg:     rgba(249,115,22,0.1);
  --green:         #22c55e;
  --green-dim:     #16a34a;
  --green-bg:      rgba(34,197,94,0.1);
  --blue:          #3b82f6;
  --blue-bg:       rgba(59,130,246,0.1);
  --purple:        #a855f7;
  --purple-bg:     rgba(168,85,247,0.1);

  /* Layout */
  --sidebar-w:     245px;
  --radius:        8px;
  --radius-sm:     5px;
  --radius-lg:     12px;
  --radius-xl:     16px;

  /* Shadows */
  --shadow:        0 2px 12px rgba(0,0,0,0.6);
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.7);
  --shadow-red:    0 0 24px rgba(107,0,0,0.12);

  --transition: 0.15s ease;
}

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--red-dim); }

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-bright); }

svg {
  width: 16px; height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

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

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 28px 32px;
  min-width: 0;
  max-width: 1440px;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  /* Subtle red glow on right edge */
  box-shadow: 2px 0 20px rgba(107,0,0,0.05);
}

.sidebar-header {
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--border);
  /* Top accent bar */
  background: linear-gradient(180deg, rgba(107,0,0,0.07) 0%, transparent 100%);
  position: relative;
}

.sidebar-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red), var(--red-dim), transparent);
}

.sidebar-logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 24px; }
.logo-icon-img { width: 26px; height: 26px; object-fit: contain; border-radius: 8px; flex-shrink: 0; }

.logo-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

.logo-sub {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

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

.nav-group { margin-bottom: 6px; }

.nav-group-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 10px 10px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

.nav-item:hover {
  background: rgba(107,0,0,0.08);
  color: var(--text-primary);
  border-left: 2px solid rgba(107,0,0,0.35);
  padding-left: 8px;
}

.nav-item.active {
  background: var(--red-bg);
  color: var(--red-bright);
  border-left: 2px solid var(--red);
  padding-left: 8px;
}

.nav-item.active svg { stroke: var(--red); }
.nav-item svg { width: 15px; height: 15px; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

/* Sidebar User */
.sidebar-user {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.2);
}

.user-info { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: border-color var(--transition);
}
.user-avatar:hover { border-color: var(--red-dim); }

.user-details { display: flex; flex-direction: column; min-width: 0; }

.user-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--red);
}

.logout-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
}
.logout-btn:hover { background: var(--red-bg); color: var(--red); }
.logout-btn svg { width: 15px; height: 15px; }

/* Sidebar Toggle (mobile) */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  cursor: pointer;
  color: var(--text-primary);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 90;
}

/* ── Page Header ─────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  position: relative;
}

.page-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.page-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  border-color: rgba(107,0,0,0.35);
  box-shadow: 0 0 0 1px rgba(107,0,0,0.08), 0 4px 24px rgba(0,0,0,0.35);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title { font-size: 14px; font-weight: 600; }
.card-body { padding: 16px 18px; }
.card-body.p-0 { padding: 0; }

.card-danger {
  border-color: rgba(107,0,0,0.35);
  background: linear-gradient(180deg, rgba(107,0,0,0.04) 0%, var(--bg-card) 60px);
}

.card-warning {
  border-color: rgba(249,115,22,0.3);
  background: linear-gradient(180deg, rgba(249,115,22,0.04) 0%, var(--bg-card) 60px);
}

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

.stats-grid-lg { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(107,0,0,0.4);
  box-shadow: 0 6px 28px rgba(0,0,0,0.45), 0 0 0 1px rgba(107,0,0,0.12);
}

.stat-card.stat-danger {
  border-color: rgba(107,0,0,0.45);
  background: linear-gradient(135deg, rgba(107,0,0,0.08) 0%, var(--bg-card) 100%);
  box-shadow: var(--shadow-red);
}
.stat-card.stat-warning {
  border-color: rgba(249,115,22,0.4);
  background: linear-gradient(135deg, rgba(249,115,22,0.06) 0%, var(--bg-card) 100%);
}
.stat-card.stat-gold {
  border-color: rgba(212,168,67,0.35);
  background: linear-gradient(135deg, rgba(212,168,67,0.06) 0%, var(--bg-card) 100%);
}
.stat-card.stat-green {
  border-color: rgba(34,197,94,0.3);
  background: linear-gradient(135deg, rgba(34,197,94,0.06) 0%, var(--bg-card) 100%);
}
.stat-card.stat-purple {
  border-color: rgba(168,85,247,0.3);
  background: linear-gradient(135deg, rgba(168,85,247,0.06) 0%, var(--bg-card) 100%);
}

.stat-icon { font-size: 22px; line-height: 1; }
.stat-info { display: flex; flex-direction: column; width: 100%; min-width: 0; }

.stat-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

.stat-badge {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}

/* ── Tables ──────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }

.table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr {
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.table-hover tbody tr:hover {
  background: rgba(107,0,0,0.05);
  box-shadow: inset 2px 0 0 rgba(107,0,0,0.5);
}
.table-sm th, .table-sm td { padding: 7px 12px; font-size: 12px; }

.row-danger { background: rgba(107,0,0,0.06); }
.row-success { background: rgba(34,197,94,0.03); }

.action-col { white-space: nowrap; }

/* ── Badges ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success  { background: var(--green-bg);   color: var(--green);   border: 1px solid rgba(34,197,94,0.3); }
.badge-danger   { background: var(--red-bg);      color: var(--red);     border: 1px solid rgba(107,0,0,0.35); }
.badge-warning  { background: var(--orange-bg);   color: var(--orange);  border: 1px solid rgba(249,115,22,0.3); }
.badge-gold     { background: var(--gold-bg);     color: var(--gold);    border: 1px solid rgba(212,168,67,0.3); }
.badge-secondary{ background: rgba(255,255,255,0.04); color: var(--text-secondary); border: 1px solid var(--border); }

/* Role badges */
.badge-boss       { color: var(--red); font-weight: 700; }
.badge-leadership { color: var(--orange); }
.badge-mitglied   { color: var(--text-secondary); }

/* Type badges */
.badge-type     { background: rgba(255,255,255,0.04); color: var(--text-secondary); border: 1px solid var(--border); }
.badge-meth     { background: rgba(59,130,246,0.12);  color: #60a5fa; border-color: rgba(59,130,246,0.25); }
.badge-weed     { background: rgba(34,197,94,0.12);   color: var(--green); border-color: rgba(34,197,94,0.25); }
.badge-waffen   { background: var(--red-bg);          color: var(--red);   border-color: rgba(107,0,0,0.25); }
.badge-kokain   { background: rgba(255,255,255,0.08); color: #d0d0d0;  border-color: rgba(255,255,255,0.15); }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn svg { width: 14px; height: 14px; }

/* Primary = Red */
.btn-primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--red-bright);
  border-color: var(--red-bright);
  color: #fff;
  box-shadow: 0 0 16px rgba(107,0,0,0.3);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: rgba(107,0,0,0.3); box-shadow: 0 0 0 1px rgba(107,0,0,0.1); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border-color: rgba(107,0,0,0.3);
}
.btn-danger:hover { background: rgba(107,0,0,0.2); }

.btn-success {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(34,197,94,0.3);
}
.btn-success:hover { background: rgba(34,197,94,0.2); }

.btn-warning {
  background: var(--orange-bg);
  color: var(--orange);
  border-color: rgba(249,115,22,0.3);
}
.btn-warning:hover { background: rgba(249,115,22,0.2); }

.btn-gold {
  background: var(--gold);
  color: #000;
  font-weight: 600;
  border-color: var(--gold);
}
.btn-gold:hover { background: #e8c068; border-color: #e8c068; }

.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Forms ───────────────────────────────────────────── */
.input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  padding: 8px 12px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(107,0,0,0.15);
}
.input::placeholder { color: var(--text-muted); }
.input-sm { padding: 5px 10px; font-size: 12px; }
select.input { cursor: pointer; }
.textarea { resize: vertical; min-height: 70px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.form-hint  { font-size: 11px; color: var(--text-muted); }
.form-static { font-size: 13px; color: var(--text-primary); padding: 4px 0; }
.form-full { grid-column: 1 / -1; }

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

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}
.form-check input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--red);
  cursor: pointer;
}

/* ── Filter Bar ──────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.filter-search { flex: 1; min-width: 180px; }
.filter-select { width: auto; min-width: 140px; flex-shrink: 0; }

.filter-bar-inline { display: flex; gap: 8px; align-items: center; }

/* ── Modals ──────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.open { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid #2a2a2a;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(107,0,0,0.06);
  animation: modalIn 0.18s ease;
}

.modal-sm { max-width: 420px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-12px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  /* Red top accent on modal */
  background: linear-gradient(180deg, rgba(107,0,0,0.05) 0%, transparent 100%);
  position: relative;
}
.modal-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red), transparent);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h3 { font-size: 15px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--red-bg); color: var(--red); }

/* Legacy modal form padding — only applies to forms NOT using .modal-section */
.modal-content > form > .form-grid { padding: 16px 20px 0; }
.modal-content > form > .form-group { padding: 8px 20px 0; }

/* ── Modal Sections (neue Struktur) ──────────────────── */
.modal-section {
  padding: 14px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-section:last-of-type { border-bottom: none; }

.section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-left: 8px;
  border-left: 2px solid var(--red-dim);
}

/* 2-col grid inside sections — no auto-fit, always 2 cols */
.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.modal-form-grid .form-full { grid-column: 1 / -1; }

/* Combined input (prefix select + number/text) */
.input-combo { display: flex; }
.input-combo .input-prefix {
  flex-shrink: 0;
  width: 88px;
  border-radius: var(--radius) 0 0 var(--radius);
  border-right: none;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 12px;
}
.input-combo .input-prefix:focus { position: relative; z-index: 1; border-right: none; }
.input-combo .input-main {
  border-radius: 0 var(--radius) var(--radius) 0;
  flex: 1;
}

/* Styled checkbox toggle row */
.fest-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.fest-toggle:hover {
  border-color: rgba(107,0,0,0.35);
  background: rgba(107,0,0,0.04);
}
.fest-toggle input[type=checkbox] {
  width: 15px; height: 15px;
  accent-color: var(--red);
  flex-shrink: 0;
}
.fest-toggle-info { display: flex; flex-direction: column; gap: 1px; }
.fest-toggle-info strong { font-size: 13px; color: var(--text-primary); }
.fest-toggle-info span { font-size: 11px; color: var(--text-muted); }

/* Von → Bis date range row */
.date-range-row {
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  gap: 8px;
  align-items: end;
}
.date-range-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 8px;
  color: var(--text-muted);
  font-size: 14px;
}

.modal-lg { max-width: 600px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}

/* ── Activity List ───────────────────────────────────── */
.activity-list { display: flex; flex-direction: column; }

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition);
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: rgba(255,255,255,0.025); }

.activity-icon { font-size: 16px; flex-shrink: 0; }

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

.activity-action {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
}

.activity-detail {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-meta { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.activity-user { font-size: 11px; font-weight: 500; color: var(--red); }
.activity-time { font-size: 11px; color: var(--text-muted); }

/* ── Dashboard Grid ──────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 20px;
}

.dash-card-wide { grid-column: 1 / -1; }

/* Dashboard Tabs */
.dashboard-tabs { display: flex; gap: 4px; margin-bottom: 18px; }
.dashboard-tabs .tab-btn {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
}
.dashboard-tabs .tab-btn.active {
  background: var(--red-bg);
  color: var(--red-bright);
  border-color: rgba(107,0,0,0.4);
}
.dashboard-tabs .tab-btn:hover:not(.active) { color: var(--text-secondary); border-color: #333; }

/* ── Lager Layout ────────────────────────────────────── */
.lager-layout { display: flex; gap: 20px; min-height: 60vh; }

.lager-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  align-self: flex-start;
  position: sticky;
  top: 20px;
}

.lager-sidebar-header {
  padding: 12px 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.lager-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  transition: all var(--transition);
  cursor: pointer;
}
.lager-item:hover { background: rgba(107,0,0,0.07); color: var(--text-primary); border-left: 2px solid rgba(107,0,0,0.3); padding-left: 12px; }
.lager-item.active { background: var(--red-bg); color: var(--red-bright); border-left: 2px solid var(--red); padding-left: 12px; }

.lager-item-icon { font-size: 16px; flex-shrink: 0; }
.lager-item-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.lager-item-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lager-item-meta { font-size: 11px; color: var(--text-muted); }
.lager-badge { font-size: 11px; font-weight: 700; min-width: 20px; text-align: center; }
.lager-empty { padding: 20px 14px; color: var(--text-muted); font-size: 12px; text-align: center; }
.lager-content { flex: 1; min-width: 0; }

.lager-content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.lager-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Item Drag Rows */
.items-drag-container { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }

.item-row-drag {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.item-row-drag:hover {
  background: var(--bg-elevated);
  border-color: rgba(107,0,0,0.35);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3), inset 2px 0 0 rgba(107,0,0,0.4);
  transform: translateX(2px);
}
.item-row-drag.drag-over { box-shadow: 0 0 0 2px var(--red); background: var(--bg-hover); border-color: var(--red-dim); }
.item-row-drag.dragging  { opacity: 0.35; }

.drag-handle {
  color: var(--text-muted); font-size: 18px; cursor: grab;
  padding: 0 2px; user-select: none; flex-shrink: 0;
  letter-spacing: -2px; transition: color var(--transition);
}
.drag-handle:hover { color: var(--red); }
.drag-handle:active { cursor: grabbing; }

.item-logo {
  width: 36px; height: 36px; object-fit: contain;
  flex-shrink: 0; border-radius: 6px;
  background: rgba(255,255,255,0.04);
  padding: 2px;
}
.item-logo-placeholder {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; border-radius: 6px;
  background: rgba(255,255,255,0.04);
}

.item-info { width: 160px; flex-shrink: 0; }
.item-name { font-weight: 500; font-size: 13px; display: block; }
.item-einheit { font-size: 11px; }

.item-bar-wrap { flex: 1; min-width: 200px; }

.item-bar {
  position: relative; height: 7px;
  background: rgba(255,255,255,0.07);
  border-radius: 4px; overflow: visible;
  margin-bottom: 4px;
}

.item-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.item-bar-fill.status-kritisch { background: var(--red); }
.item-bar-fill.status-niedrig  { background: var(--orange); }
.item-bar-fill.status-gut      { background: var(--green); }
.item-bar-fill.status-voll     { background: var(--blue); }

.item-bar-marker {
  position: absolute; top: -3px;
  width: 2px; height: 13px;
  border-radius: 1px;
  transform: translateX(-50%);
}
.marker-min { background: var(--red); opacity: 0.7; }
.marker-opt { background: var(--orange); opacity: 0.7; }

.item-values { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.item-current { font-weight: 700; }
.status-text-kritisch { color: var(--red); }
.status-text-niedrig  { color: var(--orange); }
.status-text-gut      { color: var(--green); }
.status-text-voll     { color: var(--blue); }

.item-status-badge { padding: 1px 7px; border-radius: 10px; font-size: 10px; font-weight: 600; margin-left: 4px; }
.badge-status-kritisch { background: var(--red-bg);    color: var(--red); }
.badge-status-niedrig  { background: var(--orange-bg); color: var(--orange); }
.badge-status-gut      { background: var(--green-bg);  color: var(--green); }
.badge-status-voll     { background: var(--blue-bg);   color: var(--blue); }

.item-stats { font-size: 11px; display: flex; gap: 8px; flex-shrink: 0; }
.item-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Bewegungen */
.bewegungen-log {
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.bewegungen-header { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.bewegungen-header h3 { font-size: 13px; font-weight: 600; }

/* Autocomplete */
.ac-wrap { position: relative; }
.ac-input-row { display: flex; align-items: center; gap: 8px; }
.ac-preview-img {
  width: 32px; height: 32px; object-fit: contain;
  border-radius: 4px; background: rgba(255,255,255,0.04);
  flex-shrink: 0; padding: 2px;
}
.ac-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-elevated);
  border: 1px solid #333;
  border-radius: var(--radius-lg);
  z-index: 1000; max-height: 240px; overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(107,0,0,0.1);
}
.ac-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; cursor: pointer;
  transition: background 0.1s;
}
.ac-item:hover, .ac-item.ac-active { background: rgba(107,0,0,0.08); }
.ac-item img { width: 26px; height: 26px; object-fit: contain; border-radius: 3px; flex-shrink: 0; }
.ac-item span { font-size: 13px; color: var(--text-primary); }
.ac-no-result { padding: 10px 14px; color: var(--text-muted); font-size: 13px; }

/* ── Admin Tabs ──────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--red-bright); border-bottom-color: var(--red); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Alert ───────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
}
.alert-warning { background: var(--orange-bg); border: 1px solid rgba(249,115,22,0.3); color: var(--orange); }
.alert-danger  { background: var(--red-bg);    border: 1px solid rgba(107,0,0,0.3);  color: var(--red); }

/* ── Pagination ──────────────────────────────────────── */
.pagination { display: flex; gap: 4px; padding: 12px 16px; justify-content: center; }

.page-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  font-size: 12px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.page-btn:hover,
.page-btn.active { background: var(--red-bg); color: var(--red); border-color: rgba(107,0,0,0.4); }

/* ── Empty State ─────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 24px;
  text-align: center;
  gap: 12px;
}
.empty-icon { font-size: 40px; opacity: 0.4; }
.empty-state p { color: var(--text-secondary); font-size: 14px; }

/* ── Text Utilities ──────────────────────────────────── */
.text-danger  { color: var(--red)    !important; }
.text-warning { color: var(--orange) !important; }
.text-success { color: var(--green)  !important; }
.text-gold    { color: var(--gold)   !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-nowrap  { white-space: nowrap; }
.ml-1 { margin-left: 4px; }
.mt-4 { margin-top: 16px; }

/* ── Toast ───────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast-success { background: #0f1a13; border: 1px solid rgba(34,197,94,0.4);  color: var(--green); }
.toast-error   { background: #1a0f0f; border: 1px solid rgba(107,0,0,0.45); color: var(--red); }
.toast-info    { background: var(--bg-card); border: 1px solid rgba(212,168,67,0.4); color: var(--gold); }

/* ── Finanzen Saldo Cards ─────────────────────────────── */
.saldo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 14px; margin-bottom: 24px; }
.saldo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.saldo-card .saldo-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 6px; }
.saldo-card .saldo-val { font-size: 26px; font-weight: 700; }
.saldo-card.normal { border-color: rgba(34,197,94,0.25); }
.saldo-card.normal .saldo-val { color: var(--green); }
.saldo-card.schwarz { border-color: rgba(168,85,247,0.25); }
.saldo-card.schwarz .saldo-val { color: var(--purple); }
.saldo-card.gesamt { border-color: rgba(212,168,67,0.25); }
.saldo-card.gesamt .saldo-val { color: var(--gold); }

/* ── Login Page ──────────────────────────────────────── */
.login-page { background: #000; }

.login-bg {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(107,0,0,0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(107,0,0,0.04) 0%, transparent 45%),
    radial-gradient(ellipse at 60% 80%, rgba(212,168,67,0.03) 0%, transparent 40%);
}

.login-container {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 0 80px rgba(107,0,0,0.1), 0 0 40px rgba(0,0,0,0.8);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}

.login-logo { margin-bottom: 24px; }
.login-crown { font-size: 52px; margin-bottom: 12px; }
.login-logo img { width: 72px; height: 72px; object-fit: contain; margin-bottom: 12px; }
.login-logo h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.login-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.login-divider { height: 1px; background: var(--border); margin: 20px 0; }
.login-info { margin-bottom: 20px; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

.btn-discord {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; width: 100%; padding: 12px;
  background: #5865f2; color: #fff;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  transition: background var(--transition);
  border: none; cursor: pointer;
}
.btn-discord:hover { background: #4752c4; color: #fff; }
.discord-icon { width: 20px; height: 20px; flex-shrink: 0; }
.login-hint { font-size: 11px; color: var(--text-muted); margin-top: 16px; }

/* ── Error Page ──────────────────────────────────────── */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
}
.error-content { text-align: center; }
.error-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.7; }
.error-content h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.error-content p { color: var(--text-secondary); margin-bottom: 20px; }

/* ── Schutzgelder ────────────────────────────────────── */
.familie-info { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .main-content { margin-left: 0; padding: 60px 16px 16px; }
  .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; width: 240px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .sidebar-overlay.active { display: block; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .lager-layout { flex-direction: column; }
  .lager-sidebar { width: 100%; position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .form-full { grid-column: 1; }
  .filter-bar { flex-direction: column; }
  .filter-search, .filter-select { width: 100%; }
}
