/* ==========================================================================
   SecWatch – Stylesheet
   Marke: #1B2F5E (Basis), #4A90D9 (Akzent), #00BCD4 (Hervorhebung, sparsam).
   Für Text auf hellem Grund wird das Akzentblau abgedunkelt (#2a6db5), weil #4A90D9
   auf Weiß nur 3,3:1 Kontrast hat; auf dunklem Grund aufgehellt (#7db3ec).
   Standard ist dunkel; data-theme="light" auf <html> schaltet auf hell.
   Abstände: 4 / 8 / 12 / 16 / 24 / 32 / 48 px. Ein Radius: 6 px.
   ========================================================================== */

:root,
:root[data-theme="dark"] {
  --brand: #1B2F5E;
  --accent: #4A90D9;
  --highlight: #00BCD4;

  --bg: #0a1120;
  --surface: #111a2d;
  --surface-2: #17233b;
  --sidebar: #0d1a38;
  --line: #22304c;
  --line-strong: #34466c;
  --ink: #e6ecf5;
  --ink-soft: #a9b6ca;
  --ink-muted: #8a99b1;
  --link: #7db3ec;
  --focus: #7db3ec;
  --btn: #3b82d0;
  --btn-ink: #fff;

  --crit: #ff7b7f;  --crit-bg: rgba(229, 72, 77, .16);
  --high: #ffa265;  --high-bg: rgba(247, 107, 21, .16);
  --med: #f2c76e;   --med-bg: rgba(226, 163, 54, .14);
  --low: #9fbadb;   --low-bg: rgba(107, 143, 184, .16);
  --unk: #a9b6ca;   --unk-bg: rgba(138, 153, 177, .14);

  --ok: #7fd4a3;    --ok-bg: rgba(46, 160, 98, .14);
  --warn: #f2c76e;  --warn-bg: rgba(226, 163, 54, .12);
  --err: #ff8a8d;   --err-bg: rgba(229, 72, 77, .14);
  --info: #8cc4f2;  --info-bg: rgba(74, 144, 217, .14);

  --shadow-pop: 0 8px 24px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --sidebar: #1B2F5E;
  --line: #e0e5ee;
  --line-strong: #c6cfdd;
  --ink: #14213d;
  --ink-soft: #46546d;
  --ink-muted: #5d6b83;
  --link: #2a6db5;
  --focus: #2a6db5;
  --btn: #2a6db5;
  --btn-ink: #fff;

  --crit: #b4232a;  --crit-bg: #fdeaea;
  --high: #a8480b;  --high-bg: #fdefe4;
  --med: #8a5a00;   --med-bg: #fbf2dc;
  --low: #355c88;   --low-bg: #e8eff8;
  --unk: #46546d;   --unk-bg: #eef1f5;

  --ok: #1e7a4d;    --ok-bg: #e7f4ec;
  --warn: #8a5a00;  --warn-bg: #fbf2dc;
  --err: #b4232a;   --err-bg: #fdeaea;
  --info: #2a6db5;  --info-bg: #e8f1fb;

  --shadow-pop: 0 8px 24px rgba(20, 33, 61, .16);
  color-scheme: light;
}

:root {
  --radius: 6px;
  --font: Inter, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --sidebar-w: 216px;
  --tabbar-h: 60px;
}

/* ---------- Grundlagen ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; font-weight: 650; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1rem; }
h3 { font-size: .9375rem; margin-top: 16px; }
p { margin: 0 0 12px; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
code, .mono { font-family: var(--font-mono); font-size: .875em; }
code { background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
img { max-width: 100%; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.icon { flex: none; width: 18px; height: 18px; vertical-align: -3px; }
.text-soft { color: var(--ink-soft); }
.text-err { color: var(--err); }
.lead { color: var(--ink-soft); margin: 0; }
.hint { color: var(--ink-muted); font-size: .8125rem; margin: 4px 0 0; }
.optional { color: var(--ink-muted); font-weight: 400; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  padding: 8px 12px; background: var(--surface); color: var(--ink); border-radius: var(--radius);
}
.skip-link:focus { top: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Rahmenlayout ---------- */

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--sidebar); color: #dfe7f5;
  border-right: 1px solid var(--line);
  padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; padding: 4px 8px 16px; }
.brand-name { font-weight: 700; font-size: 1.0625rem; letter-spacing: .01em; }

.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav a, .sidebar-foot > a {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: var(--radius);
  color: #c4d0e4; text-decoration: none; font-weight: 500;
}
.sidenav a:hover, .sidebar-foot > a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidenav a[aria-current="page"], .sidebar-foot > a[aria-current="page"] {
  background: rgba(74, 144, 217, .22); color: #fff;
  box-shadow: inset 3px 0 0 var(--highlight);
}
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.sidebar-foot > a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-actions { display: flex; gap: 4px; padding: 0 4px; }
.sidebar .icon-btn { color: #c4d0e4; }
.sidebar .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.page {
  margin-left: var(--sidebar-w);
  padding: 24px 32px 48px;
  max-width: calc(1440px + var(--sidebar-w));
}
.page:focus { outline: none; }

.mobilebar, .tabbar { display: none; }

@media (max-width: 899px) {
  .sidebar { display: none; }
  .page { margin-left: 0; padding: 16px 12px calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); }

  .mobilebar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 8px 8px 12px; background: var(--sidebar); color: #fff;
    border-bottom: 1px solid var(--line);
  }
  .mobilebar .brand { padding: 0; }
  .mobilebar .icon-btn { color: #fff; }

  .tabbar {
    position: fixed; inset: auto 0 0 0; z-index: 20;
    display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--ink-soft); text-decoration: none; font-size: .6875rem; font-weight: 500;
  }
  .tabbar a[aria-current="page"] { color: var(--link); box-shadow: inset 0 2px 0 var(--highlight); }
  .tabbar .icon { width: 22px; height: 22px; }
}

.mobilemenu { position: relative; }
.mobilemenu summary { list-style: none; }
.mobilemenu summary::-webkit-details-marker { display: none; }
.mobilemenu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop);
  padding: 8px; display: flex; flex-direction: column; gap: 2px;
}
.mobilemenu-panel > a { display: flex; gap: 12px; align-items: center; padding: 12px; color: var(--ink); text-decoration: none; border-radius: var(--radius); }
.mobilemenu-panel > a:hover { background: var(--surface-2); }
.mobilemenu-row { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.mobilemenu-row .icon-btn { color: var(--ink); }

/* ---------- Seitenkopf, Panels ---------- */

.page-head { margin-bottom: 16px; }
.page-head h1 { margin-bottom: 4px; }
.breadcrumb { display: flex; align-items: center; gap: 4px; font-size: .8125rem; color: var(--ink-muted); margin-bottom: 8px; }
.breadcrumb .icon { width: 14px; height: 14px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 16px;
  min-width: 0;
}
.panel.narrow { max-width: 520px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.panel-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.panel-head a { font-size: .8125rem; }
.panel > h2 { margin-bottom: 12px; }

.empty { color: var(--ink-soft); padding: 8px 0; }
.empty p { margin: 0 0 12px; }
.empty-ok { display: flex; gap: 8px; align-items: flex-start; color: var(--ok); }
.empty-ok p { margin: 0; }

/* ---------- Übersicht ---------- */

.status-line { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; font-size: 1.0625rem; color: var(--ink); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot-ok { background: var(--ok); }
.dot-alert { background: var(--crit); }
.dot-info { background: var(--info); }

.notice {
  display: flex; gap: 8px; align-items: flex-start; margin: 0 0 16px;
  color: var(--warn); font-size: .875rem;
}
.notice span { color: var(--ink-soft); }

.dash-section { max-width: 820px; margin-bottom: 24px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.section-head h2 { margin: 0; font-size: 1rem; }
.section-head a { font-size: .875rem; }
.section-hint { color: var(--ink-muted); font-size: .8125rem; margin: -4px 0 8px; }

.row-list { list-style: none; margin: 0; padding: 0 16px; }
.row-list > li + li { border-top: 1px solid var(--line); }
.row-link, .row-static {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0;
  color: var(--ink); text-decoration: none;
}
.row-link:hover .row-main strong, .row-link:hover .row-title { color: var(--link); }
.row-link > .icon { color: var(--ink-muted); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.row-sub { color: var(--ink-muted); font-size: .8125rem; }
.row-title { font-weight: 500; }
.row-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.row-date { flex: none; width: 48px; color: var(--ink-soft); font-size: .875rem; font-variant-numeric: tabular-nums; }
.row-date-wide { width: 104px; }

.pill {
  flex: none; padding: 2px 10px; border-radius: 999px; font-size: .8125rem; font-weight: 600; white-space: nowrap;
  color: var(--prio-color, var(--ink-soft)); border: 1px solid var(--prio-color, var(--line-strong));
}
.pill-ok { --prio-color: var(--ok); }
.tag-mine { border-color: var(--highlight); color: var(--highlight); }

@media (max-width: 499px) {
  .row-date-wide { width: 88px; font-size: .8125rem; }
  .pill { font-size: .75rem; padding: 2px 8px; }
}

/* ---------- Schwere, Dringlichkeit, Kennzeichen ---------- */

.sev {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: .75rem; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.sev-kritisch { color: var(--crit); background: var(--crit-bg); }
.sev-hoch { color: var(--high); background: var(--high-bg); }
.sev-mittel { color: var(--med); background: var(--med-bg); }
.sev-niedrig { color: var(--low); background: var(--low-bg); }
.sev-unbekannt { color: var(--unk); background: var(--unk-bg); }

.tag {
  display: inline-block; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 4px;
  font-size: .6875rem; font-weight: 600; letter-spacing: .02em; color: var(--ink-soft); white-space: nowrap;
}
.tag-kev { border-color: var(--crit); color: var(--crit); }
.tag-ransom { border-color: var(--high); color: var(--high); }
.tag-ann { border-color: var(--highlight); color: var(--highlight); }

.prio {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 64px; flex: none; padding: 4px 0;
  border-left: 4px solid var(--prio-color, var(--line-strong));
}
.prio strong { font-size: 1.25rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.prio small { font-size: .625rem; color: var(--ink-muted); text-align: center; line-height: 1.2; }
.prio-lg { width: 88px; }
.prio-lg strong { font-size: 2rem; }
.prio-sofort { --prio-color: var(--crit); }
.prio-dringend { --prio-color: var(--high); }
.prio-zeitnah { --prio-color: var(--med); }
.prio-beobachten { --prio-color: var(--line-strong); }
.prio-sofort .prio strong { color: var(--crit); }

.cve { font-family: var(--font-mono); font-weight: 600; font-size: .875rem; white-space: nowrap; }

/* ---------- Schwachstellen-Liste ---------- */

.vlist { list-style: none; margin: 0; padding: 0; }
.vlist.panel { padding: 0; }
.vrow + .vrow { border-top: 1px solid var(--line); }
.vrow-link {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px 8px 0; color: var(--ink); text-decoration: none;
}
.panel:not(.vlist) .vrow-link { padding-right: 0; }
.vrow-link:hover { background: var(--surface-2); }
.vrow-link > .icon { color: var(--ink-muted); }
.vrow-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.vrow-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.vrow-title { font-weight: 500; overflow-wrap: anywhere; }
.vrow-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--ink-muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.vrow-match { display: flex; gap: 6px; align-items: flex-start; font-size: .8125rem; color: var(--highlight); }
.vrow-match strong { color: var(--ink); font-weight: 600; }

/* ---------- Meldungen ---------- */

.alist { list-style: none; margin: 0; padding: 0; }
.alist.panel { padding: 0 16px; }
.arow { padding: 12px 0; }
.arow + .arow { border-top: 1px solid var(--line); }
.arow-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .8125rem; margin-bottom: 4px; }
.arow-title { font-size: .9375rem; font-weight: 600; margin: 0 0 4px; overflow-wrap: anywhere; }
.arow-title a { color: var(--ink); text-decoration: none; }
.arow-title a:hover { color: var(--link); text-decoration: underline; }
.arow-title .icon { width: 14px; height: 14px; color: var(--ink-muted); }
.arow-summary { color: var(--ink-soft); font-size: .875rem; margin: 0 0 4px; max-width: 80ch; }
.arow.is-past { opacity: .7; }
.cve-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; }
.cve-links .cve { font-size: .8125rem; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 6px 0; overflow-wrap: anywhere; }
.plain-list li + li { border-top: 1px solid var(--line); }
.plain-list .icon { width: 14px; height: 14px; }
.date-chip {
  display: inline-block; min-width: 96px; margin-right: 8px;
  font-size: .8125rem; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums;
}

/* ---------- Detailseite ---------- */

.detail-head { display: flex; gap: 16px; align-items: center; }
.detail-head h1 { margin: 0; }
.detail-head .cve { font-size: 1.375rem; }
.detail-title { font-size: 1.0625rem; margin: 4px 0 8px; max-width: 90ch; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; align-items: start; }
.detail-wide { grid-column: 1 / -1; }
@media (max-width: 899px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } }

.facts { margin: 0; display: grid; gap: 6px; }
.facts > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px; }
.facts dt { color: var(--ink-muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.prose { max-width: 90ch; overflow-wrap: anywhere; }
.product-list { margin: 0; padding-left: 18px; columns: 2 240px; column-gap: 24px; }
.product-list li { break-inside: avoid; padding: 2px 0; }

.match-list { list-style: none; margin: 0; padding: 0; }
.match-item { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; padding: 12px 0 12px 12px; border-left: 3px solid var(--prio-color, var(--line-strong)); }
.match-item + .match-item { border-top: 1px solid var(--line); }
.match-item > div { min-width: 0; flex: 1 1 280px; }
.match-item .text-soft { display: block; font-size: .8125rem; }
.match-title { margin: 2px 0 0; overflow-wrap: anywhere; }
.match-item.status-erledigt, .match-item.status-nicht_betroffen { --prio-color: var(--ok); opacity: .8; }
.match-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.match-form select { width: auto; }
.match-form input[type="text"] { width: 200px; }
.done-list { margin-top: 12px; }
.done-list summary { cursor: pointer; color: var(--ink-soft); padding: 4px 0; }

/* ---------- Systeme ---------- */

.assets-layout, .cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 16px; align-items: start; }
.assets-layout > div > .panel:last-child { margin-bottom: 0; }
@media (max-width: 1099px) { .assets-layout, .cal-layout { grid-template-columns: minmax(0, 1fr); } }

.asset-list, .customer-list { list-style: none; margin: 0; padding: 0; }
.asset-list li + li, .customer-list li + li { border-top: 1px solid var(--line); }
.asset-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; color: var(--ink); text-decoration: none; }
.asset-link:hover strong { color: var(--link); }
.asset-link > span:first-child { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; min-width: 0; }
.asset-list .is-inactive { opacity: .6; }
.count-badge {
  flex: none; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600;
  border: 1px solid var(--prio-color, var(--line-strong)); color: var(--prio-color, var(--ink-soft));
}
.count-ok { --prio-color: var(--ok); }
.customer-list { margin-bottom: 16px; }
.customer-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; }
.danger-zone h2 { color: var(--err); }

/* ---------- Kalender ---------- */

.cal-events { list-style: none; margin: 0; padding: 0; }
.cal-event { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 0; }
.cal-event + .cal-event { border-top: 1px solid var(--line); }
.cal-event-body { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.cal-event.is-past { opacity: .55; }
.cal-event.is-today .date-chip { color: var(--highlight); }
.cal-event form { margin-left: auto; }

/* ---------- Tabellen ---------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th, .table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.table thead th { color: var(--ink-muted); font-weight: 600; font-size: .75rem; position: sticky; top: 0; background: var(--surface); }
.table tbody th { font-weight: 600; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .cell-wrap { white-space: normal; min-width: 220px; overflow-wrap: anywhere; }
.table-compact td, .table-compact th { padding: 6px 8px; }

.status { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.status-ok { color: var(--ok); background: var(--ok-bg); }
.status-err { color: var(--err); background: var(--err-bg); }
.status-warn { color: var(--warn); background: var(--warn-bg); }
.status-info { color: var(--info); background: var(--info-bg); }

/* ---------- Formulare ---------- */

.form { display: flex; flex-direction: column; gap: 16px; }
.form-inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-grow { flex: 1 1 220px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 499px) { .field-row { grid-template-columns: 1fr; } }
.field label { font-weight: 600; font-size: .8125rem; }
.field-check { flex-direction: row; align-items: center; gap: 8px; }
.field-check input { width: 18px; height: 18px; }
.field-error { color: var(--err); font-size: .8125rem; margin: 0; }

input[type="text"], input[type="search"], input[type="password"], input[type="date"], input[type="url"], select {
  width: 100%; min-height: 38px; padding: 6px 10px;
  font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
input::placeholder { color: var(--ink-muted); opacity: 1; }
input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
input[aria-invalid="true"] { border-color: var(--err); }
.input-short { max-width: 180px; }

.filters {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  margin-bottom: 16px;
}
.filters .field { flex: 0 1 170px; }
.filters .field-grow { flex: 1 1 240px; }
.filters-actions { display: flex; gap: 8px; }
@media (max-width: 599px) {
  .filters .field { flex: 1 1 calc(50% - 6px); }
  .filters .field-grow { flex-basis: 100%; }
  .filters-actions { flex-basis: 100%; }
  .filters-actions .btn { flex: 1; justify-content: center; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  min-height: 38px; padding: 6px 14px;
  font: inherit; font-weight: 600; font-size: .875rem; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; border-radius: var(--radius); cursor: pointer;
}
.btn-primary { background: var(--btn); color: var(--btn-ink); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-quiet { background: transparent; color: var(--link); }
.btn-quiet:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--err); border-color: var(--err); }
.btn-danger:hover { background: var(--err-bg); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: default; pointer-events: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--ink-soft); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
@media (pointer: coarse) { .icon-btn, .btn { min-height: 44px; } .icon-btn { width: 44px; height: 44px; } }

.theme-icon { display: none; }
[data-state="dark"] .theme-icon-dark, [data-state="light"] .theme-icon-light { display: inline-flex; }

/* ---------- Meldungen (Flash) und Blättern ---------- */

.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; margin-bottom: 16px; border-radius: var(--radius);
  border-left: 3px solid currentColor;
}
.alert p { margin: 0; color: var(--ink); }
.alert-ok { color: var(--ok); background: var(--ok-bg); }
.alert-err { color: var(--err); background: var(--err-bg); }
.alert-warn { color: var(--warn); background: var(--warn-bg); }
.alert-info { color: var(--info); background: var(--info-bg); }

.pagination { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0 16px; }
.pagination-info { color: var(--ink-soft); font-size: .875rem; }

/* ---------- Anmeldung ---------- */

body.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth-main { width: 100%; max-width: 380px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 24px; }
.auth-brand-name { font-size: 1.375rem; font-weight: 700; }
.auth-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.auth-box h1 { font-size: 1.25rem; }
.auth-foot { display: flex; justify-content: center; margin-top: 16px; }
.logo-on-light { display: none; }
:root[data-theme="light"] .logo-on-light { display: block; }
:root[data-theme="light"] .logo-on-dark { display: none; }
