/* HELGA legacy compatibility layer.
   Contains historical components extracted from the Tailwind input.
   Do not add new component rules here; canonical shared UI belongs in
   helga_theme.css. Remove rules here only with focused visual regression tests. */

/* ===== Custom HELGA-Styles (waren bisher inline in base.html) ===== */
html, body { background: #fdfcf9; }

body {
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    color: #111014;
    font-feature-settings: 'ss01', 'ss02', 'cv11';
    -webkit-font-smoothing: antialiased;
}

.font-display { font-family: 'Source Serif 4', ui-serif, Georgia, serif; letter-spacing: -0.02em; }
.font-display-md { font-family: 'Source Serif 4', ui-serif, Georgia, serif; letter-spacing: -0.015em; }
.font-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

.tnum { font-variant-numeric: tabular-nums; }

.link-edit {
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size .25s ease;
}
.link-edit:hover { background-size: 100% 1px; }

.grain::before {
    content: "";
    position: fixed; inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(17,16,20,.025) 1px, transparent 1px);
    background-size: 3px 3px;
    mix-blend-mode: multiply;
    z-index: 0;
}

*:focus-visible {
    outline: 2px solid #000066;
    outline-offset: 2px;
    border-radius: 4px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c9c6cf; border-radius: 999px; border: 2px solid #fdfcf9; }
::-webkit-scrollbar-thumb:hover { background: #a09da8; }

/* ===== Klarheit-Komponenten (Tim 19.05.2026)
   Proportionen abgeleitet aus Lexware-Office-Referenz:
   - Content-Spalte zentriert, max ~1040px (NICHT full-width)
   - H1 nur ~2x Body (nicht 3-4x)
   - 8px-Basis-Grid, sehr viel Vertikal-Luft
   - Labels in UPPERCASE 11px gray
   - Card-Padding 32px / 28px
   - Akzentfarbe homoeopathisch (max 1-2 Solid-Buttons pro Seite)
   Diese Klassen sind ADDITIV — bestehende Templates bleiben funktional,
   neue/migrierte Templates koennen sie schrittweise nutzen.
   ============================================================ */

/* Page-Wrapper: zentrierte Content-Spur mit grosszuegigem Top-Abstand
   zur Top-Bar/Ribbon. Auf grossen Viewports sind links/rechts ~bis zu
   400px Luft — das ist Absicht. */
.helga-page {
    max-width: 1040px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 32px;
    padding-right: 32px;
    padding-top: 72px;     /* Top-Bar → H1: viel Luft */
    padding-bottom: 96px;
}

/* Schmalere Variante fuer Settings-Pages (Bild 4 Lexware) */
.helga-page-narrow {
    max-width: 880px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 32px;
    padding-right: 32px;
    padding-top: 72px;
    padding-bottom: 96px;
}

/* H1 — bewusst ZURUECKGENOMMEN. Regular weight, nicht bold.
   ~30px statt der ueblichen 36-48px. Verhaeltnis zu Body ~2x. */
.helga-h1 {
    font-family: 'Source Serif 4', ui-serif, Georgia, serif;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 400;
    letter-spacing: -0.015em;
    color: #1c1a20;
    margin-bottom: 32px;
}

/* H2 / Card-Headline */
.helga-h2 {
    font-size: 18px;
    line-height: 1.3;
    font-weight: 500;
    color: #1c1a20;
    letter-spacing: -0.005em;
}

/* Card — der Workhorse. Padding 32/28, kein Border, nur weisses
   Pad auf paper-Background. Gap zwischen Cards = 24px (per
   .helga-card-stack auf Container). */
.helga-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 28px 32px;
    box-shadow: 0 1px 2px rgba(17,16,20,.04), 0 8px 24px -8px rgba(17,16,20,.06);
}

.helga-card-stack > * + * {
    margin-top: 24px;
}

/* Card-Header-Zeile: Title links + Aktion rechts (Bild 4 Lexware:
   "Firmenanschrift  ✎ AENDERN") */
.helga-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

/* Label-Wert-Paar in Card. Label: 11px UPPERCASE gray, Wert: 16px dunkel.
   Reihe von solchen Paaren via .helga-fields auf Wrapper. */
.helga-fields {
    display: grid;
    grid-template-columns: minmax(140px, 200px) 1fr;
    row-gap: 20px;
    column-gap: 24px;
}

.helga-card-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #76737f;     /* slate-500 / ink-500 */
    align-self: center;
}

.helga-card-value {
    font-size: 16px;
    line-height: 1.5;
    color: #1c1a20;
    font-weight: 400;
}

/* Leerer Wert: kursiver Placeholder "keine Angabe" (Bild 4 Pattern 17) */
.helga-card-value-empty {
    font-style: italic;
    color: #a09da8;
}

/* Listen-Zeile (Bild 1/5 Belegliste). 64px hoch, Primaer + Meta + Betrag rechts. */
.helga-list-row {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 64px;
    padding: 12px 24px;
    border-bottom: 1px solid #efeae0;   /* paper-200 */
    background: #ffffff;
}

.helga-list-row:hover { background: #fdfcf9; }
.helga-list-row:last-child { border-bottom: none; }

.helga-list-primary {
    font-size: 16px;
    font-weight: 500;
    color: #1c1a20;
    line-height: 1.3;
}

.helga-meta {
    font-size: 13px;
    color: #76737f;
    line-height: 1.4;
}

/* Filter-Schiene links (Bild 1/5 Lexware). 210px breit, dezent. */
.helga-rail {
    width: 210px;
    flex: 0 0 210px;
    padding: 24px 16px;
}

.helga-rail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #33313b;
    min-height: 40px;
    cursor: pointer;
    transition: background .15s ease;
}

.helga-rail-item:hover { background: #f8f5ee; }   /* paper-100 */

.helga-rail-item-active {
    background: #f0eef2;     /* ink-100 */
    font-weight: 500;
}

.helga-rail-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: #55525e;
    background: #efeae0;
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 24px;
    text-align: center;
}

/* Tab-Bar (Underline-Stil, Bild 3 Lexware "EINSTELLUNGEN | BENACHRICHTIGUNGEN") */
.helga-tabs {
    display: flex;
    gap: 32px;
    border-bottom: 1px solid #efeae0;
    margin-bottom: 32px;
}

.helga-tab {
    padding: 12px 2px;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #76737f;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    text-decoration: none;
    transition: color .15s ease, border-color .15s ease;
}

.helga-tab:hover { color: #1c1a20; }

.helga-tab-active {
    color: #1c1a20;
    border-bottom-color: #000066;     /* helga-500, einziger Akzent */
}

/* Action-Link mit Icon (Bild 3 "MEHR ERFAHREN" / "FEEDBACK" /
   Bild 4 "✎ AENDERN"). Kein Button-Look, Text + Icon + UPPERCASE. */
.helga-action-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #55525e;
    text-decoration: none;
    transition: color .15s ease;
}

.helga-action-link:hover { color: #1c1a20; }
.helga-action-link svg { width: 16px; height: 16px; }

/* Destruktive Aktion ganz unten (Bild 3 "BELEGEMPFANG ZURUECKSETZEN"):
   wie helga-action-link, aber rechtsbuendig und gedaempfter. */
.helga-action-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a09da8;
    text-decoration: none;
    transition: color .15s ease;
    margin-top: 48px;
}

.helga-action-danger:hover { color: #b54807; }   /* helga-700 */

/* Page-Title-Zeile: H1 links + Aktionen rechts (Bild 2/3/4 Lexware) */
.helga-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 24px;
}

.helga-title-row .helga-h1 { margin-bottom: 0; }

/* Status-Badge am H1 (Bild 3 "Belegempfang [NEU]") */
.helga-title-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    margin-left: 12px;
    border-radius: 999px;
    background: #fee8c6;     /* helga-100 */
    color: #92390d;          /* helga-800 */
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    vertical-align: middle;
}

/* Primary Solid Button — bewusst SELTEN einsetzen (max 1-2 pro Seite) */
.helga-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    background: #000066;     /* helga-500 */
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    transition: background .15s ease;
}

.helga-btn-primary:hover { background: #00004d; }   /* helga-600 */

/* Outlined Button (Sekundaer, Bild 3 "+ NEUER BELEG" outline) */
.helga-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    background: #ffffff;
    color: #33313b;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid #c9c6cf;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease;
}

.helga-btn-outline:hover { border-color: #76737f; color: #1c1a20; }

/* KPI-Kachel (Bild 4 Lexware Umsatz-Tab). Hellgrauer Block,
   kleines Label oben, grosse Zahl unten. Kein Border, kein Icon. */
.helga-kpi {
    background: #f8f5ee;     /* paper-100 */
    border-radius: 10px;
    padding: 24px 28px;
    text-align: center;
}

.helga-kpi-label {
    font-size: 13px;
    color: #76737f;
    margin-bottom: 8px;
}

.helga-kpi-value {
    font-size: 28px;
    font-weight: 500;
    color: #1c1a20;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* KPI-Kachel-Row: 3 nebeneinander */
.helga-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Filter-Bar (Bild 2 Lexware "Bereich" + "Zeitraum" Dropdowns) */
.helga-filter-bar {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.helga-filter-bar label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: #76737f;
}

/* Empty-State (Bild 5 Lexware "Klasse! Fuer heute gibt es keine Aufgaben mehr!") */
.helga-empty {
    text-align: center;
    padding: 48px 24px;
    color: #76737f;
}

.helga-empty-headline {
    font-family: 'Source Serif 4', ui-serif, Georgia, serif;
    font-size: 22px;
    color: #1c1a20;
    margin-bottom: 8px;
}

.helga-empty-text {
    font-size: 14px;
}
/* ===== Two-Tier-Header (Masthead + Slimbar)
   Tim 20.05.2026: tagDiv-Newspaper-Pattern.
   1) Masthead = grosser Header oben, full-width, NICHT sticky,
      heller Hintergrund (paper-50) damit Original-Logo sichtbar
   2) Slimbar = schlanker Sticky-Header, slidet rein wenn Masthead
      aus dem Viewport ist (per IntersectionObserver in base.html)
   WICHTIG: Logo wird IMMER als <img> eingebunden, NIEMALS rekonstruiert.
   ============================================================ */

.helga-masthead {
    background: #fdfcf9;        /* paper-50 — wie vorher, original Logo zeigt sich */
    width: 100%;
    padding: 28px 32px;          /* Tim 21.05.2026: hoeher (war 14px) */
    border-bottom: 1px solid #efeae0;
}
.helga-masthead-top {
    display: flex;
    align-items: center;
    max-width: 1440px;
    margin: 0 auto;
    gap: 24px;
    min-height: 72px;            /* Tim 21.05.2026: Mindesthoehe fuer Logo 48px */
}

/* Breadcrumb-Slot zwischen Logo und Icons. Tim 20.05.2026:
   Pfad lebt jetzt im Masthead, nicht mehr als zweite Bar darunter. */
.helga-masthead-trail {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #55525e;             /* ink-600 */
    min-width: 0;               /* damit truncate funktioniert */
    overflow: hidden;
}
.helga-masthead-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.helga-masthead-logo img {
    height: 48px;                /* Tim 21.05.2026: 1.5x (war 32) */
    width: auto;
    display: block;
}
.helga-masthead-icons {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #55525e;             /* ink-600 — dunkel auf cream */
    font-size: 13px;
}
.helga-masthead-icons > * { transition: color .15s ease; }
.helga-masthead-icons a:hover,
.helga-masthead-icons > *:hover { color: #1c1a20; }

.helga-masthead-nav {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    gap: 36px;
    padding: 14px 0;
    border-top: 1px solid #efeae0;
    flex-wrap: wrap;
}
.helga-masthead-nav a {
    color: #55525e;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    transition: color .15s ease;
}
.helga-masthead-nav a:hover { color: #1c1a20; }
.helga-masthead-nav a.is-active {
    color: #1c1a20;
    position: relative;
}
.helga-masthead-nav a.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -16px;
    height: 2px;
    background: #000066;        /* helga-500 */
}

/* Slimbar — HELGA Navy */
.helga-slimbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: #000066;        /* helga-500 */
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 24px;
    z-index: 30;
    transform: translateY(-100%);
    transition: transform .25s ease;
    box-shadow: 0 2px 8px -2px rgba(0, 0, 102, .35);
}
.helga-slimbar.is-visible { transform: translateY(0); }

.helga-slimbar-logo {
    display: inline-flex;
    align-items: center;
    margin-right: 12px;
    flex-shrink: 0;
}
.helga-slimbar-logo img {
    height: 22px;
    width: auto;
    display: block;
}

.helga-slimbar a {
    color: #d6d6ed;             /* helga-100 */
    font-size: 13px;
    text-decoration: none;
    transition: color .15s ease;
}
.helga-slimbar a:hover { color: #ffffff; }
.helga-slimbar a.is-active { color: #ffffff; font-weight: 500; }
.helga-slimbar .spacer { flex: 1; }
.helga-slimbar-icons {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #d6d6ed;
    font-size: 13px;
}

/* Tim 21.05.2026: Breadcrumb auch in der Slimbar zeigen. Wir
   rendern denselben Jinja-Block via `{{ self.breadcrumb() }}` ein
   zweites Mal — Styling wird hier auf den dunklen Helga-Hintergrund
   getrimmt (das Original-Breadcrumb-Ribbon ist hell auf weiß,
   in der Slimbar ist alles auf Navy — der innere Ribbon-Container
   wird transparent gemacht). */
.helga-slimbar-trail {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    color: #d6d6ed;             /* helga-100 */
    font-size: 13px;
}
.helga-slimbar-trail nav {
    background: transparent !important;
    color: #d6d6ed !important;
    width: 100%;
}
.helga-slimbar-trail nav > div {
    padding: 0 !important;
    height: auto !important;
    max-width: none !important;
}
.helga-slimbar-trail nav a,
.helga-slimbar-trail nav span {
    color: #d6d6ed !important;
}
.helga-slimbar-trail nav a:hover {
    color: #ffffff !important;
}

/* ===== Globale Rahmen-Eliminierung (Tim 20.05.2026)
   Tim will KEINE Rahmen auf Cards/Containern. Funktionale Borders
   (Inputs, Selects, Textareas, Buttons, Drop-Zones mit .border-dashed)
   bleiben erhalten.

   Strategy: alle Elemente mit ink/paper/slate/gray border-Klassen
   bekommen border-color: transparent, ausgenommen Form-Elemente
   und .border-dashed. Klassen-Spezifisch statt Element-Spezifisch,
   damit auch transparente Container ohne bg-* erfasst werden
   (z.B. Aktenordner-Kacheln, die nur "border border-slate-200" haben). */

[class*="border-slate"]:not(input):not(select):not(textarea):not(button):not(.border-dashed):not([class*="border-dashed"]),
[class*="border-paper"]:not(input):not(select):not(textarea):not(button):not(.border-dashed):not([class*="border-dashed"]),
[class*="border-ink"]:not(input):not(select):not(textarea):not(button):not(.border-dashed):not([class*="border-dashed"]),
[class*="border-gray"]:not(input):not(select):not(textarea):not(button):not(.border-dashed):not([class*="border-dashed"]) {
    border-color: transparent !important;
}

/* Keine Shadow-Regel hier — Cards die einen Container-Hint brauchen,
   nutzen weiter die bestehende Klasse `shadow-soft` etc. */

/* ===== Detail-Page-Komponenten (Tim 21.05.2026, Variante 2)
   Basierend auf Mockup vom 21.05. — wiederverwendbare Komponenten
   fuer entity_detail, vorgang_detail, document_detail, aktenordner_
   detail. BEM-light Konvention: Block · Block-Element · Block--Modifier.

   Tokens kommen aus @theme oben (paper, ink, lila, helga). Keine
   Tailwind-Standardfarben (purple/slate/rose/emerald) — alles ueber
   die Helga-Palette gemappt. Funktionale Rahmen (Inputs, Drop-Zones)
   sind bewusst nicht entkernt.
   ============================================================ */

/* Cream-Page mit dezenter Punkt-Textur (Privatsekretaerin-Look).
   Wird auf <body> oder einem Page-Wrapper genutzt. Optional — der
   bisherige paper-50 bleibt funktional. */
.helga-page-bg {
    background-color: #fdfcf9;     /* paper-50 */
    background-image:
        radial-gradient(circle at 20% 20%, rgba(17,16,20,.035) .55px, transparent .55px),
        radial-gradient(circle at 70% 40%, rgba(17,16,20,.025) .55px, transparent .55px);
    background-size: 180px 180px, 240px 240px;
}

/* Detail-Page-Container: max-Breite, Padding, vertikale Sektion-Abstaende */
.helga-detail {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Grid-Bausteine */
.helga-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.helga-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.helga-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.helga-grid-7-5 { display: grid; grid-template-columns: 7fr 5fr; gap: 24px; }
@media (max-width: 900px) {
    .helga-grid-2, .helga-grid-3, .helga-grid-4 { grid-template-columns: 1fr; }
    .helga-grid-7-5 { grid-template-columns: 1fr; }
}

/* Card-Update: mehr Rundung + doppelte Shadow wie im Mockup.
   Ueberschreibt die Anzeige der schon vorhandenen .helga-card-Definition
   weiter oben, da sie in der Kaskade spaeter steht. */
.helga-card {
    background: #ffffff;
    border-radius: 20px;            /* 1.25rem */
    padding: 24px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .035),
        0 10px 28px rgba(15, 23, 42, .075);
}
.helga-card-stack > * + * { margin-top: 24px; }

/* Soft-Tile — Hover-faehiges Listen-Item (Brief, Vorgang, Aktenordner-
   Kachel). Lift-Effekt + Background-Wechsel beim Hover. */
.helga-soft-tile {
    display: block;
    background: rgba(248, 250, 252, .86);  /* hell-grau, leicht transparent */
    border-radius: 16px;                    /* 1rem */
    padding: 14px 18px;
    text-decoration: none;
    color: inherit;
    transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.helga-soft-tile:hover {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .07);
}

/* === HERO === */
.helga-hero {
    background: #ffffff;
    border-radius: 20px;
    padding: 28px 32px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .035),
        0 10px 28px rgba(15, 23, 42, .075);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.helga-hero-head {
    flex: 1;
    min-width: 280px;
}
.helga-hero-badge {
    display: inline-flex;
    align-items: center;
    background: #f1e2ff;            /* lila-100 */
    color: #5a0d7d;                  /* lila-800 */
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}
.helga-hero-title {
    font-family: 'Source Serif 4', ui-serif, Georgia, serif;
    font-size: 36px;
    line-height: 1.1;
    color: #1c1a20;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin: 0;
}
.helga-hero-subtitle {
    font-size: 16px;
    color: #76737f;
    margin-top: 4px;
}
.helga-hero-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #76737f;
    margin-top: 16px;
    flex-wrap: wrap;
}
.helga-hero-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

/* === Postfach-Zeile === */
.helga-postfach {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #76737f;
}
.helga-postfach-icon { width: 16px; height: 16px; color: #a09da8; }
.helga-postfach-addr {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    color: #1c1a20;
    user-select: all;
}
.helga-postfach-copy {
    background: none;
    border: none;
    color: #700e9b;                  /* lila-700 */
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}
.helga-postfach-copy:hover { color: #460b62; }

/* === KPI-Tile (neue Variante aus Mockup) === */
.helga-kpi-tile {
    background: #ffffff;
    border-radius: 20px;
    padding: 18px 20px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .035),
        0 10px 28px rgba(15, 23, 42, .075);
    display: flex;
    align-items: center;
    gap: 16px;
}
.helga-kpi-tile-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.helga-kpi-tile-icon--lila    { background: #f1e2ff; color: #700e9b; }
.helga-kpi-tile-icon--helga   { background: #fee8c6; color: #b54807; }
.helga-kpi-tile-icon--ink     { background: #e4e2e8; color: #33313b; }
.helga-kpi-tile-icon--amber   { background: #fef3c7; color: #92400e; }
.helga-kpi-tile-icon--paper   { background: #f8f5ee; color: #55525e; }
.helga-kpi-tile-label {
    font-size: 13px;
    color: #76737f;
}
.helga-kpi-tile-value {
    font-size: 22px;
    font-weight: 600;
    color: #1c1a20;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

/* === Row (Listen-Eintrag, generisch) === */
.helga-row {
    display: flex;
    align-items: center;
    gap: 16px;
}
.helga-row-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.helga-row-icon--paper { background: #efeae0; color: #76737f; }
.helga-row-icon--lila  { background: #f1e2ff; color: #700e9b; }
.helga-row-icon--helga { background: #fee8c6; color: #b54807; }
.helga-row-icon--pdf   { background: #fee2e2; color: #b91c1c; }   /* PDF-Indikator-Rot, bewusst noch erkennbar */
.helga-row-body {
    flex: 1;
    min-width: 0;
}
.helga-row-title {
    font-size: 14px;
    font-weight: 500;
    color: #1c1a20;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.helga-row-meta {
    font-size: 12px;
    color: #76737f;
    margin-top: 2px;
}

/* === Pills (Status / Tags) === */
.helga-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
}
.helga-pill--ok    { background: #d1fae5; color: #065f46; }     /* erledigt */
.helga-pill--warn  { background: #fef3c7; color: #92400e; }     /* unsicher */
.helga-pill--info  { background: #f1e2ff; color: #5a0d7d; }     /* Person/Tag */
.helga-pill--alert { background: #fee2e2; color: #991b1b; }     /* dringend */
.helga-pill--neutral { background: #f0eef2; color: #33313b; }   /* offen / default */

/* === Sektion-Header (innerhalb einer Card) === */
.helga-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.helga-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1c1a20;
    margin: 0;
}
.helga-section-link {
    font-size: 14px;
    font-weight: 500;
    color: #700e9b;
    text-decoration: none;
}
.helga-section-link:hover { color: #460b62; }
.helga-section-link--warn { color: #b54807; }
.helga-section-link--warn:hover { color: #92390d; }

/* === Buttons (Mockup-Variante) === */
.helga-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #000066;             /* helga-500 */
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background .15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 102, .22);
}
.helga-btn-primary:hover { background: #00004d; }    /* helga-600 */

.helga-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f8f5ee;             /* paper-100 */
    color: #33313b;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background .15s ease;
}
.helga-btn-secondary:hover { background: #efeae0; }   /* paper-200 */

.helga-btn-ghost {
    background: none;
    color: #76737f;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color .15s ease;
}
.helga-btn-ghost:hover { color: #1c1a20; }

/* === Form-Bausteine === */
.helga-form-field {
    display: block;
}
.helga-form-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #76737f;
    margin-bottom: 6px;
}
.helga-input,
.helga-select,
.helga-textarea {
    display: block;
    width: 100%;
    background: #f8f5ee;             /* paper-100 */
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    color: #1c1a20;
    transition: background .15s ease, border-color .15s ease;
}
.helga-input:focus,
.helga-select:focus,
.helga-textarea:focus {
    outline: none;
    background: #ffffff;
    border-color: #000066;           /* helga-500 focus ring */
    box-shadow: 0 0 0 3px rgba(0, 0, 102, .14);
}

/* === Accordion (details/summary) === */
.helga-accordion {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px 24px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .035),
        0 10px 28px rgba(15, 23, 42, .075);
}
.helga-accordion > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.helga-accordion > summary::-webkit-details-marker { display: none; }
.helga-accordion-title {
    font-size: 18px;
    font-weight: 600;
    color: #1c1a20;
}
.helga-accordion-subtitle {
    font-size: 14px;
    color: #76737f;
    margin-top: 4px;
}
.helga-accordion-toggle {
    background: #f0eef2;
    color: #33313b;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}
.helga-accordion-body {
    margin-top: 20px;
}

/* === Context-Switcher (Schreibtisch wechseln Header-Element) === */
.helga-context-switcher {
    position: relative;
}
.helga-context-switcher > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, .9);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .035);
    padding: 12px 16px;
    font-size: 14px;
}
.helga-context-switcher > summary::-webkit-details-marker { display: none; }
.helga-context-switcher-label { color: #76737f; }
.helga-context-switcher-current { font-weight: 500; color: #1c1a20; }

/* ===== Ende Detail-Page-Komponenten ===== */

/* ===== Helga-Helper (Floating Action Button + Dock-Panel)
   Tim 21.05.2026 — Privatsekretaerin meldet sich unten rechts statt
   in einer Wand-Box auf der Page. Vier Zustaende ueber Klassen:
     .helga-helper              — Base, immer
     .helga-helper-icon--alert  — Pulse-Ring an, Helga hat Tipp
     .helga-helper-bubble       — Speech-Bubble (auto-fade)
     .helga-helper-panel        — Dock-Panel von rechts
     .helga-helper-panel.is-open — sichtbar
   ============================================================ */

.helga-helper {
    position: fixed;
    bottom: 26px;
    right: 28px;
    z-index: 60;
    display: flex;
    align-items: end;
    gap: 12px;
}

.helga-helper-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow:
        0 2px 4px rgba(17, 16, 20, .10),
        0 14px 34px rgba(17, 16, 20, .22);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform .18s ease, box-shadow .18s ease;
    animation: helga-helper-arrive .45s ease-out;
}
.helga-helper-icon:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow:
        0 3px 8px rgba(17, 16, 20, .12),
        0 18px 42px rgba(17, 16, 20, .28);
}
.helga-helper-icon img {
    width: 38px;
    height: 38px;
    display: block;
}
.helga-helper-icon--alert::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid #000066;
    animation: helga-pulse 2s ease-in-out infinite;
    pointer-events: none;
}
@keyframes helga-helper-arrive {
    from { opacity: 0; transform: translateY(10px) scale(.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes helga-pulse {
    0%, 100% { opacity: .65; transform: scale(1); }
    50%      { opacity: 0;   transform: scale(1.35); }
}

.helga-helper-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #000066;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.helga-helper-bubble {
    background: #1c1a20;
    color: #fff;
    border-radius: 12px;
    padding: 10px 14px 10px 16px;
    font-size: 13px;
    line-height: 1.4;
    max-width: 280px;
    box-shadow: 0 4px 16px rgba(17, 16, 20, .16);
    position: relative;
    animation: helga-bubble-in .25s ease-out;
    transition: opacity .4s ease;
}
.helga-helper-bubble::after {
    content: "";
    position: absolute;
    right: -6px;
    bottom: 16px;
    border: 6px solid transparent;
    border-left-color: #1c1a20;
}
.helga-helper-bubble-close {
    margin-left: 8px;
    opacity: .55;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}
.helga-helper-bubble-close:hover { opacity: 1; }
@keyframes helga-bubble-in {
    from { opacity: 0; transform: translateX(8px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Dock-Panel */
:root {
    --helga-helper-dock-width: 480px;
    --helga-helper-dock-gap: 18px;
}

.helga-app-root {
    transition: padding-right .25s ease;
}

.helga-helper-panel {
    position: fixed;
    top: 96px;
    right: var(--helga-helper-dock-gap);
    bottom: var(--helga-helper-dock-gap);
    width: var(--helga-helper-dock-width);
    max-width: calc(100vw - 24px);
    background: #fdfcf9;
    border: 1px solid #efeae0;
    border-radius: 14px;
    box-shadow:
        0 1px 2px rgba(17, 16, 20, .05),
        0 14px 34px rgba(17, 16, 20, .12);
    transform: translateX(calc(100% + var(--helga-helper-dock-gap) + 8px));
    transition: transform .25s ease;
    z-index: 70;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.helga-helper-panel.is-open { transform: translateX(0); }

@media (min-width: 1025px) {
    body.helga-helper-is-open .helga-app-root {
        padding-right: calc(var(--helga-helper-dock-width) + (2 * var(--helga-helper-dock-gap)));
    }

    body.helga-helper-is-open .helga-helper {
        opacity: 0;
        transform: translateY(8px);
        pointer-events: none;
    }
}

.helga-helper-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 16px 20px;
    border-bottom: 1px solid #efeae0;
    flex-shrink: 0;
    background: #ffffff;
}
.helga-helper-panel-title {
    font-family: 'Source Serif 4', ui-serif, Georgia, serif;
    font-size: 20px;
    color: #1c1a20;
    font-weight: 500;
}
.helga-helper-panel-close {
    background: #f8f5ee;
    border: 1px solid #efeae0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #55525e;
    cursor: pointer;
    padding: 7px 12px;
    line-height: 1.1;
}
.helga-helper-panel-close:hover {
    color: #1c1a20;
    background: #efeae0;
}
.helga-helper-close-label--mobile {
    display: none;
}
.helga-helper-panel-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

@media (min-width: 768px) and (max-width: 1024px) {
    .helga-helper {
        right: 20px;
        bottom: 20px;
    }

    .helga-helper-panel {
        top: 88px;
        right: 16px;
        bottom: 16px;
        width: calc(100vw - 32px);
        max-width: 420px;
        z-index: 80;
        transform: translateX(calc(100% + 24px));
    }

    .helga-helper-panel.is-open {
        transform: translateX(0);
    }

    body.helga-helper-is-open .helga-helper {
        opacity: 0;
        transform: translateY(8px);
        pointer-events: none;
    }
}

@media (max-width: 767px) {
    .helga-helper {
        right: 50%;
        bottom: calc(18px + env(safe-area-inset-bottom, 0px));
        transform: translateX(50%);
        z-index: 90;
    }
    .helga-helper-icon {
        width: 68px;
        height: 68px;
    }
    .helga-helper-icon img {
        width: 40px;
        height: 40px;
    }
    .helga-helper-bubble {
        display: none;
    }
    .helga-helper-panel {
        inset: 0;
        width: 100vw;
        min-height: 100dvh;
        max-width: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
        z-index: 120;
        transform: translateY(100%);
    }
    .helga-helper-panel.is-open {
        transform: translateY(0);
    }
    .helga-helper-panel-head {
        padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
    }
    .helga-helper-panel-body {
        padding: 16px;
        padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    }
    .helga-helper-close-label--desktop {
        display: none;
    }
    .helga-helper-close-label--mobile {
        display: inline;
    }
    body.helga-helper-is-open {
        overflow: hidden;
    }
    body.helga-helper-is-open .helga-helper {
        opacity: 0;
        pointer-events: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .helga-helper-icon,
    .helga-helper-icon--alert::before,
    .helga-helper-bubble,
    .helga-helper-panel,
    .helga-app-root {
        animation: none;
        transition: none;
    }
}

/* ===== Tragweite-Indikator (Tim 21.05.2026)
   Horizontale Bar mit Farbverlauf gruen→gelb→rot, Marker auf Score-
   Position. Score 0-100, Labels in 5 Stufen. Drei Groessen.
   ============================================================ */

.helga-tragweite {
    color: #1c1a20;
    background: #ffffff;
    border-radius: 14px;
    padding: 18px 20px 16px;
    box-shadow: 0 1px 2px rgba(17, 16, 20, .05);
}

/* Kopf-Zeile: Titel links, Score rechts */
.helga-tragweite-kopf {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

/* Aktions-Zeile unter Begruendung */
.helga-tragweite-actions {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
}
.helga-tragweite-manuell-tag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #76737f;
    background: #f0eef2;
    padding: 2px 8px;
    border-radius: 6px;
}

/* Leere Variante — noch nie bewertet */
.helga-tragweite--leer {
    background: #f6f5f8;
    color: #76737f;
}
.helga-tragweite--leer .helga-tragweite-titel { margin-top: 0; }

/* Mid-Bar in Listen */
.helga-tragweite-mid {
    width: 100%;
    max-width: 280px;
}
.helga-tragweite-mid-label {
    margin-top: 4px;
    font-size: 11px;
    color: #76737f;
    text-transform: lowercase;
}

/* Link-Button-Stil — sekundaere Aktion ohne Boxen-Look */
.helga-link-button {
    background: transparent;
    border: none;
    padding: 0;
    color: #6b4ea0;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.helga-link-button:hover { color: #5a3e8c; }
.inline { display: inline; }

/* Score-Zahl gross + Begleit-Text */
.helga-tragweite-score {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.helga-tragweite-titel {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #76737f;
    margin-top: 6px;
}
.helga-tragweite-kategorie {
    font-size: 12px;
    color: #a09da8;
    margin-top: 2px;
}

/* Bar selbst */
.helga-tragweite-bar {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(
        to right,
        #22c55e 0%,
        #84cc16 25%,
        #facc15 50%,
        #f57d09 75%,
        #dc2626 100%
    );
    margin-top: 12px;
}
.helga-tragweite-marker {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #1c1a20;
    transform: translate(-50%, -50%);
    transition: left .8s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 1px 3px rgba(17, 16, 20, .25);
}

/* Endpunkt-Labels */
.helga-tragweite-ends {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: #76737f;
}

/* Aktuelles Label + Begruendung */
.helga-tragweite-label {
    margin-top: 14px;
    font-size: 15px;
    font-weight: 600;
    color: #1c1a20;
}
.helga-tragweite-begruendung {
    font-size: 13px;
    color: #55525e;
    margin-top: 4px;
    line-height: 1.5;
}

/* Score-Zahl-Farbe je nach Stufe */
.helga-tragweite--ruhig         .helga-tragweite-score { color: #16a34a; }
.helga-tragweite--im-blick      .helga-tragweite-score { color: #65a30d; }
.helga-tragweite--aufmerksam    .helga-tragweite-score { color: #ca8a04; }
.helga-tragweite--wichtig       .helga-tragweite-score { color: #d96104; }
.helga-tragweite--kritisch      .helga-tragweite-score { color: #dc2626; }

/* Mittlere Variante — kompakter, ohne Score-Zahl-Block */
.helga-tragweite--mid .helga-tragweite-score { font-size: 24px; }
.helga-tragweite--mid .helga-tragweite-titel { display: none; }
.helga-tragweite--mid .helga-tragweite-kategorie { display: none; }
.helga-tragweite--mid .helga-tragweite-begruendung { display: none; }
.helga-tragweite--mid .helga-tragweite-bar { margin-top: 6px; height: 5px; }
.helga-tragweite--mid .helga-tragweite-marker { width: 12px; height: 12px; border-width: 2px; }
.helga-tragweite--mid .helga-tragweite-label { font-size: 13px; margin-top: 6px; }

/* Mini-Dot — nur Farbe, kein Text */
.helga-tragweite-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.helga-tragweite-dot--ruhig       { background: #22c55e; }
.helga-tragweite-dot--im-blick    { background: #84cc16; }
.helga-tragweite-dot--aufmerksam  { background: #facc15; }
.helga-tragweite-dot--wichtig     { background: #f57d09; }
.helga-tragweite-dot--kritisch    { background: #dc2626; }

/* ===== Glocken-Badge (Tim 21.05.2026) — „X neue Briefe"
   Kleines Pill mit Glocke + Zahl, dezent navy, an Schreibtisch-
   Kacheln + Aktenordner-Tiles. */
.helga-bell-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: #000066;        /* helga-500 */
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 3px rgba(0, 0, 102, .35);
}
.helga-bell-badge svg {
    width: 16px !important;
    height: 16px !important;
}

/* ============== Ende Klarheit-Komponenten ============== */
