/* IMO App – Designsystem (D14, Designsprache 20.11.2026).
   Tannengrün als einzige Akzentfarbe, Messing nur als feine Linie und Auszeichnung.
   Kompakt und informationsdicht, feine Linien statt Schatten, Dunkelmodus.
   Bewusst anders als EDU (dunkle Seitenleiste, Limette, Pillen) und GZL (Petrol, Bernstein). */

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/inter/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500 600; font-style: normal; font-display: swap;
  src: url("../fonts/inter/Inter-Medium.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-2: #f8faf7;
  --hover: #eef3ef;
  --line: #dce3dc;
  --line-strong: #c3cec5;
  --text: #17211c;
  --muted: #5a6a61;
  --faint: #8a988f;
  --accent: #1d4433;          /* Tannengrün */
  --accent-hover: #15342a;
  --accent-soft: #e2ece6;
  --on-accent: #f4f7f4;
  --brass: #b08f55;           /* Messing: Linien, Auszeichnung */
  --brass-text: #7a5c2b;      /* Messing als Text (Kontrast ausreichend) */
  --brass-soft: #f4ede0;
  --ok: #2f7a4d;    --ok-soft: #e4f1e8;
  --warn: #9a6512;  --warn-soft: #f8eedb;
  --bad: #ad3b33;   --bad-soft: #f8e5e3;
  --info: #3a6580;  --info-soft: #e3edf3;
  --radius: 4px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs: 13px;
  --fs-s: 12px;
  --fs-xs: 11px;
  --row: 26px;
  --header-h: 46px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1512; --surface: #141d19; --surface-2: #19241f; --hover: #1f2c26;
    --line: #26342d; --line-strong: #33453c; --text: #e3eae5; --muted: #9babA1; --faint: #6f8076;
    --accent: #6fae8c; --accent-hover: #86c0a1; --accent-soft: #1d2f27; --on-accent: #0c1410;
    --brass: #c6a46a; --brass-text: #d4b47c; --brass-soft: #2a2418;
    --ok: #6cbf8c; --ok-soft: #17291f; --warn: #d9a548; --warn-soft: #2c2414;
    --bad: #e07a70; --bad-soft: #2f1a18; --info: #7fb0cf; --info-soft: #172530;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1512; --surface: #141d19; --surface-2: #19241f; --hover: #1f2c26;
  --line: #26342d; --line-strong: #33453c; --text: #e3eae5; --muted: #9baba1; --faint: #6f8076;
  --accent: #6fae8c; --accent-hover: #86c0a1; --accent-soft: #1d2f27; --on-accent: #0c1410;
  --brass: #c6a46a; --brass-text: #d4b47c; --brass-soft: #2a2418;
  --ok: #6cbf8c; --ok-soft: #17291f; --warn: #d9a548; --warn-soft: #2c2414;
  --bad: #e07a70; --bad-soft: #2f1a18; --info: #7fb0cf; --info-soft: #172530;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs)/1.45 var(--font);
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
.num, td.num, .kpi-value, .tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { font-weight: 500; margin: 0; letter-spacing: -0.005em; }
h1 { font-size: 18px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; }
p { margin: 0 0 8px; }
code { font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); padding: 0 4px; border-radius: 3px; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-s); }
.xs { font-size: var(--fs-xs); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 16px; height: 16px; flex: none; vertical-align: -3px; stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- Kopfzeile */
.hdr { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.hdr-in { display: flex; align-items: center; gap: 18px; height: var(--header-h); padding: 0 16px; max-width: 1680px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.brand:hover { text-decoration: none; }
.brand svg { height: 22px; width: auto; display: block; }
.brand-sub { font-size: var(--fs-xs); color: var(--brass-text); letter-spacing: 0.08em; text-transform: uppercase; border-left: 1px solid var(--line); padding-left: 8px; }
.tabs { display: flex; align-self: stretch; gap: 2px; margin-left: 8px; }
.tabs a { display: flex; align-items: center; gap: 6px; padding: 0 10px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { color: var(--text); text-decoration: none; background: var(--hover); }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--brass); }
.hdr-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.search { position: relative; }
.search input[type=search] { width: 220px; height: 28px; padding: 0 8px 0 28px; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius); color: var(--text); font: inherit; }
.search input[type=search]:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.search svg { position: absolute; left: 8px; top: 6px; color: var(--faint); }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 6px; border: 1px solid transparent; border-radius: var(--radius); background: none; color: var(--muted); cursor: pointer; font: inherit; }
.iconbtn:hover { background: var(--hover); color: var(--text); }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lang button { border: 0; background: none; padding: 0 7px; height: 26px; font: 500 var(--fs-xs) var(--font); color: var(--muted); cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.usermenu { position: relative; }
.usermenu > summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 2px 6px; border-radius: var(--radius); }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover { background: var(--hover); }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font: 500 11px var(--font); border: 1px solid var(--line); }
.menu { position: absolute; right: 0; top: calc(100% + 4px); min-width: 240px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 4px; z-index: 40; }
.menu a, .menu button { display: flex; width: 100%; gap: 8px; align-items: center; padding: 6px 8px; color: var(--text); border: 0; background: none; font: inherit; cursor: pointer; text-align: left; border-radius: 3px; }
.menu a:hover, .menu button:hover { background: var(--hover); text-decoration: none; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu .menu-head { padding: 6px 8px; color: var(--muted); font-size: var(--fs-s); }

.band { font-size: var(--fs-s); padding: 3px 16px; display: flex; gap: 8px; align-items: center; justify-content: center; }
.band-test { background: var(--brass-soft); color: var(--brass-text); border-bottom: 1px solid var(--line); }
.band-viewas { background: var(--info-soft); color: var(--info); border-bottom: 1px solid var(--line); }
.band form { display: inline; }

/* -------------------------------------------------------------------- Seite */
.page { max-width: 1680px; margin: 0 auto; padding: 12px 16px 72px; }
.pagehead { display: flex; align-items: center; gap: 12px; min-height: 32px; margin-bottom: 10px; }
.pagehead .crumb { color: var(--muted); font-size: var(--fs-s); }
.pagehead .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid-main { grid-template-columns: minmax(0, 1fr) 340px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-h { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line); min-height: 34px; }
.card-h h2 { font-size: 13px; }
.card-h .tools { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.card-b { padding: 8px 10px; }
.card-b.flush { padding: 0; }
details.fold > summary { list-style: none; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .chev { transition: transform .15s; color: var(--faint); }
details.fold[open] > summary .chev { transform: rotate(90deg); }

/* Kennzahlenleiste: schmal, nur Werte, die etwas zu zeigen haben (dynamisch) */
.kpis { display: flex; flex-wrap: wrap; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.kpi { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi .i { color: var(--brass); }
.kpi-value { font-weight: 500; font-size: 15px; }
.kpi-label { color: var(--muted); font-size: var(--fs-s); }
.kpi.is-warn .kpi-value { color: var(--warn); }
.kpi.is-bad .kpi-value { color: var(--bad); }

/* ------------------------------------------------------------------ Knöpfe */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font: 500 var(--fs) var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--accent); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--hover); border-color: var(--accent); }
.btn-ghost { background: none; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--hover); color: var(--text); border-color: transparent; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-sm { height: 24px; padding: 0 8px; font-size: var(--fs-s); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------------- Formular */
.form { max-width: 640px; }
.field { display: grid; gap: 3px; margin-bottom: 10px; }
.field label { font-size: var(--fs-s); color: var(--muted); font-weight: 500; }
.field .hint { font-size: var(--fs-xs); color: var(--faint); }
.field .err { font-size: var(--fs-s); color: var(--bad); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; width: 100%; }
textarea { height: auto; min-height: 70px; padding: 6px 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin: 0 0 10px; }
legend { font-size: var(--fs-s); color: var(--brass-text); padding: 0 4px; }

/* ---------------------------------------------------------------- Hinweise */
.notice { padding: 7px 10px; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 10px; background: var(--surface); }
.notice-success { border-color: var(--ok); background: var(--ok-soft); }
.notice-error { border-color: var(--bad); background: var(--bad-soft); }
.notice-warning { border-color: var(--warn); background: var(--warn-soft); }
.notice-info { border-color: var(--info); background: var(--info-soft); }
.messages { margin-bottom: 10px; }

/* Status: kleine Symbole mit sparsamer Ampel, Erklärung im Tooltip */
.st { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; }
.st svg.i { width: 14px; height: 14px; }
.st-ok { color: var(--ok); background: var(--ok-soft); }
.st-warn { color: var(--warn); background: var(--warn-soft); }
.st-bad { color: var(--bad); background: var(--bad-soft); }
.st-info { color: var(--info); background: var(--info-soft); }
.st-off { color: var(--faint); background: var(--surface-2); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot-ok { background: var(--ok); } .dot-warn { background: var(--warn); } .dot-bad { background: var(--bad); }
.tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 3px; font-size: var(--fs-xs); border: 1px solid var(--line); color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.tag-brass { border-color: var(--brass); color: var(--brass-text); background: var(--brass-soft); }
.tag-accent { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.code { font-weight: 500; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: .01em; }

/* Tooltip über data-tip (jedes Symbol erklärt sich beim Überfahren) */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  background: var(--text); color: var(--surface); font: 400 var(--fs-xs)/1.35 var(--font); padding: 4px 7px; border-radius: 3px;
  white-space: pre; max-width: 320px; z-index: 50; pointer-events: none; }
[data-tip-pos="below"]:hover::after { bottom: auto; top: calc(100% + 6px); }
/* Hover-Info mit Inhalt (Aufschlüsselung, Vorschau) */
.hover { position: relative; }
.hover .pop { display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 45; min-width: 220px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 6px 8px; font-size: var(--fs-s); }
.hover:hover .pop, .hover:focus-within .pop { display: block; }

/* ---------------------------------------------------------------- Listen */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { border-bottom: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 0; }
.rows.link > li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px; }
.objrow > summary { display: grid; grid-template-columns: 16px 40px minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; padding: 6px 10px; cursor: pointer; list-style: none; }
.objrow > summary::-webkit-details-marker { display: none; }
.objrow > summary:hover { background: var(--hover); }
.thumb { width: 40px; height: 30px; border-radius: 3px; background: var(--accent-soft); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--accent); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.objrow .addr { min-width: 0; }
.objrow .addr b { font-weight: 500; }
.objrow .addr span { color: var(--muted); font-size: var(--fs-s); margin-left: 6px; }
.objrow .share { font-variant-numeric: tabular-nums; color: var(--brass-text); font-size: var(--fs-s); }
.objrow .detail { padding: 4px 10px 10px 76px; background: var(--surface-2); border-top: 1px dashed var(--line); }
.todo li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 10px; }
.empty { padding: 14px 10px; color: var(--faint); text-align: center; font-size: var(--fs-s); }

/* Einfache Tabelle (die Tabellenkomponente erweitert diese Regeln) */
table.t { width: 100%; border-collapse: collapse; font-size: var(--fs); }
table.t th { text-align: left; font-weight: 500; font-size: var(--fs-xs); color: var(--muted); text-transform: none; padding: 5px 8px; border-bottom: 1px solid var(--line-strong); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
table.t td { padding: 4px 8px; border-bottom: 1px solid var(--line); height: var(--row); vertical-align: middle; }
table.t tr:hover td { background: var(--hover); }
table.t td.num, table.t th.num { text-align: right; }

dl.kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 4px 12px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: var(--fs-s); }
dl.kv dd { margin: 0; }

/* ---------------------------------------------------------------- Anmeldung */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 22px 24px; }
.auth-card .brand { margin-bottom: 18px; }
.auth-card h1 { margin-bottom: 12px; }
.auth-card .btn { width: 100%; justify-content: center; height: 32px; }
.auth-foot { margin-top: 14px; display: flex; justify-content: space-between; color: var(--faint); font-size: var(--fs-xs); }

/* ---------------------------------------------------------------- Handy */
.mobnav { display: none; }
@media (max-width: 860px) {
  .tabs, .search, .brand-sub { display: none; }
  .grid-2, .grid-main { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 10px 10px 72px; }
  .mobnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); }
  .mobnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 8px; color: var(--muted); font-size: 10px; }
  .mobnav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 2px 0 var(--brass); }
  .objrow > summary { grid-template-columns: 16px minmax(0, 1fr) auto auto; }
  .objrow .thumb, .objrow .hide-m { display: none; }
  .objrow .detail { padding-left: 10px; }
  dl.kv { grid-template-columns: 120px minmax(0, 1fr); }
  /* Phase 3: viele Bereiche in der unteren Leiste wischen statt quetschen */
  .mobnav { overflow-x: auto; scrollbar-width: none; }
  .mobnav a { flex: 0 0 68px; white-space: nowrap; }
  .pagehead { flex-wrap: wrap; }
  .pagehead .actions { flex-wrap: wrap; margin-left: 0; }
  /* einfache Tabellen (ohne Tabellenkomponente) seitlich wischen */
  .card > table.t, .card-b > table.t { display: block; overflow-x: auto; white-space: nowrap; }
}

@media print {
  .hdr, .mobnav, .band, .pagehead .actions, .no-print { display: none; }
  body { background: #fff; }
  .card { border-color: #bbb; }
}
.codes { font: 500 15px/1.6 ui-monospace, Menlo, monospace; list-style: none; padding: 0; columns: 2; }
.qr img { background: #fff; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------------------------------------------------------- Tabellenkomponente */
.dt { overflow: visible; }
.dt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.dt-search { position: relative; }
.dt-search svg { position: absolute; left: 7px; top: 6px; color: var(--faint); }
.dt-search input[type=search] { height: 28px; width: 240px; padding-left: 26px; }
.dt-count { color: var(--muted); font-size: var(--fs-s); }
.dt-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font-size: var(--fs-s); background: var(--surface-2); }
.chip b { font-weight: 500; color: var(--text); }
.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip.is-on { border-color: var(--brass); background: var(--brass-soft); color: var(--brass-text); }
.dt-tools { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.dt-menu { position: relative; }
.dt-menu > summary { list-style: none; }
.dt-menu > summary::-webkit-details-marker { display: none; }
.dt-cols { min-width: 260px; max-height: 60vh; overflow: auto; }
.dt-col { display: flex; align-items: center; gap: 2px; padding: 1px 4px; }
.dt-col label { flex: 1; display: flex; gap: 6px; align-items: center; cursor: pointer; }
.dt-col .iconbtn { min-width: 22px; height: 22px; }
.dt-colbtns, .dt-saveview { display: flex; gap: 6px; padding: 4px; }
.dt-saveview input { height: 24px; }
.dt-scroll { overflow-x: auto; }
.dt-table th a.dt-sort { color: inherit; }
.dt-table th a.dt-sort.is-asc::after { content: " ↑"; color: var(--brass-text); }
.dt-table th a.dt-sort.is-desc::after { content: " ↓"; color: var(--brass-text); }
.dt-filters th { padding: 3px 4px; background: var(--surface); top: 25px; }
.dt-filters input, .dt-filters select { height: 24px; font-size: var(--fs-s); padding: 0 5px; min-width: 60px; }
.dt-table tr[data-href] { cursor: pointer; }
.dt-foot { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-top: 1px solid var(--line); }
.dt-foot select { height: 24px; width: auto; }
.dt-pager { margin-left: auto; display: flex; align-items: center; gap: 6px; }
body.wide .page { max-width: none; }
@media (max-width: 860px) {
  .dt-search input[type=search] { width: 100%; }
  .dt-table thead { display: none; }
  .dt-table, .dt-table tbody, .dt-table tr, .dt-table td { display: block; width: 100%; }
  .dt-table tr { border-bottom: 1px solid var(--line); padding: 6px 4px; }
  .dt-table td { border: 0; height: auto; padding: 1px 6px; display: flex; gap: 8px; text-align: left !important; }
  .dt-table td::before { content: attr(data-label); color: var(--muted); font-size: var(--fs-xs); min-width: 110px; }
  .dt-table td.hide-m { display: none; }
}

/* Grafikbereich der Startseite: schlichte Balken */
.bars { display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) 90px; gap: 8px; align-items: center; }
.bar { height: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.bar-row .num { text-align: right; }
.objrow .chev svg { transition: transform .15s; color: var(--faint); }
.objrow[open] .chev svg { transform: rotate(90deg); }
.objrow h3 { margin: 4px 0; font-weight: 500; }
.code, table.t td.num, table.t td.code { white-space: nowrap; }
.objrow .detail.grid-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.viewer { width: 100%; height: calc(100vh - 150px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

/* Monatsansicht der Fristen */
table.cal { table-layout: fixed; }
table.cal td { vertical-align: top; height: 86px; padding: 3px 4px; border-right: 1px solid var(--line); }
table.cal td.leer { background: var(--surface-2); }
table.cal td.heute { box-shadow: inset 0 2px 0 var(--brass); }
.tag-num { font-size: var(--fs-xs); color: var(--muted); }
.cal-item { font-size: var(--fs-xs); padding: 1px 4px; margin-top: 2px; border-left: 2px solid var(--line-strong); background: var(--surface-2); border-radius: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ueberfaellig { border-left-color: var(--bad); }
.cal-faellig { border-left-color: var(--warn); }
.cal-erledigt { opacity: .55; text-decoration: line-through; }
.todo li { align-items: center; } .todo li > span { flex: 1; } .todo li > span.st { flex: 0 0 20px; } .todo-act { margin-left: auto; }
.merkmal { display: flex; gap: 6px; align-items: center; padding: 2px 0; font-size: var(--fs); } fieldset legend .tag { margin-left: 6px; }

.fotos { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; }
.fotos img { height: 84px; border-radius: var(--radius); border: 1px solid var(--line); }
.fotos img.haupt { border-color: var(--brass); }
.foto-neu { display: flex; align-items: center; justify-content: center; width: 84px; height: 84px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); }

.subtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 10px; overflow-x: auto; }
.subtabs a { padding: 6px 10px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subtabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--brass); }
.subtabs a:hover { text-decoration: none; color: var(--text); }

/* Glocke mit Zähler (Phase 4) */
.bell { position: relative; }
.bell .badge { position: absolute; top: -3px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; line-height: 16px; text-align: center; font-weight: 500; }
.mailtext { white-space: pre-wrap; font-size: var(--fs); max-height: 420px; overflow: auto; }
.navmehr { align-self: center; }
.navmehr > summary { color: var(--muted); font-weight: 500; }
.navmehr > summary[aria-current="page"] { color: var(--accent); }
.menu-links { left: 0; right: auto; min-width: 200px; }
.menu-links a { display: flex; align-items: center; gap: 6px; padding: 6px 8px; color: var(--text); border-radius: var(--radius); }
.menu-links a:hover { background: var(--hover); text-decoration: none; }
