/* ============================================================
   EventRent – Material Design 3 (Light)
   ============================================================ */

:root {
  /* Primärfarbe (Blau) */
  --md-primary:          #1565C0;
  --md-primary-dark:     #003c8f;
  --md-primary-light:    #5e92f3;
  --md-on-primary:       #FFFFFF;
  --md-primary-container:  #E3F2FD;
  --md-on-primary-container: #0d47a1;

  /* Hintergründe & Oberflächen */
  --md-background:       #F4F6F9;
  --md-surface:          #FFFFFF;
  --md-surface-low:      #F8F9FA;
  --md-surface-container: #EAEDF2;
  --md-surface-variant:  #E8EBF0;

  /* Text */
  --md-on-surface:       #1A1C1E;
  --md-on-surface-var:   #44474F;
  --md-muted:            #6B7280;

  /* Umrandungen */
  --md-outline:          #C5C9D4;
  --md-outline-strong:   #9199A8;

  /* Semantisch */
  --md-error:            #B3261E;
  --md-error-container:  #FDECEA;
  --md-success:          #2E7D32;
  --md-success-container:#E8F5E9;
  --md-warning:          #E65100;
  --md-warning-container:#FFF3E0;
  --md-info:             #0277BD;
  --md-info-container:   #E1F5FE;

  /* Elevations (Schatten) */
  --shadow-1: 0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-2: 0 4px 6px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.06);
  --shadow-3: 0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.05);
  --shadow-4: 0 20px 25px rgba(0,0,0,.10), 0 10px 10px rgba(0,0,0,.04);

  /* Formen */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 28px;
}

/* ── Reset ────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Roboto', sans-serif;
  background: var(--md-background);
  color: var(--md-on-surface);
  min-height: 100vh;
  display: flex;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Navigation Drawer (Sidebar) ───────────────────── */
.sidebar {
  width: 256px;
  min-height: 100vh;
  background: var(--md-surface);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  box-shadow: var(--shadow-2);
}

.logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--md-outline);
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo img { flex-shrink: 0; }
.logo-titles { display: flex; flex-direction: column; }
.logo-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--md-primary);
  letter-spacing: -.01em;
  line-height: 1.2;
}
.logo-sub {
  font-size: 11px;
  color: var(--md-muted);
  margin-top: 2px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.nav { flex: 1; padding: 12px 12px; overflow-y: auto; }

.nav-section {
  font-size: 11px;
  font-weight: 500;
  color: var(--md-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 16px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-xl);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--md-on-surface-var);
  transition: background .15s, color .15s;
  margin-bottom: 2px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Roboto', sans-serif;
  letter-spacing: .01em;
  position: relative;
}
.nav-item:hover {
  background: rgba(21, 101, 192, .08);
  color: var(--md-primary);
}
.nav-item.active {
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  font-weight: 600;
}
.nav-icon { font-size: 20px; width: 24px; text-align: center; flex-shrink: 0; opacity: .85; line-height: 1; }

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

/* ── Top App Bar ───────────────────────────────────── */
.main { margin-left: 256px; flex: 1; }

.topbar {
  position: sticky;
  top: 0;
  background: var(--md-surface);
  border-bottom: 1px solid var(--md-outline);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  box-shadow: var(--shadow-1);
}
.topbar-title {
  font-size: 22px;
  font-weight: 400;
  color: var(--md-on-surface);
  letter-spacing: -.01em;
}

.content { padding: 28px; }

/* ── Cards ─────────────────────────────────────────── */
.card {
  background: var(--md-surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-1);
  border: 1px solid var(--md-outline);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--md-on-surface);
  letter-spacing: .01em;
}

/* ── Layout Grids ──────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

/* ── Stat Cards ────────────────────────────────────── */
.stat {
  background: var(--md-surface);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-1);
  border: 1px solid var(--md-outline);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  transition: box-shadow .15s, transform .15s;
}
.stat:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon .material-icons-round { font-size: 26px; }
.stat-body { flex: 1; min-width: 0; }
.stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--md-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}
.stat-val {
  font-size: 28px;
  font-weight: 600;
  color: var(--md-on-surface);
  line-height: 1.1;
  letter-spacing: -.02em;
}
.stat-sub {
  font-size: 12px;
  color: var(--md-muted);
  margin-top: 3px;
}

/* ── Buttons (Material 3) ──────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--md-outline);
  background: var(--md-surface);
  color: var(--md-primary);
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  letter-spacing: .01em;
  white-space: nowrap;
}
.btn:hover {
  background: rgba(21, 101, 192, .06);
  box-shadow: var(--shadow-1);
}

/* Filled button (primary action) */
.btn-accent {
  background: var(--md-primary);
  color: var(--md-on-primary);
  border-color: var(--md-primary);
  box-shadow: var(--shadow-1);
}
.btn-accent:hover {
  background: var(--md-primary-dark);
  border-color: var(--md-primary-dark);
  box-shadow: var(--shadow-2);
}

/* Small */
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* Text/Ghost button */
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--md-primary);
}
.btn-ghost:hover {
  background: rgba(21, 101, 192, .08);
  border-color: transparent;
  box-shadow: none;
}

/* Danger */
.btn-danger {
  color: var(--md-error);
  border-color: rgba(179, 38, 30, .3);
  background: var(--md-error-container);
}
.btn-danger:hover {
  background: rgba(179, 38, 30, .12);
}

/* Tonal button */
.btn-tonal {
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  border-color: transparent;
}
.btn-tonal:hover {
  background: rgba(21, 101, 192, .15);
  box-shadow: var(--shadow-1);
}

/* ── Tables ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  padding: 10px 16px;
  color: var(--md-muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 2px solid var(--md-outline);
  white-space: nowrap;
  background: var(--md-surface-low);
}
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--md-outline);
  vertical-align: middle;
  color: var(--md-on-surface);
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:hover td { background: rgba(21, 101, 192, .08); }

/* ── Chips & Badges ────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
  background: var(--md-surface-container);
  color: var(--md-on-surface-var);
}
.badge-success {
  background: var(--md-success-container);
  color: var(--md-success);
}
.badge-warn {
  background: var(--md-warning-container);
  color: var(--md-warning);
}
.badge-danger {
  background: var(--md-error-container);
  color: var(--md-error);
}
.badge-info {
  background: var(--md-info-container);
  color: var(--md-info);
}
.badge-accent {
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}
.badge-muted {
  background: var(--md-surface-container);
  color: var(--md-muted);
}

/* ── Forms (Material outlined style) ──────────────── */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--md-on-surface-var);
  margin-bottom: 5px;
  letter-spacing: .04em;
}

input[type="checkbox"], input[type="radio"] { width: auto; }

input, select, textarea {
  width: 100%;
  background: var(--md-surface);
  border: 1.5px solid var(--md-outline);
  border-radius: var(--radius-sm);
  color: var(--md-on-surface);
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  line-height: 1.5;
}
input:hover, select:hover, textarea:hover {
  border-color: var(--md-outline-strong);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, .12);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--md-surface-variant);
  color: var(--md-muted);
  cursor: not-allowed;
}
select option { background: var(--md-surface); color: var(--md-on-surface); }
textarea { resize: vertical; min-height: 80px; }

/* ── Modal (Material Dialog) ────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--md-surface);
  border-radius: 28px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-4);
}
.modal-header {
  padding: 28px 28px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.modal-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--md-on-surface);
  line-height: 1.3;
}
.modal-body { padding: 20px 28px; }
.modal-footer {
  padding: 8px 28px 24px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ── Calendar ───────────────────────────────────────── */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-month-title { font-size: 18px; font-weight: 500; color: var(--md-on-surface); }
.cal-header { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; margin-bottom: 4px; }
.cal-day-name {
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--md-muted);
  padding: 6px 0;
  letter-spacing: .04em;
}
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.cal-day {
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: background .12s;
  position: relative;
  padding: 6px 6px;
  gap: 2px;
  border: 1px solid transparent;
}
.cal-day:hover { background: rgba(21, 101, 192, .06); border-color: var(--md-outline); }
.cal-day.today {
  background: var(--md-primary-container);
  border-color: var(--md-primary);
}
.cal-day.today .cal-day-num { color: var(--md-primary); font-weight: 700; }
.cal-day.selected { background: var(--md-primary); border-color: var(--md-primary); }
.cal-day.selected .cal-day-num { color: white; font-weight: 700; }
.cal-day.other-month { opacity: .35; }
.cal-day-num { font-size: 13px; font-weight: 400; padding: 0 2px; }
.cal-event-bar {
  display: block;
  width: 100%;
  border-radius: 3px;
  font-size: 10px;
  padding: 1px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

/* ── Timeline ────────────────────────────────────────── */
.timeline-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--md-outline);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--md-primary);
  margin-top: 7px;
  flex-shrink: 0;
}
.timeline-date { font-size: 12px; color: var(--md-muted); margin-bottom: 3px; }
.timeline-title { font-size: 14px; font-weight: 500; color: var(--md-on-surface); }
.timeline-meta { font-size: 12px; color: var(--md-muted); margin-top: 2px; }

/* ── Beleg-Positionen ────────────────────────────────── */
.pos-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.pos-row select { flex: 2; font-size: 13px; padding: 8px 10px; }
.pos-row input { font-size: 13px; padding: 8px 10px; }
.pos-menge { width: 72px !important; }
.pos-preis { width: 100px !important; }

/* ── Toast / Snackbar ────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #323232;
  color: #FFFFFF;
  border-radius: var(--radius);
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 400;
  z-index: 500;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  box-shadow: var(--shadow-3);
  min-width: 200px;
  text-align: center;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Search ──────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap input { padding-left: 38px; }
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--md-muted);
  pointer-events: none;
  font-size: 16px;
}

/* ── Misc ────────────────────────────────────────────── */
.divider { height: 1px; background: var(--md-outline); margin: 18px 0; }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--md-primary-container);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--md-on-primary-container);
  flex-shrink: 0;
}

.empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--md-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 14px; opacity: .4; }
.empty-title { font-size: 16px; font-weight: 500; color: var(--md-on-surface-var); margin-bottom: 6px; }
.empty-sub { font-size: 13px; color: var(--md-muted); margin-bottom: 20px; line-height: 1.5; }

/* ── Loading spinner ─────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.loading {
  text-align: center;
  padding: 56px;
  color: var(--md-muted);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.loading::before {
  content: '';
  width: 28px;
  height: 28px;
  border: 3px solid var(--md-outline);
  border-top-color: var(--md-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: block;
}
/* Button loading spinner */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
}

.print-only { display: none; }

/* ── Tabs ────────────────────────────────────────────── */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 2px solid var(--md-outline);
  margin-bottom: 24px;
}
.tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Roboto', sans-serif;
  cursor: pointer;
  color: var(--md-muted);
  transition: color .15s;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  letter-spacing: .01em;
}
.tab:hover { color: var(--md-primary); background: rgba(21, 101, 192, .05); }
.tab.active {
  color: var(--md-primary);
  border-bottom-color: var(--md-primary);
  font-weight: 600;
}

/* ── Utility ─────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--md-muted); }
.text-sm { font-size: 12px; }
.text-accent { color: var(--md-primary); }
.fw-500 { font-weight: 500; }
.text-right { text-align: right; }
.text-center { text-align: center; }
code { font-family: 'Roboto Mono', monospace; font-size: .9em; background: var(--md-surface-container); padding: 1px 5px; border-radius: 4px; }

/* ── Page Transition ──────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page { animation: fadeIn .18s ease; }

/* ── Elevation hover state for interactive cards ─────── */
.card-clickable {
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
}
.card-clickable:hover {
  box-shadow: var(--shadow-3);
  transform: translateY(-1px);
}

/* ── Help Sidebar ────────────────────────────────────────── */
.help-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.25);
  z-index: 1100;
}
.help-backdrop.open { display: block; }
.help-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: 90vw;
  background: var(--md-surface);
  border-left: 1px solid var(--md-outline);
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  display: flex;
  flex-direction: column;
  z-index: 1101;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.help-sidebar.open { transform: translateX(0); }
.help-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--md-outline);
  flex-shrink: 0;
}
.help-sidebar-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--md-primary);
}
.help-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.help-intro {
  font-size: 13px;
  line-height: 1.65;
  color: var(--md-on-surface-var);
  margin-bottom: 20px;
  padding: 12px 14px;
  background: var(--md-primary-container);
  border-radius: 8px;
}
.help-section { margin-bottom: 20px; }
.help-section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--md-muted);
  margin-bottom: 8px;
}
.help-item {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--md-on-surface);
  margin-bottom: 10px;
}
.help-item-icon {
  flex-shrink: 0;
  font-size: 16px !important;
  margin-top: 1px;
  color: var(--md-primary);
}
.help-item strong { font-weight: 500; display: block; margin-bottom: 1px; }
.help-tip {
  margin-top: 20px;
  padding: 10px 14px;
  background: var(--md-surface-variant, #f5f5f5);
  border-radius: 8px;
  font-size: 12px;
  color: var(--md-muted);
  line-height: 1.6;
}

/* ── Field Tooltips ─────────────────────────────────────── */
.htt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--md-primary-container);
  color: var(--md-primary);
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  margin-left: 4px;
  vertical-align: middle;
  user-select: none;
  flex-shrink: 0;
}
.htt-box {
  position: fixed;
  z-index: 2000;
  background: #333;
  color: #fff;
  font-size: 12px;
  line-height: 1.55;
  padding: 8px 12px;
  border-radius: 7px;
  max-width: 260px;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

/* ── Print ───────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .btn, .modal-overlay, .toast { display: none !important; }
  .main { margin-left: 0; }
  .print-only { display: block; }
  body { background: white; color: black; font-family: sans-serif; }
  .card { border: 1px solid #e0e0e0; box-shadow: none; border-radius: 0; }
}

/* ── Modal large ─────────────────────────────────────────── */
.modal.modal-lg { max-width: 860px; }

/* ── Gantt Chart ─────────────────────────────────────────── */
.gantt-wrap { border: 1px solid var(--md-outline); border-radius: var(--radius); overflow: hidden; }
.gantt-header { display: flex; background: var(--md-surface-low); border-bottom: 2px solid var(--md-outline); position: sticky; top: 0; z-index: 2; }
.gantt-label-head { width: 210px; min-width: 210px; flex-shrink: 0; padding: 8px 12px; font-size: 11px; font-weight: 500; color: var(--md-muted); text-transform: uppercase; letter-spacing: .06em; border-right: 1px solid var(--md-outline); }
.gantt-days-head { flex: 1; display: flex; overflow: hidden; }
.gantt-day-head { flex: 1; text-align: center; font-size: 10px; padding: 3px 1px; border-right: 1px solid var(--md-outline); color: var(--md-muted); white-space: nowrap; overflow: hidden; min-width: 20px; }
.gantt-day-head.weekend { background: var(--md-surface-container); }
.gantt-day-head.today   { background: var(--md-primary-container); color: var(--md-primary); font-weight: 700; }
.gantt-cat { padding: 5px 12px; font-size: 11px; font-weight: 600; color: var(--md-muted); text-transform: uppercase; letter-spacing: .06em; background: var(--md-surface-variant); border-bottom: 1px solid var(--md-outline); border-top: 1px solid var(--md-outline); }
.gantt-row { display: flex; border-bottom: 1px solid var(--md-outline); min-height: 38px; }
.gantt-row:last-child { border-bottom: none; }
.gantt-row-label { width: 210px; min-width: 210px; flex-shrink: 0; padding: 6px 12px; font-size: 13px; border-right: 1px solid var(--md-outline); display: flex; align-items: center; gap: 6px; }
.gantt-track { flex: 1; position: relative; }
.gantt-bar { position: absolute; top: 5px; height: 28px; border-radius: 4px; font-size: 10px; font-weight: 500; padding: 5px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; z-index: 1; cursor: default; box-shadow: var(--shadow-1); }
.gantt-empty { padding: 24px 12px; color: var(--md-muted); font-size: 13px; text-align: center; }

/* ── Staffelpreis Tabelle ────────────────────────────────── */
.staffel-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.staffel-row input { font-size: 13px; padding: 7px 10px; }

/* ── Seriennummern Liste ─────────────────────────────────── */
.sn-row input, .sn-row select { height: 42px; box-sizing: border-box; }
.sn-row .btn { height: 42px; box-sizing: border-box; }

/* ── Toast variants ──────────────────────────────────────── */
.toast.toast-error   { background: var(--md-error); }

/* ── Field validation ────────────────────────────────────── */
.form-group.field-invalid label { color: var(--md-error); }
.form-group.field-invalid input,
.form-group.field-invalid select,
.form-group.field-invalid textarea {
  border-color: var(--md-error);
  box-shadow: 0 0 0 3px rgba(179, 38, 30, .12);
}
.field-hint {
  font-size: 11px;
  margin-top: 4px;
  color: var(--md-muted);
  line-height: 1.4;
}
.field-hint.field-hint-error { color: var(--md-error); }

/* ── Button disabled / loading ───────────────────────────── */
.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Confirm dialog ──────────────────────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(2px);
}
.confirm-overlay.open { display: flex; }
.confirm-box {
  background: var(--md-surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-4);
}
.confirm-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--md-on-surface);
  margin-bottom: 10px;
}
.confirm-msg {
  font-size: 14px;
  color: var(--md-on-surface-var);
  line-height: 1.6;
  margin-bottom: 24px;
  white-space: pre-wrap;
}
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Sidebar collapse ────────────────────────────────────── */
.sidebar { transition: width .2s; }
.sidebar.collapsed { width: 64px; overflow: hidden; }
.sidebar.collapsed .logo-titles,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .sidebar-footer .user-info,
.sidebar.collapsed .sidebar-footer .btn { display: none; }
.sidebar.collapsed .logo { justify-content: center; padding: 16px 8px; }
.sidebar.collapsed .nav-item { padding: 10px; justify-content: center; gap: 0; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed + .main { margin-left: 64px; }
.main { transition: margin-left .2s; }

/* ── Autocomplete keyboard nav ───────────────────────────── */
.dd-item:hover { background: var(--md-surface-container); }
.dd-item.dd-active { background: var(--md-primary-container) !important; color: var(--md-on-primary-container); }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ── Dark Mode ────────────────────────────────────────────── */
[data-theme="dark"] {
  --md-primary:            #90CAF9;
  --md-primary-dark:       #5e92f3;
  --md-primary-light:      #bbdefb;
  --md-on-primary:         #003c8f;
  --md-primary-container:  #1565C0;
  --md-on-primary-container: #E3F2FD;

  --md-background:         #111318;
  --md-surface:            #1E2128;
  --md-surface-low:        #181C23;
  --md-surface-container:  #262B35;
  --md-surface-variant:    #2C3140;

  --md-on-surface:         #E2E2E9;
  --md-on-surface-var:     #C4C6D0;
  --md-muted:              #8E9099;

  --md-outline:            #44474F;
  --md-outline-strong:     #5E6270;

  --md-error:              #FFB4AB;
  --md-error-container:    #690005;
  --md-success:            #6DD58C;
  --md-success-container:  #0B5320;
  --md-warning:            #FFB77C;
  --md-warning-container:  #4B2400;
  --md-info:               #7DD0F7;
  --md-info-container:     #00325B;

  --shadow-1: 0 1px 3px rgba(0,0,0,.5),  0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 4px 6px rgba(0,0,0,.45), 0 2px 4px rgba(0,0,0,.35);
  --shadow-3: 0 10px 15px rgba(0,0,0,.45),0 4px 6px rgba(0,0,0,.3);
  --shadow-4: 0 20px 25px rgba(0,0,0,.5),0 10px 10px rgba(0,0,0,.25);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--md-surface-container);
  color: var(--md-on-surface);
  border-color: var(--md-outline);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: var(--md-muted); }

[data-theme="dark"] .chip-blue   { background: #1565C0; color: #90CAF9; }
[data-theme="dark"] .chip-green  { background: #0B5320; color: #6DD58C; }
[data-theme="dark"] .chip-orange { background: #4B2400; color: #FFB77C; }
[data-theme="dark"] .chip-red    { background: #690005; color: #FFB4AB; }
[data-theme="dark"] .chip-purple { background: #3B0764; color: #D8B4FE; }
[data-theme="dark"] .badge-schaden-leicht  { background: #0B5320; color: #6DD58C; }
[data-theme="dark"] .badge-schaden-mittel  { background: #3B2800; color: #FFB77C; }
[data-theme="dark"] .badge-schaden-schwer  { background: #4B2400; color: #FFB77C; }
[data-theme="dark"] .badge-schaden-total   { background: #690005; color: #FFB4AB; }

/* ── Drag & Drop ──────────────────────────────────────────── */
.drag-handle {
  cursor: grab;
  color: var(--md-outline-strong);
  flex-shrink: 0;
  font-size: 18px !important;
  user-select: none;
  transition: color .15s;
}
.drag-handle:hover { color: var(--md-primary); }
.drag-handle:active { cursor: grabbing; }
.drag-item.dragging { opacity: .45; }
.drag-item.drag-over { outline: 2px solid var(--md-primary); border-radius: var(--radius); }

/* ── Modal dirty indicator ───────────────────────────────── */
.modal-dirty-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--md-primary);
  margin-left: 8px;
  vertical-align: middle;
  opacity: .8;
}

/* ── Autosave Draft Banner ────────────────────────────────── */
.draft-banner {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  border-radius: var(--radius); padding: 8px 12px;
  font-size: 13px; margin-bottom: 12px;
}
.draft-banner span:first-child { flex: 1; }

/* ── Keyboard Hints ───────────────────────────────────────── */
kbd {
  display: inline-block;
  padding: 2px 6px;
  background: var(--md-surface-container);
  border: 1px solid var(--md-outline-strong);
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--md-on-surface);
}

/* ── Mobile Layout (<768px) ───────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-backdrop.show { display: block; }

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    width: 280px !important;
    z-index: 200;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar.collapsed { transform: translateX(-100%); }
  .main { margin-left: 0 !important; }
  .topbar { padding: 0 8px; gap: 8px; }
  .topbar-title { font-size: 15px; }
  .page { padding: 12px; }
  .card { padding: 12px; }
  .card-header { flex-wrap: wrap; gap: 6px; }
  .modal { max-width: calc(100vw - 16px) !important; max-height: 95vh; margin: 8px; }
  .modal-body { max-height: 60vh; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .table thead { display: none; }
  .table tbody tr {
    display: block;
    border-bottom: 1px solid var(--md-outline);
    padding: 8px 0;
    margin-bottom: 4px;
  }
  .table td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 3px 0; border: none;
    font-size: 13px;
  }
  .table td::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--md-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    min-width: 90px;
    flex-shrink: 0;
  }
  .table td:last-child { justify-content: flex-end; }
  .stat { padding: 12px; }
  .gantt-wrap { overflow-x: auto; }
}

/* ── Global Search ───────────────────────────────────────── */
.search-global-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-global-icon {
  position: absolute;
  left: 10px;
  font-size: 18px;
  color: var(--md-muted);
  pointer-events: none;
  z-index: 1;
}
.search-global-input {
  background: var(--md-surface-container);
  border: 1px solid var(--md-outline);
  border-radius: var(--radius);
  padding: 7px 12px 7px 34px;
  font-size: 14px;
  width: 200px;
  color: var(--md-on-surface);
  outline: none;
  transition: border-color .15s, width .2s;
  font-family: 'Roboto', sans-serif;
}
.search-global-input:focus {
  border-color: var(--md-primary);
  width: 300px;
}
.search-global-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 360px;
  background: var(--md-surface);
  border: 1px solid var(--md-outline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 400;
  max-height: 440px;
  overflow-y: auto;
  display: none;
}
.search-global-dropdown.show { display: block; }
.search-result-group {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--md-muted);
  background: var(--md-surface-container);
  border-bottom: 1px solid var(--md-outline);
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--md-outline);
  transition: background .1s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item.sr-active { background: var(--md-primary-container); }
.search-result-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--md-surface-variant);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.search-result-icon .material-icons-round { font-size: 16px; color: var(--md-primary); }
.search-result-title { font-size: 14px; font-weight: 500; line-height: 1.3; }
.search-result-detail { font-size: 12px; color: var(--md-muted); }
.search-no-results {
  padding: 20px 16px;
  text-align: center;
  color: var(--md-muted);
  font-size: 13px;
}

/* ── Kundenkonto Tabs ────────────────────────────────────── */
.kk-stat {
  background: var(--md-surface-container);
  border-radius: var(--radius);
  padding: 12px 16px;
  text-align: center;
}
.kk-stat-val { font-size: 22px; font-weight: 700; color: var(--md-primary); }
.kk-stat-label { font-size: 11px; color: var(--md-muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

@media (max-width: 768px) {
  .search-global-input { width: 120px; }
  .search-global-input:focus { width: 160px; }
  .search-global-dropdown { min-width: calc(100vw - 32px); right: -60px; }
}

/* ── Chips / Badges ──────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 500;
  white-space: nowrap;
}
.chip-blue   { background: #E3F2FD; color: #1565C0; }
.chip-green  { background: #E8F5E9; color: #2E7D32; }
.chip-orange { background: #FFF3E0; color: #E65100; }
.chip-red    { background: #FFEBEE; color: #C62828; }
.chip-grey   { background: var(--md-surface-container); color: var(--md-muted); }
.chip-purple { background: #F3E5F5; color: #6A1B9A; }

/* Schadensgrad */
.badge-schaden-leicht  { background: #E8F5E9; color: #2E7D32; }
.badge-schaden-mittel  { background: #FFF8E1; color: #F57F17; }
.badge-schaden-schwer  { background: #FFF3E0; color: #E65100; }
.badge-schaden-total   { background: #FFEBEE; color: #C62828; }

/* ── Foto-Grid ────────────────────────────────────────────── */
.foto-grid {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.foto-thumb {
  position: relative; width: 80px; height: 80px;
  border-radius: 6px; overflow: hidden;
  border: 1px solid var(--md-outline);
  cursor: pointer;
}
.foto-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-thumb-del {
  position: absolute; top: 2px; right: 2px;
  background: rgba(0,0,0,.55); color: #fff;
  border: none; border-radius: 50%; width: 20px; height: 20px;
  font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
.foto-thumb:hover .foto-thumb-del { opacity: 1; }
.foto-add {
  width: 80px; height: 80px; border-radius: 6px;
  border: 2px dashed var(--md-outline);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--md-muted); font-size: 28px;
  transition: border-color .15s, color .15s;
}
.foto-add:hover { border-color: var(--md-primary); color: var(--md-primary); }

/* ── Schaden-Karte ───────────────────────────────────────── */
.schaden-card {
  border: 1px solid var(--md-outline);
  border-radius: var(--radius); padding: 12px; margin-bottom: 10px;
}
.schaden-card + .schaden-card { margin-top: 8px; }

/* ── Tour-Stop ───────────────────────────────────────────── */
.tour-stop {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  background: var(--md-surface-container); margin-bottom: 6px;
}
.tour-stop-nr {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--md-primary); color: var(--md-on-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}

/* ── Wartung-Zeile ────────────────────────────────────────── */
.wartung-row {
  display: grid; grid-template-columns: auto 1fr auto auto;
  gap: 8px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--md-outline);
}
.wartung-row:last-child { border-bottom: none; }

/* ── Mitarbeiter-Chip ─────────────────────────────────────── */
.ma-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 16px;
  background: var(--md-surface-container);
  font-size: 12px; border: 1px solid var(--md-outline);
}
.ma-chip .ma-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 600; color: #fff; flex-shrink: 0;
}
.ma-chip .ma-del {
  cursor: pointer; color: var(--md-muted); font-size: 13px;
  background: none; border: none; padding: 0; line-height: 1;
}
.ma-chip .ma-del:hover { color: var(--md-error); }

/* ── Badge mit Statuspunkt (Point 9) ─────────────────────── */
.badge-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: .9;
}

/* ── Skeleton Loading (Point 7) ─────────────────────────── */
@keyframes skeleton-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.sk {
  background: var(--md-surface-container);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  display: block;
}
.sk::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.45) 50%, transparent 100%);
  animation: skeleton-shimmer 1.3s ease-in-out infinite;
}
[data-theme="dark"] .sk::after {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.08) 50%, transparent 100%);
}
.sk-text  { height: 13px; border-radius: 4px; }
.sk-title { height: 18px; border-radius: 4px; }
.sk-box   { border-radius: var(--radius); }

/* ── Floating Labels (Point 10) ─────────────────────────── */
/* Nutzung: <div class="form-float"><input placeholder=" "><label>Bezeichnung</label></div> */
.form-float {
  position: relative;
  margin-bottom: 16px;
}
.form-float input,
.form-float select,
.form-float textarea {
  padding-top: 20px;
  padding-bottom: 6px;
}
.form-float > label {
  position: absolute;
  left: 14px;
  top: 13px;
  font-size: 14px;
  color: var(--md-muted);
  pointer-events: none;
  transition: top .15s ease, font-size .15s ease, color .15s ease, letter-spacing .15s ease;
  margin: 0;
  font-weight: 400;
  letter-spacing: normal;
}
.form-float input:focus ~ label,
.form-float input:not(:placeholder-shown) ~ label,
.form-float select:focus ~ label,
.form-float textarea:focus ~ label,
.form-float textarea:not(:placeholder-shown) ~ label {
  top: 5px;
  font-size: 10px;
  color: var(--md-primary);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ── Dashboard Umsatz-Chart ──────────────────────────────── */
.chart-card {
  background: var(--md-surface);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-1);
  border: 1px solid var(--md-outline);
}
.chart-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.chart-card-title {
  font-size: 14px; font-weight: 500; color: var(--md-on-surface);
}
.chart-wrap { overflow: hidden; }

/* ── SIDEBAR DARK ACCENT (Point 2) ───────────────────────────
   Zum Deaktivieren: den gesamten Block unten entfernen oder
   body.sidebar-accent durch body.sidebar-accent-disabled ersetzen.
   ─────────────────────────────────────────────────────────── */
body.sidebar-accent .sidebar {
  background: #0F172A;
  box-shadow: 2px 0 12px rgba(0,0,0,.25);
  border-right: none;
}
body.sidebar-accent .logo {
  border-bottom-color: rgba(255,255,255,.08);
}
body.sidebar-accent .logo-title { color: #F1F5F9; }
body.sidebar-accent .logo-sub   { color: rgba(148,163,184,.7); }
body.sidebar-accent .nav-section { color: rgba(148,163,184,.45); }
body.sidebar-accent .nav-item {
  color: rgba(148,163,184,.85);
}
body.sidebar-accent .nav-item:hover {
  background: rgba(255,255,255,.07);
  color: #F1F5F9;
}
body.sidebar-accent .nav-item.active {
  background: #1565C0;
  color: #fff;
  font-weight: 600;
}
body.sidebar-accent .nav-item.active .nav-icon { opacity: 1; }
body.sidebar-accent .sidebar-footer {
  border-top-color: rgba(255,255,255,.08);
}
body.sidebar-accent #nav-user { color: rgba(148,163,184,.6); }
body.sidebar-accent .sidebar-footer .btn {
  color: rgba(148,163,184,.7);
  border-color: transparent;
}
body.sidebar-accent .sidebar-footer .btn:hover {
  background: rgba(255,255,255,.08);
  color: #F1F5F9;
}
body.sidebar-accent .sidebar-footer .btn-accent-toggle {
  color: #60A5FA;
}
/* Ende SIDEBAR DARK ACCENT */

