:root {
  --bg: #0a0a0c;
  --bg-2: #0f0f12;
  --card: #141418;
  --card-2: #1a1a1f;
  --card-hover: #1e1e24;
  --border: #26262e;
  --border-light: #32323c;
  --text: #f2f2f4;
  --text-dim: #9a9aa5;
  --text-mute: #6b6b76;
  /* Akzentfarbe - wird vom gewaehlten Design ueberschrieben (siehe unten) */
  --red: #e11d2a;
  --red-hover: #f42f3c;
  --red-dim: rgba(225, 29, 42, 0.14);
  /* Warn-/Loeschfarbe - bleibt IMMER rot, egal welches Design gewaehlt ist */
  --danger: #e11d2a;
  --danger-hover: #f42f3c;
  --danger-dim: rgba(225, 29, 42, 0.14);
  --green: #2fbf6d;
  --green-dim: rgba(47, 191, 109, 0.15);
  --yellow: #f0a92b;
  --yellow-dim: rgba(240, 169, 43, 0.15);
  --blue: #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.15);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 244px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Farbdesigns ---------- */
/* Nur die Akzentfarbe wird getauscht. Rot fuer Warnungen/Loeschen bleibt bestehen. */
[data-theme="blau"] {
  --red: #2f7ff0; --red-hover: #4f96ff; --red-dim: rgba(47, 127, 240, 0.16);
}
[data-theme="orange"] {
  --red: #f07b1f; --red-hover: #ff9236; --red-dim: rgba(240, 123, 31, 0.16);
}
[data-theme="gruen"] {
  --red: #22a95c; --red-hover: #2ec46e; --red-dim: rgba(34, 169, 92, 0.16);
}
[data-theme="tuerkis"] {
  --red: #12a3a3; --red-hover: #17bdbd; --red-dim: rgba(18, 163, 163, 0.16);
}
[data-theme="violett"] {
  --red: #8b5cf6; --red-hover: #a276ff; --red-dim: rgba(139, 92, 246, 0.16);
}
[data-theme="anthrazit"] {
  --red: #7d8590; --red-hover: #98a1ac; --red-dim: rgba(125, 133, 144, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

svg { flex-shrink: 0; }

/* ============ SIDEBAR LAYOUT ============ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 40;
}
/* Die Navigation ist normaler Teil der Seite: ein einziger Scrollbalken,
   beim Runterscrollen wandert die Leiste mit nach oben weg.
   Soll sie stehen bleiben, hier "position: sticky; top: 0; max-height: 100vh;" ergaenzen. */
.sidebar-inner { display: flex; flex-direction: column; }

.sidebar-brand {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
}
.brand-logo { max-height: 64px; max-width: 200px; object-fit: contain; display: block; margin: 0 auto; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--red), #a3111b);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(225,29,42,0.35);
}
.logo-mark.small { width: 28px; height: 28px; border-radius: 8px; }
.logo-mark.big { width: 64px; height: 64px; border-radius: 16px; }
.logo-mark.big svg { width: 32px; height: 32px; }
.logo-text .logo-line1 { font-weight: 800; font-size: 15px; letter-spacing: 0.5px; text-transform: uppercase; line-height: 1.1; }

.sidebar-nav { padding: 14px 12px; flex: 0 0 auto; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; margin-bottom: 4px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 14.5px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--card); color: var(--text); }
.nav-link.active {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 14px rgba(225,29,42,0.3);
}
.nav-link.active svg { color: #fff; }
.nav-sep { height: 1px; background: var(--border); margin: 12px 8px; }

.sidebar-credits {
  margin: 12px; padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sc-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-mute); }
.sc-value { font-size: 26px; font-weight: 800; margin: 4px 0 12px; }
.sc-value span { font-size: 13px; font-weight: 500; color: var(--text-dim); }
.sc-btn {
  display: block; text-align: center;
  background: var(--red); color: #fff;
  padding: 9px; border-radius: 8px; font-size: 13px; font-weight: 600;
}
.sc-btn:hover { background: var(--red-hover); color: #fff; }

.sidebar-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-top: 1px solid var(--border);
  color: var(--text-mute); font-size: 12px;
}

/* ============ MAIN ============ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 26px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; margin: 0;
  background: var(--card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); cursor: pointer;
}
.icon-btn svg { width: 18px !important; height: 18px !important; flex-shrink: 0; display: block; }
.icon-btn:hover { background: var(--card-hover); color: var(--text); }
.burger { display: none; }

.topbar-search {
  flex: 1; max-width: 460px; height: 40px; margin: 0; box-sizing: border-box;
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 0 14px;
  color: var(--text-mute);
  transition: border-color 0.15s;
}
.topbar-search:focus-within { border-color: var(--red); }
.topbar-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); padding: 0; height: 100%; font-size: 14px; line-height: normal;
}
.topbar-search svg { flex-shrink: 0; width: 18px !important; height: 18px !important; display: block; }
kbd {
  display: inline-block; background: var(--card-2); border: 1px solid var(--border-light);
  border-bottom-width: 2px; border-radius: 6px; padding: 2px 8px;
  font-family: inherit; font-size: 12px; font-weight: 600; color: var(--text);
}
#shortcutHelp td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
#shortcutHelp td:first-child { white-space: nowrap; width: 40%; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; height: 40px; }
.user-chip { display: flex; align-items: center; gap: 10px; height: 40px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--red), #a3111b);
  color: #fff; font-weight: 700; font-size: 16px;
}
.user-meta { display: flex; flex-direction: column; justify-content: center; line-height: 1.2; }
.user-name { font-size: 14px; font-weight: 600; }
.user-role { font-size: 12px; color: var(--red); }

.content { padding: 28px 26px; flex: 1; }
.content-foot {
  padding: 20px 26px; border-top: 1px solid var(--border);
  color: var(--text-mute); font-size: 12px; text-align: center;
}

/* ============ AUTH LAYOUT ============ */
body.auth-page { display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(1200px 600px at 50% -10%, #17171d 0%, var(--bg) 60%); }
.auth-wrap { width: 100%; max-width: 420px; }
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand .logo-mark.big { margin: 0 auto 16px; }
.auth-brand h1 { font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 6px; }
.auth-brand p { color: var(--text-dim); font-size: 14px; margin: 0; }
.auth-logo { max-height: 90px; max-width: 260px; margin: 0 auto 18px; display: block; object-fit: contain; }

/* ============ HERO ============ */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(115deg, #101015 0%, #17171d 45%, #201014 100%);
  padding: 40px 36px;
  margin-bottom: 24px;
  min-height: 220px;
  display: flex; flex-direction: column; justify-content: center;
}
.hero.has-image { background-size: cover; background-position: center right; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10,10,12,0.92) 0%, rgba(10,10,12,0.7) 45%, rgba(10,10,12,0.15) 100%);
}
.hero > * { position: relative; z-index: 2; }
.hero .kicker { color: var(--text-dim); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.hero h1 { font-size: 34px; font-weight: 800; text-transform: uppercase; margin: 6px 0 10px; letter-spacing: 0.5px; }
.hero p.sub { color: var(--text-dim); font-size: 15px; margin: 0 0 22px; max-width: 520px; }
.hero-features { display: flex; gap: 34px; flex-wrap: wrap; }
.hero-feature { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; width: 90px; }
.hero-feature .hf-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--red-dim); border: 1px solid rgba(225,29,42,0.3);
  display: flex; align-items: center; justify-content: center; color: var(--red);
}
.hero-feature span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-dim); }

/* ============ CARDS / GRID ============ */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.dash-grid { grid-template-columns: 300px 1fr; align-items: start; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .grid-2, .grid-3, .grid-4, .dash-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}
.card:last-child { margin-bottom: 0; }
.card h2 { margin-top: 0; font-size: 16px; font-weight: 700; }
.card h3 { font-size: 13px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-head h2 { margin: 0; }
.card-head .see-all { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--red); }
.card-title-eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-dim); font-weight: 600; margin-bottom: 16px; }

.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat .num { font-size: 30px; font-weight: 800; }
.stat .label { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

/* ============ FORMS ============ */
label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; margin-top: 14px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], textarea, select {
  width: 100%; background: var(--card-2); border: 1px solid var(--border); color: var(--text);
  padding: 11px 13px; border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--red); }
input:disabled, select:disabled { opacity: 0.6; }
textarea { resize: vertical; min-height: 80px; }
input[type=file] { width: 100%; padding: 10px 0; color: var(--text-dim); }

button, .btn {
  display: inline-block; background: var(--red); color: #fff; border: none;
  padding: 11px 22px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; cursor: pointer;
  margin-top: 18px; transition: background 0.15s; font-family: inherit;
}
button:hover, .btn:hover { background: var(--red-hover); color: #fff; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: var(--card-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--card-hover); color: var(--text); }
.btn-small { padding: 7px 13px; font-size: 12.5px; margin-top: 0; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ============ TABLES ============ */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--text-mute); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--card-2); }

/* ============ BADGES ============ */
.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-new { background: var(--yellow-dim); color: var(--yellow); }
.badge-progress { background: var(--red-dim); color: var(--red); }
.badge-done { background: var(--green-dim); color: var(--green); }
.badge-rejected { background: var(--red-dim); color: var(--red); }
.badge-pending { background: var(--yellow-dim); color: var(--yellow); }
.badge-active { background: var(--green-dim); color: var(--green); }
.badge-blocked { background: var(--danger-dim); color: var(--danger); }

/* ============ FLASH ============ */
.flash { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14px; }
.flash-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(47,191,109,0.3); }
.flash-error { background: var(--danger-dim); color: var(--danger-hover); border: 1px solid rgba(225,29,42,0.3); }
.flash-info { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(240,169,43,0.3); }

/* ============ STAGE / OPTION CARDS ============ */
.stage-card {
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
}
.stage-card:hover { border-color: var(--border-light); }
.stage-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.stage-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--red-dim); display: flex; align-items: center; justify-content: center; color: var(--red);
}
.stage-title { font-weight: 700; font-size: 16px; }
.stage-desc { color: var(--text-dim); font-size: 13px; }
.stage-gains { display: flex; gap: 18px; margin-top: 10px; font-size: 13px; font-weight: 600; }
.stage-gains .plus { color: var(--green); }

/* ============ UPLOAD DROPZONE ============ */
.dropzone {
  border: 2px dashed var(--border-light); border-radius: var(--radius);
  padding: 40px 20px; text-align: center; color: var(--text-dim);
  transition: border-color 0.15s, background 0.15s;
}
.dropzone.drag { border-color: var(--red); background: var(--red-dim); }
.dropzone .dz-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--red-dim); border: 1px solid rgba(225,29,42,0.3);
  display: flex; align-items: center; justify-content: center; color: var(--red);
  margin: 0 auto 16px;
}
.dropzone .dz-icon svg { width: 28px; height: 28px; }

/* ============ TIMELINE ============ */
.timeline { position: relative; padding-left: 8px; }
.tl-item { display: flex; gap: 14px; padding-bottom: 20px; position: relative; }
.tl-item:not(:last-child)::before {
  content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--border);
}
.tl-dot {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-2); border: 1px solid var(--border); z-index: 2;
}
.tl-dot.green { background: var(--green-dim); color: var(--green); border-color: rgba(47,191,109,0.4); }
.tl-dot.red { background: var(--danger-dim); color: var(--danger); border-color: rgba(225,29,42,0.4); }
.tl-dot.blue { background: var(--blue-dim); color: var(--blue); border-color: rgba(59,130,246,0.4); }
.tl-dot.yellow { background: var(--yellow-dim); color: var(--yellow); border-color: rgba(240,169,43,0.4); }
.tl-body { flex: 1; min-width: 0; }
.tl-title { font-weight: 600; font-size: 14px; }
.tl-sub { color: var(--text-dim); font-size: 13px; }
.tl-time { color: var(--text-mute); font-size: 12px; margin-top: 2px; }

/* ============ VEHICLE MINI ============ */
.veh-row { display: flex; gap: 14px; align-items: center; }
.veh-thumb {
  width: 72px; height: 54px; border-radius: 10px; flex-shrink: 0;
  background: var(--card-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text-mute);
}
.veh-info .veh-name { font-weight: 700; }
.veh-info .veh-spec { color: var(--text-dim); font-size: 13px; }
.veh-stats { display: flex; gap: 26px; margin-top: 16px; }
.veh-stat .vs-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-mute); }
.veh-stat .vs-value { font-size: 18px; font-weight: 700; margin-top: 2px; }

/* ============ FILE LIST ============ */
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.file-row:last-child { border-bottom: none; }
.file-icon { width: 30px; height: 30px; border-radius: 7px; background: var(--card-2); display: flex; align-items: center; justify-content: center; color: var(--text-dim); flex-shrink: 0; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-date { color: var(--text-mute); font-size: 13px; }

/* ============ HELPERS ============ */
.muted { color: var(--text-dim); font-size: 13px; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.container-narrow { width: 100%; }
.pkg-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; background: var(--card-2); }
.pkg-card .credits { font-size: 32px; font-weight: 800; color: var(--red); }
.pkg-card .price { font-size: 20px; margin: 8px 0 16px; }

/* ============ MOBILE ============ */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    transform: translateX(-100%); transition: transform 0.25s; box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .sidebar-inner { height: 100%; }
  .sidebar-nav { flex: 1; overflow-y: auto; min-height: 0; }
  .sidebar.open { transform: translateX(0); }
  .burger { display: flex; }
  .user-meta { display: none; }
  .hero h1 { font-size: 26px; }
  .hero-features { gap: 20px; }
  /* Breite Dashboard-Spalte (Neue Anfrage) nicht mehr ueber 2 Spalten strecken */
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .content { padding: 18px 14px; }
  .topbar { padding: 12px 14px; gap: 10px; }
  .card { padding: 16px; border-radius: 12px; }
  .hero { padding: 26px 20px; min-height: auto; }
  .hero h1 { font-size: 22px; }
  .hero p.sub { font-size: 13px; }
  .hero-features { gap: 14px; justify-content: space-between; }
  .hero-feature { width: 68px; }
  .hero-feature span { font-size: 10px; }
  /* Zwei-Spalten-Formularraster einspaltig */
  .grid-2 { grid-template-columns: 1fr; }
  .svc-grid { grid-template-columns: 1fr; }
  /* Tabellen horizontal scrollbar, aber lesbar */
  table { font-size: 13px; }
  th, td { padding: 9px 7px; }
  /* Chat-Bubbles breiter auf Mobil */
  .chat-msg { max-width: 88%; }
  /* Suche kompakter */
  .topbar-search { max-width: none; }
  /* Buttons in Zeilen umbrechen lassen */
  .card-head { flex-wrap: wrap; gap: 8px; }
  /* Modal etwas enger */
  .modal-box { padding: 24px 20px; }
  h2 { font-size: 16px; }
}

@media (max-width: 400px) {
  .hero-features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .hero-feature { width: auto; flex-direction: row; justify-content: flex-start; text-align: left; }
  .avatar { width: 36px; height: 36px; font-size: 14px; }
  .icon-btn { width: 36px; height: 36px; }
  /* Container-Hoehen mit verkleinern, sonst verrutscht die Topbar-Reihe */
  .topbar-right, .user-chip, .topbar-search { height: 36px; }
}

/* Klickbare Tabellenzeilen + Nachrichten-Indikator (global) */
.clickable-rows tbody tr { cursor: pointer; transition: background 0.12s; }
.clickable-rows tbody tr:hover { background: var(--card-2); }

/* Leistungsauswahl (Dashboard + Nachbuchen) */
.svc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.svc-option { display: flex; align-items: center; gap: 10px; background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; margin: 0; font-size: 14px; color: var(--text); cursor: pointer; transition: border-color 0.15s; }
.svc-option:hover { border-color: var(--border-light); }
.svc-option .svc-name { flex: 1; min-width: 0; }
.svc-option .svc-cost { color: var(--red); white-space: nowrap; font-weight: 700; }
.svc-option input:checked ~ .svc-name { color: #fff; }
.svc-option:has(input:checked) { border-color: var(--red); background: var(--red-dim); }
@media (max-width: 700px) { .svc-grid { grid-template-columns: 1fr; } }
.msg-dot {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; margin-left: 6px; background: var(--red); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 700; vertical-align: middle;
}

/* Aktions-Dropdown (z.B. Nutzerverwaltung) */
.action-menu { position: relative; display: inline-block; }
.action-menu-trigger { margin: 0; }
.action-menu-panel {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  min-width: 210px; background: var(--card); border: 1px solid var(--border-light);
  border-radius: 12px; padding: 6px; box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.action-menu.open .action-menu-panel { display: block; }
.action-menu-panel form { margin: 0; }
.action-menu-panel .menu-item {
  display: block; width: 100%; text-align: left; background: none; border: none; margin: 0;
  padding: 9px 12px; border-radius: 8px; color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; box-sizing: border-box; text-decoration: none;
}
.action-menu-panel .menu-item:hover { background: var(--card-2); }
.action-menu-panel .menu-item.danger { color: var(--danger); }
.action-menu-panel .menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.action-menu-panel .menu-label { padding: 6px 12px 2px; font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.5px; }

/* Responsive Tabellen: auf dem Handy wird jede Zeile zu einer Karte mit Beschriftung */
@media (max-width: 640px) {
  /* Sicherheitsnetz: uebrige Tabellen scrollen seitlich statt die Seite zu sprengen.
     Zweispaltige Label/Wert-Tabellen (.table-kv) sind ausgenommen - die brechen normal um. */
  table:not(.table-cards):not(.table-kv) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  table:not(.table-cards):not(.table-kv) .muted { white-space: normal; }
  /* Label/Wert-Tabellen: kompakter, Label nicht umbrechen */
  .table-kv td { padding: 8px 6px; vertical-align: top; }
  .table-kv td:first-child { white-space: nowrap; width: 1%; padding-right: 12px; }
  .table-kv td:last-child { text-align: right; word-break: break-word; }

  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards { border-collapse: separate; }
  .table-cards tbody tr {
    background: var(--card-2); border: 1px solid var(--border); border-radius: 12px;
    margin-bottom: 10px; padding: 2px 0; box-sizing: border-box; overflow: hidden;
  }
  .table-cards tbody tr:last-child { margin-bottom: 0; }
  .table-cards tbody tr:hover td { background: transparent; }
  .table-cards tbody td {
    border-bottom: 1px solid var(--border); padding: 9px 12px; box-sizing: border-box;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
    text-align: right; word-break: break-word;
  }
  .table-cards tbody td:last-child { border-bottom: none; }
  /* Zusammengefasster Zellwert (z.B. E-Mail + Telefon) bleibt ein Block */
  .table-cards tbody td .cv { flex: 1 1 auto; min-width: 0; text-align: right; }
  .table-cards tbody td::before {
    content: attr(data-label); color: var(--text-mute); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px; text-align: left;
    flex: 0 0 auto; padding-top: 2px; white-space: nowrap;
  }
  /* Zellen ohne Beschriftung (z.B. Aktionen) nehmen die volle Breite */
  .table-cards tbody td[data-label=""] { display: block; text-align: left; }
  .table-cards tbody td[data-label=""]::before { display: none; }
  .table-cards tbody td:not([data-label]) { display: block; text-align: left; }
  .table-cards tbody td:not([data-label])::before { display: none; }
  /* Eingabefelder in Karten-Zeilen (Bearbeiten-Modus) volle Breite */
  .table-cards tbody td input[type="text"],
  .table-cards tbody td input[type="number"],
  .table-cards tbody td select { width: 100%; max-width: none; }
  /* Dropdown-Menue am rechten Rand halten */
  .table-cards .action-menu-panel { right: 0; left: auto; }
}

/* Filter-Tabs (Auftragslisten Admin + Kunde) */
.order-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filter-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--border); color: var(--text-dim);
  font-size: 13px; font-weight: 600; text-decoration: none; transition: all 0.15s;
}
.filter-tab:hover { border-color: var(--border-light); color: var(--text); }
.filter-tab.active { background: var(--red); border-color: var(--red); color: #fff; }
.filter-tab .cnt { background: rgba(0,0,0,0.25); border-radius: 999px; padding: 1px 8px; font-size: 11px; }


/* ---------- Dashboard: Kennzahlen ---------- */
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 4px;
}
.stat-label { color: var(--text-mute); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1.15; }
.stat-unit { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.stat-link { margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--text-dim); text-decoration: none; }
.stat-link:hover { color: var(--red); }

/* ---------- Dashboard: News ---------- */
.news-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.news-item:first-of-type { padding-top: 0; }
.news-item:last-of-type { border-bottom: none; padding-bottom: 0; }
.news-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.news-pin { font-size: 13px; }
.news-date { color: var(--text-mute); font-size: 12px; margin-left: auto; white-space: nowrap; }
.news-body { color: var(--text-dim); font-size: 14px; line-height: 1.65; }

/* ---------- Dashboard: Balken-Statistik ---------- */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.bar-label {
  flex: 0 0 92px; font-size: 13px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track { flex: 1; height: 8px; background: var(--card-2); border-radius: 999px; overflow: hidden; min-width: 0; }
.bar-fill { height: 100%; background: var(--red); border-radius: 999px; }
.bar-fill.blue { background: var(--blue); }
.bar-val { flex: 0 0 auto; font-size: 12px; color: var(--text-dim); font-weight: 600; min-width: 34px; text-align: right; }

/* ---------- Dashboard: Status-Verteilung ---------- */
.status-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--card-2); }
.status-seg.green { background: var(--green); }
.status-seg.blue { background: var(--blue); }
.status-seg.yellow { background: #e0a800; }
.status-seg.red { background: var(--danger); }
.status-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.leg-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); }
.leg-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.leg-dot.green { background: var(--green); }
.leg-dot.blue { background: var(--blue); }
.leg-dot.yellow { background: #e0a800; }
.leg-dot.red { background: var(--danger); }

@media (max-width: 900px) {
  .bar-label { flex-basis: 78px; font-size: 12.5px; }
}

/* Dashboard-Hauptlayout (Inhalt + Seitenspalte) */
.dash-main { grid-template-columns: 1fr 340px; align-items: start; }
/* Neue-Anfrage-Layout (Guthaben + Formular) */
.order-main { grid-template-columns: 300px 1fr; align-items: start; }
@media (max-width: 1000px) {
  .dash-main, .order-main { grid-template-columns: 1fr; }
}

/* ---------- Design-Auswahl (Einstellungen) ---------- */
.theme-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-opt {
  display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px; margin: 0;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card-2);
  font-size: 13px; font-weight: 600; color: var(--text-dim); cursor: pointer; transition: all 0.15s;
}
.theme-opt:hover { border-color: var(--border-light); color: var(--text); }
.theme-opt.active { border-color: var(--red); color: var(--text); background: var(--red-dim); }
.theme-opt input { display: none; }
.theme-dot { width: 15px; height: 15px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.18); }

/* ---------- Sprachumschalter (Topbar) ---------- */
.lang-switch {
  display: flex; align-items: center; gap: 2px; height: 40px; flex-shrink: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 3px;
}
.lang-switch form { margin: 0; display: flex; }
.lang-opt {
  display: flex; align-items: center; justify-content: center; margin: 0;
  height: 32px; min-width: 34px; padding: 0 8px; border: none; border-radius: 7px;
  background: none; color: var(--text-mute);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.5px; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
.lang-opt:hover { background: var(--card-2); color: var(--text); }
.lang-opt.active { background: var(--red); color: #fff; cursor: default; }
@media (max-width: 400px) { .lang-switch { height: 36px; } .lang-opt { height: 28px; min-width: 30px; } }
