/* ═══════════════════════════════════════════════════════════════
   DoorGuard – Gemeinsames Stylesheet
   Light Theme | v2.0
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. CUSTOM PROPERTIES (Design-Tokens) ── */
:root {
  /* Hintergründe */
  --bg:       #f6f8fa;
  --surface:  #ffffff;
  --surface2: #f0f4f8;
  --surface3: #e8edf3;

  /* Rahmen */
  --border:  #d0d7de;
  --border2: #e4e8ec;

  /* Text */
  --text:   #1f2328;
  --muted:  #656d76;
  --subtle: #8c959f;

  /* Primär-Akzent */
  --accent:       #0969da;
  --accent-hover: #0860ca;
  --accent-bg:    #dbeafe;
  --accent-logo:  #58a6ff;

  /* Status: Warnung / Offen (gelb) */
  --yellow:     #9a6700;
  --yellow-bg:  #fff8c5;
  --yellow-bdr: #e3b341;

  /* Status: Alarm / Offline / Fehler (rot) */
  --red:     #cf222e;
  --red-bg:  #ffebe9;
  --red-bdr: #ff8182;

  /* Status: OK / Aktiv / Geschlossen (grün) */
  --green:     #1a7f37;
  --green-bg:  #dafbe1;
  --green-bdr: #4ac26b;

  /* Status: Defekt / Orange */
  --warn:     #bc4c00;
  --warn-bg:  #fff1e5;
  --warn-bdr: #fb8f44;

  /* Status: Pending / Offen (amber) */
  --pend-bg:  #fff8c5;
  --pend-bdr: #e3b341;

  /* Status: Erledigt (dunkleres Grün) */
  --ok:       #1a7f37;
  --ok-bg:    #dafbe1;
  --ok-bdr:   #4ac26b;
  --done:     #0d6e31;
  --done-bg:  #d1f5dc;
  --done-bdr: #34d058;

  /* View-Switcher / Technik-Rolle (lila) */
  --vs-border: #a78bfa;
  --vs-bg:     #ede9fe;
  --vs-text:   #6933d8;

  /* Row-Highlight-Farben */
  --row-open-bg:      #fffbeb;
  --row-uncertain-bg: #fef9c3;
  --row-offline-bg:   #fff5f5;

  /* Schatten */
  --shadow-sm:      0 1px 3px rgba(31,35,40,.08), 0 0 1px rgba(31,35,40,.06);
  --shadow-md:      0 3px 12px rgba(31,35,40,.10), 0 0 1px rgba(31,35,40,.08);
  --shadow-overlay: 0 16px 48px rgba(31,35,40,.20);

  /* Radien */
  --radius-sm: 4px;
  --radius-md: 6px;
}

/* ── 2. RESET & BASE ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* ── 3. TYPOGRAFIE ── */
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ── 4. BODY-VARIANTEN ── */

/* login.html, install.html */
body.layout-centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* streife.html, technik.html, admin.html, missions.html */
body.layout-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* index.html, system.html, floorplan.html */
body.layout-dashboard {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── 5. HEADER ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.header-logo {
  height: 28px;
  width: auto;
  flex-shrink: 0;
}

.header-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── 6. TOOLBAR & FILTER ── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0;
  flex-shrink: 0;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border2);
  margin-bottom: 0.4rem;
}

/* Toolbar als horizontaler Balken (missions.html) */
.toolbar-bar {
  padding: 0.55rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.filter-wrap {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  flex: 1;
  min-width: 80px;
  border-radius: var(--radius-sm);
}

.filter-wrap input {
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.78rem;
  font-family: inherit;
  width: 100%;
  outline: none;
}

.filter-wrap input::placeholder { color: var(--muted); }

.toolbar-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── 7. PANEL-SYSTEM ── */
main.panel-layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  padding: 0.7rem 1rem;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.panel:last-child {
  border-right: none;
}

.panel-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.5rem;
  white-space: nowrap;
}

.panel-scrollable {
  flex: 1;
  overflow-y: auto;
}

/* ── 8. CARDS & DISPATCH-CARDS ── */

/* Generische Card (login.html) */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 360px;
}

/* Dispatch-Cards (streife.html, technik.html) */
.dispatch-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.dispatch-card:last-child { margin-bottom: 0; }

.dc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.dc-door {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.dc-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.dc-note {
  font-size: 0.82rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.6rem;
  word-break: break-word;
  border-radius: var(--radius-sm);
}

.dc-defect {
  font-size: 0.82rem;
  background: var(--red-bg);
  border: 1px solid var(--red-bdr);
  color: var(--red);
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.6rem;
  word-break: break-word;
  border-radius: var(--radius-sm);
}

.dc-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* ── 9. STATUS-BADGES & TYP-BADGES ── */

/* Basis */
.status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* Dispatch-Status (.sb-*) */
.sb-pending   { background: var(--yellow-bg);  color: var(--yellow);  border-color: var(--yellow-bdr); }
.sb-accepted  { background: var(--green-bg);   color: var(--green);   border-color: var(--green-bdr); }
.sb-done      { background: var(--done-bg);    color: var(--done);    border-color: var(--done-bdr); }
.sb-cancelled { background: var(--surface2);   color: var(--muted);   border-color: var(--border); }

/* Missions-Status (.st-*) */
.st-pending    { background: var(--yellow-bg);  color: var(--yellow);   border-color: var(--yellow-bdr); }
.st-accepted   { background: var(--accent-bg);  color: var(--accent);   border-color: var(--accent-logo); }
.st-active     { background: var(--green-bg);   color: var(--green);    border-color: var(--green-bdr); }
.st-done       { background: var(--green-bg);   color: var(--green);    border-color: var(--green-bdr); }
.st-cancelled  { background: none;              color: var(--muted);    border-color: var(--border); }
.st-forwarded  { background: var(--vs-bg);      color: var(--vs-text);  border-color: var(--vs-border); }
.st-resolved   { background: var(--done-bg);    color: var(--done);     border-color: var(--done-bdr); }
.st-yellow     { background: var(--yellow-bg);  color: var(--yellow);   border-color: var(--yellow-bdr); }
.st-green      { background: var(--green-bg);   color: var(--green);    border-color: var(--green-bdr); }
.st-warning    { background: var(--warn-bg);    color: var(--warn);     border-color: var(--warn-bdr); }

/* Kommunikations-Status */
.st-komm-lost    { background: var(--red-bg);    color: var(--red);    border-color: var(--red-bdr); }
.st-komm-back    { background: var(--green-bg);  color: var(--green);  border-color: var(--green-bdr); }
.st-komm-restart { background: var(--yellow-bg); color: var(--yellow); border-color: var(--yellow-bdr); }

/* Offline-Badge */
.status-offline {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-bdr);
  padding: 0.05rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Tür-Status-Farben (Textfarben in Türlisten) */
.status-open    { color: var(--yellow); font-weight: 700; }
.status-alert   { color: var(--red);    font-weight: 700; }
.status-closed  { color: var(--green); }
.status-unknown { color: var(--muted); }

/* Typ-Badges (missions.html) */
.type-badge {
  font-size: 0.61rem;
  font-weight: 700;
  padding: 0.07rem 0.32rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.tb-dispatch { background: var(--accent-bg);  color: var(--accent);   border-color: var(--accent-logo); }
.tb-defekt   { background: var(--red-bg);     color: var(--red);      border-color: var(--red-bdr); }
.tb-technik  { background: var(--vs-bg);      color: var(--vs-text);  border-color: var(--vs-border); }
.tb-komm     { background: var(--warn-bg);    color: var(--warn);     border-color: var(--warn-bdr); }
.tb-manuell  { background: var(--surface2);   color: var(--muted);    border-color: var(--border); }

/* Rollen-Badges (admin.html) */
.role-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.08rem 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid;
  border-radius: var(--radius-sm);
  display: inline-block;
  white-space: nowrap;
}

.role-admin           { background: var(--accent-bg);  color: #0550ae;        border-color: var(--accent-logo); }
.role-alarm-operator  { background: var(--green-bg);   color: var(--green);   border-color: var(--green-bdr); }
.role-system-operator { background: var(--vs-bg);      color: var(--vs-text); border-color: var(--vs-border); }
.role-streife         { background: var(--yellow-bg);  color: var(--yellow);  border-color: var(--yellow-bdr); }
.role-technik         { background: var(--warn-bg);    color: var(--warn);    border-color: var(--warn-bdr); }

/* ── 10. BUTTONS ── */

/* Ghost-Button (Standard-Outline) */
.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: inherit;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  line-height: 1.4;
  transition: border-color .15s, color .15s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }

/* Primär (filled blau) */
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  transition: background .15s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Erfolg (grün) */
.btn-success {
  background: var(--green);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.4rem 0.9rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  transition: background .15s;
}
.btn-success:hover { background: #1f9142; }

/* Danger-Hover */
.btn-danger:hover { border-color: var(--red); color: var(--red); }

/* Header-Buttons */
.btn-hdr {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: inherit;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.btn-hdr:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* Kleine Action-Buttons in Listen/Tabellen */
.btn-sm {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }

/* Link-Button (reiner Text) */
.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  text-decoration: underline;
}
.btn-link:hover { color: var(--accent-hover); }

/* Volle Breite */
.btn-block { width: 100%; justify-content: center; }

/* View-Switcher */
.view-switcher {
  display: none;
  border: 1px solid var(--vs-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.view-switcher.visible { display: flex; }

.btn-view-switch {
  background: none;
  border: none;
  color: var(--vs-text);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.6rem;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.btn-view-switch.active { background: var(--vs-bg); }
.btn-view-switch:hover  { background: var(--vs-bg); }

/* ── 11. FORMULARE & INPUTS ── */
label {
  display: block;
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

input[type="email"],
input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  padding: 0.4rem 0.65rem;
  outline: none;
  font-family: inherit;
  border-radius: var(--radius-sm);
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}

input[type="email"]:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(9,105,218,.15);
}

input::placeholder,
textarea::placeholder { color: var(--muted); }
input[type="checkbox"] { accent-color: var(--accent); }

textarea { resize: vertical; min-height: 80px; }

.field { margin-bottom: 1rem; }
.form-field { display: flex; flex-direction: column; gap: 0.2rem; }

/* Datei-Upload */
.upload-area {
  border: 2px dashed var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: border-color .15s;
}
.upload-area:hover { border-color: var(--accent); color: var(--accent); }

/* ── 12. TABELLEN ── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

thead tr {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
}

th {
  text-align: left;
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.45rem 0.75rem;
  white-space: nowrap;
}

td {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border2);
  vertical-align: middle;
}

tbody tr:hover { background: var(--surface2); }

/* ── 13. MODALS & OVERLAYS ── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(31,35,40,0.45);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-overlay);
}

.modal-title {
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.modal-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.btn-modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  line-height: 1;
  border-radius: var(--radius-sm);
}
.btn-modal-close:hover { color: var(--text); background: var(--surface2); }

.btn-modal-primary {
  flex: 1;
  background: var(--accent);
  color: #ffffff;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.btn-modal-primary:hover { background: var(--accent-hover); }
.btn-modal-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-modal-secondary {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--radius-sm);
}
.btn-modal-secondary:hover { border-color: var(--muted); color: var(--text); }

/* Bottom-Sheet (mobil) */
.modal-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 1rem;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 310;
  box-shadow: var(--shadow-overlay);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border2);
}

/* ── 14. TAB-NAVIGATION ── */
.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.tab-nav-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-family: inherit;
  padding: 0.65rem 1.25rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s;
  margin-bottom: -1px;
}
.tab-nav-btn:hover { color: var(--text); }
.tab-nav-btn.active { color: var(--text); border-bottom-color: var(--accent); }

.tab-content { display: none; flex: 1; }
.tab-content.active { display: block; }

/* ── 15. VERBINDUNGS-INDIKATOREN ── */

/* Salto-Verbindungs-Chip */
.conn-chip {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.conn-chip.ok  { color: var(--green);  border-color: var(--green-bdr);  background: var(--green-bg); }
.conn-chip.err { color: var(--red);    border-color: var(--red-bdr);    background: var(--red-bg); }
.conn-chip .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.conn-chip.ok .dot { animation: blink 2.5s infinite; }

/* Salto-Status-Badge (admin.html) */
.salto-status {
  font-size: 0.75rem;
  padding: 0.22rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.salto-status.ok    { color: var(--green);  border-color: var(--green-bdr); background: var(--green-bg); }
.salto-status.err   { color: var(--red);    border-color: var(--red-bdr);   background: var(--red-bg); }
.salto-status.muted { color: var(--muted); }

/* Kommunikations-Dot in Türlisten */
.comm-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.comm-dot.online    { background: var(--green); }
.comm-dot.offline   { background: var(--red); }
.comm-dot.uncertain { background: var(--yellow-bdr); }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── 16. NACHRICHTEN ── */
.msg {
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  display: none;
  border-radius: var(--radius-sm);
}
.msg-err,   .error-msg   { background: var(--red-bg);   border: 1px solid var(--red-bdr);   color: var(--red);   }
.msg-ok,    .success-msg { background: var(--green-bg); border: 1px solid var(--green-bdr); color: var(--green); }

/* ── 17. LEER- / LADEZUSTÄNDE ── */
.state-msg {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 3rem 1rem;
}

.empty-hint {
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.4rem 0.2rem;
  font-style: italic;
}

/* ── 18. ICONS ── */
.icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }
.icon-xl { width: 24px; height: 24px; }

/* ── 19. RESPONSIVE ── */
@media (max-width: 768px) {
  header { padding: 0.55rem 0.85rem; }

  main.panel-layout { flex-direction: column; }

  .panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .panel:last-child { border-bottom: none; }

  .modal { max-width: 100%; }

  .toolbar-bar { padding: 0.5rem 0.85rem; }
}

@media (max-width: 480px) {
  body { font-size: 15px; }
  .card { padding: 1.25rem; }
}

@media print {
  header, .toolbar, .toolbar-bar, .btn-ghost, .btn-hdr, .btn-sm { display: none !important; }
  body { background: white !important; color: black !important; }
  .dispatch-card { box-shadow: none !important; border: 1px solid #ccc !important; }
}

/* ── 20. DARK MODE ── */
[data-theme="dark"] {
  /* Hintergründe */
  --bg:       #0d1117;
  --surface:  #161b22;
  --surface2: #1c2330;
  --surface3: #0a0e14;

  /* Rahmen */
  --border:  #30363d;
  --border2: #1a1f27;

  /* Text */
  --text:   #e6edf3;
  --muted:  #7d8590;
  --subtle: #444d56;

  /* Primär-Akzent */
  --accent:       #58a6ff;
  --accent-hover: #79b8ff;
  --accent-bg:    #0d1f38;
  --accent-logo:  #58a6ff;

  /* Status: Warnung / Offen (gelb) */
  --yellow:     #e3b341;
  --yellow-bg:  #2d1f04;
  --yellow-bdr: #9e6a03;

  /* Status: Alarm / Offline / Fehler (rot) */
  --red:     #ff7b7b;
  --red-bg:  #2d0f0e;
  --red-bdr: #6e1b1b;

  /* Status: OK / Aktiv / Geschlossen (grün) */
  --green:     #3fb950;
  --green-bg:  #0f2d16;
  --green-bdr: #238636;

  /* Status: Defekt / Orange */
  --warn:     #f5a623;
  --warn-bg:  #2d1c00;
  --warn-bdr: #7d5200;

  /* Status: Pending / Offen (amber) */
  --pend-bg:  #2d1f04;
  --pend-bdr: #9e6a03;

  /* Status: Erledigt */
  --ok:       #4eda62;
  --ok-bg:    #163e25;
  --ok-bdr:   #2ea843;
  --done:     #2d6e3c;
  --done-bg:  #0a140e;
  --done-bdr: #163d1e;

  /* View-Switcher / Technik-Rolle (lila) */
  --vs-border: #6e4db4;
  --vs-bg:     #1e1a2e;
  --vs-text:   #b07bf8;

  /* Row-Highlight-Farben */
  --row-open-bg:      #12100a;
  --row-uncertain-bg: #12110a;
  --row-offline-bg:   #180d0d;

  /* Schatten */
  --shadow-sm:      0 1px 3px rgba(0,0,0,.4), 0 0 1px rgba(0,0,0,.3);
  --shadow-md:      0 3px 12px rgba(0,0,0,.5);
  --shadow-overlay: 0 16px 48px rgba(0,0,0,.65);
}

/* Theme-Toggle-Button */
.btn-theme-toggle {
  font-size: 1rem;
  line-height: 1;
  padding: 0.22rem 0.5rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  user-select: none;
}
