/* ============================================================================
   Rechnungstransfer — Design-Tokens & Kern-Komponenten
   FC Hansa Rostock × DIGIWERFT · Ziel: Bootstrap 5.3 + Stimulus
   Werte 1:1 aus dem Design-Handoff (design_handoff_rechnungstransfer).
   Lädt NACH bootstrap.min.css (siehe app.js) → Overrides gewinnen.
   ============================================================================ */

:root {
    /* ====================================================================
       MARKE — HIER ANPASSEN (einziger Swap-Punkt fürs Vereins-Branding).
       Offizielle FC-Hansa-Guideline hier eintragen; alles andere leitet ab.
       Logo separat: assets/images/logo.png ersetzen (siehe docs/branding.md).
       ==================================================================== */
    --brand: #002D72;         /* FC-Hansa-Blau (Vorschlag — durch offiziellen Ton ersetzen) */
    --brand-deep: #001a44;    /* dunklere Variante (Navbar-Tiefe, Login-Verlauf, Button-Hover) */
    --brand-rgb: 0, 45, 114;  /* --brand als RGB-Triplet (für Bootstrap --bs-primary-rgb) */

    /* Interaktion (DIGIWERFT-Blau) */
    --interaction: #208FCC;
    --interaction-dark: #135f86;

    /* Status */
    --success: #08B183;
    --success-text: #0a7a52;
    --warn: #e8a317;
    --warn-text: #9a6a12;
    --danger: #d60202;
    --danger-text: #a51b16;
    --danger-dark: #9E0101;

    /* Text */
    --text-primary: #161F28;
    --text-body: #2C3A47;
    --text-secondary: #5E7081;
    --text-muted: #8597A6;
    --text-head: #7c8894;   /* Spaltenköpfe */
    --text-placeholder: #9aa6b2;

    /* Flächen + Rahmen */
    --bg-page: #eef1f5;
    --bg-card: #ffffff;
    --bg-well: #f5f7fa;
    --bg-well-2: #fafbfc;
    --bg-soft: #f5f6f8;
    --border-card: #e3e8ee;
    --border-row: #eef1f4;
    --border-row-2: #f2f5f8;
    --input-border: #c4ccd6;

    /* Schatten */
    --shadow-card: 0 1px 2px rgba(16,40,70,0.04);
    --glow-brand: 0 4px 12px rgba(0,45,114,0.2);
    --shadow-modal: 0 30px 70px rgba(0,20,55,0.4);
    --shadow-toast: 0 14px 40px rgba(16,40,70,0.2);

    /* Maße */
    --navbar-h: 56px;
    --sidebar-w: 230px;
    --content-max: 1300px;

    /* Bootstrap-Overrides ohne SCSS-Build (CSS-Custom-Properties) */
    --bs-primary: var(--brand);
    --bs-primary-rgb: var(--brand-rgb);
    --bs-body-bg: #eef1f5;
    --bs-body-color: #2C3A47;
    --bs-body-font-family: 'Mulish', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-body-font-size: 0.9rem;
    --bs-border-color: #e3e8ee;
    --bs-link-color: #208FCC;
    --bs-link-color-rgb: 32, 143, 204;
    --bs-link-hover-color: #135f86;
    --bs-heading-color: #161F28;
    --bs-emphasis-color: #161F28;
    --bs-secondary-color: #5E7081;
    --bs-tertiary-color: #8597A6;
    --bs-focus-ring-color: rgba(32, 143, 204, 0.25);
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-page);
    color: var(--text-body);
    font-family: var(--bs-body-font-family);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Poppins', var(--bs-body-font-family);
    color: var(--text-primary);
    font-weight: 700;
}

::selection { background: #cfe0f5; }
::-moz-selection { background: #cfe0f5; }

a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* sichtbarer Fokus (barrierearm) */
:focus-visible { outline: 2px solid var(--interaction); outline-offset: 2px; }
.form-control:focus, .form-select:focus, .app-input:focus, textarea:focus {
    border-color: var(--interaction) !important;
    box-shadow: 0 0 0 3px rgba(32, 143, 204, 0.18) !important;
    outline: none;
}
::placeholder { color: var(--text-placeholder); opacity: 1; }

/* dezenter Scrollbalken für gekapselte Tabellen */
.dwscroll::-webkit-scrollbar { height: 10px; width: 10px; }
.dwscroll::-webkit-scrollbar-thumb {
    background: #cdd6e0; border-radius: 6px; border: 2px solid var(--bg-soft);
}

@keyframes dwspin { to { transform: rotate(360deg); } }
@keyframes dwtoast { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dwfade { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

.spinner-inline {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
    display: inline-block; animation: dwspin 0.7s linear infinite; flex-shrink: 0;
}
.spinner-inline--dark { border-color: rgba(0,45,114,0.25); border-top-color: var(--brand); }
.spinner-inline--info { border-color: rgba(19,95,134,0.3); border-top-color: var(--interaction-dark); }

/* ============================================================================
   APP-SHELL: Navbar + Sidebar
   ============================================================================ */

.app-navbar {
    height: var(--navbar-h);
    background: var(--brand);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 18px;
    position: sticky; top: 0; z-index: 1040;
    box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}
.app-navbar__left { display: flex; align-items: center; gap: 11px; }
.brand-chip {
    width: 34px; height: 34px; border-radius: 9px; background: #fff;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    overflow: hidden; padding: 3px;
}
.brand-chip img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-chip--lg { width: 56px; height: 56px; border-radius: 13px; padding: 6px; }
.app-navbar__title { color: #fff; font: 700 15.5px 'Poppins'; letter-spacing: -0.01em; }
.app-navbar__sub {
    color: rgba(255,255,255,0.5); font-size: 12px; font-weight: 600;
    padding-left: 10px; border-left: 1px solid rgba(255,255,255,0.18); margin-left: 4px;
}
.app-navbar__right { display: flex; align-items: center; gap: 16px; }
.app-user { display: flex; align-items: center; gap: 9px; }
.app-user__avatar {
    width: 30px; height: 30px; border-radius: 50%; background: var(--interaction);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font: 700 12px 'Poppins'; flex-shrink: 0;
}
.app-user__name { color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.15; }
.app-user__role { color: rgba(255,255,255,0.6); font-size: 10.5px; line-height: 1.15; }
.app-navbar__logout {
    background: rgba(255,255,255,0.1); border: none; color: #fff; border-radius: 7px;
    width: 32px; height: 32px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.app-navbar__logout:hover { background: rgba(255,255,255,0.2); color: #fff; }

.app-shell { display: flex; align-items: stretch; }

.app-sidebar {
    width: var(--sidebar-w); flex-shrink: 0; background: #fff;
    border-right: 1px solid var(--border-card);
    min-height: calc(100vh - var(--navbar-h));
    padding: 14px 12px; position: sticky; top: var(--navbar-h); align-self: flex-start;
}
.side-nav__label {
    font: 700 10px 'Poppins'; letter-spacing: 0.13em; color: var(--text-placeholder);
    padding: 6px 10px 8px;
}
.side-nav__item {
    position: relative; width: 100%; display: flex; align-items: center; gap: 11px;
    border: none; background: none; color: #3a4650; font: 600 13.5px 'Poppins';
    padding: 9px 11px; border-radius: 8px; cursor: pointer; margin-bottom: 2px;
    text-align: left; text-decoration: none;
}
.side-nav__item:hover { background: #f4f7fb; color: #3a4650; text-decoration: none; }
.side-nav__item.is-active { background: #EAF1FA; color: var(--brand); }
.side-nav__item.is-active::before {
    content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--brand);
}
.side-nav__item .icon { width: 18px; height: 18px; flex-shrink: 0; color: #8597A6; }
.side-nav__item.is-active .icon { color: var(--brand); }
.side-nav__item span:nth-child(2) { flex: 1; }
.side-nav__count {
    font: 700 11px 'Poppins'; background: #eef1f4; color: #5E7081;
    border-radius: 20px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.side-nav__item.is-active .side-nav__count { background: var(--brand); color: #fff; }
.side-foot {
    margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-row);
    font-size: 11px; color: var(--text-placeholder); padding-left: 10px; padding-right: 10px;
    line-height: 1.5;
}

.app-main {
    flex: 1; min-width: 0; background: var(--bg-page);
    min-height: calc(100vh - var(--navbar-h));
}
.app-container { max-width: var(--content-max); margin: 0 auto; padding: 22px 26px 70px; }

/* Offcanvas-Sidebar auf schmalen Viewports */
.sidebar-toggle { display: none; }
@media (max-width: 900px) {
    .app-sidebar { display: none; }
    .app-sidebar.offcanvas { display: block; }
    .sidebar-toggle {
        display: inline-flex; align-items: center; justify-content: center;
        background: rgba(255,255,255,0.1); border: none; color: #fff;
        border-radius: 7px; width: 32px; height: 32px; cursor: pointer;
    }
    .app-container { padding: 16px 14px 60px; }
}

/* ============================================================================
   SEITEN-KOPF
   ============================================================================ */
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    flex-wrap: wrap; gap: 14px; margin-bottom: 18px;
}
.page-title { margin: 0; font: 800 25px 'Poppins'; color: var(--text-primary); letter-spacing: -0.02em; }
.page-sub { color: var(--text-secondary); font-size: 13.5px; margin-top: 3px; }
.back-link {
    display: inline-flex; align-items: center; gap: 6px; background: none; border: none;
    color: var(--interaction); font: 600 12.5px 'Poppins'; cursor: pointer; padding: 0;
    margin-bottom: 14px; text-decoration: none;
}
.back-link:hover { text-decoration: underline; color: var(--interaction); }

/* ============================================================================
   CARD
   ============================================================================ */
.card-soft {
    background: var(--bg-card); border: 1px solid var(--border-card);
    border-radius: 12px; box-shadow: var(--shadow-card);
}
.card-soft--flush { overflow: hidden; }
.card-soft__body { padding: 17px 19px; }
.card-title {
    font: 700 14px 'Poppins'; color: var(--text-primary); margin: 0;
}
.card-title--lg { font-size: 16px; }
.field-label {
    font: 600 10.5px 'Poppins'; letter-spacing: 0.05em; color: var(--text-muted);
    text-transform: uppercase; margin-bottom: 3px;
}
.field-value { font-size: 14px; color: var(--text-primary); font-weight: 600; }
.field-value--lg { font: 700 18px 'Poppins'; font-variant-numeric: tabular-nums; }

/* ============================================================================
   BUTTONS (Prototyp-treu — eigenständig, kein .btn nötig)
   ============================================================================ */
.btn-brand, .btn-secondary-soft, .btn-interaction, .btn-danger-outline,
.btn-danger-hard, .btn-warn-soft, .btn-info-outline {
    display: inline-flex; align-items: center; gap: 7px; justify-content: center;
    border-radius: 8px; padding: 9px 15px; font: 600 12.5px 'Poppins';
    cursor: pointer; border: 1px solid transparent; white-space: nowrap;
    transition: background 0.15s, box-shadow 0.15s;
}
.btn-brand { background: var(--brand); color: #fff; box-shadow: var(--glow-brand); }
.btn-brand:hover { background: var(--brand-deep); color: #fff; }
.btn-secondary-soft { background: #fff; color: var(--brand); border-color: var(--input-border); }
.btn-secondary-soft:hover { background: #f4f7fb; }
.btn-interaction { background: var(--interaction); color: #fff; }
.btn-interaction:hover { background: var(--interaction-dark); color: #fff; }
.btn-info-outline { background: #fff; color: var(--interaction-dark); border-color: #cfe6f4; }
.btn-info-outline:hover { background: #E7F3FA; }
.btn-warn-soft { background: #FDF0DD; color: var(--warn-text); border-color: #f6e0b8; }
.btn-danger-outline { background: #fff; color: var(--text-secondary); border-color: #d5dce4; }
.btn-danger-hard { background: #fff; color: var(--danger-dark); border-color: #f0cccb; }
.btn-ghost {
    display: inline-flex; align-items: center; gap: 6px; background: none; border: none;
    color: var(--text-muted); font: 600 13px 'Poppins'; cursor: pointer; padding: 9px 12px;
    border-radius: 8px;
}
.btn-sm-soft { padding: 7px 12px; font-size: 12px; border-radius: 7px; }
[disabled], .is-busy { opacity: 0.7; cursor: progress; }

/* Bootstrap-Primary an die Marke koppeln (falls .btn-primary genutzt wird) */
.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-deep); --bs-btn-hover-border-color: var(--brand-deep);
    --bs-btn-active-bg: var(--brand-deep); --bs-btn-active-border-color: var(--brand-deep);
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
    box-shadow: var(--glow-brand);
}
.text-brand { color: var(--brand) !important; }
.text-interaction { color: var(--interaction-dark) !important; }
.text-danger-amt { color: var(--danger-text) !important; }
.tnum { font-variant-numeric: tabular-nums; }

/* ============================================================================
   FORM-FELDER
   ============================================================================ */
.app-input, .app-select, .app-textarea {
    width: 100%; border: 1px solid var(--input-border); border-radius: 8px;
    padding: 9px 11px; font-size: 13.5px; font-family: 'Mulish'; color: var(--text-body);
    background: #fff;
}
.app-textarea { min-height: 74px; resize: vertical; }
.app-input[readonly], .app-textarea[readonly], .field-readonly { background: var(--bg-soft); }
.form-label-sm { display: block; font: 600 11.5px 'Poppins'; color: #3a4650; margin-bottom: 5px; }
.req-star { color: var(--danger); }
.help-text { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }

/* ============================================================================
   TABELLEN
   ============================================================================ */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table thead tr { background: var(--bg-well); border-bottom: 1px solid var(--border-card); }
.data-table th {
    font: 700 10.5px 'Poppins'; letter-spacing: 0.04em; color: var(--text-head);
    padding: 9px 10px; text-align: left; white-space: nowrap;
}
.data-table th:first-child, .data-table td:first-child { padding-left: 15px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 15px; }
.data-table th.num, .data-table td.num { text-align: right; }
.data-table th.center, .data-table td.center { text-align: center; }
.data-table td { padding: 9px 10px; color: var(--text-body); vertical-align: middle; }
.data-table tbody tr { border-top: 1px solid var(--border-row); }
.data-table tbody tr.is-link { cursor: pointer; }
.data-table tbody tr.is-link:hover { background: #f7f9fc; }
.data-table .cell-number { font-weight: 700; color: var(--brand); white-space: nowrap; }
.data-table .cell-muted { color: var(--text-secondary); }
.data-table tfoot tr { border-top: 2px solid var(--border-card); background: var(--bg-well); }

.table-foot {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    gap: 12px; padding: 12px 15px; border-top: 1px solid var(--border-card); background: var(--bg-well-2);
}
.table-foot__totals { display: flex; gap: 22px; align-items: center; font-size: 12.5px; color: var(--text-secondary); }

/* Pagination */
.pager { display: flex; gap: 3px; }
.pager a, .pager span.page {
    width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #d5dce4; background: #fff; border-radius: 7px; color: #3a4650;
    font: 600 12.5px 'Poppins'; text-decoration: none;
}
.pager a:hover { background: #f4f7fb; }
.pager .page.is-active { border-color: var(--brand); background: var(--brand); color: #fff; }
.pager .is-disabled { color: var(--text-placeholder); cursor: not-allowed; pointer-events: none; }

/* Toolbar (Suche + Filter über Tabelle) */
.toolbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--border-card); border-bottom: none;
    border-radius: 12px 12px 0 0; padding: 12px 15px;
}
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 340px; }
.search-box .icon {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: var(--text-placeholder); pointer-events: none;
}
.search-box input {
    width: 100%; border: 1px solid var(--input-border); border-radius: 8px;
    padding: 8px 12px 8px 32px; font-size: 13px; font-family: 'Mulish';
}
.filter-select {
    border: 1px solid var(--input-border); border-radius: 8px; padding: 8px 10px;
    font-size: 13px; font-family: 'Mulish'; color: #3a4650; background: #fff; cursor: pointer;
}
.table-attached {
    background: #fff; border: 1px solid var(--border-card); border-top: none;
    border-radius: 0 0 12px 12px; overflow: hidden;
}

/* Status-Tabs (Segmented Control) */
.status-tabs {
    display: flex; gap: 4px; background: #fff; border: 1px solid var(--border-card);
    border-radius: 10px; padding: 5px; margin-bottom: 14px; overflow-x: auto;
}
.status-tab {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px; border: none;
    background: none; color: #5E7081; font: 600 12.5px 'Poppins'; padding: 7px 12px;
    border-radius: 7px; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.status-tab:hover { background: #f4f7fb; color: #3a4650; text-decoration: none; }
.status-tab.is-active { background: var(--brand); color: #fff; }
.status-tab__count { font: 700 10.5px 'Poppins'; background: #eef1f4; color: #5E7081; border-radius: 20px; padding: 1px 6px; }
.status-tab.is-active .status-tab__count { background: rgba(255,255,255,0.22); color: #fff; }

/* ============================================================================
   BADGES — Status (dbState) + Mahnung (dunningStage)
   ============================================================================ */
.badge-state, .badge-dun {
    display: inline-flex; align-items: center; gap: 5px; font: 700 10.5px 'Poppins';
    border: 1px solid transparent; border-radius: 6px; padding: 2px 8px; white-space: nowrap;
}
.badge-state .dot, .badge-dun .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.badge-state--lg { font-size: 11px; border-radius: 7px; padding: 3px 10px; }

.badge-state.is-open        { background: #eef1f4; color: #4b5763; border-color: #dbe1e8; }
.badge-state.is-open .dot   { background: #8a97a5; }
.badge-state.is-transferred { background: #E7F3FA; color: #135f86; border-color: #cfe6f4; }
.badge-state.is-transferred .dot { background: #208FCC; }
.badge-state.is-sent        { background: #E3F6FB; color: #0c6a7c; border-color: #c7edf4; }
.badge-state.is-sent .dot   { background: #0f9fc0; }
.badge-state.is-reminded    { background: #FDF0DD; color: #9a6a12; border-color: #f6e0b8; }
.badge-state.is-reminded .dot { background: #e8a317; }
.badge-state.is-payed       { background: #E4F6EE; color: #0a7a52; border-color: #cdeede; }
.badge-state.is-payed .dot  { background: #08B183; }
.badge-state.is-canceled    { background: #FBE7E6; color: #a51b16; border-color: #f3c9c7; }
.badge-state.is-canceled .dot { background: #d60202; }
.badge-state.is-trash       { background: #eef1f4; color: #8a939c; border-color: #dfe3e8; text-decoration: line-through; }
.badge-state.is-trash .dot  { background: #b6bdc6; }

.badge-dun.is-reminder { background: #eef1f4; color: #52606d; border-color: #dbe1e8; }
.badge-dun.is-stage1   { background: #FDF0DD; color: #9a6a12; border-color: #f6e0b8; }
.badge-dun.is-stage2   { background: #FBE7E6; color: #a51b16; border-color: #f3c9c7; }
.badge-dun.is-paused   { background: #eef1f4; color: #6b7580; border-color: #dbe1e8; }

.badge-source { font: 700 10.5px 'Poppins'; border-radius: 6px; padding: 2px 8px; }
.badge-source.is-sr { background: #E7F3FA; color: #135f86; }
.badge-source.is-manual { background: #eef1f4; color: #5E7081; }
.badge-linked { font: 700 10.5px 'Poppins'; border-radius: 6px; padding: 2px 8px; background: #E4F6EE; color: #0a7a52; border: 1px solid #cdeede; }
.badge-unlinked { font: 700 10.5px 'Poppins'; border-radius: 6px; padding: 2px 8px; background: #eef1f4; color: #8597A6; }

/* Datenqualitäts-Marker */
.warn-dot {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; background: #FDF0DD; border: 1px solid #f0cf8f;
    color: #9a6a12; border-radius: 50%; font: 700 10px 'Poppins'; cursor: help;
}
.chip-missing {
    display: inline-flex; align-items: center; gap: 6px; font: 700 10px 'Poppins';
    background: #FBE7E6; color: #a51b16; border: 1px solid #f3c9c7; border-radius: 6px; padding: 2px 7px;
}

/* Inline-Banner (Async / Warnung / Info) */
.banner { display: flex; align-items: center; gap: 10px; border-radius: 10px; padding: 11px 15px; margin-bottom: 14px; font-size: 13px; font-weight: 600; }
.banner--info { background: #EAF3FB; border: 1px solid #cfe6f4; color: var(--interaction-dark); }
.banner--warn { background: #FDF0DD; border: 1px solid #f6e0b8; color: var(--warn-text); }
.banner__icon-warn { width: 20px; height: 20px; border-radius: 50%; background: var(--warn); color: #fff; display: flex; align-items: center; justify-content: center; font: 700 12px 'Poppins'; flex-shrink: 0; }

/* ============================================================================
   KPI-KACHELN
   ============================================================================ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-tile {
    background: #fff; border: 1px solid var(--border-card); border-radius: 12px;
    padding: 16px 17px; box-shadow: var(--shadow-card); text-decoration: none; display: block; color: inherit;
}
a.kpi-tile:hover { text-decoration: none; box-shadow: 0 4px 14px rgba(16,40,70,0.08); }
.kpi-tile__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kpi-tile__icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.kpi-tile__pill { font: 600 11px 'Poppins'; border-radius: 20px; padding: 2px 8px; }
.kpi-tile__value { font: 800 26px 'Poppins'; color: var(--text-primary); letter-spacing: -0.02em; line-height: 1; }
.kpi-tile__label { font-size: 12.5px; color: var(--text-secondary); margin-top: 6px; }

.icon-chip-neutral { background: #eef1f4; color: #5E7081; }
.icon-chip-warn { background: #FDF0DD; color: var(--warn); }
.icon-chip-euro { background: #FBE7E6; color: var(--danger); }
.icon-chip-info { background: #E7F3FA; color: var(--interaction); }
.icon-chip-danger { background: #FBE7E6; color: var(--danger); }

/* ============================================================================
   LEERZUSTAND
   ============================================================================ */
.empty-state { padding: 52px 20px; text-align: center; }
.empty-state__title { font: 700 15px 'Poppins'; color: #3a4650; margin-bottom: 4px; }
.empty-state__sub { font-size: 13px; color: var(--text-muted); }
.empty-state--dashed { background: #fff; border: 1px dashed #d5dce4; border-radius: 12px; }

/* ============================================================================
   TOASTS (unten rechts) + FLASH
   ============================================================================ */
.toast-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 1080; display: flex; flex-direction: column; gap: 10px; }
.app-toast {
    display: flex; align-items: center; gap: 11px; background: #fff;
    border: 1px solid var(--border-card); border-left: 4px solid var(--interaction);
    border-radius: 10px; padding: 13px 16px; box-shadow: var(--shadow-toast);
    min-width: 280px; max-width: 400px; animation: dwtoast 0.25s ease;
}
.app-toast__icon { width: 22px; height: 22px; border-radius: 50%; background: var(--interaction); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.app-toast__msg { flex: 1; font-size: 13.5px; color: var(--text-body); line-height: 1.4; }
.app-toast__close { background: none; border: none; color: var(--text-placeholder); cursor: pointer; font-size: 17px; line-height: 1; padding: 0 2px; }
.app-toast.is-success { border-left-color: var(--success); } .app-toast.is-success .app-toast__icon { background: var(--success); }
.app-toast.is-error   { border-left-color: var(--danger); }  .app-toast.is-error .app-toast__icon { background: var(--danger); }
.app-toast.is-info    { border-left-color: var(--interaction); } .app-toast.is-info .app-toast__icon { background: var(--interaction); }
.app-toast.is-warn    { border-left-color: var(--warn); }    .app-toast.is-warn .app-toast__icon { background: var(--warn); }

/* ============================================================================
   BESTÄTIGUNGS-MODAL (eigenes Overlay, Stimulus-gesteuert)
   ============================================================================ */
.confirm-overlay {
    position: fixed; inset: 0; z-index: 1070; background: rgba(10,25,50,0.5);
    display: none; align-items: center; justify-content: center; padding: 24px;
}
.confirm-overlay.is-open { display: flex; animation: dwfade 0.15s ease; }
.confirm-dialog { width: 100%; max-width: 460px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-modal); overflow: hidden; }
.confirm-dialog__head { padding: 20px 22px 0; display: flex; gap: 13px; align-items: flex-start; }
.confirm-dialog__icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #E7F3FA; color: var(--interaction); }
.confirm-dialog__title { font: 700 17px 'Poppins'; color: var(--text-primary); }
.confirm-dialog__msg { font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; margin-top: 4px; }
.confirm-dialog__warn { margin: 14px 22px 0; display: flex; gap: 9px; align-items: flex-start; background: #FBE7E6; border: 1px solid #f3c9c7; color: var(--danger-text); border-radius: 9px; padding: 11px 13px; font-size: 12.5px; line-height: 1.5; }
.confirm-dialog__warn.d-none { display: none; }
.confirm-dialog__actions { display: flex; justify-content: flex-end; gap: 9px; padding: 18px 22px 20px; }

/* Toggle-Switch (dunningDisabled) */
.switch { position: relative; width: 42px; height: 23px; border-radius: 20px; border: none; cursor: pointer; background: #cfd6df; transition: background 0.2s; flex-shrink: 0; padding: 0; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: left 0.2s; }
.switch.is-on { background: var(--success); }
.switch.is-on .knob { left: 21px; }
.switch--sm { width: 38px; height: 21px; }
.switch--sm .knob { width: 17px; height: 17px; }
.switch--sm.is-on .knob { left: 19px; }

/* JSON-Detail (Logs) */
.json-block { margin: 0; background: #0c131a; color: #a6e3c0; border-radius: 8px; padding: 12px 14px; font-size: 12px; font-family: monospace; overflow-x: auto; line-height: 1.5; }

/* Einstellungen: Gruppen-Nav links, aktive Gruppe rechts */
.settings-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.settings-nav { padding: 8px; }
.settings-nav__item {
    width: 100%; text-align: left; border: none; background: none; color: #3a4650;
    font: 600 13px 'Poppins'; padding: 9px 12px; border-radius: 8px; cursor: pointer; margin-bottom: 2px;
}
.settings-nav__item:hover { background: #f4f7fb; }
.settings-nav__item.is-active { background: #EAF1FA; color: var(--brand); }
@media (max-width: 760px) { .settings-layout { grid-template-columns: 1fr; } }

/* Login */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
    background: radial-gradient(1200px 600px at 50% -10%, #0a3f8f 0%, var(--brand) 55%, var(--brand-deep) 100%);
}
.login-card { background: #fff; border-radius: 14px; padding: 30px 30px 26px; box-shadow: 0 24px 60px rgba(0,20,55,0.4); }
.login-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 22px; }
.login-brand__title { color: #fff; font: 700 20px 'Poppins'; letter-spacing: -0.01em; }
.login-foot { text-align: center; color: rgba(255,255,255,0.6); font-size: 11.5px; margin-top: 16px; }

/* Trix-WYSIWYG (Html-Settings auf der Einstellungen-Seite) */
trix-editor.app-textarea { min-height: 160px; height: auto; overflow-y: auto; }
trix-toolbar .trix-button-group--file-tools { display: none; } /* keine Anhänge (trix-file-accept wird zusätzlich geblockt) */
trix-toolbar .trix-button-group { background: #fff; }
.trix-content { font-size: 13px; }
.trix-content ul { padding-left: 20px; }
