/* ==========================================================================
   Dashboard – Gestaltung
   Primärfarbe #cc1e1c · Schrift Inter · ausgelegt auf 1920 × 1080 (24")

   Aufbau der Datei
     1. Grundwerte (Farben, Abstände, Schatten)
     2. Grundgerüst und Typografie
     3. Kopfzeile und Navigation
     4. Bedienelemente
     5. Karten und Raster
     6. Widgets
     7. Formulare und Dialoge
     8. Tabellen, Hinweise, Sonderseiten
     9. Anpassung an Bildschirmbreiten
   ========================================================================== */
/* --- Inter ---------------------------------------------------------------
   Lokal ausgeliefert (assets/fonts/), SIL Open Font License 1.1 – siehe
   assets/fonts/OFL.txt. Es werden keine externen Schrift-Server angefragt.
   Die Aufteilung in „latin“ und „latin-ext“ über unicode-range sorgt dafür,
   dass der erweiterte Zeichensatz nur geladen wird, wenn eine Seite ihn
   tatsächlich braucht. Nachladen/Aktualisieren: php tools/fetch-inter.php
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-ext-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,
                 U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,
                 U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,
                 U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-ext-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,
                 U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,
                 U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,
                 U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-ext-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,
                 U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,
                 U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,
                 U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-ext-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,
                 U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,
                 U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,
                 U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ==========================================================================
   1. Grundwerte
   ========================================================================== */

:root {
  /* Markenfarbe – bewusst sparsam eingesetzt: Hauptaktionen, aktive Zustände,
     Hervorhebungen. Flächen bleiben neutral. */
  --brand:         #cc1e1c;
  --brand-strong:  #b01917;
  --brand-deep:    #8f1412;
  --brand-tint:    #fdf3f3;
  --brand-soft:    rgba(204, 30, 28, 0.09);
  --brand-line:    rgba(204, 30, 28, 0.22);
  --brand-ring:    rgba(204, 30, 28, 0.20);
  --brand-fg:      #ffffff;

  /* Neutrale Töne mit leichtem Blaustich – wirkt ruhiger als reines Grau. */
  --bg:            #f5f6f8;
  --bg-deep:       #eef0f4;
  --surface:       #ffffff;
  --surface-2:     #f8f9fb;
  --surface-3:     #f1f3f6;
  --surface-sunken:#fafbfc;
  --bg-elevated:   #ffffff;

  --border:        #e7e9ef;
  --border-soft:   #eef0f4;
  --border-strong: #d6dae2;

  --text:          #11141a;
  --text-muted:    #5a6373;
  --text-subtle:   #8a91a0;
  --text-faint:    #a8aebb;

  --success:       #0e8a53;
  --success-soft:  rgba(14, 138, 83, 0.10);
  --warning:       #b06a10;
  --warning-soft:  rgba(176, 106, 16, 0.11);
  --info:          #2563eb;
  --info-soft:     rgba(37, 99, 235, 0.10);
  --danger:        #c62828;

  /* Ecken */
  --r-xs: 7px;
  --r-sm: 10px;
  --r:    13px;
  --r-lg: 17px;
  --r-xl: 22px;

  /* Gestaffelte Schatten: mehrere weiche Lagen wirken natürlicher als eine. */
  --shadow-1: 0 1px 2px rgba(17, 20, 26, 0.04), 0 1px 1px rgba(17, 20, 26, 0.03);
  --shadow-2: 0 1px 2px rgba(17, 20, 26, 0.04), 0 4px 12px rgba(17, 20, 26, 0.05);
  --shadow-3: 0 2px 6px rgba(17, 20, 26, 0.05), 0 12px 28px rgba(17, 20, 26, 0.08);
  --shadow-4: 0 8px 20px rgba(17, 20, 26, 0.10), 0 28px 64px rgba(17, 20, 26, 0.20);
  --shadow-brand: 0 1px 2px rgba(143, 20, 18, 0.24), 0 4px 12px rgba(143, 20, 18, 0.18);

  /* Abstände (Vielfache von 4) */
  --gap:       20px;
  --gap-sm:    12px;
  --pad-card:  20px;
  --header-h:  66px;
  --content-max: 1800px;

  /* Bewegung */
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --fast: 0.14s var(--ease);
  --slow: 0.24s var(--ease);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
          'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

/* --- Dunkles Farbschema -------------------------------------------------- */
:root[data-theme='dark'] {
  --brand:         #f04b49;
  --brand-strong:  #e63b39;
  --brand-deep:    #cc1e1c;
  --brand-tint:    rgba(240, 75, 73, 0.10);
  --brand-soft:    rgba(240, 75, 73, 0.14);
  --brand-line:    rgba(240, 75, 73, 0.30);
  --brand-ring:    rgba(240, 75, 73, 0.30);
  --brand-fg:      #ffffff;

  --bg:            #0b0d11;
  --bg-deep:       #07090c;
  --surface:       #14171d;
  --surface-2:     #191d24;
  --surface-3:     #21262e;
  --surface-sunken:#101318;
  --bg-elevated:   #191d24;

  --border:        #252a33;
  --border-soft:   #1e232a;
  --border-strong: #333a45;

  --text:          #edeff3;
  --text-muted:    #a3aab8;
  --text-subtle:   #7d8493;
  --text-faint:    #626977;

  --success:       #40bd7e;
  --success-soft:  rgba(64, 189, 126, 0.13);
  --warning:       #e0a340;
  --warning-soft:  rgba(224, 163, 64, 0.13);
  --info:          #6a9bff;
  --info-soft:     rgba(106, 155, 255, 0.13);
  --danger:        #ef5350;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.36);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.40), 0 4px 14px rgba(0, 0, 0, 0.32);
  --shadow-3: 0 2px 8px rgba(0, 0, 0, 0.45), 0 14px 34px rgba(0, 0, 0, 0.42);
  --shadow-4: 0 10px 26px rgba(0, 0, 0, 0.50), 0 32px 72px rgba(0, 0, 0, 0.60);
  --shadow-brand: 0 1px 2px rgba(0, 0, 0, 0.40), 0 4px 14px rgba(204, 30, 28, 0.30);
}

/* Systemeinstellung folgen (Darstellung: automatisch) */
@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] {
    --brand:         #f04b49;
    --brand-strong:  #e63b39;
    --brand-deep:    #cc1e1c;
    --brand-tint:    rgba(240, 75, 73, 0.10);
    --brand-soft:    rgba(240, 75, 73, 0.14);
    --brand-line:    rgba(240, 75, 73, 0.30);
    --brand-ring:    rgba(240, 75, 73, 0.30);
    --brand-fg:      #ffffff;

    --bg:            #0b0d11;
    --bg-deep:       #07090c;
    --surface:       #14171d;
    --surface-2:     #191d24;
    --surface-3:     #21262e;
    --surface-sunken:#101318;
    --bg-elevated:   #191d24;

    --border:        #252a33;
    --border-soft:   #1e232a;
    --border-strong: #333a45;

    --text:          #edeff3;
    --text-muted:    #a3aab8;
    --text-subtle:   #7d8493;
    --text-faint:    #626977;

    --success:       #40bd7e;
    --success-soft:  rgba(64, 189, 126, 0.13);
    --warning:       #e0a340;
    --warning-soft:  rgba(224, 163, 64, 0.13);
    --info:          #6a9bff;
    --info-soft:     rgba(106, 155, 255, 0.13);
    --danger:        #ef5350;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.36);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.40), 0 4px 14px rgba(0, 0, 0, 0.32);
    --shadow-3: 0 2px 8px rgba(0, 0, 0, 0.45), 0 14px 34px rgba(0, 0, 0, 0.42);
    --shadow-4: 0 10px 26px rgba(0, 0, 0, 0.50), 0 32px 72px rgba(0, 0, 0, 0.60);
    --shadow-brand: 0 1px 2px rgba(0, 0, 0, 0.40), 0 4px 14px rgba(204, 30, 28, 0.30);
  }
}

/* ==========================================================================
   2. Grundgerüst und Typografie
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

/* Muss vor den Komponenten stehen, sonst überschreibt z. B. .btn{display:flex}
   die Standardregel des Browsers für [hidden]. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: 'cv05' 1, 'ss03' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.016em; }
p { margin: 0 0 0.7em; }
a { color: var(--brand); text-decoration: none; transition: color var(--fast); }
a:hover { color: var(--brand-strong); }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code { font-family: var(--mono); font-size: 0.92em; }
::selection { background: var(--brand-soft); }

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

/* Zahlen in Tabellen und Kennzahlen laufen nicht mehr unruhig. */
.metric-value, .clock-time, .weather-temp, .table .num,
.toplist-count, .weather-stat-value, .weather-day-temps {
  font-variant-numeric: tabular-nums;
}

/* Bildlaufleisten dezent halten */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 99px;
  border: 3.5px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: content-box; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }

.wrap {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 30px;
}

main { flex: 1; padding: 24px 0 40px; }

/* ==========================================================================
   3. Kopfzeile und Navigation
   ========================================================================== */

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border-soft);
}
.topbar-inner { height: 100%; display: flex; align-items: center; gap: 22px; }

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(140deg, #e0342f 0%, var(--brand) 45%, var(--brand-deep) 100%);
  color: #fff; display: grid; place-items: center;
  font-size: 15px; font-weight: 700; letter-spacing: -0.04em;
  box-shadow: var(--shadow-brand);
}
.brand-name {
  display: block;
  font-size: 15.5px; font-weight: 600; letter-spacing: -0.022em;
  color: var(--text);
}
.brand-sub {
  display: block; margin-top: -2px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--text-subtle);
}

/* Hauptnavigation */
.topnav { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.topnav-item {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 13px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background var(--fast), color var(--fast);
}
.topnav-item:hover { background: var(--surface-3); color: var(--text); }
.topnav-item.is-active {
  background: var(--brand-soft); color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand-line);
}
.topnav-item .icon { width: 16px; height: 16px; }

/* Suchfeld */
.topbar-search { flex: 1; max-width: 620px; margin: 0 auto; }
.searchbar { position: relative; display: flex; align-items: center; }
.searchbar-icon {
  position: absolute; left: 14px; color: var(--text-subtle);
  display: grid; place-items: center; pointer-events: none;
  transition: color var(--fast);
}
.searchbar input {
  width: 100%; height: 40px;
  padding: 0 130px 0 42px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--text);
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.searchbar input::placeholder { color: var(--text-subtle); }
.searchbar input:focus {
  outline: none; background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px var(--brand-ring);
}
.searchbar input:focus + .searchbar-kbd { opacity: 0; }
.searchbar:focus-within .searchbar-icon { color: var(--brand); }
.searchbar-engine {
  position: absolute; right: 5px;
  height: 30px; padding: 0 26px 0 10px;
  border: 1px solid var(--border); border-radius: var(--r-xs);
  background: var(--surface) url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a91a0' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 7px center;
  font-size: 12.5px; font-weight: 500; color: var(--text-muted);
  appearance: none; cursor: pointer;
  transition: border-color var(--fast), color var(--fast);
}
.searchbar-engine:hover { border-color: var(--border-strong); color: var(--text); }
.searchbar-kbd {
  position: absolute; right: 118px;
  min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 5px;
  background: var(--surface);
  font-size: 11px; font-weight: 600; color: var(--text-subtle);
  pointer-events: none; transition: opacity var(--fast);
}

.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* Benutzermenü */
.usermenu { position: relative; }
.usermenu-trigger {
  display: flex; align-items: center; gap: 9px;
  height: 38px; padding: 0 10px 0 5px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; cursor: pointer;
  transition: background var(--fast), border-color var(--fast);
}
.usermenu-trigger:hover { background: var(--surface-3); }
.usermenu-trigger[aria-expanded='true'] { background: var(--surface-3); border-color: var(--border); }
.usermenu-name {
  font-size: 13.5px; font-weight: 500; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.avatar {
  width: 29px; height: 29px; border-radius: 50%;
  background: linear-gradient(140deg, var(--brand-soft), var(--brand-tint));
  color: var(--brand);
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--brand-line);
  flex-shrink: 0;
}
.avatar-lg { width: 46px; height: 46px; font-size: 16px; }

.menu {
  position: absolute; right: 0; top: calc(100% + 9px);
  min-width: 244px; padding: 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98);
  transform-origin: top right;
  transition: opacity var(--fast), transform var(--fast), visibility var(--fast);
}
.menu.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.menu-head { padding: 9px 11px 11px; border-bottom: 1px solid var(--border-soft); margin-bottom: 6px; }
.menu-head strong { display: block; font-size: 13.5px; }
.menu-head span { font-size: 12px; color: var(--text-subtle); }
.menu-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 8px 11px;
  border: 0; border-radius: var(--r-xs); background: transparent;
  color: var(--text); font-size: 13.5px; text-align: left; cursor: pointer;
  transition: background var(--fast), color var(--fast);
}
.menu-item:hover { background: var(--surface-3); color: var(--text); }
.menu-item .icon { width: 16px; height: 16px; color: var(--text-subtle); }
.menu-item:hover .icon { color: var(--brand); }
.menu-sep { height: 1px; background: var(--border-soft); margin: 6px 0; }

/* ==========================================================================
   4. Bedienelemente
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13.8px; font-weight: 500; white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: background var(--fast), border-color var(--fast), color var(--fast),
              box-shadow var(--fast), transform 0.06s var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: var(--text-faint); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(1px); box-shadow: var(--shadow-1); }

.btn-primary {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-strong) 100%);
  border-color: var(--brand-strong);
  color: var(--brand-fg);
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #d9302e 0%, var(--brand) 100%);
  border-color: var(--brand-strong);
  box-shadow: 0 2px 4px rgba(143, 20, 18, .28), 0 8px 20px rgba(143, 20, 18, .22);
}

.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: transparent; box-shadow: none; }

.btn-danger { background: transparent; border-color: transparent; color: var(--danger); box-shadow: none; }
.btn-danger:hover { background: rgba(198, 40, 40, .09); border-color: transparent; box-shadow: none; }

.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: var(--r-xs); }
.btn-block { width: 100%; }
.btn:disabled, .btn[disabled], .btn.is-disabled {
  opacity: .5; cursor: not-allowed; box-shadow: none; pointer-events: none;
}

.btn-icon {
  width: 36px; height: 36px; padding: 0; flex-shrink: 0;
  display: inline-grid; place-items: center;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; color: var(--text-subtle);
  cursor: pointer;
  transition: background var(--fast), color var(--fast), border-color var(--fast);
}
.btn-icon:hover { background: var(--surface-3); color: var(--text); }
.btn-icon.sm { width: 30px; height: 30px; border-radius: var(--r-xs); }

.icon { width: 18px; height: 18px; stroke-width: 1.75; flex-shrink: 0; }
.icon-sm { width: 15px; height: 15px; stroke-width: 1.9; }

/* ==========================================================================
   5. Karten und Raster
   ========================================================================== */

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 28px; margin-bottom: 22px;
}
.page-title { font-size: 27px; letter-spacing: -0.032em; line-height: 1.18; }
.page-title .accent { color: var(--brand); }
.page-sub { font-size: 13.5px; color: var(--text-muted); margin: 5px 0 0; max-width: 70ch; }

.metrics { display: flex; gap: 11px; flex-shrink: 0; }
.metric {
  min-width: 112px; padding: 11px 16px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--fast), border-color var(--fast);
}
.metric:hover { box-shadow: var(--shadow-2); }
.metric-value { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.metric-label {
  font-size: 10.5px; font-weight: 600; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: .07em; margin-top: 2px;
}
/* Auffällig, aber nicht alarmierend: nur die Zahl trägt die Farbe. */
.metric.is-alert { border-color: var(--brand-line); }
.metric.is-alert .metric-value { color: var(--brand); }
.metric.is-alert .metric-label { color: var(--brand); opacity: .75; }

/* 12-Spalten-Raster */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-12 { grid-column: span 12; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  transition: box-shadow var(--slow);
}
.card:hover { box-shadow: var(--shadow-3); }

.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px var(--pad-card) 14px;
  min-height: 56px;
}
/* Trennlinie nur dort, wo direkt darunter Inhalt beginnt. */
.card-head + .card-body.flush,
.card-head + .todo-add,
.card-head + .doc-toolbar { border-top: 1px solid var(--border-soft); }

.card-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 14.5px; font-weight: 600; letter-spacing: -0.012em;
  min-width: 0;
}
.card-title .icon { color: var(--brand); width: 17px; height: 17px; }
.card-count {
  min-width: 22px; height: 21px; padding: 0 7px;
  display: inline-grid; place-items: center;
  background: var(--surface-3); border-radius: 99px;
  font-size: 11.5px; font-weight: 600; color: var(--text-muted);
}
.card-tools { display: flex; align-items: center; gap: 5px; margin-left: auto; flex-shrink: 0; }
.card-body { padding: var(--pad-card); padding-top: 4px; }
.card-body.flush { padding: 0; }
.card-foot {
  padding: 11px var(--pad-card);
  border-top: 1px solid var(--border-soft);
  background: var(--surface-sunken);
  font-size: 12.5px; color: var(--text-subtle);
  display: flex; align-items: center; gap: 9px;
}
.card-foot .icon { color: var(--text-faint); }

/* ==========================================================================
   6. Widgets
   ========================================================================== */

/* --- Lesezeichen --------------------------------------------------------- */
.bm-group + .bm-group { margin-top: 24px; }
.bm-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.bm-dot { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.bm-group-name {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted);
}
.bm-group-line { flex: 1; height: 1px; background: var(--border-soft); }
.bm-group-tools { display: flex; gap: 2px; opacity: 0; transition: opacity var(--fast); }
.bm-group:hover .bm-group-tools, .bm-group:focus-within .bm-group-tools { opacity: 1; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(204px, 1fr));
  gap: 11px;
  border-radius: var(--r);
  transition: background var(--fast), outline-color var(--fast);
}
:root[data-tiles='compact'] .tiles { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }

.tile {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-1);
  transition: border-color var(--fast), box-shadow var(--fast),
              transform var(--fast), background var(--fast);
}
.tile:hover {
  border-color: var(--brand-line);
  box-shadow: var(--shadow-3);
  transform: translateY(-2px);
  color: var(--text);
}
.tile:active { transform: translateY(0); box-shadow: var(--shadow-1); }
.tile.dragging { opacity: .4; transform: scale(.98); }
.tile.drop-target { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }

.tile-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: var(--r-xs);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; letter-spacing: -0.02em;
  color: #fff;
  background: var(--brand);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(17, 20, 26, .14);
  transition: background var(--slow);
}
.tile-icon img { width: 20px; height: 20px; }
.tile-text { min-width: 0; flex: 1; overflow: hidden; }
.tile-title {
  display: block; max-width: 100%;
  font-size: 13.5px; font-weight: 500; letter-spacing: -0.008em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile-host {
  display: block; max-width: 100%;
  font-size: 11.5px; color: var(--text-subtle);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile-edit {
  position: absolute; top: 5px; right: 5px;
  width: 24px; height: 24px; border-radius: 6px;
  display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-subtle);
  box-shadow: var(--shadow-1);
  opacity: 0; cursor: pointer;
  transition: opacity var(--fast), color var(--fast), border-color var(--fast);
}
.tile:hover .tile-edit, .tile:focus-within .tile-edit { opacity: 1; }
.tile-edit:hover { color: var(--brand); border-color: var(--brand-line); }

.tile-add {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 58px;
  border: 1px dashed var(--border-strong); border-radius: var(--r);
  background: transparent; color: var(--text-subtle);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: border-color var(--fast), color var(--fast), background var(--fast);
}
.tile-add:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); }

/* Zielkategorie beim Verschieben */
.tiles.drop-zone {
  outline: 2px dashed var(--brand);
  outline-offset: 7px;
  background: var(--brand-tint);
}

/* --- Häufig genutzt ------------------------------------------------------ */
.toplist { display: flex; flex-direction: column; }
.toplist-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px var(--pad-card);
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  transition: background var(--fast);
}
.toplist-item:last-child { border-bottom: 0; }
.toplist-item:hover { background: var(--surface-2); color: var(--text); }
.toplist-rank {
  width: 18px; font-size: 11.5px; font-weight: 600;
  color: var(--text-faint); text-align: right; flex-shrink: 0;
}
.toplist-text { min-width: 0; flex: 1; }
.toplist-title {
  display: block; max-width: 100%; font-size: 13.5px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.toplist-host {
  display: block; max-width: 100%; font-size: 11.5px; color: var(--text-subtle);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.toplist-count {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  background: var(--surface-3); border-radius: 99px; padding: 3px 9px; flex-shrink: 0;
}

/* --- Aufgaben ------------------------------------------------------------ */
.todo-add { display: flex; gap: 8px; padding: 13px var(--pad-card); border-bottom: 1px solid var(--border-soft); }
.todo-list { max-height: 384px; overflow-y: auto; }
.todo {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px var(--pad-card);
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--fast);
}
.todo:last-child { border-bottom: 0; }
.todo:hover { background: var(--surface-2); }
.todo.is-done { opacity: .5; }
.todo.is-done .todo-title { text-decoration: line-through; text-decoration-thickness: 1px; }

.check {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; margin: 3px 0 0; flex-shrink: 0;
  border: 1.5px solid var(--border-strong); border-radius: 6px;
  background: var(--surface); cursor: pointer;
  transition: background var(--fast), border-color var(--fast), box-shadow var(--fast);
  position: relative;
}
.check:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.check:checked { background: var(--brand); border-color: var(--brand); }
.check:checked::after {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center / 12px;
}

.todo-main { flex: 1; min-width: 0; }
.todo-title { font-size: 13.8px; word-break: break-word; line-height: 1.45; }
.todo-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.todo-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--fast); }
.todo:hover .todo-actions, .todo:focus-within .todo-actions { opacity: 1; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 8px;
  border-radius: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .005em;
  background: var(--surface-3); color: var(--text-muted);
  white-space: nowrap;
}
.badge .icon { width: 12px; height: 12px; }
.badge-due    { background: var(--warning-soft); color: var(--warning); }
.badge-late   { background: var(--brand-soft);   color: var(--brand); }
.badge-prio   { background: var(--brand-soft);   color: var(--brand); }
.badge-ok     { background: var(--success-soft); color: var(--success); }
.badge-assign { background: var(--info-soft);    color: var(--info); }

/* --- Notizen ------------------------------------------------------------- */
.notepad {
  width: 100%; min-height: 236px;
  padding: 14px var(--pad-card) 18px;
  border: 0; background: transparent; color: var(--text);
  font-size: 13.8px; line-height: 1.68; resize: vertical;
}
.notepad:focus { outline: none; }
.notepad::placeholder { color: var(--text-subtle); }

/* --- Nachrichten --------------------------------------------------------- */
.feed-list { max-height: 468px; overflow-y: auto; }
.feed-item {
  display: block; padding: 13px var(--pad-card);
  border-bottom: 1px solid var(--border-soft);
  color: var(--text); transition: background var(--fast);
}
.feed-item:last-child { border-bottom: 0; }
.feed-item:hover { background: var(--surface-2); color: var(--text); }
.feed-item.has-image { display: flex; gap: 13px; align-items: flex-start; }
.feed-body { min-width: 0; flex: 1; display: block; }
.feed-thumb {
  width: 96px; height: 68px; flex-shrink: 0;
  border-radius: var(--r-sm); overflow: hidden;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--border-soft);
  display: block;
}
.feed-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed-item-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.feed-title, .feed-summary, .feed-source { display: block; }
.feed-source {
  font-size: 11px; font-weight: 700; color: var(--brand);
  text-transform: uppercase; letter-spacing: .05em;
}
.feed-time { font-size: 11.5px; color: var(--text-subtle); margin-left: auto; flex-shrink: 0; }
.feed-title { font-size: 13.8px; font-weight: 500; line-height: 1.42; letter-spacing: -0.008em; }
.feed-summary {
  font-size: 12.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* --- Uhr ----------------------------------------------------------------- */
.clock { text-align: center; padding: 22px var(--pad-card) 24px; }
.clock-time {
  font-size: 48px; font-weight: 600; letter-spacing: -0.042em; line-height: 1;
}
.clock-time .sec { font-size: 20px; font-weight: 500; color: var(--text-faint); letter-spacing: -0.01em; }
.clock-date { font-size: 13px; color: var(--text-muted); margin-top: 10px; }
.clock-week { font-size: 11.5px; color: var(--text-subtle); margin-top: 3px; }

/* --- Wetter -------------------------------------------------------------- */
.weather-now { display: flex; align-items: center; gap: 16px; padding: 16px var(--pad-card) 15px; }
.weather-icon {
  width: 62px; height: 62px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--r);
  background: linear-gradient(145deg, var(--brand-soft), var(--brand-tint));
  color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand-line);
}
.weather-icon .icon { width: 34px; height: 34px; stroke-width: 1.6; }
.weather-main { min-width: 0; flex: 1; }
.weather-temp { font-size: 35px; font-weight: 600; letter-spacing: -0.042em; line-height: 1.05; }
.weather-temp .unit { font-size: 18px; font-weight: 500; color: var(--text-faint); letter-spacing: -0.01em; }
.weather-text {
  font-size: 13px; color: var(--text-muted); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.weather-place {
  display: flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--text-subtle); margin-top: 4px;
}
.weather-place .icon { width: 13px; height: 13px; }

.weather-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border-soft); }
.weather-stat {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 11px 6px;
  border-right: 1px solid var(--border-soft);
}
.weather-stat:last-child { border-right: 0; }
.weather-stat .icon { width: 15px; height: 15px; color: var(--text-faint); }
.weather-stat-value { font-size: 13px; font-weight: 600; }
.weather-stat-label {
  font-size: 10px; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
}

.weather-days { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--border-soft); }
.weather-day {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 4px 13px;
  border-right: 1px solid var(--border-soft);
}
.weather-day:last-child { border-right: 0; }
.weather-day-name { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.weather-day .icon { width: 20px; height: 20px; color: var(--brand); stroke-width: 1.7; }
.weather-day-temps { font-size: 12px; }
.weather-day-max { font-weight: 600; }
.weather-day-min { color: var(--text-subtle); }
.weather-day-rain { display: flex; align-items: center; gap: 2px; font-size: 10.5px; color: var(--text-subtle); }
.weather-day-rain .icon { width: 10px; height: 10px; color: var(--info); }
.weather-day.is-today { background: var(--surface-2); }

/* --- Ortssuche ----------------------------------------------------------- */
.geo-results { margin-top: 10px; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.geo-results:empty { display: none; }
.geo-result {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 13px;
  border: 0; border-bottom: 1px solid var(--border-soft);
  background: var(--surface); color: var(--text);
  font-size: 13.5px; text-align: left; cursor: pointer;
  transition: background var(--fast);
}
.geo-result:last-child { border-bottom: 0; }
.geo-result:hover { background: var(--surface-3); }
.geo-result .icon { width: 15px; height: 15px; color: var(--text-subtle); flex-shrink: 0; }
.geo-result-name { font-weight: 500; }
.geo-result-region { font-size: 12px; color: var(--text-subtle); }
.geo-current {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; margin-top: 10px;
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface-2);
  font-size: 13.5px;
}
.geo-current .icon { color: var(--brand); flex-shrink: 0; }
.geo-current .spacer { flex: 1; }

/* --- Dokumente ----------------------------------------------------------- */
.doc-toolbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 13px var(--pad-card);
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-sunken);
}
.doc-toolbar .searchbar input { padding-right: 14px; }
.doc-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--r-xs);
  background: var(--brand-soft); color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand-line);
}

/* --- Lesebereich --------------------------------------------------------- */
.doc-heading {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.reader-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px var(--pad-card);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-sunken);
}
.reader-search { flex: 0 1 300px; min-width: 200px; }
.reader-search input { height: 34px; padding-right: 14px; }

.reader-pager { display: flex; align-items: center; gap: 4px; }
.reader-pager .btn-icon:first-child .icon { transform: rotate(180deg); }
.reader-jump { display: flex; align-items: center; gap: 6px; }
.reader-jump .input {
  width: 68px; height: 32px; padding: 0 8px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.reader-total { font-size: 12.5px; color: var(--text-subtle); white-space: nowrap; }

.reader {
  max-height: 620px; overflow-y: auto;
  background: var(--surface);
}
.reader-page { padding: 22px var(--pad-card) 26px; }
.reader-page + .reader-page { border-top: 1px dashed var(--border); }
.reader-pagemark {
  display: inline-block; margin-bottom: 12px;
  padding: 3px 9px; border-radius: 99px;
  background: var(--surface-3); color: var(--text-subtle);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.reader-text {
  white-space: pre-wrap; word-break: break-word;
  font-size: 13.8px; line-height: 1.72; color: var(--text);
  max-width: 78ch;
}
.reader-text mark {
  background: rgba(255, 213, 79, .55); color: inherit;
  border-radius: 3px; padding: 0 2px;
}
:root[data-theme='dark'] .reader-text mark { background: rgba(255, 196, 0, .30); color: #fff6d8; }

/* Autofilter über den Einträgen */
.filterbar {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  padding: 14px var(--pad-card);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-sunken);
}
.filterbar-field { display: flex; flex-direction: column; gap: 5px; min-width: 144px; }
.filterbar-field.is-wide { flex: 1 1 200px; max-width: 300px; }
.filterbar-label {
  font-size: 10.5px; font-weight: 700; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: .06em;
}
.filterbar .select, .filterbar .searchbar input { height: 36px; }
.filterbar .searchbar input { padding-right: 14px; }

.filterbar-status {
  display: flex; align-items: center; gap: 7px;
  padding: 9px var(--pad-card);
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px; color: var(--text-muted);
  background: var(--surface);
}
.filterbar-status .icon { color: var(--text-faint); }
.filterbar-status strong { color: var(--text); font-weight: 600; }

/* Aufbereitete Release-Einträge */
.release { display: flex; flex-direction: column; gap: 14px; }

.release-version {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 10px 0 4px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand-line);
}
.release:first-child > .release-version:first-child { margin-top: 0; }
.release-version-name {
  font-size: 16px; font-weight: 600; letter-spacing: -0.02em; color: var(--text);
}
.release-version-date {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--brand);
  background: var(--brand-soft); border-radius: 99px; padding: 3px 10px;
}
.release-version-date .icon { width: 12px; height: 12px; }

.release-entry {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  transition: border-color var(--fast), background var(--fast);
}
.release-entry:hover { background: var(--surface); border-color: var(--border-strong); }
.release-entry.is-korrektur { border-left-color: var(--warning); }
.release-entry.is-neuerung  { border-left-color: var(--success); }

.release-side {
  display: flex; flex-direction: column; gap: 5px; align-items: flex-start;
  width: 118px; flex-shrink: 0;
}
.release-kind {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.release-kind .icon { width: 13px; height: 13px; }
.is-korrektur .release-kind { color: var(--warning); }
.is-neuerung  .release-kind { color: var(--success); }
.release-id {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-subtle);
  background: var(--surface-3); border-radius: 5px; padding: 1px 7px;
}

.release-version-link {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 6px;
  color: var(--text-subtle); margin-left: auto;
  transition: background var(--fast), color var(--fast);
}
.release-version-link:hover { background: var(--brand-soft); color: var(--brand); }
.release-page {
  font-size: 11px; font-weight: 600; color: var(--text-subtle);
  transition: color var(--fast);
}
.release-page:hover { color: var(--brand); }

.release-main { min-width: 0; flex: 1; }
.release-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 5px; }
.release-area {
  font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -0.008em;
  transition: color var(--fast);
}
a.release-area:hover { color: var(--brand); }
.release-mark {
  font-size: 10.5px; font-weight: 600; color: var(--info);
  background: var(--info-soft); border-radius: 5px; padding: 2px 7px;
  white-space: nowrap;
}
.release-text {
  margin: 0; font-size: 13.5px; line-height: 1.62; color: var(--text-muted);
  max-width: 76ch;
}
.release-text mark, .release-area mark, .release-version-name mark {
  background: rgba(255, 213, 79, .55); color: inherit; border-radius: 3px; padding: 0 2px;
}
:root[data-theme='dark'] .release-text mark,
:root[data-theme='dark'] .release-area mark,
:root[data-theme='dark'] .release-version-name mark { background: rgba(255, 196, 0, .30); color: #fff6d8; }

.release-note {
  margin: 0; font-size: 13.2px; line-height: 1.6; color: var(--text-subtle);
  max-width: 76ch;
}

@media (max-width: 760px) {
  .release-entry { flex-direction: column; gap: 8px; }
  .release-side { flex-direction: row; align-items: center; width: auto; }
}

/* Fundstellen */
.hit {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px var(--pad-card);
  border-bottom: 1px solid var(--border-soft);
  color: var(--text); transition: background var(--fast);
}
.hit:last-child { border-bottom: 0; }
.hit:hover { background: var(--surface-2); color: var(--text); }
.hit.is-current { background: var(--brand-tint); box-shadow: inset 3px 0 0 var(--brand); }
.hit-page {
  flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--text-subtle);
  background: var(--surface-3); border-radius: 99px; padding: 2px 8px; margin-top: 1px;
}
.hit-text { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; min-width: 0; }
.hit-text mark { background: rgba(255, 213, 79, .55); color: inherit; border-radius: 3px; }
:root[data-theme='dark'] .hit-text mark { background: rgba(255, 196, 0, .28); color: #fff6d8; }

/* Gliederung */
.toc-item {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px var(--pad-card) 8px 20px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text); font-size: 13px; line-height: 1.4;
  transition: background var(--fast), color var(--fast);
}
.toc-item:last-child { border-bottom: 0; }
.toc-item:hover { background: var(--surface-2); color: var(--brand); }
.toc-item.is-current { background: var(--brand-tint); color: var(--brand); font-weight: 500; }
.toc-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toc-page {
  flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
}

.is-busy { opacity: .55; pointer-events: none; }
.is-busy .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Leerzustand --------------------------------------------------------- */
.empty { padding: 38px 24px; text-align: center; }
.empty-icon {
  width: 46px; height: 46px; margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: var(--r); background: var(--surface-3); color: var(--text-subtle);
}
.empty-icon .icon { width: 22px; height: 22px; }
.empty-title { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.empty-text { font-size: 13px; color: var(--text-muted); max-width: 380px; margin: 0 auto 16px; line-height: 1.6; }

/* ==========================================================================
   7. Formulare und Dialoge
   ========================================================================== */

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.label {
  display: block; margin-bottom: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  letter-spacing: -0.005em;
}
.input, .select, textarea.input {
  width: 100%; height: 40px; padding: 0 13px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
textarea.input { height: auto; min-height: 88px; padding: 10px 13px; resize: vertical; line-height: 1.55; }
.select {
  padding-right: 34px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a91a0' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.input::placeholder, textarea.input::placeholder { color: var(--text-subtle); }
.input:hover, .select:hover, textarea.input:hover { border-color: var(--text-faint); }
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3.5px var(--brand-ring);
}
.input:disabled { background: var(--surface-3); color: var(--text-subtle); cursor: not-allowed; }
.hint { font-size: 12px; color: var(--text-subtle); margin-top: 6px; line-height: 1.5; }
.field-error { font-size: 12.5px; color: var(--brand); margin-top: 6px; font-weight: 500; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 8px 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 42px; height: 24px; flex-shrink: 0;
  border-radius: 99px; background: var(--border-strong);
  position: relative; transition: background var(--slow);
}
.switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(17, 20, 26, .28);
  transition: transform var(--slow);
}
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3.5px var(--brand-ring); }
.switch-text { font-size: 13.5px; }
.switch-text small { display: block; font-size: 12px; color: var(--text-subtle); margin-top: 1px; }

.colors { display: flex; gap: 9px; flex-wrap: wrap; }
.color-opt { position: relative; }
.color-opt input { position: absolute; opacity: 0; }
.color-opt span {
  display: block; width: 28px; height: 28px; border-radius: var(--r-xs);
  cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
  transition: transform var(--fast), box-shadow var(--fast);
}
.color-opt:hover span { transform: scale(1.06); }
.color-opt input:checked + span {
  transform: scale(1.1);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text);
}

.overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(11, 13, 17, .52);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 28px;
  opacity: 0; visibility: hidden; transition: opacity var(--slow), visibility var(--slow);
}
.overlay.open { opacity: 1; visibility: visible; }
.modal {
  width: 100%; max-width: 500px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-4);
  transform: translateY(12px) scale(.985);
  transition: transform var(--slow);
  max-height: calc(100vh - 56px);
  display: flex; flex-direction: column;
}
.overlay.open .modal { transform: translateY(0) scale(1); }
.modal-lg { max-width: 640px; }
.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px 16px; border-bottom: 1px solid var(--border-soft);
}
.modal-title { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 22px; border-top: 1px solid var(--border-soft);
  background: var(--surface-sunken);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}
.modal-foot .spacer { flex: 1; }

/* ==========================================================================
   8. Tabellen, Hinweise, Sonderseiten
   ========================================================================== */

.toasts {
  position: fixed; bottom: 24px; right: 24px; z-index: 120;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 440px;
  padding: 13px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--r);
  box-shadow: var(--shadow-3);
  font-size: 13.5px;
  animation: toast-in .22s var(--ease);
}
.toast.ok    { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.leaving { animation: toast-out .18s var(--ease) forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateX(16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px) scale(.97); } }

.alert {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 15px; margin-bottom: 20px;
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  font-size: 13.5px; line-height: 1.55;
}
.alert .icon { flex-shrink: 0; margin-top: 1px; }
.alert-error   { background: var(--brand-tint);   border-color: var(--brand-line);   color: var(--brand); }
.alert-success { background: var(--success-soft); border-color: transparent;         color: var(--success); }
.alert-warning { background: var(--warning-soft); border-color: transparent;         color: var(--warning); }
.alert-info    { background: var(--surface-2);    border-color: var(--border);       color: var(--text-muted); }
.alert strong { font-weight: 600; }

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 11px var(--pad-card);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-subtle);
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.table td {
  padding: 13px var(--pad-card);
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.8px; vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; }
.table-actions { display: flex; gap: 3px; justify-content: flex-end; }

.user-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.user-cell-name { font-size: 13.8px; font-weight: 500; overflow-wrap: anywhere; }
/* Verweise in Tabellen bleiben neutral – Rot ist Aktionen vorbehalten. */
.table a { color: var(--text); }
.table a:hover { color: var(--brand); }
.user-cell-mail {
  font-size: 12px; color: var(--text-subtle);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px;
}

/* --- Anmeldeseite -------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--bg); }
.auth-visual {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1000px 600px at 15% 110%, rgba(204, 30, 28, .28), transparent 62%),
    radial-gradient(760px 520px at 88% -10%, rgba(204, 30, 28, .34), transparent 60%),
    linear-gradient(160deg, #191b20 0%, #0d0f13 48%, #16090a 100%);
  color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 56px 60px;
}
/* Feines Raster für Tiefe */
.auth-visual::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at 30% 50%, #000 0%, transparent 78%);
}
.auth-visual > * { position: relative; z-index: 1; }
.auth-claim { font-size: 36px; font-weight: 600; letter-spacing: -0.038em; line-height: 1.2; max-width: 480px; }
.auth-claim em { font-style: normal; color: #ff6260; }
.auth-text { font-size: 14.5px; color: rgba(255, 255, 255, .62); max-width: 430px; margin-top: 16px; line-height: 1.65; }
.auth-points { display: flex; flex-direction: column; gap: 13px; margin-top: 34px; }
.auth-point { display: flex; align-items: center; gap: 12px; font-size: 13.8px; color: rgba(255, 255, 255, .82); }
.auth-point .icon { color: #ff6260; width: 17px; height: 17px; }
.auth-foot { font-size: 12.5px; color: rgba(255, 255, 255, .35); }

.auth-form-side { display: grid; place-items: center; padding: 44px 28px; }
.auth-card { width: 100%; max-width: 404px; }
.auth-head { margin-bottom: 28px; }
.auth-head .brand { margin-bottom: 24px; }
.auth-title { font-size: 25px; letter-spacing: -0.032em; }
.auth-sub { font-size: 13.8px; color: var(--text-muted); margin-top: 6px; }
.auth-note {
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-subtle); line-height: 1.65;
  display: flex; gap: 8px; align-items: flex-start;
}
.auth-note .icon { flex-shrink: 0; margin-top: 2px; }
.pw-wrap { position: relative; }
.pw-toggle {
  position: absolute; right: 5px; top: 5px;
  width: 30px; height: 30px; border-radius: var(--r-xs);
  display: grid; place-items: center;
  border: 0; background: transparent; color: var(--text-subtle); cursor: pointer;
  transition: background var(--fast), color var(--fast);
}
.pw-toggle:hover { color: var(--text); background: var(--surface-3); }

/* --- Installer ----------------------------------------------------------- */
.page-narrow { max-width: 780px; margin: 0 auto; padding: 48px 28px 64px; }
.steps { display: flex; gap: 9px; margin-bottom: 30px; }
.step { flex: 1; }
.step-bar { height: 4px; border-radius: 99px; background: var(--border); transition: background var(--slow); }
.step.done .step-bar { background: var(--brand-line); }
.step.active .step-bar { background: var(--brand); }
.step-label { font-size: 12px; font-weight: 500; color: var(--text-subtle); margin-top: 8px; }
.step.active .step-label { color: var(--brand); font-weight: 600; }
.step.done .step-label { color: var(--text-muted); }

.check-list { display: flex; flex-direction: column; gap: 1px; }
.check-row {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 16px; background: var(--surface-2);
  font-size: 13.8px;
}
.check-row:first-child { border-radius: var(--r) var(--r) 0 0; }
.check-row:last-child  { border-radius: 0 0 var(--r) var(--r); }
.check-row .state { margin-left: auto; font-size: 12.5px; font-weight: 600; }
.check-row.ok   .icon  { color: var(--success); }
.check-row.ok   .state { color: var(--success); }
.check-row.fail .icon  { color: var(--danger); }
.check-row.fail .state { color: var(--danger); }
.check-row.warn .icon  { color: var(--warning); }
.check-row.warn .state { color: var(--warning); }

.code {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--surface-3); border: 1px solid var(--border-soft);
  border-radius: var(--r-sm); padding: 11px 13px;
  overflow-x: auto; white-space: pre; color: var(--text-muted);
}

/* --- Hilfsklassen -------------------------------------------------------- */
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.drag-handle { color: var(--text-subtle); cursor: grab; }
.drag-handle:active { cursor: grabbing; }

/* ==========================================================================
   9. Anpassung an Bildschirmbreiten
   ========================================================================== */

@media (max-width: 1500px) {
  /* Zweite Reihe wird 4 | 4 | 4, erste Reihe 8 | 4 */
  .col-3 { grid-column: span 4; }
  .col-5 { grid-column: span 4; }
  .col-9 { grid-column: span 8; }
}

@media (max-width: 1280px) {
  .wrap { padding: 0 22px; }
  .col-4, .col-5, .col-7, .col-8 { grid-column: span 6; }
  .col-3 { grid-column: span 6; }
  .col-9 { grid-column: span 12; }
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}

@media (max-width: 1180px) {
  .topnav-item span { display: none; }
  .topnav-item { padding: 0 10px; }
}

@media (max-width: 900px) {
  .grid > * { grid-column: span 12 !important; }
  .topnav { display: none; }
  .topbar-inner { gap: 14px; }
  .usermenu-name, .searchbar-kbd, .brand-sub { display: none; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .metrics { flex-wrap: wrap; }
  .doc-toolbar > .select, .doc-toolbar > .btn { flex: 1; }
}

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

@media print {
  .topbar, .card-tools, .btn, .toasts, .doc-toolbar { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
}
