:root {
  /* INV Verkehrstechnik – Markenfarben: Grau #969696, Signalrot #dc0014 */
  --bg: #eef0f2;
  --panel: #ffffff;
  --panel-2: #f5f6f7;
  --line: #e2e4e7;
  --text: #2c2f33;
  --muted: #7a7f85;
  --accent: #dc0014;
  --accent-hover: #b80011;
  --accent-soft: rgba(220, 0, 20, 0.10);
  --kunde: #1a7f37;
  --lieferant: #9a6b00;
  --danger: #c20016;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(20, 22, 25, 0.12);
}

* { box-sizing: border-box; }
/* hidden-Attribut muss display-Regeln (grid/flex) ausstechen, sonst bleiben Modal & Ansichten sichtbar */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---- App-Shell mit beschrifteter Seitenleiste ---- */
.app-shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.brand-logo { height: 40px; width: auto; display: block; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: #ffffff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-width: 0; z-index: 40;
}
.sidebar-brand { padding: 18px 16px 14px; border-bottom: 1px solid var(--line); display: flex; }
.sidebar-brand .brand-logo { width: 150px; height: auto; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; padding: 12px; flex: 1; overflow-y: auto; }
.nav-btn {
  display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 13px; width: 100%; text-align: left;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  padding: 11px 14px; min-height: 48px; border-radius: 10px; font-weight: 600; font-size: 14px;
}
.nav-btn svg { width: 22px; height: 22px; flex: none; }
.nav-btn:hover { background: var(--panel-2); color: var(--text); }
.nav-btn.is-active { background: var(--accent); color: #fff; }
.sidebar-foot { border-top: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.user-box { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px;
}
.user-meta { min-width: 0; }
.user-meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { color: var(--muted); font-size: 12px; }
.sidebar-foot .btn { font-size: 13px; min-height: 42px; width: 100%; }
.sidebar-backdrop { display: none; }

.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  background: #ffffff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 19px; font-weight: 700; margin: 0; flex: 1; min-width: 0; }
.sidebar-toggle { display: none; }
.app-content { flex: 1; }

/* ---- Layout (innerhalb des Inhaltsbereichs) ---- */
.layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 16px;
  padding: 16px;
  max-width: 1500px;
  margin: 0 auto;
}
.layout-single { max-width: 1100px; margin: 0 auto; padding: 16px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.list-panel { padding: 14px; }
.detail-panel { min-height: 60vh; }

/* Kontakte-Werkzeugleiste (Suche + Filter in einer Reihe) */
.firm-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.firm-toolbar #search { flex: 1; min-width: 200px; }
.firm-toolbar .filterbar { margin-bottom: 0; }
.firm-tag-sel { width: auto; min-width: 150px; }

/* ---- Kennzahlen als kompakte Chip-Zeile ---- */
.stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.stat-chip {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 11px; font-size: 12px; color: var(--muted); white-space: nowrap;
}
.stat-chip b { color: var(--text); font-weight: 700; margin-right: 3px; }

/* ---- Controls ---- */
.controls { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.input, .seg-btn, .btn, select, textarea {
  font: inherit; color: var(--text);
}
.input, select, textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; outline: none;
}
.input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.seg { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; gap: 4px; }
.seg-btn {
  flex: 1; min-height: 40px; border: 0; background: transparent; color: var(--muted);
  border-radius: 7px; cursor: pointer; font-weight: 600;
}
.seg-btn.is-active { background: var(--accent); color: #fff; }

/* ---- Firmenliste ---- */
.firm-list { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow: auto; }
.firm-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; cursor: pointer; min-height: 56px;
}
.firm-card:hover { border-color: var(--accent); }
.firm-card.is-active { border-color: var(--accent); background: var(--accent-soft); }
.firm-card .tag { flex: none; }
.firm-card .meta { min-width: 0; flex: 1; }
.firm-card .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.firm-card .meta small { color: var(--muted); }

.tag {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.tag.kunde { color: var(--kunde); background: rgba(63, 185, 80, .14); }
.tag.lieferant { color: var(--lieferant); background: rgba(210, 153, 34, .14); }
.tag.inaktiv { color: var(--muted); background: #e9ebee; }

/* ---- Detail ---- */
.detail { padding: 20px; }
.empty { display: grid; place-items: center; min-height: 50vh; color: var(--muted); padding: 24px; text-align: center; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.detail-head h2 { margin: 0 0 6px; }
.detail-head .sub { color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 16px; overflow-x: auto; }
.tab {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  padding: 10px 14px; min-height: 44px; border-bottom: 2px solid transparent; font-weight: 600; white-space: nowrap;
}
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }

.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field { min-width: 0; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.field .val { word-break: break-word; }
.field.full { grid-column: 1 / -1; }
.section-title { margin: 22px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }

/* ---- Listenelemente in Detail ---- */
.row-item {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 8px;
}
.row-item .ri-main { min-width: 0; }
.row-item .ri-main b { display: block; }
.row-item .ri-main small { color: var(--muted); }
.row-item .ri-actions { display: flex; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; margin-bottom: 12px; transition: border-color .15s, background .15s; }
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.busy { opacity: .6; pointer-events: none; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #e9ebee; color: var(--muted); }
button.pill-link { border: 1px solid var(--line); cursor: pointer; font: inherit; font-size: 11px; min-height: auto; }
button.pill-link:hover, a.pill-link:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
a.pill-link { text-decoration: none; color: var(--muted); }
a.link { color: var(--accent); text-decoration: none; word-break: break-word; }
a.link:hover { text-decoration: underline; }
.af-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.af-filter .input, .af-filter select { width: auto; min-width: 150px; }
.af-filter .af-date { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.af-filter .af-date .input { min-width: 150px; }
.daybars { display: flex; gap: 6px; align-items: flex-end; overflow-x: auto; padding-top: 8px; }
.daybar { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 26px; }
.daybar-fill { width: 20px; background: var(--accent); border-radius: 5px 5px 0 0; }
.daybar small { color: var(--muted); font-size: 10px; white-space: nowrap; }

/* ---- Buttons ---- */
.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  border-radius: 10px; padding: 10px 14px; min-height: 44px; cursor: pointer; font-weight: 600;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger); }
.btn-sm { min-height: 38px; padding: 7px 11px; font-size: 13px; }
.btn-icon { background: none; border: 0; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; min-width: 44px; min-height: 44px; }
.inline-form { display: grid; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; }

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: grid; place-items: center; z-index: 50; padding: 16px;
}
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  width: 100%; max-width: 720px; max-height: 90vh; display: flex; flex-direction: column;
}
.modal-head, .modal-foot { padding: 14px 18px; display: flex; align-items: center; }
.modal-head { justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 18px; overflow: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.modal-foot { justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
.form-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 12px; color: var(--muted); }
.form-field .req { color: var(--danger); }
.group-title { grid-column: 1 / -1; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--accent); margin-top: 6px; }

/* ---- Horizontale Filterleiste (Pillen, eine Reihe, scrollbar) ---- */
.filterbar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 12px; scrollbar-width: thin; }
.filterbar .seg-btn {
  flex: 0 0 auto; min-height: 40px; padding: 8px 16px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--panel-2); color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap;
}
.filterbar .seg-btn:hover { border-color: var(--accent); }
.filterbar .seg-btn.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-sep { flex: 0 0 auto; width: 1px; align-self: stretch; background: var(--line); margin: 2px 4px; }

/* Tags */
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; color: #fff; white-space: nowrap;
}
.tag-chip .x { cursor: pointer; opacity: .8; font-weight: 700; }
.tag-chip .x:hover { opacity: 1; }
.tag-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }

/* Art-Badges: Angebot / Auftrag */
.art-angebot { color: #1d5fc4; background: rgba(47, 129, 247, .14); }
.art-auftrag { color: #1a7f37; background: rgba(26, 127, 55, .14); }
.auf-offen { color: #9a6b00; background: rgba(210, 153, 34, .16); }
.auf-abgeschlossen { color: #5f6671; background: #e9ebee; }

/* ---- Daten-Tabelle (volle Breite) ---- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: var(--panel-2); }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .t-title { font-weight: 600; }
.data-table .t-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---- Aufklappbare Spaltenköpfe (Sortieren/Filtern) ---- */
.data-table th { position: relative; }
.th-head { display: inline-flex; align-items: center; gap: 4px; }
.th-caret {
  border: 0; background: transparent; cursor: pointer; color: var(--muted);
  font-size: 11px; line-height: 1; padding: 4px 6px; border-radius: 6px; min-height: 24px;
}
.th-caret:hover { background: var(--panel-2); color: var(--text); }
.th-caret.is-active { color: var(--accent); }
.th-menu {
  display: none; position: absolute; top: 100%; left: 6px; z-index: 40; margin-top: 4px;
  min-width: 200px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 6px; text-align: left;
}
.lex-note { font-size: 12px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; white-space: nowrap; align-self: flex-start; }
.th-sort { border: 0; background: transparent; cursor: pointer; font: inherit; font-weight: 600; color: var(--muted); padding: 0; text-transform: inherit; letter-spacing: inherit; white-space: nowrap; }
.th-sort:hover { color: var(--text); }
.th-sort.is-active { color: var(--accent); }
.th-menu.right { left: auto; right: 6px; }
.th-menu.open { display: block; }
.th-menu-item {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 9px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text);
  font-weight: 500; white-space: nowrap; min-height: 40px;
}
.th-menu-item:hover { background: var(--panel-2); }
.th-menu-item.is-active { color: var(--accent); font-weight: 600; }
.th-menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* ---- Vorgänge: Status-Badges ---- */
.seg-wrap { flex-wrap: wrap; }
.seg-wrap .seg-btn { flex: 1 1 auto; min-width: 84px; }
.st {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap; display: inline-block;
}
.st-entwurf { color: #5f6671; background: #e9ebee; }
.st-wartet_freigabe { color: #9a6b00; background: rgba(210, 153, 34, .16); }
.st-freigegeben { color: #1d5fc4; background: rgba(47, 129, 247, .14); }
.st-versendet { color: #6a36c0; background: rgba(122, 63, 208, .14); }
.st-gewonnen { color: #1a7f37; background: rgba(26, 127, 55, .14); }
.st-verloren { color: #c20016; background: rgba(220, 0, 20, .12); }

/* Reklamations-Status & Priorität */
.rk-neu { color: #1d5fc4; background: rgba(47, 129, 247, .14); }
.rk-in_bearbeitung { color: #9a6b00; background: rgba(210, 153, 34, .16); }
.rk-geloest { color: #1a7f37; background: rgba(26, 127, 55, .14); }
.rk-abgelehnt { color: #c20016; background: rgba(220, 0, 20, .12); }
.rk-geschlossen { color: #5f6671; background: #e9ebee; }
.prio { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.prio-niedrig { color: #5f6671; background: #e9ebee; }
.prio-mittel { color: #9a6b00; background: rgba(210, 153, 34, .16); }
.prio-hoch { color: #c20016; background: rgba(220, 0, 20, .12); }
.komment { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.komment .k-meta { color: var(--muted); font-size: 12px; margin-bottom: 3px; }

.vg-amount { font-variant-numeric: tabular-nums; font-weight: 700; }
.vg-nr { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; color: var(--muted); font-size: 12px; }

/* Positionstabelle */
.pos-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.pos-table th, .pos-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.pos-table th { color: var(--muted); font-size: 12px; font-weight: 600; }
.pos-table td.num, .pos-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos-table tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
.pos-wrap { overflow-x: auto; }

/* Aufmaß-Eingabetabelle */
.am-table td { padding: 4px; }
.am-table input { width: 100%; padding: 7px 8px; border-radius: 8px; }
.am-table input[type='number'] { min-width: 68px; }
.am-table td:first-child input { min-width: 130px; }
.am-table th { white-space: nowrap; }

/* Freigabe-Hinweis */
.notice { border-radius: 10px; padding: 12px 14px; margin: 4px 0 14px; border: 1px solid var(--line); background: var(--panel-2); }
.notice.warn { border-color: var(--lieferant); background: rgba(210, 153, 34, .08); }
.notice.ok { border-color: var(--kunde); background: rgba(63, 185, 80, .08); }
.notice b { display: block; margin-bottom: 2px; }

.action-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }

/* Reporting */
.report-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.kpi b { display: block; font-size: 26px; line-height: 1.1; }
.kpi span { color: var(--muted); font-size: 12px; }
.report-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: center; margin-bottom: 8px; }
.bar-track { background: #e9ebee; border-radius: 6px; height: 12px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 6px; }
.report-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.report-card h3 { margin: 0 0 14px; font-size: 15px; }
.settings-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }

/* ---- Benachrichtigungen (Glocke) ---- */
.notif-wrap { position: relative; }
.notif-bell { position: relative; color: var(--muted); }
.notif-bell:hover { color: var(--text); }
.notif-bell svg { width: 22px; height: 22px; }
.notif-badge {
  position: absolute; top: 4px; right: 4px; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.notif-panel {
  position: absolute; right: 0; top: 50px; width: 330px; max-width: 92vw;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); z-index: 55; overflow: hidden;
}
.notif-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 700; }
.notif-list { max-height: 60vh; overflow: auto; }
.notif-item { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 11px 12px; cursor: pointer; }
.notif-item:hover { background: var(--panel-2); }
.notif-item.unread { background: rgba(220, 0, 20, .05); }
.notif-item b { display: block; font-size: 13px; margin-bottom: 2px; }
.notif-item small { color: var(--muted); display: block; }

/* ---- Benutzer-Chip ---- */
.user-chip { color: var(--muted); font-weight: 600; font-size: 13px; line-height: 1.3; }
.user-chip b { color: var(--text); display: block; }

/* ---- Login ---- */
.login-screen {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: var(--bg); padding: 16px;
}
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 28px; width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-logo { height: 56px; align-self: center; }
.login-card h1 { font-size: 18px; margin: 0; text-align: center; }
.login-error { color: var(--danger); font-size: 13px; margin: 0; text-align: center; }
.login-hint { color: var(--muted); font-size: 12px; margin: 4px 0 0; text-align: center; }
.role-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.role-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 13px; min-height: 36px; }
.role-pill input { width: 16px; height: 16px; }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); z-index: 80; max-width: 92vw;
}
.toast.err { border-color: var(--danger); }

/* ---- Mobile ---- */
@media (max-width: 1000px) {
  .report-grid { grid-template-columns: repeat(2, 1fr); }
  .report-cols { grid-template-columns: 1fr; }
}
/* Auf kleinen Phones: schmale Icon-Leiste (nur Icons) */
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 66px 1fr; }
  .sidebar-brand { justify-content: center; padding: 12px 6px; }
  .sidebar-brand .brand-logo { width: 46px; }
  .nav-btn { flex-direction: column; justify-content: center; gap: 5px; padding: 9px 4px; font-size: 10px; text-align: center; min-height: 54px; }
  .user-meta { display: none; }
  .sidebar-foot { align-items: center; }
  .user-box { justify-content: center; }
  .sidebar-foot .btn { font-size: 0; }
  .sidebar-foot .btn::after { content: 'Abmelden'; font-size: 10px; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .detail-panel { display: none; }
  body.detail-open .list-panel { display: none; }
  body.detail-open .detail-panel { display: block; }
  .fields, .modal-body { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .bar-row { grid-template-columns: 110px 1fr auto; }
}

/* iOS: kein Zoom beim Fokus auf Eingaben */
@media (max-width: 1023px) {
  input:not([type='button']):not([type='submit']):not([type='reset']):not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']):not([type='color']),
  textarea, select { font-size: 16px; }
}
