:root {
  --lila: #6E2680;
  --lila-hell: #9C42B0;
  --pink: #E91E8C;
  --schwarz: #0D0D0D;
  --grau-dunkel: #3A2E3D;
  --grau-mittel: #2A2A2A;
  --grau-hell: #555;
  --text: #E8E8E8;
  --text-gedaempft: #aaa;
  --border: rgba(110, 38, 128, 0.3);
  --radius: 4px;
  --transition: 0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Lato', sans-serif;
  background: var(--schwarz);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

a { color: var(--lila-hell); text-decoration: none; }
a:hover { color: var(--pink); }

/* ── Layout ── */

.page { display: flex; flex-direction: column; min-height: 100vh; }

.header {
  background: var(--grau-dunkel);
  border-bottom: 2px solid var(--lila);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  color: var(--text);
  letter-spacing: 0.1em;
}

.header__logo span { color: var(--pink); }

.header__nav { display: flex; gap: 0.5rem; margin-left: auto; align-items: center; }

.header__user {
  color: var(--text-gedaempft);
  font-size: 0.85rem;
}

.main { flex: 1; padding: 2rem 1.5rem; max-width: 1100px; margin: 0 auto; width: 100%; }

/* ── Cards & Sections ── */

.card {
  background: var(--grau-mittel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card--lila { border-top: 3px solid var(--lila); }
.card--pink  { border-top: 3px solid var(--pink); }

.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--text);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--lila);
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-gedaempft);
  margin-top: -1rem;
  margin-bottom: 1.5rem;
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border: none;
  border-radius: var(--radius);
  font-family: 'Lato', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  text-decoration: none;
}
.btn:hover { opacity: 0.85; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn--lila   { background: var(--lila); color: #fff; }
.btn--pink   { background: var(--pink); color: #fff; }
.btn--ghost  { background: transparent; border: 1px solid var(--border); color: var(--text-gedaempft); }
.btn--ghost:hover { border-color: var(--lila-hell); color: var(--text); }
.btn--danger { background: #8B1A1A; color: #fff; }

/* ── Forms ── */

.form { display: flex; flex-direction: column; gap: 1.2rem; }

.form__group { display: flex; flex-direction: column; gap: 0.4rem; }

.form__group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-gedaempft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form__group label .required { color: var(--pink); margin-left: 2px; }

input, textarea, select {
  background: var(--schwarz);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
  transition: border-color var(--transition);
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--lila-hell);
}

input::placeholder, textarea::placeholder { color: var(--grau-hell); }

textarea { resize: vertical; min-height: 100px; }

select option { background: var(--schwarz); }

.form__hint { font-size: 0.8rem; color: var(--text-gedaempft); }

.form__error { font-size: 0.85rem; color: var(--pink); }

/* ── Alert / Notice ── */

.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  border-left: 3px solid;
  font-size: 0.9rem;
}
.alert--ok    { border-color: #4CAF50; background: rgba(76,175,80,0.1); color: #a5d6a7; }
.alert--warn  { border-color: var(--pink); background: rgba(233,30,140,0.08); color: var(--pink); }
.alert--info  { border-color: var(--lila-hell); background: rgba(110,38,128,0.1); color: var(--lila-hell); }

/* ── Tables ── */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }

th {
  text-align: left;
  padding: 0.6rem 0.8rem;
  background: var(--grau-dunkel);
  color: var(--text-gedaempft);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(110,38,128,0.05); }

/* ── Status badges ── */

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge--offen      { background: rgba(233,30,140,0.15); color: var(--pink); }
.badge--eingereicht { background: rgba(110,38,128,0.2); color: var(--lila-hell); }
.badge--done       { background: rgba(76,175,80,0.15); color: #a5d6a7; }
.badge--locked     { background: var(--grau-dunkel); color: var(--text-gedaempft); }

/* ── Login page ── */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a0f1e 0%, var(--schwarz) 70%);
  padding: 1.5rem;
}

.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--grau-mittel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
}

.login-box__logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  color: var(--text);
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.login-box__logo span { color: var(--pink); }

.login-box__sub {
  font-size: 0.85rem;
  color: var(--text-gedaempft);
  margin-bottom: 2rem;
}

/* ── Portal grid ── */

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.portal-card {
  background: var(--grau-mittel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.portal-card:hover { border-color: var(--lila-hell); transform: translateY(-2px); color: var(--text); }
.portal-card__icon { font-size: 1.8rem; margin-bottom: 0.3rem; }
.portal-card__title { font-family: 'Bebas Neue', sans-serif; font-size: 1.2rem; letter-spacing: 0.05em; }
.portal-card__desc { font-size: 0.85rem; color: var(--text-gedaempft); }

/* ── Dashboard status ── */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
@media (max-width: 600px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ── Running order ── */

.ro-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.4rem;
  cursor: grab;
  user-select: none;
  transition: opacity var(--transition);
}
.ro-item:active { cursor: grabbing; }
.ro-item.sortable-ghost { opacity: 0.3; }
.ro-item.sortable-chosen { box-shadow: 0 4px 20px rgba(0,0,0,0.5); }

.ro-item__num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  width: 2rem;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-gedaempft);
}
.ro-item__handle { cursor: grab; color: var(--grau-hell); flex-shrink: 0; }
.ro-item__name { font-weight: 700; flex: 1; }
.ro-item__mood { font-size: 0.8rem; color: var(--text-gedaempft); }
.ro-item__actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* Stimmungs-Farben */
.mood-A-odd  { background: rgba(110, 38, 128, 0.25); border-left: 3px solid #6E2680; }
.mood-A-even { background: rgba(110, 38, 128, 0.15); border-left: 3px solid #6E2680; }
.mood-B-odd  { background: rgba(233, 30, 140, 0.20); border-left: 3px solid #E91E8C; }
.mood-B-even { background: rgba(233, 30, 140, 0.12); border-left: 3px solid #E91E8C; }
.mood-C-odd  { background: rgba(58, 46, 61, 0.60); border-left: 3px solid #3A2E3D; }
.mood-C-even { background: rgba(58, 46, 61, 0.40); border-left: 3px solid #3A2E3D; }
.mood-D-odd  { background: rgba(255,255,255, 0.04); border-left: 3px solid #555; }
.mood-D-even { background: rgba(255,255,255, 0.02); border-left: 3px solid #555; }

/* ── Utilities ── */

.flex        { display: flex; }
.flex-gap    { gap: 0.75rem; }
.flex-wrap   { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--text-gedaempft); }
.text-small { font-size: 0.85rem; }
.text-pink { color: var(--pink); }
.text-lila { color: var(--lila-hell); }
[x-cloak] { display: none !important; }

@media (max-width: 768px) {
  .main { padding: 1.5rem 1rem; }
  .portal-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .portal-grid { grid-template-columns: 1fr; }
}
