/* VR Erd & Tiefbau – Design-System (logo-konform: Schieferblau + Gold, modern/smooth) */
:root {
  /* Flaechen & Text – neutral, leicht kuehl */
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-hover: #eef1f6;
  --ink: #1c2634;
  --ink-strong: #0f1826;
  --muted: #64748b;
  --label: #475569;            /* Beschriftungen (KPI-Label, Feld-Label, Tabellenkopf) — 7:1 Kontrast auf Weiß */
  --line: #dfe4ec;

  /* Marke: Schieferblau (Primaer) + Logo-Gold (Akzent) */
  --accent: #3c4e6b;
  --accent-dark: #2b3a52;
  --accent-ring: rgba(60,78,107,.18);
  --accent-light: rgba(60,78,107,.10);
  --gold: #e8991c;
  --gold-dark: #c67d10;
  --gold-light: rgba(232,153,28,.14);

  /* Semantik */
  --blue: #2563eb;  --blue-light: #e0e9ff;
  --green: #15914b; --green-light: #dcf5e6;
  --red: #dc2626;   --red-light: #fde5e5;
  --amber: #d97706; --amber-light: #fef1d6;

  /* Form: weichere Rundungen + echte, weiche Elevation */
  --radius: 12px; --radius-sm: 8px; --radius-lg: 16px; --radius-pill: 999px;
  --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 8px 24px rgba(16,24,40,.10), 0 2px 6px rgba(16,24,40,.06);

  /* Spacing (4px-Skala) */
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:24px; --sp-6:32px;

  /* Typografie */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-h1:1.5rem; --fs-h2:1.2rem; --fs-h3:1rem; --fs-body:0.95rem; --fs-sm:0.82rem;
  --fs-kpi: 1.75rem;   /* KPI-Wert (vorher 1.4rem – Kontrast-/Hierarchie-Fix) */

  --transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
  --sidebar-width: 260px;
}

/* Dark Mode (Nachtschicht) – Schieferblau/Gold auf kuehlem Dunkelgrund */
body.dark {
  --bg: #12161d;
  --panel: #1a2029;
  --panel-hover: #232b37;
  --ink: #e6ebf2;
  --ink-strong: #f4f7fb;
  --muted: #93a0b4;
  --label: #a8b4c8;
  --line: #2c3542;

  --accent: #6e86ad;
  --accent-dark: #8299c2;
  --accent-ring: rgba(110,134,173,.28);
  --accent-light: rgba(110,134,173,.16);
  --gold: #f2a93b;
  --gold-light: rgba(242,169,59,.18);

  --blue: #60a5fa;  --blue-light: rgba(96,165,250,.16);
  --green: #34d399; --green-light: rgba(52,211,153,.16);
  --red: #f87171;   --red-light: rgba(248,113,113,.16);
  --amber: #fbbf24; --amber-light: rgba(251,191,36,.16);

  --shadow: 0 1px 3px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.5);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--fs-body);
  line-height: 1.45;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* App Container Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Layout */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  transition: width 0.3s ease, transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.sidebar-brand .logo-img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.brand-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.sidebar-toggle-btn {
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  z-index: 50;
  transition: var(--transition);
}
.sidebar-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sidebar Navigation */
.app-sidebar .tabs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0.5rem;
  overflow-y: auto;
}

.app-sidebar .tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  transition: var(--transition);
}

.tab-icon {
  font-size: 1.15rem;
  width: 20px;
  display: inline-flex;
  justify-content: center;
}

.tab-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar .tab:hover {
  background: var(--panel-hover);
  color: var(--ink);
}

.app-sidebar .tab.active {
  background: var(--accent);
  color: #ffffff;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

/* Collapsed Sidebar on Desktop */
.app-container.collapsed .app-sidebar {
  width: 72px;
}
.app-container.collapsed .brand-info,
.app-container.collapsed .tab-text,
.app-container.collapsed .rolle {
  display: none;
}
.app-container.collapsed .sidebar-footer {
  padding: 0.5rem;
}
.app-container.collapsed .user-btn {
  justify-content: center;
  font-size: 1.25rem;
  padding: 0.5rem;
}

/* App Content Area */
.app-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
}
.app-container.collapsed .app-content {
  margin-left: 72px;
}

/* App Header (Top bar) */
.app-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 30;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.mobile-menu-btn, .mobile-brand {
  display: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.save-status {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  background: var(--panel-hover);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.save-status.fehler {
  color: var(--red);
  background: var(--red-light);
  border-color: rgba(220, 38, 38, 0.2);
  font-weight: 700;
}

.theme-toggle-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
}
.theme-toggle-btn:hover {
  border-color: var(--accent);
  background: var(--panel-hover);
}

/* User Box & Menu */
.userbox {
  position: relative;
  width: 100%;
}
.user-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.user-btn:hover {
  background: var(--panel-hover);
  border-color: var(--accent);
}
.user-btn .rolle {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.78rem;
  margin-left: 0.5rem;
}
.user-menu {
  position: absolute;
  bottom: 110%;
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  overflow: hidden;
}
.user-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}
.user-menu button:hover {
  background: var(--panel-hover);
}

/* Views & Main Content */
.view {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Panel / Cards */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease, border-color 0.3s ease;
}
.panel:hover {
  box-shadow: var(--shadow-lg);
}
.panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
}
.panel h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}
.panel .sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* Layout Utilities */
.row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.row:last-child {
  margin-bottom: 0;
}
.row > .field {
  flex: 1;
  min-width: 180px;
}
.field label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--label);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}
.spacer {
  flex: 1;
}

/* Inputs, Select, Textarea */
input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  width: 100%;
  transition: var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
input[readonly] {
  background: var(--panel-hover);
  color: var(--muted);
  cursor: not-allowed;
}
textarea {
  resize: vertical;
  min-height: 80px;
}

/* Buttons */
.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.btn:hover {
  background: var(--panel-hover);
  border-color: var(--accent);
}
.btn:active {
  transform: translateY(1px);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.btn.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}
.btn.blue {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}
.btn.blue:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}
.btn.green {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}
.btn.green:hover {
  background: #15803d;
  border-color: #15803d;
}
.btn.danger {
  background: var(--panel);
  border-color: var(--red);
  color: var(--red);
}
.btn.danger:hover {
  background: var(--red-light);
}
.btn.small {
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Tables */
table.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
table.grid th, table.grid td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: middle;
  background: var(--panel);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
table.grid th:last-child, table.grid td:last-child {
  border-right: 0;
}
table.grid tr:last-child td {
  border-bottom: 0;
}
table.grid th {
  background: var(--panel-hover);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--label);
  font-weight: 700;
}
table.grid tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.015);
}
body.dark table.grid tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.01);
}
table.grid td.num, table.grid th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.grid input, table.grid select {
  padding: 0.35rem;
  border: 1px solid transparent;
  background: transparent;
}
table.grid input:focus, table.grid select:focus {
  border-color: var(--accent);
  background: var(--panel);
}
table.grid td.we {
  background: var(--amber-light) !important;
}
tr.tagtyp-urlaub td, tr.tagtyp-feiertag td, tr.tagtyp-krank td {
  color: var(--amber);
  font-style: italic;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge.erfasst, .badge.entwurf { background: var(--panel-hover); color: var(--muted); }
.badge.geprueft, .badge.final, .badge.festgeschrieben { background: var(--blue-light); color: var(--blue); border-color: transparent; }
.badge.storniert { background: var(--red-light); color: var(--red); border-color: transparent; text-decoration: line-through; }
.badge.freigegeben, .badge.verbucht, .badge.angenommen { background: var(--green-light); color: var(--green); border-color: transparent; }
.badge.versendet, .badge.gelb { background: var(--amber-light); color: var(--amber); border-color: transparent; }
.badge.abgelehnt, .badge.rot { background: var(--red-light); color: var(--red); border-color: transparent; }

/* KPI Grid */
.kpi {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.kpi .box {
  background: var(--accent-dark);
  border: 1px solid transparent;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem 0.85rem;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 0.3rem;
}
.kpi .box.red-box { background: var(--red); border-left-color: rgba(255,255,255,.5); }
.kpi .box .k {
  font-size: 0.74rem;
  color: rgba(255,255,255,.72);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.kpi .box .v {
  font-size: var(--fs-kpi);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}
.kpi .box .v small { font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,.65); letter-spacing: 0; margin-left: 0.2rem; }
.kpi .box .hint { font-size: 0.78rem; color: rgba(255,255,255,.65); }
body.dark .kpi .box {
  background: #2b3a52;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
@media (max-width: 768px) {
  .kpi { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .kpi .box { padding: 0.8rem 0.85rem; }
  .kpi .box .v { font-size: 1.6rem; }
}

/* Alerts / Notes */
.hinweis {
  background: var(--amber-light);
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: var(--ink);
}
.warn {
  color: var(--red);
  font-weight: 600;
}
.muted {
  color: var(--muted);
}
.right {
  text-align: right;
}
.pill-list {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.chip {
  background: var(--panel-hover);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  user-select: none;
}
.chip:hover {
  border-color: var(--accent);
}
.chip.on {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
@media (max-width: 768px) { .chip { padding: 0.45rem 0.75rem; font-size: 0.95rem; } }

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-width: 90%;
  font-weight: 600;
  animation: slideUp 0.2s ease;
}
body.dark .toast {
  background: #1f2937;
  border: 1px solid var(--line);
}

/* Modal Dialog */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 80;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: min(680px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  animation: scaleIn 0.15s ease;
}
.modal h3 {
  margin-top: 0;
  font-size: 1.2rem;
  font-weight: 700;
}
.modal .actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* Login Page Customizations */
.login-back {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--bg), var(--line));
  display: grid;
  place-items: center;
  z-index: 1000;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: min(400px, 92vw);
  padding: 2.25rem 2rem;
  text-align: center;
}
.login-card .login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 0.85rem;
}
.login-card h1 {
  margin: 0.2rem 0;
  font-size: 1.4rem;
  font-weight: 800;
}
.login-card .sub {
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
}
.login-card .field {
  text-align: left;
  margin-bottom: 1rem;
}
.login-card .btn {
  width: 100%;
  justify-content: center;
  margin-top: 0.75rem;
  font-weight: 700;
}
.login-fehler {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* Ein/Aus-Stempel Panel */
.stempel-panel {
  border-left: 4px solid var(--green);
}
.stempel-head {
  font-weight: 700;
  margin-bottom: 0.85rem;
  font-size: 1rem;
}
.stempel-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.btn.stempel {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 1.15rem;
  min-height: 80px;
  border: 0;
  border-radius: var(--radius);
  color: #ffffff;
  cursor: pointer;
}
.btn.stempel small {
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.9;
}
.btn.stempel.kommen {
  background: var(--green);
}
.btn.stempel.kommen:hover {
  background: #15803d;
}
.btn.stempel.gehen {
  background: var(--amber);
}
.btn.stempel.gehen:hover {
  background: #b45309;
}
.stempel-info {
  margin-top: 0.75rem;
  font-size: 0.88rem;
}

/* Notifications Bell Box */
.bellbox {
  position: relative;
  display: inline-flex;
}
.bell-btn {
  background: transparent;
  border: 0;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  position: relative;
  padding: 0.35rem;
  transition: var(--transition);
}
.bell-btn:hover {
  transform: scale(1.05);
}
.bell-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--red);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--panel);
}
.bell-menu {
  position: absolute;
  right: 0;
  top: 130%;
  z-index: 80;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: min(380px, 92vw);
  max-height: 70vh;
  overflow-y: auto;
}
.bell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 10;
}
.bell-head-n {
  color: var(--red);
  font-size: 0.78rem;
  background: var(--red-light);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.bell-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
}
.bell-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  transition: var(--transition);
}
.bell-item:last-child {
  border-bottom: 0;
}
.bell-item.neu {
  background: var(--accent-light);
}
.bell-was {
  font-size: 0.88rem;
  font-weight: 500;
}
.bell-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* Reminders view */
.erinnerung-liste {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.erinnerung {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  transition: var(--transition);
}
.erinnerung.rot {
  border-left: 4px solid var(--red);
}
.erinnerung.gelb {
  border-left: 4px solid var(--amber);
}
.erinnerung.info {
  border-left: 4px solid var(--muted);
}
.erinnerung-txt {
  flex: 1;
  min-width: 0;
}
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* Autocomplete Streetbox */
.strassen-box {
  position: absolute;
  z-index: 1000;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 280px;
  overflow-y: auto;
  font-size: 0.88rem;
}
.strassen-box .si {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  transition: var(--transition);
}
.strassen-box .si:hover, .strassen-box .si.sel {
  background: var(--panel-hover);
}
.strassen-box .si-o {
  color: var(--muted);
  font-size: 0.78rem;
}

/* Animations */
@keyframes slideUp {
  from { transform: translate(-50%, 1rem); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Printable PDF layouts (hidden on screen) */
.print-root {
  display: none;
}

/* Mobile & Tablet layout optimizations */
@media (max-width: 820px) {
  .view {
    padding: 0.75rem;
  }
  .panel {
    padding: 1rem;
    overflow-x: auto;
  }
  table.grid {
    min-width: 780px;
  }
  .btn {
    padding: 0.5rem 0.85rem;
  }
}

/* Mobile-only Viewports (< 768px) */
@media (max-width: 768px) {
  /* Sidebar sliding navigation */
  .app-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .app-container.sidebar-open .app-sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  
  .sidebar-toggle-btn {
    display: none;
  }
  
  .app-content {
    margin-left: 0 !important;
  }
  
  .app-header {
    height: 55px;
    padding: 0 1rem;
  }
  
  .mobile-menu-btn {
    display: flex;
    background: transparent;
    border: 0;
    font-size: 1.35rem;
    color: var(--ink);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
  }
  
  .mobile-brand {
    display: block;
    margin-left: 0.75rem;
  }
  .mobile-brand .brand-title {
    font-size: 1.05rem;
    font-weight: 700;
  }
  
  /* Stundenerfassung cards list layout on mobile */
  #tab-erfassung {
    min-width: 0;
    border: 0;
  }
  #tab-erfassung thead {
    display: none;
  }
  #tab-erfassung, #tab-erfassung tbody {
    display: block;
    width: 100%;
  }
  #tab-erfassung tr {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--panel);
    box-shadow: var(--shadow);
  }
  #tab-erfassung tr td {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    border: 0;
    padding: 0.5rem 0 0;
    background: transparent !important;
  }
  #tab-erfassung tr td:first-child {
    padding-top: 0;
  }
  #tab-erfassung td::before {
    content: attr(data-label);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    font-weight: 600;
  }
  #tab-erfassung td input, #tab-erfassung td select {
    width: 100% !important;
    min-height: 44px;
    border: 1px solid var(--line) !important;
    background: var(--panel) !important;
    border-radius: var(--radius-sm);
    padding: 0.55rem;
    font-size: 1rem;
  }
  
  /* Grid ordering of rows for easier mobile input */
  #tab-erfassung td:nth-child(1) { display: none; }            /* Nr */
  #tab-erfassung td:nth-child(2) { order: 1; }                 /* Datum */
  #tab-erfassung td:nth-child(5) { order: 2; }                 /* Baustelle */
  #tab-erfassung td:nth-child(6) { order: 3; }                 /* Von */
  #tab-erfassung td:nth-child(7) { order: 4; }                 /* Bis */
  #tab-erfassung td:nth-child(9) { order: 5; }                 /* Stunden */
  #tab-erfassung td:nth-child(3) { order: 6; }                 /* Art */
  #tab-erfassung td:nth-child(4) { order: 7; }                 /* Kunde */
  #tab-erfassung td:nth-child(8) { order: 8; }                 /* Pause */
  #tab-erfassung td:nth-child(10) { order: 9; }                /* Gerät */
  #tab-erfassung td:nth-child(11) { order: 10; flex-direction: row; align-items: center; justify-content: space-between; padding-top: 0.75rem; }  /* Spesen */
  #tab-erfassung td:nth-child(12) { order: 11; flex-direction: row; gap: 0.5rem; padding-top: 0.85rem; }  /* Aktionen */
  
  #tab-erfassung td:nth-child(2) input {
    font-weight: 700;
  }
  #tab-erfassung td:nth-child(11)::before {
    font-size: 0.9rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink);
  }
  #tab-erfassung td input[type="checkbox"] {
    width: 24px !important;
    height: 24px;
  }
  #tab-erfassung td .chip {
    padding: 0.45rem 0.75rem;
    font-size: 0.95rem;
  }
  #tab-erfassung td:nth-child(12) .btn {
    flex: 1;
    min-height: 42px;
    font-size: 1rem;
  }
  #tab-erfassung tr.summe {
    background: var(--panel-hover);
    box-shadow: none;
  }
  #tab-erfassung tr.summe td {
    flex-direction: row;
    justify-content: space-between;
  }
  #tab-erfassung tr.summe td::before {
    content: "";
  }
}

/* ===== Scroll & Tabellen-Layout ========================================= */
.grid-scroll {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  /* Scroll-Schatten als visueller Hinweis dass mehr Inhalt da ist */
  background:
    linear-gradient(to right, var(--panel) 30%, transparent) left / 24px 100% no-repeat,
    linear-gradient(to left,  var(--panel) 30%, transparent) right / 24px 100% no-repeat,
    radial-gradient(ellipse at left,  rgba(0,0,0,.10), transparent 60%) left  / 16px 100% no-repeat,
    radial-gradient(ellipse at right, rgba(0,0,0,.10), transparent 60%) right / 16px 100% no-repeat;
  background-attachment: local, local, scroll, scroll;
}

/* Sticky Header in Tabellen */
table.grid thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--panel-hover);
}

/* Klickbare Zeilen in Prüfung */
table.grid tr[data-ma] { cursor: pointer; }
table.grid tr[data-ma]:hover td { background: var(--accent-light) !important; }

@media (min-width: 769px) {
  table.grid#tab-erfassung { min-width: 1160px; }
  #tab-erfassung td[data-label="Baustelle / Tätigkeit"],
  #tab-erfassung th:nth-child(5) { min-width: 220px; }
  #tab-erfassung td[data-label="Kunde"], #tab-erfassung th:nth-child(4) { min-width: 150px; }
  #tab-erfassung td[data-label="Art"],   #tab-erfassung th:nth-child(3) { min-width: 120px; }
  #tab-erfassung td input, #tab-erfassung td select { width: 100%; box-sizing: border-box; }
  #tab-erfassung td[data-label="Von"] input,
  #tab-erfassung td[data-label="Bis"] input,
  #tab-erfassung td.num input { width: auto; }
}

@media (max-width: 768px) {
  /* Erfassungs-Tabelle auf Mobile: KARTEN-Layout (kein horizontales Scrollen) –
     min-width:0 überstimmt die Desktop-Breite, sonst wird die Karte zerquetscht. */
  table.grid#tab-erfassung { min-width: 0; }
  .toolbar { flex-wrap: wrap; gap: 0.5rem; }
  /* Scrollbar auf iOS etwas prominenter (für die übrigen breiten Tabellen) */
  .grid-scroll::-webkit-scrollbar { height: 5px; }
  .grid-scroll::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 3px; }
}

/* ===== Stunden-Ergebnis, Baustellen-Feld & Korrektur-Freigabe ============ */
.std-anzeige { font-size: .72rem; color: var(--muted); margin-top: 2px; }

.hk-baustelle-feld { display: block; margin: .85rem 0 .25rem; font-weight: 600; font-size: .85rem; color: var(--ink); }
.hk-baustelle-feld input { display: block; width: 100%; margin-top: .35rem; padding: .65rem .7rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 1rem; background: var(--panel); box-sizing: border-box; }

.korrektur-wartet { font-size: .72rem; color: var(--amber); font-weight: 700; margin-top: 3px; }
.hk-korrektur { background: var(--amber-light); border: 1px solid var(--amber); color: var(--ink);
  border-radius: var(--radius-sm); padding: .55rem .75rem; margin: .6rem 0; font-weight: 600; font-size: .9rem; }
.korr-liste { margin-top: .5rem; display: flex; flex-direction: column; gap: .5rem; }
.korr-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .75rem; }

/* Prüfen-Spalte (Prüfung & Freigabe): ✓ passt / ✗ beanstanden */
.pz-gruppe { display: flex; gap: 4px; }
.pz-btn {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel);
  font: inherit; font-size: 0.85rem; font-weight: 700; color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.pz-btn.ok:hover { border-color: var(--green); color: var(--green); }
.pz-btn.falsch:hover { border-color: var(--red); color: var(--red); }
.pz-btn.ok.an { background: var(--green); border-color: var(--green); color: #fff; }
.pz-btn.falsch.an { background: var(--red); border-color: var(--red); color: #fff; }
tr.pz-falsch td { background: var(--red-light) !important; }
tr.pz-nachgebessert td { background: var(--amber-light) !important; }
.beanstandet-wartet { font-size: .72rem; color: var(--red); font-weight: 700; margin-top: 3px; }
.nachgebessert-wartet { font-size: .72rem; color: var(--amber); font-weight: 700; margin-top: 3px; }
.pz-nachbesserung { font-size: .68rem; color: var(--amber); font-weight: 700; margin-bottom: 2px; }
/* Beanstandungs-Banner in der Heute-Karte (Mitarbeiter sieht die Rückgabe sofort) */
.hk-beanstandung { background: var(--red-light); border: 1px solid var(--red); border-left: 4px solid var(--red);
  color: var(--ink); border-radius: var(--radius-sm); padding: .6rem .8rem; margin: .6rem 0; font-size: .9rem; }
.hk-beanstandung b { color: var(--red); }
/* Read-only Geräte-Chips (Prüfung): nicht klickbar wirken */
.chip.fest { cursor: default; }
.chip.fest:hover { border-color: var(--line); }
/* Prüf-Buttons am Handy größer (Touch >=40px) */
@media (max-width: 768px) { .pz-btn { width: 40px; height: 40px; font-size: 1rem; } .pz-gruppe { gap: 6px; } }

@media (max-width: 768px) {
  /* Stunden-Ergebnis in der Karte groß & farbig – „was ist 1,65?" eindeutig */
  #tab-erfassung td[data-label="Stunden"] .std-anzeige { font-size: 1.05rem; font-weight: 800; color: var(--accent); margin-top: 4px; }
  /* Gesamt-Zeile deutlich hervorheben */
  #tab-erfassung tr.summe { border: 2px solid var(--accent); }
  #tab-erfassung tr.summe td b { color: var(--accent); font-size: 1.05rem; }
}

/* ===== Feinschliff (Review 2026-07-05): Safe-Area, iOS-Zoom, Motion, Touch ===== */
input, select, textarea { font-size: 16px; }            /* verhindert iOS-Auto-Zoom beim Fokussieren */
.app-sidebar { padding-top: env(safe-area-inset-top); }
.toast { bottom: calc(1.5rem + env(safe-area-inset-bottom)) !important; }
@media (max-width: 768px) {
  .app-header {
    height: calc(55px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  .view { padding-bottom: calc(0.75rem + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
@media (hover: none) {
  .panel:hover { box-shadow: var(--shadow); transform: none; }   /* kein Sticky-Hover auf Touch */
}

/* ===== Sichtbarkeit (Live-Test 06.07.): Buttons deutlich, v. a. Dark Mode ===== */
.btn { background: var(--panel-hover); }                          /* hebt sich von der Panel-Fläche ab */
/* Nur die NEUTRALEN Buttons im Dark Mode einfärben – farbige (primary/blue/green/danger/stempel) behalten ihre Farbe */
body.dark .btn:not(.primary):not(.blue):not(.green):not(.danger):not(.stempel):not(.heute-btn) { border-color: #414f63; background: #242e3c; }
body.dark .btn:not(.primary):not(.blue):not(.green):not(.danger):not(.stempel):not(.heute-btn):hover { border-color: var(--accent); }
body.dark .btn:disabled { opacity: .45; }
.badge:empty::before { content: "–"; }
.badge { background: var(--panel-hover); color: var(--muted); border: 1px solid var(--line); }

/* Mobile: Felder in .row immer volle Breite stapeln (nichts abschneiden, kein Seiten-Scroll) */
@media (max-width: 768px) {
  .row > .field { flex: 1 1 100% !important; min-width: 0; }
  .row > .field > div[style*="display:flex"] { flex-wrap: wrap !important; }
  /* Kopf entlasten, damit das 👤-Konto-Menü (mit „Abmelden") immer sichtbar bleibt */
  .header-right { gap: 0.5rem; }
  #header-right > .theme-toggle-btn { display: none; }   /* Theme-Umschalter steckt im 👤-Menü */
  #header-right > .save-status { display: none; }         /* Speicher-Status siehst du in der Karte, nicht im engen Kopf */
}
.user-menu-logout { color: var(--red); font-weight: 700; }
.user-menu .user-menu-logout:hover, .user-menu-header .user-menu-logout:hover { background: var(--red-light); }

/* ===== Nutzer-Menü im Kopf (Abmelden immer erreichbar, alle Rollen/Geräte) ===== */
.userbox-header { position: relative; }
.user-btn-header {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel-hover);
  font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.user-btn-header:hover { border-color: var(--accent); }
.user-menu-header {
  position: absolute; right: 0; left: auto; top: calc(100% + 8px); bottom: auto; width: max-content; z-index: 60;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); min-width: 220px; padding: var(--sp-2); display: flex; flex-direction: column; gap: 2px;
}
.user-menu-header[hidden] { display: none; }
.user-menu-header .user-menu-name {
  padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); color: var(--muted);
  border-bottom: 1px solid var(--line); margin-bottom: var(--sp-1); white-space: nowrap;
}
.user-menu-header button {
  border: 0; background: transparent; color: var(--ink); font: inherit; text-align: left;
  padding: var(--sp-3); border-radius: var(--radius-sm); cursor: pointer; min-height: 44px;
}
.user-menu-header button:hover { background: var(--panel-hover); }

/* Sidebar-Fuß nicht hinter der Bottom-Nav verstecken */
@media (max-width: 768px) {
  .app-sidebar { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
}

/* ===== Heute-Karte (Rolle Baustelle, aktueller Monat) ==================== */
.heute-karte { border-left: 4px solid var(--accent); }
.heute-gruss {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink-strong);
}
.heute-datum {
  color: var(--muted);
  margin-bottom: var(--sp-4);
}
.btn.heute-btn {
  width: 100%;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  font-size: 1.25rem;
  font-weight: 700;
  border: 0;
  border-radius: var(--radius);
  color: #ffffff;
  box-shadow: var(--shadow);
}
.btn.heute-btn small { font-size: 0.75rem; font-weight: 400; opacity: 0.92; }
.btn.heute-btn.kommen { background: var(--green); }
.btn.heute-btn.kommen:hover { background: #15803d; border-color: transparent; }
.btn.heute-btn.gehen { background: var(--amber); }
.btn.heute-btn.gehen:hover { background: #b45309; border-color: transparent; }
.heute-live {
  font-size: 1.05rem;
  background: var(--gold-light);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
}
.heute-fertig {
  background: var(--green-light);
  color: var(--green);
  border-radius: var(--radius-sm);
  padding: var(--sp-4);
  font-weight: 700;
  font-size: 1.05rem;
}
.heute-woche {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}
.heute-woche .wtag {
  flex: 1;
  text-align: center;
  padding: var(--sp-2) 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel-hover);
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.35;
}
.heute-woche .wtag-name { font-weight: 700; }
.heute-woche .wtag.ok { background: var(--green-light); color: var(--green); border-color: transparent; }
.heute-woche .wtag.laeuft { background: var(--gold-light); color: var(--gold-dark); border-color: transparent; font-weight: 700; }
body.dark .heute-woche .wtag.laeuft { color: var(--gold); }
.heute-woche .wtag.istheute { box-shadow: 0 0 0 2px var(--accent); }
.heute-monat {
  margin-top: var(--sp-3);
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* Eingeklappte Monatstabelle („Alle Tage anzeigen/bearbeiten") */
.alle-tage-details { margin-bottom: 1.5rem; }
.alle-tage-details > summary {
  cursor: pointer;
  padding: var(--sp-4);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-weight: 600;
  user-select: none;
  transition: var(--transition);
}
.alle-tage-details > summary:hover { border-color: var(--accent); }
.alle-tage-details[open] > summary { margin-bottom: 1.5rem; }
.zeile-blink { box-shadow: 0 0 0 3px var(--gold) !important; transition: box-shadow 0.3s ease; }

/* ===== Feierabend-Overlay (Gold-Haken) =================================== */
.feierabend-back {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 200;
  animation: fadeIn 0.18s ease;
}
.feierabend-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: min(360px, 90vw);
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  animation: scaleIn 0.18s ease;
}
.feierabend-card h2 { margin: 0 0 var(--sp-2); font-size: 1.35rem; font-weight: 800; }
.feierabend-zeile { color: var(--muted); font-size: 1rem; margin-bottom: var(--sp-5); }
.feierabend-haken {
  width: 88px;
  height: 88px;
  display: block;
  margin: 0 auto var(--sp-4);
}
.feierabend-haken circle {
  fill: var(--gold-light);
  stroke: var(--gold);
  stroke-width: 3;
}
.feierabend-haken path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: haken-zeichnen 0.6s ease 0.15s forwards;
}
@keyframes haken-zeichnen { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .feierabend-haken path { animation: none; stroke-dashoffset: 0; }
}
.feierabend-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.feierabend-actions .btn { width: 100%; justify-content: center; min-height: 46px; }

/* ===== Toast mit Aktions-Button (Undo) =================================== */
.toast .toast-aktion {
  background: transparent;
  border: 0;
  color: var(--gold);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  margin-left: var(--sp-3);
  padding: var(--sp-1) var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ===== Start-Skeleton (statt „Lädt …") =================================== */
.skeleton-panel {
  height: 130px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  background: linear-gradient(100deg, var(--panel) 35%, var(--panel-hover) 50%, var(--panel) 65%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-panel { animation: none; background: var(--panel-hover); }
}

/* ===== Mobile Bottom-Navigation (< 768px) ================================ */
.bottom-nav { display: none; }
@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: var(--panel);
    border-top: 1px solid var(--line);
    padding: var(--sp-1) var(--sp-2) calc(var(--sp-1) + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(16, 24, 40, 0.08);
  }
  body.dark .bottom-nav { box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.4); }
  .bottom-nav .bn-item {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font: inherit;
    font-weight: 600;
    padding: var(--sp-1) 0 2px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
  }
  .bottom-nav .bn-icon { font-size: 1.3rem; line-height: 1.2; }
  .bottom-nav .bn-label { font-size: 0.68rem; }
  .bottom-nav .bn-item.active { color: var(--accent); }
  .bottom-nav .bn-item.active .bn-label { font-weight: 800; }
  /* Inhalt + Toast über der Bottom-Bar halten */
  .view { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(70px + 1rem + env(safe-area-inset-bottom)) !important; }
}

/* ================= Übersicht / Dashboard (Büro/Admin) ================= */
.ueb-aktionen {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  align-items: center;
  margin-top: var(--sp-4);
}
.ueb-aktionen .btn { font-size: 1rem; padding: 0.65rem 1.1rem; }
.ueb-hinweis { color: var(--muted); font-size: var(--fs-sm); }
.ueb-offen { font-size: 1.05rem; margin-bottom: var(--sp-3); }
.ueb-offen b { font-variant-numeric: tabular-nums; }
.ueb-zuletzt { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--sp-3); }

/* Monats-Umsatzbalken: reine Divs, Marken-Schieferblau */
.ubalken-reihe {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-3);
  min-height: 165px;
  padding-top: var(--sp-4);
}
.ubalken-spalte {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-1);
}
.ubalken {
  width: 100%;
  max-width: 64px;
  background: var(--accent);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  min-height: 2px;
  transition: var(--transition);
}
.ubalken.leer { background: var(--panel-hover); border: 1px dashed var(--line); }
.ubalken-wert {
  font-size: 0.7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ubalken-label { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }


/* ============================================================================
   VR Erd & Tiefbau — Block 1: Belege · Export · Stammdaten · Seg · Empty-State
   Nur NEUE Klassen; nutzt ausschließlich vorhandene Design-Tokens aus :root.
   ============================================================================ */

/* === SEG (geteilt: Belege-Filter + Stammdaten) ============================ */

.seg {
  display: inline-flex;
  background: var(--panel-hover);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.seg-btn {
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  padding: var(--sp-2) var(--sp-3);
  min-height: 40px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  white-space: nowrap;
  transition: var(--transition);
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.an {
  background: var(--panel);
  color: var(--accent);
  box-shadow: var(--shadow);
}
body.dark .seg-btn.an { background: #2b3a52; color: #fff; }
.seg-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.seg-badge {
  font-size: .72rem;
  font-weight: 700;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-pill);
  padding: 0 .4rem;
  line-height: 1.5;
}
.seg-badge.warn { background: var(--amber-light); color: var(--amber); }

/* === BELEGE — Master-Detail =============================================== */

.beleg-master-detail {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  column-gap: var(--sp-5);
  align-items: start;
}

/* Liste: scrollbar bei vielen Einträgen; 3px Innenluft, damit der
   Aktiv-/Fokusring nicht vom overflow abgeschnitten wird */
.beleg-liste {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-height: 60vh;
  overflow-y: auto;
  padding: 3px;
}
.beleg-liste:focus-visible {
  outline: none;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.beleg-zeile {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}
.beleg-zeile:hover {
  border-color: var(--accent);
  background: var(--panel-hover);
}
.beleg-zeile.aktiv {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-ring);
}
.beleg-zeile:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.beleg-thumb {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--panel-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  overflow: hidden;
}
.beleg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.beleg-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.beleg-info b {
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.beleg-info .muted {
  font-size: var(--fs-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.beleg-rechts {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.beleg-betrag {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Detail: abgesetzte Box, klebt beim Scrollen der Liste (nur Desktop) */
.beleg-detail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4);
  position: sticky;
  top: 1rem;
}

.beleg-vorschau {
  min-height: 220px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: var(--sp-3);
}
.beleg-vorschau img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.beleg-vorschau-icon { font-size: 3.5rem; opacity: .8; }

.beleg-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-3);
}
.beleg-meta > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.beleg-meta .k {
  color: var(--label);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: .02em;
}
.beleg-meta > div > span:not(.k) {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.label-mini {
  display: block;
  color: var(--label);
  font-size: var(--fs-sm);
  font-weight: 600;
  margin: var(--sp-3) 0 var(--sp-1);
}

.beleg-status-btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.beleg-detail-leer {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 220px;
  padding: var(--sp-6) var(--sp-4);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

@media (max-width: 768px) {
  .beleg-master-detail {
    grid-template-columns: 1fr;
    row-gap: var(--sp-4);
  }
  .beleg-liste {
    max-height: none;
    overflow-y: visible;
  }
  .beleg-detail { position: static; }
}

/* === EXPORT — Kachel-Grid + Status-Popover ================================ */

.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}
@media (max-width: 720px) {
  .export-grid { grid-template-columns: 1fr; }
}

.export-karte {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--sp-4) var(--sp-5);
  transition: var(--transition);
}
.export-karte:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.export-karte:focus-within {
  box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow);
}

.export-icon {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.export-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.export-body b { font-size: var(--fs-body); color: var(--ink); }
.export-body .muted { font-size: var(--fs-sm); }

.ex-jahr {
  max-width: 150px;
  margin-top: var(--sp-2);
}

/* Status-Popover: absolut positioniert, bläht die Tabellenzeile nicht auf */
.status-pop {
  display: inline-block;
  position: relative;
}
.status-pop summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.status-pop summary::-webkit-details-marker { display: none; }
.status-pop summary::marker { content: ""; }

.status-pop-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  min-width: 150px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-1);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-pop-opt {
  width: 100%;
  min-height: 40px;
  padding: var(--sp-2) var(--sp-3);
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.status-pop-opt:hover { background: var(--panel-hover); }
.status-pop-opt:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent-ring);
}
.status-pop-opt.an {
  font-weight: 700;
  color: var(--accent);
}

/* === STAMMDATEN — Segmented-Control + Tab-Panes =========================== */

/* Abstand zwischen Tab-Leiste und Pane innerhalb des Panels */
.sd-tabs .seg-wide { margin-bottom: var(--sp-4); }

/* FUNKTIONAL KRITISCH: Umschaltung der Panes */
.sd-pane { display: none; }
.sd-pane.an { display: block; }

.seg-wide {
  display: flex;
  width: 100%;
}
.seg-wide .seg-btn {
  flex: 1;
  justify-content: center;
}

@media (max-width: 768px) {
  .seg-wide {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .seg-wide::-webkit-scrollbar { height: 4px; }
  .seg-wide::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: var(--radius-pill);
  }
  .seg-wide .seg-btn { flex: 0 0 auto; }
}

/* === EMPTY-STATE (geteilt: Belege/Export) ================================= */

.empty-state {
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
  color: var(--ink);
}
.empty-state p { margin: 0 0 var(--sp-1); }
.empty-emoji {
  font-size: 2.75rem;
  line-height: 1;
  margin-bottom: var(--sp-2);
  opacity: .85;
}
.empty-state.klein { padding: var(--sp-5) var(--sp-4); }
.empty-state.klein .empty-emoji { font-size: 2rem; }


/* ============================================================
   VR Tiefbau – Block 234: Neue UI-Bausteine
   Stepper · Lightbox · Kamera-FAB/Bottom-Sheet · Sticky-Aktion ·
   Undo-Toast · Prüf-Stapel (Triage) · Übergabe-Paket-Assistent
   Nur neue Klassen; nutzt ausschließlich vorhandene Variablen.
   ============================================================ */

/* === STEPPER (Belege-Detail) === */
.status-stepper {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex-wrap: wrap;
}
.step {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-3);
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-sm);
  transition: var(--transition);
}
button.step { cursor: pointer; }
button.step:hover { border-color: var(--accent); }
.step:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.step.erledigt {
  background: var(--accent-light);
  color: var(--accent);
  border-color: transparent;
}
.step.aktuell {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-color: var(--accent);
}
body.dark .step.aktuell { background: var(--accent); color: #fff; }
.step.offen { color: var(--muted); }
.step-linie {
  flex: 0 0 12px;
  height: 2px;
  background: var(--line);
}

/* === LIGHTBOX (Foto-Overlay) === */
.lightbox-back {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .85);
  padding: var(--sp-4);
}
.lightbox-img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.lightbox-close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  transition: var(--transition);
}
.lightbox-close:hover { background: rgba(255, 255, 255, .3); }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
}
.lightbox-nav:hover { background: rgba(255, 255, 255, .3); }
.lightbox-nav.prev { left: var(--sp-4); }
.lightbox-nav.next { right: var(--sp-4); }
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .45);
}
.lightbox-info {
  position: absolute;
  bottom: var(--sp-5);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .6);
  color: #fff;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === KAMERA-FAB + BOTTOM-SHEET (mobil) === */
.beleg-fab { display: none; }                 /* Desktop: unsichtbar */
.sheet-scrim {                                 /* sichtbar nur ohne [hidden] */
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 65;
}
@media (max-width: 768px) {
  .beleg-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: var(--sp-4);
    bottom: calc(72px + env(safe-area-inset-bottom)); /* über der Bottom-Nav */
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: #fff;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 60;
    cursor: pointer;
    transition: var(--transition);
  }
  .beleg-fab:active { transform: scale(.96); }
  .beleg-fab:focus-visible {
    outline: none;
    box-shadow: var(--shadow-lg), 0 0 0 3px var(--accent-ring);
  }
  .beleg-erfassen {                            /* Erfassen-Formular als Bottom-Sheet */
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(105%);
    transition: transform .25s ease;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg);
    margin: 0;
    padding-bottom: calc(var(--sp-5) + env(safe-area-inset-bottom));
  }
  .beleg-erfassen.offen { transform: translateY(0); }
}

/* === STICKY-AKTION (Firma speichern) + DIRTY === */
.dirty-hint {
  display: none;
  color: var(--amber);
  font-weight: 600;
  font-size: var(--fs-sm);
  margin-right: auto;                          /* schiebt Button nach rechts */
}
.sticky-aktion.dirty .dirty-hint { display: inline; }
@media (max-width: 768px) {
  .sticky-aktion {
    position: sticky;
    bottom: 0;
    background: var(--panel);
    border-top: 1px solid var(--line);
    margin: 0 calc(-1 * var(--sp-4));
    padding: var(--sp-2) var(--sp-4);
    z-index: 20;
    box-shadow: 0 -2px 8px rgba(16, 24, 40, .06);
  }
  body.dark .sticky-aktion { box-shadow: 0 -2px 8px rgba(0, 0, 0, .4); }
}

/* === UNDO-TOAST === */
.undo-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--ink-strong);
  color: #fff;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  max-width: 92vw;
}
.undo-btn {
  border: 0;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  padding: var(--sp-1) var(--sp-2);
}
.undo-btn:hover { text-decoration: underline; }
.undo-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
  border-radius: var(--radius-sm);
}
/* Dark: --ink-strong wird hell → Text/Aktion invertieren, sonst weiß auf weiß */
body.dark .undo-toast { color: var(--bg); }
body.dark .undo-btn { color: var(--gold-dark); }

/* === TRIAGE (Prüf-Stapel, Vollbild-Overlay) === */
.triage-back {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .6);
  padding: var(--sp-4);
}
.triage-karte {
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-5);
  width: min(460px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.triage-kopf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--label);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.triage-x {
  border: 0;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--muted);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.triage-x:hover { background: var(--panel-hover); }
.triage-x:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.triage-bild {
  min-height: 240px;
  max-height: 46vh;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.triage-bild img {
  max-width: 100%;
  max-height: 46vh;
  object-fit: contain;
}
.triage-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.triage-info b { font-size: var(--fs-h3); }
.triage-betrag {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
  margin-top: var(--sp-1);
}
.triage-aktionen {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}
.triage-aktionen .btn {
  flex: 1;
  min-height: 48px;
  font-size: 1rem;
}
.triage-fortschritt {
  height: 6px;
  background: var(--panel-hover);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.triage-fortschritt > span {
  display: block;
  height: 100%;
  background: var(--gold);
  transition: width .2s;
}
.triage-emoji {
  font-size: 3rem;
  text-align: center;
}
.triage-karte.fertig {
  text-align: center;
  align-items: center;
}

/* === ÜBERGABE-PAKET-ASSISTENT (Export) === */
.schritt-streifen {
  display: flex;
  gap: var(--sp-3);
  align-items: stretch;
}
.schritt {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  flex: 1;
  background: var(--panel-hover);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  position: relative;
}
@media (min-width: 769px) {
  /* dezente Verbindungslinie – füllt exakt die 12px-Lücke (gap --sp-3) */
  .schritt:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: calc(-1 * var(--sp-3));
    width: var(--sp-3);
    height: 2px;
    background: var(--line);
  }
}
.schritt-nr {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.schritt-inhalt {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
}
.schritt-inhalt b {
  font-size: var(--fs-sm);
  color: var(--label);
}
.schritt-inhalt select,
.schritt-inhalt button { margin-top: 2px; }
.ub-check {
  font-size: var(--fs-sm);
  line-height: 1.4;
}
.ub-check.warn { color: var(--amber); }
.ub-check.ok { color: var(--green); }

/* === MOBIL-FEINSCHLIFF (Tap-Targets ≥ 44px) === */
@media (max-width: 768px) {
  button.step, .triage-x { min-height: 44px; }
  .triage-x { width: 44px; }
  .schritt-streifen { flex-direction: column; }
}

/* ============================================================================
   BAUSTELLE: Team-Erfassung (Kolonne) + Doku (mobil)  — aus Design-System
   (Heute-Karte, Bottom-Nav, Feierabend-Overlay stehen bereits weiter oben)
   ============================================================================ */

/* ---- Team-Erfassung (Kolonne) ---- */
.team-kopf { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin: var(--sp-2) 0 var(--sp-3); padding: 0 2px; }
.team-kopf .btn { flex: 0 0 auto; white-space: nowrap; }
.team-titel { font-size: 1.35rem; font-weight: 800; color: var(--ink-strong); letter-spacing: -0.01em; }
.team-liste { display: flex; flex-direction: column; gap: var(--sp-3); }
.team-karte { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; transition: var(--transition); }
.team-karte.da { border-color: var(--accent-ring); box-shadow: var(--shadow), 0 0 0 1px var(--accent-ring); }
.team-zeile { width: 100%; border: 0; background: transparent; font: inherit; color: var(--ink); display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); min-height: 64px; cursor: pointer; text-align: left; }
.team-avatar { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; background: var(--accent-light); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.95rem; letter-spacing: 0.5px; transition: var(--transition); }
.team-karte.da .team-avatar { background: var(--accent); color: #fff; }
.team-wer { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 0 0 auto; }
.team-wer b { white-space: nowrap; }
.team-wer .muted { font-size: 0.75rem; }
.team-std { margin-left: auto; text-align: right; display: flex; flex-direction: column; gap: 1px; font-variant-numeric: tabular-nums; min-width: 0; }
.team-std b { font-size: 1rem; white-space: nowrap; }
.team-std .muted { font-size: 0.72rem; overflow: hidden; text-overflow: ellipsis; }
.team-schalter { flex: 0 0 52px; width: 52px; height: 30px; border-radius: 999px; background: var(--panel-hover); border: 1px solid var(--line); position: relative; cursor: pointer; transition: var(--transition); }
.team-schalter .knauf { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); transition: left .18s ease; }
body.dark .team-schalter .knauf { background: #cfd8e6; }
.team-schalter.an { background: var(--green); border-color: var(--green); }
.team-schalter.an .knauf { left: 24px; }
.team-schalter:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.team-detail { padding: 0 var(--sp-4) var(--sp-4); border-top: 1px dashed var(--line); padding-top: var(--sp-3); }
.team-summe { position: sticky; bottom: 0; margin-top: var(--sp-4); display: flex; align-items: center; justify-content: space-between; background: var(--accent); color: #fff; border-radius: var(--radius); padding: var(--sp-3) var(--sp-4); box-shadow: var(--shadow-lg); font-size: 0.92rem; }
.team-summe b { font-size: 1.1rem; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ---- Kolonnen-Akkordeon (mehrere Trupps) ---- */
details.kolonne { padding: 0; overflow: hidden; margin-bottom: var(--sp-3); }
details.kolonne > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); min-height: 52px; }
details.kolonne > summary::-webkit-details-marker { display: none; }
.kolonne-kopf .team-wer { flex: 1 1 auto; min-width: 0; }
.kolonne-kopf .team-std { flex: 0 0 auto; text-align: right; }
.kolonne-pfeil { flex: 0 0 auto; color: var(--muted); transition: transform .18s ease; }
details.kolonne[open] .kolonne-pfeil { transform: rotate(180deg); }
details.kolonne.nur-lesen > summary { opacity: .82; }
.kolonne-body { padding: 0 var(--sp-4) var(--sp-4); }
.kolonne-body .team-liste { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-2); }
.kolonne-body .team-summe { position: static; box-shadow: none; margin-top: var(--sp-3); }
.team-karte.nur-lesen { opacity: .72; }
.team-schalter.gesperrt { cursor: default; opacity: .5; pointer-events: none; }

/* ---- Baustellen-Doku ---- */
.doc-aktionen { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.doc-aktionen .btn { flex: 1 1 160px; }
.doc-notiz-leiste { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.doc-notiz-leiste .btn { min-height: 44px; flex: 1; justify-content: center; }
.mikro-btn.an { background: var(--gold-light); border-color: var(--gold); color: var(--gold-dark); animation: mikro-puls 1.4s ease infinite; }
body.dark .mikro-btn.an { color: var(--gold); }
@keyframes mikro-puls { 0%, 100% { box-shadow: 0 0 0 0 var(--gold-light); } 50% { box-shadow: 0 0 0 6px var(--gold-light); } }
@media (prefers-reduced-motion: reduce) { .mikro-btn.an { animation: none; } }
.mikro-hinweis { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--gold-dark); }
body.dark .mikro-hinweis { color: var(--gold); }
.doc-liste { display: flex; flex-direction: column; gap: var(--sp-2); }
.doc-karte { display: flex; align-items: center; gap: var(--sp-3); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); background: var(--panel); }
.doc-thumb { width: 44px; height: 44px; flex: 0 0 44px; border-radius: var(--radius-sm); background: var(--panel-hover); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; overflow: hidden; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 0.88rem; }
.doc-info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-info .muted { font-size: 0.75rem; }
