/* ============================================================
   KIRONA – Seitenbausteine und einzelne Seiten
   Wiederverwendbare Muster zuerst (Seitenkopf, Platte, Leerzustand),
   danach die von Hand gestalteten Seiten. Tokens: app.css.
   ============================================================ */

/* ---- Seitenkopf ---------------------------------------------- */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
    margin-bottom: var(--space-5);
}
.page-head-text { min-width: 0; }
.page-head h1 { margin: 0; }
.page-head-intro { margin: 0.3rem 0 0; color: var(--ink-muted); }
.page-head-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ---- Platte ---------------------------------------------------
   Wie das Typenschild an einem Tor: eine Platte, in Felder geteilt.
   Zusammengehoerige Kennzahlen stehen auf einer Flaeche statt in
   lauter einzelnen Karten. Die Haarlinien entstehen aus dem 1px-Abstand. */
.plate {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--line);
}
.plate-cell {
    flex: 1 1 11.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    padding: 1rem 1.15rem 1.05rem;
    background: var(--plate-bg, var(--surface));
    color: var(--ink);
    transition: background-color var(--dur-fast) var(--ease-out);
}
a.plate-cell:hover { background: var(--surface-raised); color: var(--ink); text-decoration: none; }
a.plate-cell:focus-visible { outline-offset: -2px; }
.plate-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--plate-label-color, var(--ink-muted));
    font-size: var(--font-size-sm);
    font-weight: 500;
}
.plate-label i, .plate-label .bi { width: 1rem; text-align: center; font-size: 0.85rem; }
.plate-value {
    font-family: var(--font-display);
    font-size: calc(1.75rem * var(--heading-scale, 1));
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0;
    color: var(--plate-value-color, var(--ink));
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.plate-hint { font-size: var(--font-size-xs); color: var(--ink-muted); }
a.plate-cell:hover .plate-hint { color: var(--accent-text); }

/* ---- Leerzustand --------------------------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: var(--space-5) 1.1rem;
}
.empty-state-icon { font-size: 1.5rem; color: var(--ink-muted); margin-bottom: 0.25rem; }
.empty-state-title { margin: 0; font-weight: 600; }
.empty-state-text { margin: 0 0 0.5rem; color: var(--ink-muted); font-size: var(--font-size-sm); }

/* Kartenkopf mit Verweis rechts */
.card-header-split { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.card-header-link {
    font-family: var(--font-family, 'Segoe UI'), system-ui, sans-serif;
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
}

/* ---- Rollen-Dashboard (RoleDashboard) ------------------------ */
.rd { margin-bottom: var(--space-7); }
.rd-header { margin-bottom: var(--space-4); }
.rd-heading { font-size: 1.75rem; margin: 0; }
.rd-intro { margin: 0.3rem 0 0; color: var(--ink-muted); }
.rd-kpis { margin-bottom: var(--space-5); }
.rd-columns {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-5) var(--space-6);
}
.rd-subheading {
    margin: 0 0 var(--space-3);
    font-size: 1rem;
}
.rd-open {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
}
.rd-open-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.65rem 0.9rem;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    transition: background-color var(--dur-fast) var(--ease-out);
}
.rd-open-item:last-child { border-bottom: 0; }
.rd-open-item:hover { background: var(--pressed); color: var(--ink); text-decoration: none; }
.rd-open-item:focus-visible { outline-offset: -2px; }
.rd-open-count {
    min-width: 2.1rem;
    padding: 0.1rem 0.45rem;
    border-radius: 5px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: center;
}
.rd-open-label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.5rem; }
.rd-open-label i { color: var(--ink-muted); width: 1rem; text-align: center; }
.rd-open-arrow { color: var(--ink-muted); font-size: 0.7rem; }
.rd-empty {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0.8rem 0.9rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    color: var(--ink-muted);
}
.rd-empty i { color: var(--status-success); }
.rd-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
    gap: var(--space-2);
}
.rd-action {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 2.75rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    transition: var(--transition);
}
.rd-action:hover { background: var(--surface-raised); border-color: var(--line-strong); color: var(--ink); text-decoration: none; }
.rd-action-icon { width: 1.1rem; flex-shrink: 0; text-align: center; color: var(--ink-muted); }
.rd-action:hover .rd-action-icon { color: var(--accent-text); }
.rd-action-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1199.98px) { .rd-columns { grid-template-columns: 1fr; } }

/* ---- Startseite: Handbuch ------------------------------------ */
/* .page-shell nutzt die volle Breite; Lese- und Kontoseiten begrenzen sich hier selbst. */
.page-shell.home-page { max-width: 1100px; }
.page-shell.cms-standard { max-width: var(--page-container-max-width, 1320px); }
.guide {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6) var(--space-6);
}
.guide-section-wide { grid-column: 1 / -1; }
.guide-heading {
    margin: 0 0 var(--space-2);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--line);
    font-size: 1.15rem;
}
.guide-list { display: flex; flex-direction: column; }
.guide-list-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-6); }
.guide-item {
    display: flex;
    gap: 0.8rem;
    margin-inline: -0.6rem;
    padding: 0.65rem 0.6rem;
    border-radius: var(--radius);
    color: var(--ink);
    transition: background-color var(--dur-fast) var(--ease-out);
}
.guide-item:hover { background: var(--pressed); color: var(--ink); text-decoration: none; }
.guide-item-icon { width: 1.15rem; margin-top: 0.22rem; flex-shrink: 0; text-align: center; color: var(--ink-muted); }
.guide-item:hover .guide-item-icon { color: var(--accent-text); }
.guide-item-body { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.guide-item-title { font-weight: 600; }
.guide-item-text { color: var(--ink-muted); font-size: var(--font-size-sm); line-height: 1.5; }
.guide-steps {
    list-style: none;
    counter-reset: step;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: var(--space-4);
    margin: var(--space-3) 0 0;
    padding: 0;
}
.guide-steps li {
    counter-increment: step;
    padding-top: 0.6rem;
    border-top: 2px solid var(--line-strong);
    color: var(--ink-muted);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}
.guide-steps li::before {
    content: counter(step);
    display: block;
    margin-bottom: 0.15rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--ink);
}
.home-info-text { margin: var(--space-6) 0 0; color: var(--ink-muted); font-size: var(--font-size-sm); }

@media (max-width: 767.98px) {
    .guide, .guide-list-columns { grid-template-columns: 1fr; }
}

/* ---- Admin-Dashboard ----------------------------------------- */
.admin-workspace {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-5);
    align-items: start;
}
.admin-order-link { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.admin-order-main { display: flex; flex-direction: column; min-width: 0; }
.admin-order-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-order-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; flex-shrink: 0; }
.admin-order-total { font-variant-numeric: tabular-nums; font-weight: 600; }
.admin-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 2px;
    padding: var(--space-2);
}
.admin-quick-action-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 2.5rem;
    padding: 0.45rem 0.65rem;
    border-radius: var(--radius);
    color: var(--ink);
    transition: background-color var(--dur-fast) var(--ease-out);
}
.admin-quick-action-link:hover { background: var(--pressed); color: var(--ink); text-decoration: none; }
.admin-quick-action-link .bi { width: 1.1rem; flex-shrink: 0; text-align: center; color: var(--ink-muted); }
.admin-quick-action-link:hover .bi { color: var(--accent-text); }

@media (max-width: 1199.98px) { .admin-workspace { grid-template-columns: 1fr; } }

/* ---- Anmeldung ------------------------------------------------ */
.login-page {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
    max-width: 60rem;
    margin: clamp(1rem, 6vh, 4rem) auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
}
/* Die Marke steht auf Schwarz – so ist das Logo gezeichnet. */
.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-6);
    background: #000;
    color: #c9d1da;
    text-align: center;
}
.login-brand-logo { width: min(100%, 20rem); height: auto; }
.login-brand-company { margin: 0; font-size: var(--font-size-sm); letter-spacing: 0.04em; }
.login-panel { padding: clamp(1.5rem, 4vw, 3rem); min-width: 0; }
.login-header { margin-bottom: var(--space-5); }
.login-header h1 { margin: 0; }
.login-header p { margin: 0.35rem 0 0; color: var(--ink-muted); }
.login-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.login-minor-link { font-size: var(--font-size-sm); }
.login-divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-4) 0;
    color: var(--ink-muted);
    font-size: var(--font-size-sm);
}
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem var(--space-5);
    margin: var(--space-5) 0 0;
    padding: var(--space-4) 0 0;
    border-top: 1px solid var(--line);
    list-style: none;
    font-size: var(--font-size-sm);
}
.login-external { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.login-external h2 { font-size: 1rem; margin-bottom: var(--space-3); }

@media (max-width: 767.98px) {
    .login-page { grid-template-columns: 1fr; max-width: 30rem; }
    .login-brand { padding: var(--space-4); }
    .login-brand-logo { width: 11rem; }
    .login-brand-company { display: none; }
}

/* ---- Konto-Seiten (Identity) --------------------------------- */
.account-shell { max-width: 30rem; margin: clamp(1rem, 5vh, 3rem) auto; }
.account-shell h1 { margin-bottom: var(--space-2); }

/* ---- Einrichtungs-Assistent ---------------------------------- */
.setup-page {
    display: flex;
    justify-content: center;
    padding: clamp(0.5rem, 3vh, 2.5rem) 0;
}
.setup-card {
    width: 100%;
    max-width: 52rem;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}
.setup-title { font-size: 1.75rem; }
.setup-title > i { display: none; }

/* Sechs Schritte als Strecke: erledigt = gefuellt, aktuell = rot, offen = Umriss. */
.setup-steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 0 0 var(--space-5);
    padding: 0 0 var(--space-5);
    border-bottom: 1px solid var(--line);
}
.setup-steps li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: var(--ink-muted);
    font-size: var(--font-size-xs);
    text-align: center;
}
.setup-steps li::before {
    content: "";
    position: absolute;
    top: 0.9rem;
    right: 50%;
    width: 100%;
    height: 2px;
    background: var(--line-strong);
}
.setup-steps li:first-child::before { display: none; }
.setup-steps li.done::before, .setup-steps li.active::before { background: var(--ink-muted); }
.setup-step-num {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    border: 2px solid var(--line-strong);
    background: var(--surface);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
}
.setup-steps li.done .setup-step-num { background: var(--ink-muted); border-color: var(--ink-muted); color: var(--surface); }
.setup-steps li.active { color: var(--ink); font-weight: 600; }
.setup-steps li.active .setup-step-num { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.setup-step-label { padding-inline: 0.2rem; line-height: 1.3; }

.setup-readonly {
    padding: 0.75rem 1rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--hover);
    font-size: var(--font-size-sm);
    line-height: 1.9;
}
.setup-summary {
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-sunk);
}
.setup-summary-title { font-size: 1.1rem; margin-bottom: 0.75rem; }
.setup-summary dt { color: var(--ink-muted); font-weight: 500; }
.setup-summary dd { color: var(--ink); }

@media (max-width: 575.98px) {
    .setup-steps li:not(.active) .setup-step-label { display: none; }
}

/* Konto verwalten */
.page-shell.account-manage, .account-manage { max-width: 64rem; }
.account-manage-grid { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.account-manage-nav .nav-pills .nav-link { padding: 0.45rem 0.7rem; }
.account-manage-body > h1:first-child, .account-manage-body > h2:first-child, .account-manage-body > h3:first-child { font-size: 1.2rem; margin-bottom: var(--space-4); }
@media (max-width: 767.98px) {
    .account-manage-grid { grid-template-columns: 1fr; gap: var(--space-4); }
    .account-manage-nav .nav-pills { flex-direction: row !important; flex-wrap: nowrap; overflow-x: auto; }
    .account-manage-nav .nav-pills .nav-link { white-space: nowrap; }
}

/* ---- Hinweisseiten (404, Zugriff verweigert) ----------------- */
.notice-page { max-width: 34rem; padding: clamp(1rem, 6vh, 4rem) 0; }
.notice-page-code {
    margin: 0 0 var(--space-2);
    font-family: var(--font-display);
    font-size: 4.5rem;
    font-weight: 600;
    line-height: 1;
    color: var(--line-strong);
    font-variant-numeric: tabular-nums;
}
.notice-page h1 { margin-bottom: var(--space-2); }
.notice-page-text { color: var(--ink-muted); margin-bottom: var(--space-5); }
.notice-page-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ---- Shop ----------------------------------------------------- */
.shop-product-price .text-primary { color: var(--shop-text, var(--ink)) !important; font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.shop-group-image.bg-secondary, .shop-product-image.bg-light { background: var(--shop-surface-2, var(--surface-sunk)) !important; }
.shop-group-image .bi, .shop-product-image > .bi { color: var(--shop-text-muted, var(--line-strong)) !important; }
.shop-product-image .btn { opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); margin-inline: 0.4rem; }
.shop-product-image:hover .btn, .shop-product-image .btn:focus-visible { opacity: 1; }

/* ---- KI-Assistent: Startknopf ------------------------------- */
/* Ruhig statt signalrot: er liegt ueber jeder Seite und darf Zeilenaktionen nicht ueberstrahlen. */
.page .ai-fab {
    width: 3rem;
    height: 3rem;
    border: 1px solid var(--line-strong);
    background-color: var(--surface-raised);
    color: var(--ink);
    font-size: 1.1rem;
    box-shadow: var(--shadow-float);
    transition: var(--transition);
}
.page .ai-fab:hover { filter: none; border-color: var(--accent-text); color: var(--accent-text); }
.page .ai-window { background-color: var(--surface); border-color: var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-float); }

/* Bestellbestaetigung */
.checkout-success { padding: var(--space-6) 0; }
.checkout-success-icon { font-size: 2.5rem; line-height: 1; }
.checkout-success-title { margin: var(--space-3) 0 var(--space-1); }
.checkout-success-text { margin: 0; }
.checkout-success-number {
    margin: var(--space-4) 0 var(--space-5);
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    user-select: all;
}
.checkout-success-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Offenes Menue (schmale Fenster): der Startknopf wuerde das Abmelden ueberdecken. */
.page:has(.navbar-toggler:checked) .ai-fab { display: none; }

/* ---- Berichte-Cockpit (/erp/reports) ------------------------------------------------------
   Ein Bildschirm statt einer langen Spalte: Kopf mit Filtern, Kennzahlen-Leiste, darunter ein
   12er-Raster. Ab 1400 px Breite und 800 px Höhe füllt das Raster genau den Rest des Fensters
   (--rc-offset = alles darüber); lange Listen scrollen in ihrer Karte. Darunter stapeln sich
   die Karten mit festen Höhen. */
/* --rc-offset = alles über dem Raster (Kopfzeile, Seitenkopf, Kennzahlen) + alles darunter (Abstand,
   Fusszeile ≈ 108 px). Gemessen 2026-11-10: Raster beginnt bei 235 px (Modulleiste einzeilig, ab 2200 px)
   bzw. 268 px (Module in eigener Zeile). */
.reports-cockpit { --rc-gap: 0.75rem; --rc-offset: 347px; }
@media (max-width: 2199.98px) { .reports-cockpit { --rc-offset: 380px; } }
.rc-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
    margin-bottom: var(--rc-gap);
}
.rc-title { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; min-width: 0; }
.rc-title h1 { margin: 0; }
.rc-updated { color: var(--ink-muted); font-size: var(--font-size-xs); }
.rc-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.rc-filters .form-select { width: auto; max-width: 13rem; }

.rc-kpis { margin-bottom: var(--rc-gap); }
.rc-kpis .plate-cell { flex-basis: 10rem; padding: 0.75rem 1rem 0.8rem; gap: 0.2rem; }
.rc-kpis .plate-value { font-size: 1.45rem; }

.rc-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--rc-gap);
}
.rc-card { display: flex; flex-direction: column; min-height: 0; margin: 0; }
.rc-card > .card-header { flex: 0 0 auto; font-weight: 600; }
.rc-body { flex: 1 1 auto; min-height: 0; padding: 0.75rem 1rem; }
.rc-scroll { overflow: auto; }
.rc-chart { position: relative; padding: 0.25rem 0.5rem; }
.rc-chart > * { height: 100%; }
.rc-muted { color: var(--ink-muted); }
.rc-empty { margin: 0; padding: 1rem; color: var(--ink-muted); }

/* Standard (schmaler als 1400 px): sechs Spalten, feste Höhen. */
.rc-trend { grid-column: span 12; height: 320px; }
.rc-share { grid-column: span 4; height: 300px; }
.rc-production { grid-column: span 8; height: 300px; }
.rc-income, .rc-balance { grid-column: span 6; height: 380px; }
.rc-plans { grid-column: span 12; height: 420px; }

@media (min-width: 1400px) {
    .rc-trend { grid-column: span 6; }
    .rc-share { grid-column: span 2; }
    .rc-production { grid-column: span 4; }
    .rc-income, .rc-balance { grid-column: span 3; }
    .rc-plans { grid-column: span 6; }
}
@media (min-width: 1400px) and (min-height: 800px) {
    .rc-grid {
        height: calc(100dvh - var(--rc-offset, 330px));
        min-height: 560px;
        grid-template-rows: minmax(0, 44fr) minmax(0, 56fr);
    }
    .rc-grid > .rc-card { height: auto; }
}
@media (max-width: 767.98px) {
    .rc-share, .rc-production, .rc-income, .rc-balance { grid-column: span 12; }
}

.rc-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem 1rem;
    margin: 0 0 0.9rem;
}
.rc-stats dt { font-size: var(--font-size-xs); font-weight: 500; color: var(--ink-muted); }
.rc-stats dd { margin: 0; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.rc-compare { display: grid; gap: 0.35rem; }
.rc-compare-row { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--font-size-sm); }
.rc-compare-row span { color: var(--ink-muted); }
.rc-compare-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-bar { height: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; margin-bottom: 0.4rem; }
.rc-bar > span { display: block; height: 100%; border-radius: inherit; }

.rc-group + .rc-group { margin-top: 0.9rem; }
.rc-group-head {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    padding-bottom: 0.3rem;
    margin-bottom: 0.2rem;
    border-bottom: 1px solid var(--line);
    font-size: var(--font-size-sm);
    font-weight: 600;
}
.rc-lines { list-style: none; margin: 0; padding: 0; }
.rc-lines li {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 0.22rem 0;
    font-size: var(--font-size-sm);
    font-variant-numeric: tabular-nums;
    border-bottom: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
}
.rc-account { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rc-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface);
    font-size: var(--font-size-xs);
    white-space: nowrap;
}
.rc-table td { font-size: var(--font-size-sm); font-variant-numeric: tabular-nums; }

/* ---- Data Analyzer (/erp/analyzer) -------------------------------------------------------
   Panels im Design der Karten; gezogen wird nur am Titel (.an-drag), damit die Knöpfe im Kopf
   klickbar bleiben. Inhalt und Diagramm füllen das Panel, auch nach dem Ändern der Grösse. */
.an-layout { margin-top: var(--space-2); }
/* Syncfusion setzt Panel- und Rastergrund mit .e-dashboardlayout.e-control – daher dieselbe Tiefe. */
.an-layout .e-dashboardlayout.e-control { background: transparent; }
.an-layout .e-dashboardlayout.e-control .e-panel,
.an-layout .e-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: none;
}
.an-layout .e-panel:hover { border-color: var(--line-strong); }
.an-layout .e-panel.e-panel-transition { transition: top var(--dur) var(--ease-out), left var(--dur) var(--ease-out); }
.an-layout .e-panel .e-panel-container { display: flex; flex-direction: column; height: 100%; }
.an-layout .e-panel .e-panel-header {
    height: auto;
    padding: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
}
.an-layout .e-panel .e-panel-content { flex: 1 1 auto; min-height: 0; height: auto !important; }
.an-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 0.3rem 0.35rem 0.3rem 0.5rem; }
.an-drag {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1 1 auto;
    min-width: 0;
    cursor: grab;
    font-size: var(--font-size-sm);
    font-weight: 600;
}
.an-drag:active { cursor: grabbing; }
.an-drag > i { color: var(--ink-muted); }
.an-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-actions { display: flex; align-items: center; gap: 0.15rem; flex: none; }
.an-content { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 0.5rem 0.75rem 0.75rem; }
.an-chart { flex: 1 1 auto; min-height: 0; }
.an-chart > * { height: 100%; }
.an-kpi { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; gap: 0.25rem; }
.an-kpi-value {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 2.6vw, 2.75rem);
    font-weight: 600;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.an-kpi-label { color: var(--ink-muted); font-size: var(--font-size-sm); }
.an-error { color: var(--text-danger, var(--status-danger)); font-size: var(--font-size-sm); }
.an-layout .e-resize.e-south-east { opacity: .6; }

/* Handbuch & SOPs (On-Page-Manual) */
.manual-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: var(--space-4, 1.5rem);
    align-items: start;
}
.manual-sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 8rem);
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
}
.manual-group { margin-bottom: 0.5rem; }
.manual-group-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent-text);
    padding: 0.5rem 0.6rem 0.25rem;
}
.manual-item {
    display: block;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius);
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 0.9rem;
}
.manual-item:hover { color: var(--ink); background: var(--hover); }
.manual-item.active { color: var(--ink); background: var(--accent-soft); }
.manual-content { min-width: 0; }
.manual-category {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent-text);
    margin-bottom: 0.35rem;
}
.manual-body { font-size: 0.95rem; }
.manual-body h1, .manual-body h2, .manual-body h3 { margin-top: 1.5rem; margin-bottom: 0.6rem; }
.manual-body h1:first-child, .manual-body h2:first-child { margin-top: 0.5rem; }
.manual-body table { width: 100%; font-size: 0.85rem; }
.manual-body pre {
    background: var(--surface-sunk);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    overflow: auto;
}
.manual-body code {
    background: var(--surface-sunk);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 0.85em;
}
.manual-body pre code { background: none; padding: 0; }
@media (max-width: 768px) {
    .manual-layout { grid-template-columns: 1fr; }
    .manual-sidebar { position: static; max-height: none; }
}

/* DMS-Explorer: Verzeichnisbaum + Kontextmenü */
.dms-tree { padding-left: 0.25rem; }
.dms-tree-node { list-style: none; }
.dms-tree-children { list-style: none; padding-left: 1rem; border-left: 1px solid var(--line); margin-left: 0.55rem; }
.dms-tree-row {
    display: flex; align-items: center; gap: 0.25rem;
    padding: 0.3rem 0.4rem; border-radius: var(--radius);
    cursor: pointer; color: var(--ink);
}
.dms-tree-row:hover { background: var(--surface-sunk); }
.dms-tree-row.active { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.dms-tree-toggle { padding: 0 0.2rem; line-height: 1; border: 0; background: transparent; color: var(--ink-muted); }
.dms-tree-empty { padding: 0.15rem 0.4rem; font-style: italic; }
.dms-context-menu .list-group-item { border: 0; background: var(--surface); color: var(--ink); text-align: left; }
.dms-context-menu .list-group-item:hover { background: var(--surface-sunk); }
.dms-card { cursor: pointer; transition: border-color .15s ease; }
.dms-card:hover { border-color: var(--line-strong); }

/* DMS Explorer: Seite + Popup (Layout, verschiebbarer Teiler, Dokumente im Baum) */
.dms-explorer-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.dms-explorer-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.dms-explorer-main { display: flex; flex: 1 1 auto; min-height: 62vh; min-width: 0; }
.dms-explorer-tree { width: 300px; flex: 0 0 auto; min-width: 180px; max-width: 700px; }
.dms-explorer-tree .card { height: 100%; overflow: hidden; }
.dms-explorer-tree .card-body { overflow: auto; }
.dms-explorer-resizer { width: 6px; flex: 0 0 auto; cursor: col-resize; background: var(--line); transition: background .15s ease; }
.dms-explorer-resizer:hover, .dms-explorer-resizer:active { background: var(--metal-accent); }
.dms-explorer-content { flex: 1 1 auto; min-width: 0; padding-left: .75rem; overflow: auto; }
.dms-tree-doc { list-style: none; }
.dms-tree-doc-row {
    display: flex; align-items: center; gap: .4rem; width: 100%; text-align: left;
    border: 0; background: transparent; color: var(--ink);
    padding: .12rem .4rem; border-radius: 4px; font-size: .85rem;
}
.dms-tree-doc-row:hover { background: var(--surface-sunk); }
.dms-tree-doc-row .text-truncate { flex: 1; min-width: 0; }

/* ==== Cockpit-Bausteine (ERP-Redesign) — Kennzahlen, Bereichs-Navigation, Baum, Lookup ==== */
.kpi-plate {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
}
.kpi-plate-accent { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.kpi-plate-label {
    font-size: 10.5px;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.kpi-plate-value {
    font-size: 21px;
    font-weight: 650;
    letter-spacing: -.02em;
    margin-top: 2px;
}
.kpi-plate-detail { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }

.cockpit-area { display: flex; flex-direction: column; gap: 1px; }
.cockpit-area-item {
    display: flex; align-items: center; gap: 9px;
    padding: 6px 9px; border: 0; border-radius: 7px;
    background: transparent; color: var(--ink-muted);
    cursor: pointer; font: inherit; font-size: 12.5px; text-align: left;
}
.cockpit-area-item:hover { background: var(--surface); color: var(--ink); }
.cockpit-area-item.active { background: var(--surface); color: var(--ink); }
.cockpit-area-item .i { width: 16px; text-align: center; color: var(--ink-muted); }
.cockpit-area-item.active .i { color: var(--accent-text); }
.cockpit-area-item .lbl { flex: 0 1 auto; }
.cockpit-area-item .cnt {
    margin-left: auto; font-size: 10px; background: var(--line);
    border-radius: 999px; padding: 1px 7px; color: var(--ink-muted);
}
.cockpit-area-item .cnt.hot { background: var(--metal-warning); color: #0e1114; }

.treeview, .treeview ul { list-style: none; margin: 0; padding: 0; }
.treeview-row {
    display: flex; align-items: center; gap: 7px;
    padding: 5px 8px; border-radius: 6px; font-size: 12.5px;
}
.treeview-row:hover { background: var(--surface); }
.tw-arrow { width: 14px; color: var(--ink-muted); flex: none; }
.tw-arrow.empty { visibility: hidden; }
.tw-icon { width: 16px; text-align: center; color: var(--ink-muted); flex: none; }
.tw-label { flex: 0 1 auto; }
.tw-badge {
    margin-left: auto; font-size: 10px; background: var(--line);
    border-radius: 999px; padding: 1px 7px; color: var(--ink-muted);
}

.lookup { position: relative; }
.lookup-list {
    position: absolute; z-index: 30; top: 100%; left: 0; right: 0;
    margin: 3px 0 0; padding: 5px; list-style: none;
    background: var(--surface); border: 1px solid var(--line-strong);
    border-radius: 10px; max-height: 260px; overflow: auto;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
}
.lookup-list li {
    display: flex; justify-content: space-between; gap: 10px;
    padding: 7px 9px; border-radius: 7px; cursor: pointer; font-size: 12.5px;
}
.lookup-list li:hover { background: var(--surface-sunk); }
.lookup-list .s { color: var(--ink-muted); font-size: 11px; }

.filter-chip {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--line); background: transparent; color: var(--ink-muted);
    border-radius: 999px; padding: 4px 12px; font-size: 11.5px; cursor: pointer;
    white-space: nowrap;
}
.filter-chip:hover { color: var(--ink); border-color: var(--line-strong); }
.filter-chip.active { border-color: var(--accent-text); color: var(--accent-text); background: var(--accent-soft); }

.kve-row { display: flex; gap: 6px; margin-bottom: 6px; }
.kve-row input, .kve-row select { min-width: 0; }
.kve-row input:first-child { flex: 1 1 40%; }
.kve-row input:nth-child(2), .kve-row select:nth-child(2) { flex: 1 1 40%; }

/* Mobile-Sicht (Telefone): Cockpit-Bausteine stapeln statt überlaufen */
@media (max-width: 575.98px) {
    .kpi-plate { padding: 10px 12px; }
    .kpi-plate-value { font-size: 17px; }
    .kve-row { flex-wrap: wrap; }
    .kve-row input:first-child,
    .kve-row input:nth-child(2),
    .kve-row select:nth-child(2) { flex: 1 1 100%; }
    .filter-chip { padding: 3px 9px; font-size: 11px; }
    .cockpit-area-item { padding: 7px 9px; }
    .lookup-list { max-height: 200px; }
}
