/* ============================================================
   Benny's Autowerkstatt – Style
   ============================================================ */

:root {
  --bg:        #0d0d0f;
  --bg-card:   #161619;
  --bg-card2:  #1e1e23;
  --border:    #2a2a32;
  --accent:    #f5a623;
  --accent2:   #e8380d;
  --text:      #e8e8ec;
  --text-muted:#9a9aa8;
  --green:     #27c77c;
  --radius:    10px;
  --font-head: 'Bebas Neue', sans-serif;
  --font-body: 'Barlow', sans-serif;
  --shadow:    0 4px 24px rgba(0,0,0,0.45);
}

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

/* Sichtbarer Fokus für Tastatur-Navigation (nicht bei Maus-Klick) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}

/* ── HEADER ─────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}
.header-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 40px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon { font-size: 28px; }
.logo-title {
  display: block;
  font-family: var(--font-head);
  font-size: 26px;
  color: var(--accent);
  line-height: 1;
  letter-spacing: 1px;
}
.logo-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.backup-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  opacity: 0.35;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.backup-btn:hover { opacity: 1; }
.nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.5px;
}
.nav-btn:hover { background: var(--bg-card2); color: var(--text); }
.nav-btn.active { background: var(--accent); color: #000; }

/* ── MAIN ────────────────────────────────────────────── */
.main-content {
  max-width: 1300px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

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

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

/* ── AUFTRÄGE HEADER ─────────────────────────────────── */
.orders-header {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.orders-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.orders-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.order-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  color: var(--text-muted);
  transition: all 0.15s;
  white-space: nowrap;
}
.filter-btn:hover { border-color: var(--text-muted); color: var(--text); }

/* Aktive Zustände passend zu den Status-Badges */
.filter-btn.active.filter-arbeit {
  background: rgba(245,166,35,0.12);
  color: var(--accent);
  border-color: rgba(245,166,35,0.4);
}
.filter-btn.active.filter-zahlung {
  background: rgba(232,56,13,0.12);
  color: #e8380d;
  border-color: rgba(232,56,13,0.4);
}
.filter-btn.active.filter-abholung {
  background: rgba(124,124,138,0.15);
  color: var(--text);
  border-color: rgba(124,124,138,0.4);
}
.filter-btn.active.filter-done {
  background: rgba(39,199,124,0.1);
  color: #27c77c;
  border-color: rgba(39,199,124,0.35);
}

/* ── AUFTRAGS-SUCHFELDER ─────────────────────────────── */
.order-search-wrap {
  display: flex;
  gap: 8px;
}
.order-search-wrap input {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 16px;
  outline: none;
  transition: border-color 0.15s;
}
.order-search-wrap input:first-child { width: 200px; }
.order-search-wrap input:last-child  { width: 150px; }
.order-search-wrap input:focus { border-color: var(--accent); }

/* ── KUNDEN-DETAIL FAHRZEUG-ZEILE ────────────────────── */
.customer-car-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
}
.car-unlink-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  line-height: 1;
}
.car-unlink-btn:hover {
  color: #e8380d;
  background: rgba(232,56,13,0.1);
}

.section-title {
  font-family: var(--font-head);
  font-size: 28px;
  letter-spacing: 1px;
  color: var(--text);
}

/* ── DASHBOARD GRID ──────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--accent); }
.stat-number {
  font-family: var(--font-head);
  font-size: 48px;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.stat-sub {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  min-height: 14px;
}
.cashbalance-edit-btn {
  background: rgba(255, 130, 0, 0.12);
  border: 1px solid rgba(255, 130, 0, 0.28);
  border-radius: 6px;
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 8px;
  margin-left: 8px;
  opacity: 0.95;
  text-transform: uppercase;
  transition: opacity 0.2s, background 0.2s, border-color 0.2s;
}
.cashbalance-edit-btn:hover {
  background: rgba(255, 130, 0, 0.2);
  border-color: rgba(255, 130, 0, 0.42);
  opacity: 1;
}

.recent-orders-section {
  margin-top: 8px;
  padding: 24px;
}

.recent-orders-section .section-title {
  margin-bottom: 18px;
}

/* ── DASHBOARD RECENT LIST ───────────────────────────── */
.recent-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 1000px) {
  .recent-list { grid-template-columns: repeat(2, 1fr); }
}
.recent-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recent-item:hover { border-color: var(--accent); }
.recent-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.recent-name {
  font-weight: 700;
  font-size: 15px;
}
.recent-car {
  font-size: 12px;
  color: var(--text-muted);
}
.recent-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}
.recent-price {
  font-family: var(--font-head);
  font-size: 22px;
  color: var(--accent);
  margin-top: auto;
}

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { opacity: 0.88; }
.btn-danger {
  background: var(--bg-card2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-danger:hover {
  color: #e8380d;
  border-color: rgba(232,56,13,0.4);
  background: rgba(232,56,13,0.07);
}
.btn-ghost {
  background: var(--bg-card2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); }

/* ── FORM CARD ───────────────────────────────────────── */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 28px;
  max-width: 560px;
  box-shadow: var(--shadow);
}
.form-card h3 {
  font-family: var(--font-head);
  font-size: 22px;
  margin-bottom: 20px;
  color: var(--accent);
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.form-row input,
.form-row select,
.form-row textarea {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
}
.form-row input:focus,
.form-row select:focus {
  border-color: var(--accent);
}
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.hidden { display: none !important; }

/* ── KUNDEN-SUCHE ────────────────────────────────────── */
.customer-search-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.customer-search-wrap input {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 8px 14px;
  outline: none;
  transition: border-color 0.15s;
}
.customer-search-wrap input:first-child { width: 220px; }
.customer-search-wrap input:last-child  { width: 160px; }
.customer-search-wrap input:focus { border-color: var(--accent); }

/* ── CARD LIST (Kunden / Aufträge) ───────────────────── */
.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.customer-card,
.order-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s;
}
.customer-card:hover,
.order-card:hover { border-color: var(--accent); }

.order-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.note-indicator {
  font-size: 14px;
  opacity: 0.7;
  flex-shrink: 0;
  cursor: default;
}
.card-name {
  font-weight: 700;
  font-size: 16px;
}
.card-sub {
  font-size: 13px;
  color: var(--text-muted);
}
.card-type-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 2px;
}
.card-type-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(245,166,35,0.1);
  color: var(--accent);
  border: 1px solid rgba(245,166,35,0.25);
}
.card-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.card-date-item {
  font-size: 12px;
  color: var(--text-muted);
}
.card-pickup {
  color: var(--accent);
  font-weight: 600;
}
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* ── FAHRZEUGE TABELLE ───────────────────────────────── */
.search-box input {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 16px;
  width: 280px;
  outline: none;
  transition: border-color 0.15s;
}
.search-box input:focus { border-color: var(--accent); }

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.cat-btn {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.cat-btn:hover { border-color: var(--accent); color: var(--text); }
.cat-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }


.car-count-info {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.car-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.car-table {
  width: 100%;
  border-collapse: collapse;
}
.car-table th {
  background: var(--bg-card2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.car-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.car-table tr:last-child td { border-bottom: none; }
.car-table tr:hover td { background: var(--bg-card2); }
.car-table .price {
  font-family: var(--font-head);
  font-size: 16px;
  color: var(--accent);
}
.car-table .price-unknown { color: var(--text-muted); font-style: italic; }
.car-table .cat-badge {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  padding: 2px 7px;
  color: var(--text-muted);
}

/* ── MODAL ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 420px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-family: var(--font-head);
  font-size: 22px;
  color: var(--accent);
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--bg-card2); color: var(--text); }
.modal-body { padding: 24px; }

/* ── EMPTY STATE ─────────────────────────────────────── */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 24px;
  font-size: 15px;
}

/* ── ORDER MODAL ─────────────────────────────────────── */
.modal-order {
  width: min(1100px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.modal-order .modal-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

/* Layout */
.of-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  min-height: 0;
}

.of-main {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid var(--border);
}

/* Sektionen */
.of-section {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.of-section-title {
  font-family: var(--font-head);
  font-size: 16px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 14px 18px 0;
  text-transform: uppercase;
  font-size: 13px;
}
.of-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
}
.of-section-body {
  padding: 0 18px 18px;
  border-top: 1px solid var(--border);
  margin-top: 0;
}
.of-section-body.hidden { display: none; }

/* Toggle Switch */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  user-select: none;
}
.toggle-label input[type="checkbox"] { display: none; }
.toggle-track {
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: left 0.2s, background 0.2s;
}
.toggle-label input:checked ~ .toggle-track { background: var(--accent); }
.toggle-label input:checked ~ .toggle-track .toggle-thumb {
  left: 21px;
  background: #000;
}

/* Section Badge */
.section-badge {
  font-family: var(--font-head);
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.5px;
}

/* OF Form rows */
.of-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  padding: 0 18px;
}
.of-row:first-of-type { padding-top: 14px; }
.of-row label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.label-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}
.of-row input[type="text"],
.of-row input[type="number"],
.of-row select,
.of-row textarea,
#of-notes {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.of-row input:focus,
.of-row select:focus,
.of-row textarea:focus { border-color: var(--accent); }
.of-row input[readonly] {
  color: var(--accent);
  cursor: default;
  font-weight: 600;
}
.of-row input[readonly]:focus { border-color: var(--border); }
.of-pickup-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: flex-start;
}
.of-pickup-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.of-pickup-col label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.of-pickup-col input[type="date"],
.of-pickup-col input[type="time"] {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 5px 8px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
  color-scheme: dark;
}
.of-pickup-col input[type="date"]:focus,
.of-pickup-col input[type="time"]:focus { border-color: var(--accent); }

/* Datum-Wrapper mit Pfeil-Buttons */
.pickup-date-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}
.pickup-date-wrap input[type="date"] {
  flex: 1;
}
.pickup-day-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pickup-day-btn {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 9px;
  width: 22px;
  height: 18px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  padding: 0;
}
.pickup-day-btn:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* Uhrzeit-Wrapper mit Addier-Eingabe */
.pickup-time-wrap {
  display: flex;
  align-items: flex-end;
  gap: 5px;
}
.pickup-time-wrap input[type="time"] {
  flex: 1;
}
.pickup-add-wrap {
  display: flex;
  align-items: flex-end;
  gap: 3px;
}
.pickup-add-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.pickup-add-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1;
}
.pickup-add-input {
  width: 28px;
  text-align: center;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 3px 2px;
  outline: none;
  -moz-appearance: textfield;
}
.pickup-add-input::-webkit-outer-spin-button,
.pickup-add-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pickup-add-input:focus { border-color: var(--accent); }
.pickup-add-sep {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 3px;
}
.pickup-add-btn {
  background: var(--accent);
  border: none;
  border-radius: 5px;
  color: #000;
  font-size: 15px;
  font-weight: 700;
  width: 32px;
  height: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
  padding: 0;
  flex-shrink: 0;
  margin-bottom: 0;
}
.pickup-add-btn:hover { opacity: 0.8; }
#of-notes {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  width: 100%;
  margin: 0 18px 18px;
  width: calc(100% - 36px);
}
#of-notes:focus { border-color: var(--accent); }

/* Car search dropdown */
.car-search-wrap { position: relative; }
.car-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  z-index: 200;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.car-dd-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.1s;
}
.car-dd-item:hover { background: var(--bg-card2); }
.dd-name { color: var(--text); }
.dd-price { color: var(--accent); font-size: 12px; }

/* Hint */
.of-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 12px 0 14px;
  line-height: 1.5;
}

/* Multiplier info */
.mult-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}
.mult-label { color: var(--text-muted); }
.mult-value { font-family: var(--font-head); font-size: 20px; color: var(--accent); }
.mult-desc  { color: var(--text-muted); font-size: 12px; }

/* Tuning Tabelle */
.tuning-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tuning-table th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.tuning-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tuning-table tfoot td { border-bottom: none; border-top: 2px solid var(--border); }
.tuning-table tr:hover td { background: rgba(255,255,255,0.02); }

.part-name { display: block; font-weight: 600; }
.part-note { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.td-ep { color: var(--text-muted); white-space: nowrap; }
.td-qty { width: 120px; }
.td-line { text-align: right; white-space: nowrap; font-weight: 600; }
.tf-label { color: var(--text-muted); font-weight: 700; font-size: 12px; letter-spacing: 0.5px; }
.tf-total { text-align: right; font-family: var(--font-head); font-size: 18px; }

/* Qty Controls */
.qty-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
}
.qty-btn {
  width: 26px;
  height: 26px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.1s;
  flex-shrink: 0;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.qty-input {
  width: 48px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  padding: 4px;
  outline: none;
}
.qty-input:focus { border-color: var(--accent); }
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Type Buttons (Wartung/Reparatur) */
.type-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.type-btn {
  flex: 1;
  min-width: 140px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.type-btn:hover { border-color: var(--accent); }
.type-btn.active { border-color: var(--accent); background: rgba(245,166,35,0.08); }
.type-btn-name {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.type-btn-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}
.type-btn-price {
  display: block;
  font-family: var(--font-head);
  font-size: 18px;
  color: var(--accent);
  margin-top: 4px;
}

/* Sondereinnahmen */
.sonder-row {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.sonder-row:last-child { border-bottom: none; }
.sonder-check-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.sonder-check-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.sonder-info { flex: 1; }
.sonder-name { display: block; font-weight: 700; font-size: 14px; }
.sonder-sub  { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.sonder-price {
  font-family: var(--font-head);
  font-size: 18px;
  color: var(--accent);
  white-space: nowrap;
}

.sonder-benzin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.benzin-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.benzin-input-wrap input {
  width: 70px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  padding: 6px;
  outline: none;
}
.benzin-input-wrap input:focus { border-color: var(--accent); }
.benzin-unit { font-size: 13px; color: var(--text-muted); }
.benzin-result {
  font-family: var(--font-head);
  font-size: 18px;
  color: var(--accent);
  white-space: nowrap;
}

/* ── PRICE SIDEBAR ─────────────────────────────────────── */
.of-sidebar {
  background: var(--bg-card);
  position: sticky;
  top: 0;
  align-self: start;
}
.price-summary {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ps-title {
  font-family: var(--font-head);
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--text);
  margin-bottom: 16px;
}
.ps-car-info {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.ps-car-label { display: block; font-size: 13px; font-weight: 700; }
.ps-plate {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--font-head);
  font-size: 15px;
  letter-spacing: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  color: var(--text);
}
.ps-car-price {
  display: block;
  font-family: var(--font-head);
  font-size: 20px;
  color: var(--accent);
  margin-top: 2px;
}
.ps-employee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(245, 166, 35, 0.07);
  border: 1px solid rgba(245, 166, 35, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.ps-employee-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
  user-select: none;
}
.ps-employee-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.ps-employee-hint {
  font-size: 11px;
  color: var(--text-muted);
}
.ps-dpos-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(39, 199, 124, 0.07);
  border: 1px solid rgba(39, 199, 124, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.ps-dpos-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--green);
  user-select: none;
}
.ps-dpos-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
  cursor: pointer;
}
.ps-dpos-hint {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}
.ps-fickcaddy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(245, 166, 35, 0.07);
  border: 1px solid rgba(245, 166, 35, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.ps-fickcaddy-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
  user-select: none;
}
.ps-fickcaddy-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.ps-fickcaddy-hint {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.ps-mddiscount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(79, 168, 255, 0.07);
  border: 1px solid rgba(79, 168, 255, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.ps-mddiscount-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: #4fa8ff;
  user-select: none;
}
.ps-mddiscount-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #4fa8ff;
  cursor: pointer;
}
.ps-mddiscount-hint {
  font-size: 13px;
  font-weight: 700;
  color: #4fa8ff;
}
.ps-maskenball-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(180, 100, 220, 0.08);
  border: 1px solid rgba(180, 100, 220, 0.25);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.ps-maskenball-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #c678dd;
  user-select: none;
}
.ps-maskenball-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #c678dd;
  cursor: pointer;
}
.ps-maskenball-hint {
  font-size: 13px;
  font-weight: 700;
  color: #c678dd;
}
.ps-lostmc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(224, 82, 82, 0.08);
  border: 1px solid rgba(224, 82, 82, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.ps-lostmc-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: #e05252;
  user-select: none;
}
.ps-lostmc-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #e05252;
  cursor: pointer;
}
.ps-lostmc-hint {
  font-size: 13px;
  font-weight: 700;
  color: #e05252;
}
.ps-discount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  margin-bottom: 14px;
  background: var(--bg-card2);
  border-radius: 8px;
}
.ps-discount-label {
  font-size: 13px;
  color: var(--text-muted);
}
.ps-discount-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ps-discount-wrap input[type="number"] {
  width: 54px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  padding: 4px 6px;
  text-align: center;
  -moz-appearance: textfield;
}
.ps-discount-wrap input[type="number"]::-webkit-inner-spin-button,
.ps-discount-wrap input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
.ps-discount-wrap input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
}
.ps-discount-pct {
  font-size: 13px;
  color: var(--text-muted);
}
.ps-discount-amount {
  color: var(--green);
}

.ps-lines { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.ps-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.ps-line span:last-child { font-weight: 700; }
.ps-no-service {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 16px 0;
}
.ps-divider {
  border-top: 1px solid var(--border);
  margin: 14px 0;
}
.ps-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
}
.ps-total span:first-child {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
}
.ps-total span:last-child {
  font-family: var(--font-head);
  font-size: 32px;
  color: var(--accent);
}
.btn-full { width: 100%; justify-content: center; margin-bottom: 8px; }
.text-accent { color: var(--accent); }

/* ── STATUS BADGES ───────────────────────────────────── */
.order-status-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin: 6px 0 2px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.1px;
  padding: 3px 7px;
  border-radius: 20px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
/* Klick-Affordance: kleiner Wechsel-Pfeil davor, deutlicher beim Hover */
.status-badge::before {
  content: '⇄';
  font-size: 9px;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.status-badge:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
.status-badge:hover::before { opacity: 1; }
.status-badge:active { transform: translateY(0) scale(0.97); }
.st-green  { background: rgba(39,199,124,0.15); color: #27c77c; border-color: rgba(39,199,124,0.3); }
.st-orange { background: rgba(245,166,35,0.15);  color: var(--accent); border-color: rgba(245,166,35,0.3); }
.st-red    { background: rgba(232,56,13,0.15);   color: #e8380d; border-color: rgba(232,56,13,0.3); }
.st-gray   { background: rgba(124,124,138,0.15); color: var(--text-muted); border-color: rgba(124,124,138,0.3); }
.st-green:hover  { background: rgba(39,199,124,0.28); }
.st-orange:hover { background: rgba(245,166,35,0.28); }
.st-red:hover    { background: rgba(232,56,13,0.28); }
.st-gray:hover   { background: rgba(124,124,138,0.28); }

/* ── STATUS TOGGLES (im Detail-Modal) ────────────────── */
.status-toggles {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 18px;
}
.status-toggle-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 7px;
  border: 2px solid var(--border);
  background: var(--bg-card2);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.status-toggle-btn:hover { border-color: var(--accent); color: var(--text); }
.status-toggle-btn.active { border-color: #27c77c; color: #27c77c; background: rgba(39,199,124,0.08); }
.stb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ── DETAIL MODAL TABELLE ────────────────────────────── */
.detail-car-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.detail-car-price {
  color: var(--text-muted);
  font-size: 13px;
  margin-left: 4px;
}
.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.detail-table td { padding: 6px 8px; }
.detail-total-row td {
  padding: 10px 8px;
  font-weight: 700;
  font-size: 14px;
  border-top: 2px solid var(--border);
}
.detail-total-row td:last-child {
  font-family: var(--font-head);
  font-size: 22px;
  color: var(--accent);
}
.detail-notes {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--bg-card2);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ── ORDER CARD EXTRAS ───────────────────────────────── */
.plate-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  color: var(--text);
  vertical-align: middle;
  text-transform: uppercase;
}
.order-type-badge {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  padding: 2px 8px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.order-price {
  font-family: var(--font-head);
  font-size: 20px;
  color: var(--accent);
}

/* ── ORDER DETAIL TABLE ──────────────────────────────── */
.detail-group td {
  padding: 10px 0 4px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-top: 1px solid var(--border);
}
.detail-sub td {
  padding: 6px 0;
  font-weight: 700;
  border-top: 1px dashed var(--border);
}
.detail-discount-row td {
  padding: 6px 0;
  border-top: 1px dashed var(--border);
  color: var(--green);
}
.detail-discount-row td:last-child {
  font-weight: 700;
}
.detail-employee-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: rgba(39,199,124,.15);
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.detail-created-by {
  font-size: 12px;
  color: var(--text-muted);
  margin: 6px 0 2px;
}
.detail-created-by strong {
  color: var(--text);
}

.detail-pickup-info {
  margin: 6px 0 10px;
  font-size: 13px;
  color: var(--accent);
}
.modal-body table td { padding: 6px 8px; }

/* ── WIKI ────────────────────────────────────────────── */
.wiki-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.wiki-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 10px 20px;
  margin-bottom: -1px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0.3px;
}
.wiki-tab:hover { color: var(--text); }
.wiki-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.wiki-content {
  animation: wikiFadeIn 0.18s ease;
}
@keyframes wikiFadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wiki-article { max-width: 860px; }

.wiki-article-title {
  font-family: var(--font-head);
  font-size: 36px;
  color: var(--accent);
  letter-spacing: 1.5px;
  margin-bottom: 32px;
  line-height: 1;
}

.wiki-section { margin-bottom: 36px; }

.wiki-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.wiki-text {
  color: var(--text-muted);
  line-height: 1.75;
  font-size: 14px;
}
.wiki-text-hint {
  font-size: 12px;
  margin-bottom: 14px;
}

.wiki-type-cards {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.wiki-type-card {
  flex: 1;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wiki-type-small { border-left-color: var(--accent); }
.wiki-type-large { border-left-color: var(--accent2); }

.wiki-type-badge {
  font-size: 15px;
  font-weight: 700;
}
.wiki-type-small .wiki-type-badge { color: var(--accent); }
.wiki-type-large .wiki-type-badge { color: var(--accent2); }

.wiki-type-range {
  font-size: 13px;
  color: var(--text-muted);
}
.wiki-type-price {
  font-family: var(--font-head);
  font-size: 28px;
  letter-spacing: 1px;
  color: var(--text);
  margin-top: 10px;
}

.wiki-materials {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
}
.wiki-material-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}
.wiki-mat-qty {
  font-weight: 700;
  color: var(--accent);
  font-size: 13px;
  min-width: 22px;
  flex-shrink: 0;
}
.wiki-mat-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.wiki-material-highlight {
  border-color: var(--accent);
}
.wiki-material-highlight .wiki-mat-qty {
  color: var(--accent);
}

/* Wiki – Preistabelle */
.wiki-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.wiki-table th,
.wiki-table td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.wiki-table thead th {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
}
.wiki-table tbody tr:hover td {
  background: var(--bg-card2);
}
.wiki-table tbody td:last-child {
  color: var(--accent);
  font-weight: 700;
}

/* Wiki – Schritt-Liste (Tuning-Ablauf) */
.wiki-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wiki-step {
  display: flex;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}
.wiki-step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-family: var(--font-head);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: .5px;
}
.wiki-step-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wiki-step-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.wiki-step-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── AUTH PAGES ──────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-wrap {
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.auth-logo-icon { font-size: 32px; }

.auth-logo-title {
  display: block;
  font-family: var(--font-head);
  font-size: 28px;
  color: var(--accent);
  line-height: 1;
  letter-spacing: 1px;
}

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

.auth-heading {
  font-family: var(--font-head);
  font-size: 32px;
  letter-spacing: 1px;
  color: var(--text);
  margin-bottom: 24px;
}

.auth-error {
  background: rgba(232,56,13,0.12);
  border: 1px solid rgba(232,56,13,0.3);
  color: #e8380d;
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

.auth-success {
  background: rgba(39,199,124,0.12);
  border: 1px solid rgba(39,199,124,0.3);
  color: var(--green);
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

.auth-submit-btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  margin-bottom: 16px;
  padding: 12px;
  font-size: 15px;
}

.auth-link {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-link a:hover { text-decoration: underline; }

/* ── HEADER USER ─────────────────────────────────────── */
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-username {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.header-admin-btn {
  position: relative;
  background: rgba(245,166,35,0.12);
  border: 1px solid rgba(245,166,35,0.3);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  letter-spacing: 0.3px;
}

.header-admin-btn:hover { background: rgba(245,166,35,0.22); }

.header-admin-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  background: var(--accent2);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  pointer-events: none;
}

.header-logout-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}

.header-logout-btn:hover {
  border-color: var(--accent2);
  color: #e8380d;
}

/* ── ADMIN PAGE ──────────────────────────────────────── */
.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 28px;
  overflow: hidden;
}

.admin-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}

.admin-section-title {
  font-family: var(--font-head);
  font-size: 20px;
  letter-spacing: 0.5px;
  color: var(--text);
}

.admin-section-count {
  background: var(--accent);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 8px;
  min-width: 22px;
  text-align: center;
}

.admin-section-count:empty { display: none; }

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.admin-user-row:last-child { border-bottom: none; }

.admin-user-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-user-name {
  font-weight: 700;
  font-size: 15px;
}

.admin-user-date {
  font-size: 12px;
  color: var(--text-muted);
}

.admin-user-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.admin-self-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  background: rgba(245,166,35,0.12);
  color: var(--accent);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
  letter-spacing: 0.3px;
}

.admin-empty {
  padding: 28px 24px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

/* ── STATISTIKEN ─────────────────────────────────────── */
.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.stat-period-bar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.stat-period-btn {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.stat-period-btn:hover { border-color: var(--accent); color: var(--text); }
.stat-period-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }

/* KPI-Kacheln */
.stat-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat-kpi-grid-sm {
  margin-bottom: 0;
}
@media (max-width: 900px) {
  .stat-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px;
  text-align: center;
  transition: border-color 0.2s;
}
.stat-kpi-card:hover { border-color: var(--accent); }

.stat-kpi-val {
  font-family: var(--font-head);
  font-size: 36px;
  line-height: 1;
  color: var(--text);
}
.stat-kpi-val-sm {
  font-size: 28px;
}
.stat-kpi-lbl {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: .8px;
  text-transform: uppercase;
}

/* Farbvarianten */
.stat-kpi-accent .stat-kpi-val { color: var(--accent); }
.stat-kpi-accent { border-color: rgba(245,166,35,.25); background: rgba(245,166,35,.05); }
.stat-kpi-green  .stat-kpi-val { color: var(--green); }
.stat-kpi-green  { border-color: rgba(39,199,124,.25); background: rgba(39,199,124,.05); }
.stat-kpi-orange .stat-kpi-val { color: var(--accent); }
.stat-kpi-orange { border-color: rgba(245,166,35,.25); background: rgba(245,166,35,.05); }
.stat-kpi-red    .stat-kpi-val { color: var(--accent2); }
.stat-kpi-red    { border-color: rgba(232,56,13,.25); background: rgba(232,56,13,.05); }
.stat-kpi-blue   .stat-kpi-val { color: #4fa8ff; }
.stat-kpi-blue   { border-color: rgba(79,168,255,.25); background: rgba(79,168,255,.05); }
.stat-kpi-lostmc .stat-kpi-val { color: #e05252; }
.stat-kpi-lostmc { border-color: rgba(224,82,82,.25); background: rgba(224,82,82,.05); }

/* Karten */
.stat-card-wide {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.stat-card-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.stat-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .stat-two-col { grid-template-columns: 1fr; }
}

.stat-card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}
.stat-card-title {
  font-family: var(--font-head);
  font-size: 18px;
  letter-spacing: .5px;
  color: var(--text);
}
.stat-card-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* Vertikales Balkendiagramm */
.stat-chart-wrap {
  padding-bottom: 4px;
}
.stat-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 120px;
  overflow: hidden;
}
.sbcol {
  flex: 1;
  min-width: 2px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  cursor: default;
}
.sbbar {
  width: 100%;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  opacity: .85;
  transition: opacity .15s;
}
.sbcol:hover .sbbar { opacity: 1; }
.stat-bar-xlabels {
  display: flex;
  gap: 2px;
  margin-top: 5px;
}
.sblabel {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  overflow: hidden;
  white-space: nowrap;
  min-width: 2px;
}

/* Stoßzeiten-Hinweis */
.stat-peak-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 12px;
  background: var(--bg-card2);
  border-radius: 6px;
}
.stat-peak-hint strong { color: #4fa8ff; }

/* Horizontale Balken */
.stat-hbars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-hbars-sep {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin: 14px 0 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.stat-hbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stat-hbar-label {
  width: 120px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-hbar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-card2);
  border-radius: 4px;
  overflow: hidden;
}
.stat-hbar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .3s ease;
  min-width: 4px;
}
.stat-hbar-val {
  width: 80px;
  flex-shrink: 0;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Leerer Zustand */
.stat-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
  font-size: 13px;
}

/* ==================== KASSENBUCH ==================== */
.kb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kb-actions {
  display: flex;
  gap: 10px;
}

.kb-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 700px) {
  .kb-summary { grid-template-columns: 1fr; }
}
.kb-sum-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
}
.kb-sum-val {
  font-family: var(--font-head);
  font-size: 36px;
  line-height: 1;
}
.kb-sum-lbl {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.kb-amount-in  { color: var(--green); }
.kb-amount-out { color: var(--accent2); }

.kb-readonly-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.kb-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.kb-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.kb-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: top;
}
.kb-table tbody tr:last-child td { border-bottom: none; }
.kb-table tbody tr:hover { background: var(--bg-card2); }

.kb-col-date   { white-space: nowrap; color: var(--text-muted); }
.kb-col-by     { color: var(--text-muted); white-space: nowrap; }
.kb-col-amount { text-align: right; white-space: nowrap; font-weight: 700; }
.kb-col-actions { white-space: nowrap; text-align: right; }
.kb-col-actions .btn { margin-left: 6px; }

.kb-reason { color: var(--text); }
.kb-note   { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.kb-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.kb-badge-in  { background: rgba(39, 199, 124, 0.15); color: var(--green); }
.kb-badge-out { background: rgba(232, 56, 13, 0.15);  color: var(--accent2); }

/* Kassenbuch-Formular im Modal */
.kb-form .form-row { margin-bottom: 14px; }
.kb-form select,
.kb-form textarea {
  width: 100%;
}
.kb-form input[type="date"] { color-scheme: dark; }
.cb-modal-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: -4px 0 4px;
}

/* ==================== MITARBEITER ==================== */
.ma-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ma-actions {
  display: flex;
  gap: 10px;
}

.ma-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 200px));
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 700px) {
  .ma-summary { grid-template-columns: 1fr; }
}
.ma-sum-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
}
.ma-sum-val {
  font-family: var(--font-head);
  font-size: 36px;
  line-height: 1;
  color: var(--accent);
}
.ma-sum-lbl {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ma-readonly-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Job-Gruppe */
.ma-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
}
.ma-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card2);
}
.ma-group-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ma-group-title {
  font-family: var(--font-head);
  font-size: 20px;
  letter-spacing: 0.5px;
  flex: 1;
}
.ma-group-paycheck {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  white-space: nowrap;
}
.ma-group-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
}

.ma-table {
  width: 100%;
  border-collapse: collapse;
}
.ma-group .ma-table { background: transparent; }
.ma-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.ma-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: top;
}
.ma-table tbody tr:last-child td { border-bottom: none; }
.ma-table tbody tr:hover { background: var(--bg-card2); }

.ma-col-name    { font-weight: 600; white-space: nowrap; }
.ma-col-phone   { color: var(--text-muted); white-space: nowrap; }
.ma-col-actions { white-space: nowrap; text-align: right; }
.ma-col-actions .btn { margin-left: 6px; }
.ma-muted { color: var(--text-muted); }

/* Jobs-Verwaltung im Modal */
.ma-jobs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ma-job-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ma-job-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ma-job-order {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.ma-order-btn {
  width: 22px;
  height: 16px;
  line-height: 1;
  font-size: 9px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}
.ma-order-btn:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
}
.ma-order-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.ma-job-name { flex: 1; font-weight: 600; }
.ma-job-pay {
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  white-space: nowrap;
}
.ma-job-count {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.ma-form .form-row { margin-bottom: 14px; }
.ma-form select,
.ma-form textarea,
.ma-form input[type="text"] { width: 100%; }
.ma-color-input {
  width: 60px;
  height: 36px;
  padding: 2px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

/* ==================== RESPONSIVE (schmale Fenster / Zweitmonitor) ==================== */

/* Header bricht um, Nav wird horizontal scrollbar statt gequetscht */
@media (max-width: 900px) {
  .header-inner {
    height: auto;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 12px 16px;
  }
  .main-nav {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .main-nav::-webkit-scrollbar { height: 0; }
  .nav-btn { white-space: nowrap; flex-shrink: 0; }
  .header-user { margin-left: auto; }
  .main-content { padding: 24px 16px 56px; }
  .view-header { flex-wrap: wrap; gap: 12px; }
}

/* Auftrags-Formular: Sidebar unter den Inhalt stapeln */
@media (max-width: 760px) {
  .of-layout { grid-template-columns: 1fr; }
  .of-main { border-right: none; padding: 18px 16px; }
  .of-sidebar {
    position: static;
    border-top: 1px solid var(--border);
  }
}

/* Modals dürfen den Viewport nicht sprengen */
@media (max-width: 480px) {
  .modal {
    min-width: 0;
    width: 94vw;
    max-height: 92vh;
    overflow-y: auto;
  }
  .modal-body { padding: 16px; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1; justify-content: center; }
}

/* ==================== RP95 DARK OPERATIONS THEME ==================== */

:root {
  --bg: #06070a;
  --bg-card: rgba(19, 21, 27, 0.86);
  --bg-card2: rgba(28, 31, 39, 0.78);
  --border: rgba(255, 255, 255, 0.08);
  --accent: #ff8200;
  --accent2: #ff4d16;
  --text: #f5f6fb;
  --text-muted: #a3a7b7;
  --green: #63df8f;
  --radius: 8px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
}

html,
body {
  min-height: 100%;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 130, 0, 0.12), transparent 34%),
    linear-gradient(135deg, #050608 0%, #11141b 48%, #07080b 100%);
}

body:not(.auth-page) {
  padding-left: 260px;
}

body::before {
  content: none;
}

.site-header,
.main-content,
.modal-overlay,
.auth-wrap {
  position: relative;
  z-index: 1;
}

body:not(.auth-page) .site-header {
  position: fixed;
  inset: 0 auto 0 0;
  width: 252px;
  border: 1px solid var(--border);
  border-width: 0 1px 0 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(22, 24, 31, 0.94), rgba(12, 13, 18, 0.9));
  box-shadow: 18px 0 50px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

body:not(.auth-page) .header-inner {
  width: 100%;
  height: 100%;
  max-width: none;
  padding: 26px 18px;
  flex-direction: column;
  align-items: stretch;
  gap: 26px;
}

.logo,
.auth-logo {
  gap: 10px;
}

.logo-icon,
.auth-logo-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--accent);
  background: rgba(255, 130, 0, 0.1);
  border: 1px solid rgba(255, 130, 0, 0.22);
  font-family: var(--font-head);
  font-size: 24px;
  line-height: 1;
}

.logo-title,
.auth-logo-title {
  color: #ffffff;
  text-shadow: 0 0 22px rgba(255, 130, 0, 0.32);
}

.logo-sub,
.auth-logo-sub {
  color: var(--accent);
}

body:not(.auth-page) .main-nav {
  flex: 0 0 auto;
  flex-direction: column;
  gap: 8px;
}

.nav-btn {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #c7cad6;
  background: transparent;
  text-align: left;
  letter-spacing: 0;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-btn.active {
  background: linear-gradient(90deg, rgba(255, 130, 0, 0.18), rgba(255, 130, 0, 0.04));
  border-color: rgba(255, 130, 0, 0.36);
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

body:not(.auth-page) .backup-btn {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  opacity: 0.85;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

body:not(.auth-page) .header-user {
  margin-top: auto;
  margin-left: 0;
  flex-direction: column;
  align-items: stretch;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.header-username,
.header-admin-btn,
.header-logout-btn {
  justify-content: center;
}

body:not(.auth-page) .main-content {
  width: min(1280px, calc(100vw - 300px));
  max-width: none;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.section-title {
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.dashboard-grid,
.stat-kpi-grid,
.kb-summary,
.ma-summary {
  gap: 14px;
}

.stat-card,
.recent-orders-section,
.form-card,
.customer-card,
.order-card,
.car-table-wrapper,
.admin-section,
.stat-kpi-card,
.stat-card-wide,
.stat-card-block,
.kb-table,
.ma-group,
.modal,
.auth-card {
  border: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(15, 17, 23, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.stat-card,
.stat-kpi-card {
  min-height: 122px;
  padding: 24px;
}

.stat-card:hover,
.stat-kpi-card:hover,
.customer-card:hover,
.order-card:hover,
.recent-item:hover {
  border-color: rgba(255, 130, 0, 0.42);
  transform: translateY(-1px);
}

.stat-number,
.stat-kpi-val,
.kb-sum-val,
.ma-sum-val,
.recent-price,
.order-price,
.detail-total-row td:last-child {
  color: var(--accent);
}

.stat-label,
.stat-kpi-lbl,
.kb-sum-lbl,
.ma-sum-lbl {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0;
}

.btn,
.filter-btn,
.cat-btn,
.type-btn,
.status-toggle-btn,
.pickup-day-btn {
  border-radius: 8px;
  letter-spacing: 0;
}

.btn-primary,
.cat-btn.active,
.stat-period-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #111;
  box-shadow: 0 10px 24px rgba(255, 130, 0, 0.2);
}

.btn-primary:hover {
  opacity: 1;
  filter: brightness(1.08);
}

.form-row input,
.form-row select,
.form-row textarea,
.order-search-wrap input,
.customer-search-wrap input,
.search-box input,
.of-row input[type="text"],
.of-row input[type="number"],
.of-row select,
.of-row textarea,
.of-pickup-col input[type="date"],
.of-pickup-col input[type="time"] {
  background: rgba(5, 6, 10, 0.62);
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.recent-item,
.admin-user-row,
.ma-job-row,
.kb-sum-card,
.ma-sum-card {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.075);
}

.auth-page {
  padding-left: 0;
  overflow: hidden;
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-wrap {
  width: min(420px, calc(100vw - 40px));
  max-width: none;
  min-height: 0;
  padding: 0;
  background:
    linear-gradient(135deg, rgba(5, 6, 10, 0.22), rgba(5, 6, 10, 0.8)),
    radial-gradient(circle at 50% 0%, rgba(255, 130, 0, 0.15), transparent 40%);
  background: transparent;
}

.auth-card {
  width: 100%;
  border-radius: 18px;
}

@media (max-width: 980px) {
  body:not(.auth-page) {
    padding-left: 0;
  }

  body:not(.auth-page) .site-header {
    position: sticky;
    inset: auto;
    width: auto;
    margin: 16px;
    border-radius: 16px;
  }

  body:not(.auth-page) .header-inner {
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    padding: 14px 16px;
  }

  body:not(.auth-page) .main-nav {
    order: 3;
    flex-direction: row;
    flex-basis: 100%;
    overflow-x: auto;
  }

  body:not(.auth-page) .backup-btn {
    width: 40px;
  }

  body:not(.auth-page) .header-user {
    margin-top: 0;
    margin-left: auto;
    padding-top: 0;
    border-top: 0;
    flex-direction: row;
  }

  body:not(.auth-page) .main-content {
    width: 100%;
    padding: 18px 16px 56px;
  }
}
