/* 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;
  --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;

  --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;
  --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.78rem;
  font-weight: 600;
  color: var(--muted);
  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(--muted);
  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 { background: var(--panel-hover); color: var(--muted); }
.badge.geprueft { background: var(--blue-light); color: var(--blue); }
.badge.freigegeben { background: var(--green-light); color: var(--green); }
.badge.entwurf { background: var(--panel-hover); color: var(--muted); }
.badge.final { background: var(--blue-light); color: var(--blue); }
.badge.versendet { background: var(--amber-light); color: var(--amber); }
.badge.verbucht { background: var(--green-light); color: var(--green); }
.badge.angenommen { background: var(--green-light); color: var(--green); }
.badge.abgelehnt { background: var(--red-light); color: var(--red); }
.badge.rot { background: var(--red-light); color: var(--red); }
.badge.gelb { background: var(--amber-light); color: var(--amber); }

/* KPI Grid */
.kpi {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.kpi .box {
  background: var(--panel-hover);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}
.kpi .box .k {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.kpi .box .v {
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* 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);
}

/* 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: "";
  }
}

/* ===== Lesbarkeit Erfassung (Fix 2026-07-05) ============================
   Desktop/Laptop: Tabelle nie abschneiden -> horizontal scrollen; Baustelle/
   Kunde/Art bekommen Mindestbreite, damit Adressen lesbar sind.
   Mobil: kein horizontaler Ueberlauf der Karten. */
.grid-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@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) {
  .grid-scroll { overflow-x: hidden; }
  table.grid#tab-erfassung { min-width: 0 !important; }
  .toolbar { flex-wrap: wrap; gap: 0.5rem; }
}

/* ===== 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 */
body.dark .btn { border-color: #414f63; background: #242e3c; }    /* klar sichtbare Fläche + Rand */
body.dark .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; }
