:root {
  /* enschotec-Markenfarbe */
  --brand: #39AF74;
  --brand-hover: #2f9a64;
  --brand-dark: #1f7a4d;
  --brand-soft: #e7f6ee;   /* heller Grünschleier für Flächen/aktive Chips */
  --hover-soft: #eef2f6;   /* neutraler Grau-Hover (universell, statt Grün) */
  --hover-border: #cbd5db; /* neutraler Rahmen beim Hover */

  --bg: #f4f7f6;           /* App-Hintergrund, hell */
  --surface: #ffffff;      /* Karten/Kacheln */
  --surface-2: #eef2f0;    /* dezente Fläche */
  --text: #1f2a30;         /* fast schwarz */
  --muted: #6b7885;        /* graue Nebentexte */
  --border: #dde4e2;

  --primary: var(--brand);
  --primary-hover: var(--brand-hover);
  --green: var(--brand);
  --green-hover: var(--brand-hover);
  --red: #e2483d;
  --amber: #e08b2b;
  --blue: #2f7fd1;

  --radius: 14px;
  --shadow: 0 1px 3px rgba(16,32,24,.08), 0 1px 2px rgba(16,32,24,.05);
  --shadow-md: 0 4px 14px rgba(16,32,24,.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  /* verhindert den waagerechten Scrollbalken durch die 100vw-Kalender-Full-Bleed;
     breite Inhalte (Board/Kalender-Grid) scrollen ohnehin in ihrem eigenen Container. */
  overflow-x: hidden;
}

body { min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 1.1rem; margin: 0; color: var(--text); }
.topbar .user { color: var(--muted); font-size: .95rem; }
.topbar a { color: var(--brand); text-decoration: none; }

/* Standard-Inhaltsbreite begrenzt (sonst wirkt es auf breiten Monitoren zu weit).
   Tabs/Buttons/Listen bleiben immer begrenzt – nur der Kalender bricht per Full-Bleed aus. */
.container { max-width: 1280px; margin: 0 auto; padding: 18px 28px; }
/* Full-Bleed: nur das Kalender-Element spannt die volle Viewport-Breite, egal wie breit
   der (begrenzte) Container ist. Der innere Grid scrollt bei Bedarf selbst. */
.kal-fullbleed { width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }

/* ---------- Lager: große Touch-Elemente ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 130px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .05s, box-shadow .15s, background .15s;
}
.tile:hover { box-shadow: var(--shadow-md); }
.tile:active { transform: scale(.97); }
.tile .icon { font-size: 2.4rem; }
/* Weiße Karten: Icon in Markengrün */
.tile:not(.green):not(.blue):not(.amber):not(.primary) .icon { color: var(--brand); }
/* Vollfarbige Kacheln */
.tile.green, .tile.primary { background: var(--brand); color: #fff; border-color: transparent; }
.tile.blue { background: var(--blue); color: #fff; border-color: transparent; }
.tile.amber { background: var(--amber); color: #fff; border-color: transparent; }

button, input, select {
  font-family: inherit;
  font-size: 1.15rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px;
  min-height: 58px;
  border: none;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  box-shadow: var(--shadow);
  transition: transform .05s, background .15s;
}
.btn:hover { background: var(--brand-hover); }
.btn:active { transform: scale(.98); }
.btn.green { background: var(--brand); }
.btn.green:hover { background: var(--brand-hover); }
.btn.red { background: var(--red); }
.btn.ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--surface-2); }
.btn.ghost.danger { color: var(--red); border-color: #f0c2be; }
.btn.ghost.danger:hover { background: #fdecea; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.field { margin: 14px 0; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); }
.input {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.input::placeholder { color: #9aa6af; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.scanhint {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: .95rem; margin-top: 6px;
}

.list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.list-item:hover { border-color: var(--hover-border); background: var(--hover-soft); }
.list-item:active { background: var(--hover-soft); }
.list-item .sub { color: var(--muted); font-size: .9rem; }

.stepper { display: flex; align-items: center; gap: 14px; justify-content: center; }
.stepper button {
  width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 2rem; cursor: pointer; box-shadow: var(--shadow);
}
.stepper button:hover { background: var(--hover-soft); border-color: var(--hover-border); }
.stepper input {
  width: 130px; text-align: center; font-size: 2rem; font-weight: 700;
  padding: 12px; border-radius: var(--radius);
  border: 2px solid var(--border); background: var(--surface); color: var(--text);
}

.toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border);
}
.switch { width: 62px; height: 34px; border-radius: 999px; background: #cbd3d0; position: relative; cursor: pointer; transition: background .15s; }
.switch.on { background: var(--brand); }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: var(--shadow); }
.switch.on .knob { left: 31px; }

.crumbs { color: var(--muted); margin-bottom: 10px; font-size: .95rem; }
.crumbs a { color: var(--brand) !important; text-decoration: none; }
.big-ok { text-align: center; padding: 40px 0; }
.big-ok .icon { font-size: 5rem; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card h2 { margin-top: 0; }

/* Ruhigere Typografie: Überschriften kleiner und weniger fett
   (Browser-Standard wäre 1.5em/2em bei Gewicht 700 – das wirkt zu schwer). */
h1 { font-size: 1.35rem; font-weight: 600; line-height: 1.3; }
h2 { font-size: 1.12rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1rem;    font-weight: 600; line-height: 1.3; }
h4 { font-size: .95rem;  font-weight: 600; line-height: 1.3; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: #fff;
  padding: 14px 20px; border-radius: var(--radius);
  box-shadow: var(--shadow-md); z-index: 100; max-width: 90%;
}
/* Als Popover (Top-Layer) liegt der Toast ÜBER modalen Dialogen – Fehler bleiben sichtbar. */
.toast[popover] { margin: 0; inset: auto; left: 50%; bottom: 24px; border: none; overflow: visible; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--brand); }

/* ---------- Büro: Tabellen ---------- */
table { width: 100%; border-collapse: collapse; font-size: .98rem; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; background: #f7faf9; }
tbody tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--hover-soft); }
/* Mitarbeiter-Verwaltung: feste Spaltenbreiten (Aufdecken der PIN verschiebt nichts)
   und alle Inhalte mittig unter der Überschrift. */
.admin-tabelle { table-layout: fixed; }
.admin-tabelle th, .admin-tabelle td { text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; }
/* Aktionsspalte breiter, damit die 3 Symbole samt Luft rechts hineinpassen. */
.admin-tabelle th:last-child, .admin-tabelle td:last-child { width: 235px; }
.admin-tabelle th:first-child, .admin-tabelle td:first-child { width: 110px; }
/* Neutraler Hover statt Grün: sonst verschwimmt die Zeile mit den grünen
   „aktiv"/„gesetzt"-Chips (fast gleicher Ton). */
.admin-tabelle tr:hover td { background: var(--hover-soft); }
/* Kompakte Urlaub-Historientabelle im Arbeitszeit-Dialog */
.urlaub-tab { width: 100%; font-size: .82rem; box-shadow: none; border: 1px solid var(--border, #e2e8ec); border-radius: 8px; }
.urlaub-tab th, .urlaub-tab td { padding: 4px 8px; text-align: left; }
.urlaub-tab th { background: #f7faf9; font-weight: 600; }
.urlaub-tab .right { text-align: right; }
/* Aktionsspalte: feste, gleich breite Slots -> gleiche Symbole stehen zeilenübergreifend
   exakt untereinander; rechts etwas mehr Luft zum Rahmen. */
.akt-grid { display: inline-grid; grid-template-columns: repeat(4, 40px); gap: 6px; justify-items: center; align-items: center; padding-right: 18px; }
.akt-btn { width: 40px; min-width: 40px; min-height: 36px; padding: 6px 0; flex: 0 0 auto; }
.akt-leer { width: 40px; height: 36px; display: block; }
/* Pflichtfeld-Fehler: dezent rötlich statt Popup */
.feld-fehler { border-color: #e0a0a0 !important; background: #fdf5f5 !important; }
.feld-fehler::placeholder { color: #c0392b; }
/* Monteur-Kalender: Outlook-artige Kacheln – nur der Titel, einzeilig gekürzt.
   Details (Zeit/Nummer) per Klick im Mini-Popup. */
.kal-ev { border-radius: 4px; padding: 3px 6px; overflow: hidden; cursor: pointer;
  background: #dbe7fb; border-left: 3px solid #3b6fc4; color: #23405f; }
.kal-ev:hover { filter: brightness(0.96); }
.kal-ev.fremd { background: #eef1f4; border-left-color: #9aa5b1; color: #5b6673; }
.kal-ev-titel { font-size: .72rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; width: 100%; }
/* „Neuer Termin" = der Termin, der gerade angelegt wird: klar abgesetzt –
   hell schraffiert + gestrichelter Rahmen (liest sich als „noch nicht gespeichert"). */
.kal-neu { border-radius: 4px; padding: 3px 6px; overflow: hidden; font-weight: 700;
  color: var(--kn-bar, #16a34a);
  background: repeating-linear-gradient(45deg, #ffffff, #ffffff 6px, var(--kn-bg, #dcf3e5) 6px, var(--kn-bg, #dcf3e5) 12px);
  border: 1.5px dashed var(--kn-bar, #16a34a); }
/* Unterer Zieh-Griff zum Ändern der Dauer – fassbare Fläche + Greif-Indikator. */
.kal-neu-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; cursor: ns-resize; }
.kal-neu-resize::after { content: ""; position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  width: 22px; height: 3px; border-radius: 2px; background: var(--kn-bar, #16a34a); opacity: .55; }
/* Feld-Vollbildkalender: Terminblock (Monteur-eigene Termine) */
.kalm-ev { background:#e3edfb; border-left:3px solid #3b6fc4; color:#23405f; border-radius:4px; padding:2px 5px; overflow:hidden; cursor:pointer; }
.kalm-ev:active { filter:brightness(0.96); }
.mini-pop { border: none; border-radius: 12px; padding: 14px 16px; box-shadow: 0 10px 40px rgba(0,0,0,.22); }
.mini-pop::backdrop { background: rgba(0,0,0,.25); }
.tag { padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; display: inline-block; }
.tag.warn { background: #fbe9d0; color: #9a6212; }
.tag.ok { background: var(--brand-soft); color: var(--brand-dark); }
.tag.res { background: #e2edfb; color: #235e9e; }
.tag.danger-tag { background: #fdecea; color: var(--red); }

/* ---------- Betriebs-App: Status-Chips (semantische Farben, §7) ---------- */
.chip { padding: 4px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700; display: inline-block; white-space: nowrap; }
.chip.blau    { background: #e2edfb; color: #235e9e; }   /* terminiert */
.chip.gruen   { background: #dff3e6; color: #1f7a4d; }   /* in montage / läuft */
.chip.gelb    { background: #fbefcf; color: #8a6410; }   /* wartet */
.chip.violett { background: #ece4fb; color: #5b3ba6; }   /* abzurechnen */
.chip.grau    { background: #e7ebe9; color: #55636b; }   /* offen / erledigt / abgebrochen */

/* ---------- Monteur-PWA ---------- */
.m-topbar { display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:14px 16px; background:var(--surface); border-bottom:1px solid var(--border);
  box-shadow:var(--shadow); position:sticky; top:0; z-index:10; }
.m-topbar h1 { font-size:1.05rem; margin:0; }
.m-wrap { max-width:640px; margin:0 auto; padding:16px 16px 120px; }
.m-section-title { font-size:.88rem; font-weight:600; color:var(--muted); text-transform:uppercase;
  letter-spacing:.03em; margin:18px 2px 8px; }
.m-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:16px; box-shadow:var(--shadow); cursor:pointer; margin-bottom:10px; }
.m-card:active { transform:scale(.99); }
.m-card .head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.m-card .nr { font-weight:700; }
.m-card .sub { color:var(--muted); font-size:.9rem; margin-top:4px; }
.m-progress { height:10px; border-radius:999px; background:var(--surface-2); overflow:hidden; margin-top:12px; }
.m-progress > span { display:block; height:100%; background:var(--brand); }
.m-actionbar { position:fixed; left:0; right:0; bottom:0; background:var(--surface);
  border-top:1px solid var(--border); box-shadow:0 -2px 12px rgba(16,32,24,.08);
  padding:12px 16px calc(12px + env(safe-area-inset-bottom)); display:grid;
  grid-template-columns:1fr 1fr; gap:10px; z-index:20; max-width:640px; margin:0 auto; }
.m-actionbar .btn { min-height:60px; font-size:1.15rem; }
.m-actionbar .full { grid-column:1 / -1; }
.zettel { display:flex; flex-direction:column; gap:8px; margin-top:10px; }
.zettel .ev { display:flex; gap:10px; padding:10px 12px; background:var(--surface-2);
  border-radius:10px; font-size:.95rem; }
.zettel .ev .t { color:var(--muted); font-variant-numeric:tabular-nums; white-space:nowrap; }
.timer { font-variant-numeric:tabular-nums; font-weight:700; color:var(--brand-dark); }

/* ---------- Betriebs-Büro: Kanban-Board ---------- */
.board { display:flex; gap:14px; overflow-x:auto; padding-bottom:8px; align-items:flex-start; }
.board-col { flex:0 0 260px; background:var(--surface-2); border-radius:var(--radius); padding:10px; }
.board-col > h4 { margin:4px 6px 10px; font-size:.9rem; display:flex; justify-content:space-between; align-items:center; }
.board-col > h4 .cnt { color:var(--muted); font-weight:600; }
.vcard { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:12px;
  box-shadow:var(--shadow); margin-bottom:10px; }
.vcard .nr { font-weight:700; }
.vcard .sub { color:var(--muted); font-size:.88rem; margin-top:3px; }
.vcard .acts { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.vcard .acts .btn { width:auto; min-height:34px; padding:5px 10px; font-size:.85rem; box-shadow:none; }
/* Sparten-Kennzeichnung bewusst dezent/neutral halten – die Vorgangsliste soll nicht bunt wirken. */
.sparte-pill { font-size:.72rem; font-weight:600; padding:2px 8px; border-radius:999px; background:#eef1f4; color:#5b6673; }
.sparte-pill.sf { background:#eef1f4; color:#5b6673; }
.doc-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px;
  border:1px solid var(--border); border-radius:10px; background:var(--surface); margin-bottom:8px; }
.doc-row .acts { display:flex; gap:6px; flex-wrap:wrap; }

/* ---------- Desktop-Büro: kompakte, professionelle Steuerelemente ----------
   (Feld-/Lager-Ansicht behält große Touch-Ziele.) */
#app[data-area="betrieb"] .btn,
#app[data-area="buero"] .btn,
#app[data-area="admin"] .btn,
dialog.betrieb-dlg .btn {
  min-height: 34px;
  padding: 6px 14px;
  font-size: .9rem;
  font-weight: 500;
  width: auto;
  border-radius: 6px;
  box-shadow: none;
}
#app[data-area="betrieb"] .btn:active,
#app[data-area="buero"] .btn:active,
#app[data-area="admin"] .btn:active,
dialog.betrieb-dlg .btn:active { transform: none; }
/* Sekundäraktionen neutral (nur Primär bleibt Markengrün) */
#app[data-area="betrieb"] .btn.ghost,
#app[data-area="buero"] .btn.ghost,
#app[data-area="admin"] .btn.ghost { border-color: var(--border); }
/* Kompakte Formularfelder */
#app[data-area="betrieb"] .input,
#app[data-area="buero"] .input,
#app[data-area="admin"] .input,
#app[data-area="betrieb"] select.input,
dialog.betrieb-dlg .input,
dialog.betrieb-dlg select {
  padding: 8px 10px;
  font-size: .92rem;
  border-radius: 6px;
  border-width: 1px;
}
#app[data-area="betrieb"] .field label,
dialog.betrieb-dlg .field label { font-size: .85rem; }
dialog.betrieb-dlg { max-width: 560px; }

/* Typeahead / Autocomplete */
.ta-wrap { position: relative; }
.ta-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 60; background: var(--surface);
  border: 1px solid var(--border); border-top: none; border-radius: 0 0 8px 8px; box-shadow: var(--shadow-md);
  max-height: 240px; overflow-y: auto; }
.ta-item { padding: 8px 10px; cursor: pointer; font-size: .92rem; border-bottom: 1px solid var(--surface-2); }
.ta-item:last-child { border-bottom: none; }
.ta-item:hover, .ta-item.aktiv { background: var(--hover-soft); }
.ta-item .sub { color: var(--muted); font-size: .82rem; }
.ta-item.neu { color: var(--brand-dark); font-weight: 600; }

/* Dashboard */
.kpi-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:8px; }
.kpi { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px;
  box-shadow:var(--shadow); cursor:default; }
.kpi.klick { cursor:pointer; } .kpi.klick:hover { border-color:var(--hover-border); background:var(--hover-soft); }
.kpi .val { font-size:2rem; font-weight:800; line-height:1; }
.kpi .lab { color:var(--muted); font-size:.85rem; margin-top:6px; }
.kpi.gross .val { font-size:2.6rem; color:var(--brand-dark); }
.kpi.warn-k { border-color:#f0c98f; } .kpi.warn-k .val { color:#9a6212; }
.kpi.rot-k { border-color:#f0c2be; } .kpi.rot-k .val { color:var(--red); }
.stale-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 14px;
  border:1px solid var(--border); border-left:4px solid var(--amber); border-radius:10px; background:var(--surface);
  margin-bottom:8px; cursor:pointer; }
.stale-row:hover { background:var(--hover-soft); }
.stale-row.rot { border-left-color:var(--red); }
.stale-row .g { color:var(--muted); font-size:.9rem; }

/* Kartenansicht */
.m-map { height: 68vh; min-height: 380px; width: 100%; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.leaflet-popup-content { font-family: inherit; }
.leaflet-popup-content .pop-nr { font-weight: 700; }
.leaflet-popup-content .pop-act { margin-top: 8px; display: flex; gap: 6px; }
.leaflet-popup-content .pop-act button { font-size: .85rem; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.leaflet-popup-content .pop-act button.green { background: var(--brand); color: #fff; border-color: transparent; }

/* Druck: nur die Abrechnungskarte, kein Navigations-Chrom */
@media print {
  .topbar, #tabbar, #betrieb-subtabs, .no-print, .toast { display: none !important; }
  .container { max-width: none; padding: 0; }
  .card { box-shadow: none; border: none; }
}

/* PIN-Anzeige-Pille (gleiche Größe wie Rollen-Tags) */
.pinpill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--brand-soft); color: var(--brand-dark); border: none; font-family: inherit; margin: 1px; }
button.pinpill { cursor: pointer; }
button.pinpill:hover { background: #d9efe3; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 10px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; color: var(--text); box-shadow: var(--shadow); white-space: nowrap; }
.tab:hover { border-color: var(--brand); }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Rollen-Reiter (Lager/Büro/Admin) = Bereichs-Überschriften: größer, klar abgetrennt */
#tabbar { border-bottom: 2px solid var(--border); padding-bottom: 16px; margin-bottom: 22px; }
#tabbar .tab { font-size: 1.05rem; font-weight: 600; padding: 11px 20px; }

/* Prozess-Reiter (Büro) kleiner und immer in einer Zeile */
#buero-subtabs { flex-wrap: wrap; }
#buero-subtabs .tab { font-size: .95rem; padding: 8px 14px; box-shadow: none; }

/* Betrieb-Subreiter: zwei klar getrennte Zeilen, abgesetzt vom Bereichs-Menü */
#betrieb-subtabs { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; margin-bottom: 16px; box-shadow: var(--shadow); }
.subtab-row { display: flex; gap: 8px; flex-wrap: wrap; }
.subtab-row + .subtab-row { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
/* Reiter gleichmäßig über die volle Breite verteilen */
.subtab-row .tab { flex: 1 1 0; min-width: 110px; text-align: center; justify-content: center; }
#betrieb-subtabs .tab { font-size: .95rem; padding: 8px 14px; box-shadow: none; }
/* Bereichs-Reiter (Betrieb/Inventar/…) ebenfalls über die volle Breite */
#tabbar .tab { flex: 1 1 0; min-width: 110px; justify-content: center; }
/* dezentes Gruppen-Icon im Reiter: klein + zurückgenommen */
.tab-ico { font-size: .82em; opacity: .6; margin-right: 5px; }
.tab.active .tab-ico { opacity: .9; }
/* dezentes Icon in Buttons (gleiche Größe wie die Reiter-Icons) */
.btn-ico { font-size: .82em; opacity: .7; margin-right: 5px; }
/* Einheitlicher Zurück-Link (überall gleich, etwas größer) */
.zurueck { display: inline-flex; align-items: center; gap: 4px; color: var(--brand, #16a34a); font-weight: 600; font-size: 1.02rem; padding: 6px 4px; margin-bottom: 8px; cursor: pointer; text-decoration: none; }
.zurueck:hover { text-decoration: underline; }
.tab.tab-alert, .tab.tab-alert:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .input { width: auto; flex: 1; min-width: 200px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

dialog {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  color: var(--text); padding: 24px; max-width: 480px; width: 92%;
  box-shadow: var(--shadow-md);
}
dialog::backdrop { background: rgba(31,42,48,.45); }
select.input { appearance: auto; }

@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
}
