:root {
    --bg: #f4f5f7;
    --surface: #fff;
    --border: #e5e7eb;
    --border-strong: #ccc;
    --text: #1f2937;
    --text-muted: #6b7280;
    --accent: #1f2937;
    --link: #2563eb;
    --link-strong: #1e3a8a;
    --danger: #b91c1c;
    --danger-strong: #7f1d1d;
    --success: #166534;
    --hover-bg: #f3f4f6;
    --input-border: #d1d5db;
    --popover-bg: #fff;
    --popover-text: #111;

    --badge-success-bg: #dcfce7;
    --badge-success-fg: #166534;
    --badge-danger-bg: #fee2e2;
    --badge-danger-fg: #991b1b;
    --badge-info-bg: #dbeafe;
    --badge-info-fg: #1d4ed8;
    --badge-warning-bg: #fef3c7;
    --badge-warning-fg: #92400e;
    --badge-warning-alt-bg: #ffe9d6;
    --badge-warning-alt-fg: #9a3412;
    --badge-neutral-bg: #f3f4f6;
    --badge-neutral-fg: #4b5563;
    --badge-indigo-bg: #e0e7ff;
    --badge-indigo-fg: #3730a3;

    --chat-mine-bg: #dbeafe;
    --chat-mine-border: #bfdbfe;
    --chat-internal-bg: #fdecea;
    --chat-internal-border: #e57373;
    --chat-system-bg: #eef1f6;
    --chat-system-border: #dde2ea;
    --chat-avatar-bg: #cbd5e1;
    --chat-avatar-fg: #1e293b;
    --icon-badge-bg: #4f46e5;
}

/* Dark-Mode-Tokens: systematischer Retrofit ueber semantische
   Farb-Tokens statt hunderter Einzelfarben - jede "weiche" Badge-Farbe
   (heller Hintergrund + kraeftiger Text derselben Farbfamilie) bekommt EIN
   Token-Paar (--badge-*-bg/fg), das hier fuer Dark-Mode umgekehrt wird
   (dunklerer, entsaettigter Hintergrund + hellerer Text derselben
   Farbfamilie - Bedeutung/Signalfarbe bleibt erhalten). Robustes
   Standardmuster (siehe docs/DECISIONS.md): @media als OS-Standard, wenn
   keine explizite Wahl gespeichert ist; :root[data-theme] gewinnt in beide
   Richtungen dagegen. Sidebar bleibt bewusst UNVERAENDERT (war schon immer
   fest dunkel gestylt, unabhaengig vom Seitentheme - Bereichsfarben dort
   sind Sidebar-intern und muessen nicht mitgezogen werden). */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #14161a;
        --surface: #1e2126;
        --border: #30343c;
        --border-strong: #454b55;
        --text: #e5e7eb;
        --text-muted: #9aa1ac;
        --accent: #2563eb;
        --link: #60a5fa;
        --link-strong: #93c5fd;
        --danger: #f87171;
        --danger-strong: #fca5a5;
        --success: #4ade80;
        --hover-bg: #262b33;
        --input-border: #3f4552;
        --popover-bg: #24282f;
        --popover-text: #e5e7eb;

        --badge-success-bg: #14432a;
        --badge-success-fg: #86efac;
        --badge-danger-bg: #4c1414;
        --badge-danger-fg: #fca5a5;
        --badge-info-bg: #1e3a5f;
        --badge-info-fg: #93c5fd;
        --badge-warning-bg: #4a3a0a;
        --badge-warning-fg: #fcd34d;
        --badge-warning-alt-bg: #4a2a10;
        --badge-warning-alt-fg: #fdba74;
        --badge-neutral-bg: #333844;
        --badge-neutral-fg: #cbd5e1;
        --badge-indigo-bg: #2e2a5c;
        --badge-indigo-fg: #c7d2fe;

        --chat-mine-bg: #1e3a5f;
        --chat-mine-border: #2c5282;
        --chat-internal-bg: #4c1414;
        --chat-internal-border: #7f3030;
        --chat-system-bg: #262b33;
        --chat-system-border: #383e4a;
        --chat-avatar-bg: #475569;
        --chat-avatar-fg: #e2e8f0;
        --icon-badge-bg: #6366f1;
    }
}

:root[data-theme="dark"] {
    --bg: #14161a;
    --surface: #1e2126;
    --border: #30343c;
    --border-strong: #454b55;
    --text: #e5e7eb;
    --text-muted: #9aa1ac;
    --accent: #2563eb;
    --link: #60a5fa;
    --link-strong: #93c5fd;
    --danger: #f87171;
    --danger-strong: #fca5a5;
    --success: #4ade80;
    --hover-bg: #262b33;
    --input-border: #3f4552;
    --popover-bg: #24282f;
    --popover-text: #e5e7eb;

    --badge-success-bg: #14432a;
    --badge-success-fg: #86efac;
    --badge-danger-bg: #4c1414;
    --badge-danger-fg: #fca5a5;
    --badge-info-bg: #1e3a5f;
    --badge-info-fg: #93c5fd;
    --badge-warning-bg: #4a3a0a;
    --badge-warning-fg: #fcd34d;
    --badge-warning-alt-bg: #4a2a10;
    --badge-warning-alt-fg: #fdba74;
    --badge-neutral-bg: #333844;
    --badge-neutral-fg: #cbd5e1;
    --badge-indigo-bg: #2e2a5c;
    --badge-indigo-fg: #c7d2fe;

    --chat-mine-bg: #1e3a5f;
    --chat-mine-border: #2c5282;
    --chat-internal-bg: #4c1414;
    --chat-internal-border: #7f3030;
    --chat-system-bg: #262b33;
    --chat-system-border: #383e4a;
    --chat-avatar-bg: #475569;
    --chat-avatar-fg: #e2e8f0;
    --icon-badge-bg: #6366f1;
}

/* Explizite Hell-Wahl gewinnt gegen eine dunkle OS-Praeferenz (siehe
   @media-Block oben) - reine Wiederholung der :root-Hell-Werte. */
:root[data-theme="light"] {
    --bg: #f4f5f7;
    --surface: #fff;
    --border: #e5e7eb;
    --border-strong: #ccc;
    --text: #1f2937;
    --text-muted: #6b7280;
    --accent: #1f2937;
    --link: #2563eb;
    --link-strong: #1e3a8a;
    --danger: #b91c1c;
    --danger-strong: #7f1d1d;
    --success: #166534;
    --hover-bg: #f3f4f6;
    --input-border: #d1d5db;
    --popover-bg: #fff;
    --popover-text: #111;

    --badge-success-bg: #dcfce7;
    --badge-success-fg: #166534;
    --badge-danger-bg: #fee2e2;
    --badge-danger-fg: #991b1b;
    --badge-info-bg: #dbeafe;
    --badge-info-fg: #1d4ed8;
    --badge-warning-bg: #fef3c7;
    --badge-warning-fg: #92400e;
    --badge-warning-alt-bg: #ffe9d6;
    --badge-warning-alt-fg: #9a3412;
    --badge-neutral-bg: #f3f4f6;
    --badge-neutral-fg: #4b5563;
    --badge-indigo-bg: #e0e7ff;
    --badge-indigo-fg: #3730a3;

    --chat-mine-bg: #dbeafe;
    --chat-mine-border: #bfdbfe;
    --chat-internal-bg: #fdecea;
    --chat-internal-border: #e57373;
    --chat-system-bg: #eef1f6;
    --chat-system-border: #dde2ea;
    --chat-avatar-bg: #cbd5e1;
    --chat-avatar-fg: #1e293b;
    --icon-badge-bg: #4f46e5;
}

* { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Gastseiten (Login/Registrierung, keine Navigation) --- */
.guest-box {
    max-width: 420px;
    margin: 8vh auto;
    background: var(--surface);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}
.guest-box h1 { font-size: 1.25rem; margin-top: 0; }

/* --- Öffentliche CMS-Seiten (Content-Seiten, keine Navigation) --- */
.public-page { max-width: 900px; margin: 0 auto; padding: 2rem; }

/* --- Panel-Shell (Sidebar + Topbar), für Staff und Kunde --- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #1f2937;
    color: #d1d5db;
    padding: 1.1rem 0;
}
.sidebar .brand {
    font-weight: 600;
    color: #fff;
    padding: 0 1.5rem 1rem;
    font-size: 1.05rem;
}
.sidebar .nav-search { padding: 0 1.5rem 1rem; }
.sidebar .nav-search input {
    width: 100%;
    box-sizing: border-box;
    padding: .4rem .6rem;
    font-size: .85rem;
    border: 1px solid #374151;
    border-radius: 4px;
    background: #111827;
    color: #f3f4f6;
}
.sidebar .nav-search input::placeholder { color: #6b7280; }
.sidebar nav a {
    display: block;
    padding: .35rem 1.5rem;
    color: #d1d5db;
    font-size: .9rem;
    line-height: 1.3;
}
.sidebar nav a:hover { background: #111827; text-decoration: none; }
.sidebar nav a.active { background: #111827; color: #fff; font-weight: 500; }

.sidebar nav details.nav-group {
    margin: 0 0 .05rem;
    border-left: 3px solid transparent;
    border-radius: 0 4px 4px 0;
}
.sidebar nav details.nav-group summary {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem 1.5rem .2rem calc(1.5rem - 3px);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    cursor: pointer;
    list-style: none;
}
.sidebar nav details.nav-group summary::-webkit-details-marker { display: none; }
.sidebar nav details.nav-group summary::marker { content: ''; }
.sidebar nav details.nav-group summary .nav-icon {
    display: inline-flex;
    flex-shrink: 0;
}
.sidebar nav details.nav-group summary .nav-icon svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
}
.sidebar nav details.nav-group a { padding-left: calc(1.75rem - 3px); }

/* Drag&Drop-Anordnung der Menuebereiche (layouts/staff.blade.php) - summary
   ist gleichzeitig Klick-Ziel (auf-/zuklappen) UND Drag-Griff, der Browser
   unterscheidet beides bereits nativ ueber die Mausbewegung. */
.sidebar nav details.nav-group summary.nav-group-summary-draggable { cursor: grab; }
.sidebar nav details.nav-group.nav-group--dragging { opacity: .4; }
.sidebar nav details.nav-group.nav-group--drop-target { box-shadow: inset 0 2px 0 #fff; }

/* Bereichsfarben: dezente Akzentfarbe je Gruppe (Hintergrund+Überschrift+Icon+
   Rand) - hebt die Bereiche voneinander ab. Aktive/gehoverte Menüpunkte
   behalten ihren eigenen (dunkleren) Hintergrund, siehe .sidebar nav a oben,
   der per Spezifität Vorrang hat. */
.nav-group--allgemein { border-left-color: #60a5fa; background: rgba(96, 165, 250, .08); }
.nav-group--allgemein summary { color: #93c5fd; }
.nav-group--kunden { border-left-color: #34d399; background: rgba(52, 211, 153, .08); }
.nav-group--kunden summary { color: #6ee7b7; }
.nav-group--shop { border-left-color: #a78bfa; background: rgba(167, 139, 250, .08); }
.nav-group--shop summary { color: #c4b5fd; }
.nav-group--buchhaltung { border-left-color: #fbbf24; background: rgba(251, 191, 36, .08); }
.nav-group--buchhaltung summary { color: #fcd34d; }
.nav-group--einstellungen { border-left-color: #94a3b8; background: rgba(148, 163, 184, .08); }
.nav-group--einstellungen summary { color: #cbd5e1; }
.nav-group--agent-verwaltung { border-left-color: #22d3ee; background: rgba(34, 211, 238, .08); }
.nav-group--agent-verwaltung summary { color: #67e8f9; }
.nav-group--voiceserver { border-left-color: #e879f9; background: rgba(232, 121, 249, .08); }
.nav-group--voiceserver summary { color: #f0abfc; }
.nav-group--streamserver { border-left-color: #fb923c; background: rgba(251, 146, 60, .08); }
.nav-group--streamserver summary { color: #fdba74; }
.nav-group--proxmox { border-left-color: #4ade80; background: rgba(74, 222, 128, .08); }
.nav-group--proxmox summary { color: #86efac; }
.nav-group--it-verwaltung { border-left-color: #f472b6; background: rgba(244, 114, 182, .08); }
.nav-group--it-verwaltung summary { color: #f9a8d4; }

/* Kundenbereich-Sidebar nutzt dasselbe Bereichsfarben-Muster wie oben. */
.nav-group--dienste { border-left-color: #2dd4bf; background: rgba(45, 212, 191, .08); }
.nav-group--dienste summary { color: #5eead4; }
.nav-group--rechnungswesen { border-left-color: #a3e635; background: rgba(163, 230, 53, .08); }
.nav-group--rechnungswesen summary { color: #bef264; }
.nav-group--kontoinformationen { border-left-color: #38bdf8; background: rgba(56, 189, 248, .08); }
.nav-group--kontoinformationen summary { color: #7dd3fc; }
.nav-group--konto-verwaltung { border-left-color: #8b5cf6; background: rgba(139, 92, 246, .08); }
.nav-group--konto-verwaltung summary { color: #ddd6fe; }
.nav-group--hilfe { border-left-color: #f87171; background: rgba(248, 113, 113, .08); }
.nav-group--hilfe summary { color: #fca5a5; }

/* --- Responsive (Smartphones) - siehe docs/DECISIONS.md für die
   Gesamt-Herangehensweise. Zwei Breakpoints bewusst getrennt: 768px für
   Struktur (Sidebar/Topbar/Dichte/Touch-Ziele - deckt Hochformat-Handys
   UND kleine Tablets ab), 640px eigens für die Tabellen-Kartenumwandlung
   (siehe weiter unten im Stylesheet) - zwischen 640-768px bleibt eine
   Tabelle bewusst im Scroll-Fallback, auf einem ~700px breiten Geraet noch
   zumutbar. */
/* Element-Selektor (statt nur .nav-toggle) bewusst noetig: die
   .icon-btn-Basisregel (weiter unten im Stylesheet) setzt ebenfalls
   display:inline-flex mit derselben Spezifitaet (eine Klasse) - da sie
   QUELLTEXT-spaeter steht, wuerde sie sonst auf dem Desktop gewinnen und
   den eigentlich versteckten Hamburger-Button sichtbar (aber funktionslos)
   machen. button.nav-toggle (Typ+Klasse) hat hoehere Spezifitaet und
   gewinnt unabhaengig von der Reihenfolge im Stylesheet. */
button.nav-toggle { display: none; }
.sidebar-backdrop { display: none; }

/* Z-Index-Staffelung dieses Stylesheets (hoechste zuerst): 200 = die
   mobile Off-Canvas-Sidebar (.sidebar, s.u.) - liegt ueber allem, auch
   ueber ihrer eigenen Backdrop, da sie als Vollbild-Navigationsflaeche
   nichts verdecken lassen darf, solange sie offen ist. 190 = die
   zugehoerige .sidebar-backdrop direkt darunter, aber ueber jedem
   normalen Seiteninhalt inkl. Popovers. 50 = an ein Trigger-Element
   verankerte Popover/Dropdowns ausserhalb der Drawer (.user-menu,
   .header-popover). 20 = eine inline in den Seitenfluss eingebettete
   Ergebnisliste (.colocation-search-results) - muss nur ueber ihre
   unmittelbaren Geschwister-Elemente hinausragen, nicht ueber
   Topbar-Popovers oder gar die Navigation. */
@media (max-width: 768px) {
    body.nav-open { overflow: hidden; } /* Hintergrund nicht mitscrollen, solange die Drawer offen ist */

    button.nav-toggle { display: inline-flex; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 260px;
        max-width: 82vw;
        z-index: 200;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 2px 0 12px rgba(0, 0, 0, .3);
    }
    .shell.nav-open .sidebar { transform: translateX(0); }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .4);
        z-index: 190;
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }
    .shell.nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
}

.main { flex: 1; min-width: 0; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: .85rem 2rem;
}
.topbar .title { font-size: 1.05rem; font-weight: 600; }
.topbar .user { display: flex; align-items: center; gap: .75rem; font-size: .875rem; color: var(--text-muted); }
.topbar-search-input { min-width: 22rem; }
.topbar form { display: inline; }
.topbar button.link-button {
    background: none; border: none; color: var(--link); cursor: pointer; padding: 0; font-size: .875rem;
}
.roles span { display: inline-block; background: var(--border); padding: .1rem .5rem; border-radius: 4px; font-size: .75rem; }

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: .5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    z-index: 50;
    min-width: 11rem;
    padding: .35rem;
}
.user-menu a, .user-menu-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    padding: .5rem .65rem;
    border-radius: 4px;
    font-size: .875rem;
    color: var(--text);
    text-decoration: none;
    background: none;
    border: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.user-menu a:hover, .user-menu-item:hover { background: var(--hover-bg); }
.user-menu svg { width: 1rem; height: 1rem; flex-shrink: 0; color: var(--text-muted); }
.user-menu form { margin: 0; }
.user-menu-divider { height: 1px; background: var(--border); margin: .35rem 0; }

.content { padding: 2rem; }

/* --- Wiederverwendbare Komponenten --- */
.card {
    background: var(--surface);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
    margin-bottom: 1.5rem;
}
.card h2 { font-size: 1.1rem; margin-top: 0; }
.card.notice { background: var(--badge-warning-bg); border: 1px solid var(--badge-warning-alt-fg); }
.card.notice p { margin: 0; font-size: .875rem; color: var(--badge-warning-fg); }

/* --- Responsive (Smartphones): Content-/Card-Dichte. Volles
   2rem/1.5rem-2rem-Padding frisst auf einem ~360-414px breiten Screen einen
   grossen Teil der nutzbaren Breite. */
@media (max-width: 768px) {
    .content { padding: 1rem; }
    .card { padding: 1rem 1.25rem; }
    .customer-area-notice { padding: .75rem 1rem; }
}

/* --- Start-Uebersicht --- */
.start-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    align-items: start;
}
.start-overview-grid .card { margin-bottom: 0; }
.start-overview-grid ul { margin: 0; padding-left: 1.2rem; }
.start-overview-grid li { margin-bottom: .4rem; }

/* --- Dashboard-Widgets: Admin- und Kunden-Dashboard nutzen seit
   2026-08-16 dieselbe variable-Breite-Grid-Optik (Nutzerauftrag: "Optik
   des Kundenbereich-Dashboards uebernehmen"), aber getrennte Klassen -
   beide Bereiche haben eigene Layout-Klassen im restlichen CSS
   (.card, Tabellen, ...), eine gemeinsame Klasse waere hier keine
   Vereinfachung, nur eine zusaetzliche Kopplung zwischen den beiden
   Bereichen. --- */
.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: start;
}
.admin-dashboard-grid-item .card { margin-bottom: 0; }
.admin-dashboard-grid-item .card h3 { font-size: 1rem; margin-top: 0; }
.admin-dashboard-grid-item--w1 { grid-column: span 1; }
.admin-dashboard-grid-item--w2 { grid-column: span 2; }
.admin-dashboard-grid-item--w3 { grid-column: span 3; }
@media (max-width: 768px) {
    .admin-dashboard-grid { grid-template-columns: 1fr; }
    .admin-dashboard-grid-item--w1,
    .admin-dashboard-grid-item--w2,
    .admin-dashboard-grid-item--w3 { grid-column: span 1; }
}

/* --- Kunden-Dashboard-Grid (variable Breite je Widget) --- */
.customer-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: start;
}
.customer-dashboard-grid-item .card { margin-bottom: 0; }
.customer-dashboard-grid-item--w1 { grid-column: span 1; }
.customer-dashboard-grid-item--w2 { grid-column: span 2; }
.customer-dashboard-grid-item--w3 { grid-column: span 3; }
@media (max-width: 768px) {
    .customer-dashboard-grid { grid-template-columns: 1fr; }
    .customer-dashboard-grid-item--w1,
    .customer-dashboard-grid-item--w2,
    .customer-dashboard-grid-item--w3 { grid-column: span 1; }
}

/* --- Newsletter-Kategorie-Toggles (Kunden-Dashboard + Praeferenzen) --- */
.newsletter-toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: .6rem 0; border-bottom: 1px solid var(--border);
}
.newsletter-toggle-row:last-of-type { border-bottom: none; }

/* --- Schnellzugriff-Kacheln (Kunden-Dashboard) --- */
.quick-link-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.quick-link-tile {
    display: flex; flex-direction: column; align-items: center; gap: .5rem;
    padding: 1.25rem 1rem; border: 1px solid var(--border-strong); border-radius: 8px;
    text-decoration: none; color: var(--text); text-align: center;
}
.quick-link-tile:hover { background: var(--hover-bg); }
.quick-link-tile-icon {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 2.5rem; height: 2.5rem; border-radius: 8px; background: var(--hover-bg);
}
.quick-link-tile-icon svg { width: 1.4rem; height: 1.4rem; }

/* --- Profildetails-Feldraster (Kunden-Dashboard) --- */
.profile-field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.5rem; }
@media (max-width: 768px) { .profile-field-grid { grid-template-columns: 1fr; } }

/* --- IPAM Netzuebersicht --- */
.ipam-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.ipam-tiles-grid .card { margin-bottom: 0; padding: 1rem 1.25rem; }
.ipam-tile-label { font-size: .8rem; color: var(--text-muted); }
.ipam-tile-value { font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* --- KPI-Kacheln (Finance: Rechnungen, Kennzahlen) --- */
.kpi-tiles { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.kpi-tile {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: .75rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--surface);
    min-width: 10rem;
}
.kpi-tile__label { font-size: .78rem; color: var(--text-muted); }
.kpi-tile__value { font-size: 1.4rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

.ipam-overview-grid {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 1.5rem;
    align-items: start;
}
.ipam-overview-grid .card { margin-bottom: 0; min-width: 0; }
@media (max-width: 900px) {
    .ipam-overview-grid { grid-template-columns: 1fr; }
}

.ipam-tree { font-size: .875rem; }
.ipam-tree ul { list-style: none; margin: 0; padding-left: 1.1rem; }
.ipam-tree > ul { padding-left: 0; }
.ipam-tree summary { cursor: pointer; }
.ipam-tree summary:hover { color: var(--link); }
.ipam-tree .ipam-tree-leaf { padding: .15rem 0; }
.ipam-tree .ipam-tree-node-label { padding: .15rem 0; }
.ipam-tree code { font-size: .8em; }

.proxmox-expert-mode { margin: 1rem 0; }
.proxmox-expert-mode summary { cursor: pointer; font-weight: 600; }
.proxmox-expert-mode summary:hover { color: var(--link); }
.proxmox-expert-mode[open] summary { margin-bottom: 1rem; }

/* --- Kundenbereich "Mein Voiceserver": Kachel je Server --- */
.voiceserver-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
    align-items: start;
}
.voiceserver-tile { margin-bottom: 0; padding: 1.25rem 1.5rem; }
.voiceserver-tile-header { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.voiceserver-tile-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--badge-info-bg);
    color: var(--badge-info-fg);
}
.voiceserver-tile-logo svg { width: 1.6rem; height: 1.6rem; }
.voiceserver-tile-title strong { display: block; font-size: 1.05rem; }
.voiceserver-tile-facts { display: flex; gap: 1.5rem; margin: 0 0 1rem; }
.voiceserver-tile-facts dt { font-size: .75rem; color: var(--text-muted); margin: 0; }
.voiceserver-tile-facts dd { margin: .1rem 0 0; font-weight: 500; }
.voiceserver-tile-actions { flex-wrap: wrap; padding-top: .75rem; border-top: 1px solid var(--border); }

.notice-urgent {
    background: var(--badge-danger-bg); border: 2px solid var(--danger); color: var(--danger-strong);
    padding: .9rem 1.1rem; border-radius: 8px; margin-bottom: 1.5rem;
    font-size: .9rem; font-weight: 600;
}
.notice-urgent a { color: var(--danger-strong); text-decoration: underline; margin-left: .5rem; }

.notice-banner {
    padding: .9rem 1.1rem; border-radius: 8px; margin-bottom: 1.5rem;
    font-size: .9rem; font-weight: 600; border: 2px solid;
}
.notice-banner--success { background: var(--badge-success-bg); border-color: var(--success); color: var(--badge-success-fg); }
.notice-banner--danger { background: var(--badge-danger-bg); border-color: var(--danger); color: var(--badge-danger-fg); }

/* Dauerhafter, admin-gepflegter Kundenbereich-Hinweis (Einstellungen ->
   Allgemein) - bewusst zurueckhaltender als .notice-urgent (kein roter
   Alarm-Ton), aber ueber die gesamte Breite des Kopfbereichs, mit kraeftiger
   Akzentfarbe und etwas groesserer Schrift, damit er zuverlaessig auffaellt. */
.customer-area-notice {
    background: var(--badge-info-bg); border-bottom: 3px solid var(--link); color: var(--link-strong);
    padding: .85rem 2rem; font-size: 1rem; font-weight: 600;
}

/* Kleines, neutrales Hinweis-Badge fuer Status-Zusatzinfos (z.B. "automatisch
   generiert" bei Rechnungen, "Mahnsperre aktiv" im Kundenpopup) - bewusst
   dezenter als .notice-urgent, da es keine Warnung ist, nur eine Zusatzinfo. */
.badge-auto {
    display: inline-block; background: var(--badge-indigo-bg); color: var(--badge-indigo-fg);
    border-radius: 4px; padding: .1rem .5rem; font-size: .8rem; margin-left: .4rem;
}
/* Variante fuer die Kopfzeilen-Glocke/Sidebar-Benachrichtigungen, sobald
   mindestens ein Eintrag Schweregrad "warnung" hat (z.B. Mahnstufe,
   unbestaetigte E-Mail) - derselbe Rotton wie .notice-urgent. */
.badge-auto--warnung { background: var(--badge-danger-bg); color: var(--badge-danger-fg); }
/* Ampel-Varianten fuer den Zahlungsrisiko-Score im Kundenpopup (Tab
   "Statistik") - "hoch" nutzt bewusst denselben Rotton wie --warnung. */
.badge-auto--gut { background: var(--badge-success-bg); color: var(--badge-success-fg); }
.badge-auto--mittel { background: var(--badge-warning-bg); color: var(--badge-warning-fg); }
/* Domain-Robot Domains-Liste: Eigenbedarf/Reseller/Kunde-Kategorie je Zeile
   (Modules/DomainRobot/resources/views/admin/domains/index.blade.php). */
.badge-auto--eigenbedarf { background: var(--badge-neutral-bg); color: var(--badge-neutral-fg); }
.badge-auto--reseller { background: var(--badge-indigo-bg); color: var(--badge-indigo-fg); }
.badge-auto--kunde { background: var(--badge-info-bg); color: var(--badge-info-fg); }
/* "Verwaist" - noch keinem Kunden/Eigenbedarf zugewiesen, braucht
   administrative Aufmerksamkeit - bewusst derselbe Warnton wie --mittel. */
.badge-auto--verwaist { background: var(--badge-warning-bg); color: var(--badge-warning-fg); }
.customer-area-notice a { color: var(--link-strong); text-decoration: underline; }

/* Vorschau-Eintraege im Glocken-Popover (layouts/customer.blade.php) - siehe
   .notification-item auf der Vollansicht (notifications/index.blade.php)
   fuer dieselbe Hinweis/Warnung-Farbunterscheidung. */
.notification-preview-item { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.notification-preview-item:last-of-type { border-bottom: none; }
.notification-preview-item--warnung strong { color: var(--badge-danger-fg); }

/* Einheitlicher, umrandeter Icon-Button - Standard fuer Aktionsspalten in
   Listen (urspruenglich Kunden-Uebersicht) UND fuer die Icon-Gruppe in der
   Kundenbereich-Kopfzeile (Hilfe/Benachrichtigungen/Service-PIN). Gilt fuer
   <a class="icon-btn"> und <button class="icon-btn"> gleichermassen, damit
   Links und Formular-Buttons in derselben Zeile/Gruppe optisch identisch
   aussehen. */
.icon-btn-group { display: flex; gap: .3rem; align-items: center; }
.icon-btn-group form { display: inline-flex; margin: 0; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center; position: relative;
    width: 1.6rem; height: 1.6rem; border: 1px solid var(--border-strong); border-radius: 4px;
    background: var(--surface); color: var(--text); cursor: pointer; padding: 0; margin: 0; line-height: 1;
    text-decoration: none;
}
.icon-btn:hover { background: var(--hover-bg); border-color: var(--text-muted); }
.icon-btn svg { display: block; width: 1rem; height: 1rem; }
/* Responsive (Smartphones): 1.6rem (~25.6px) liegt unter der gaengigen
   ~44px-Touch-Ziel-Empfehlung - betrifft praktisch jede Aktionsspalte in
   jeder Tabelle sowie die Topbar-Icon-Cluster. */
@media (max-width: 768px) {
    .icon-btn { width: 2.75rem; height: 2.75rem; }
    .icon-btn svg { width: 1.4rem; height: 1.4rem; }
}
.icon-btn-danger { background: var(--badge-danger-bg); border-color: var(--danger-strong); color: var(--badge-danger-fg); }
.icon-btn-danger:hover { background: var(--badge-danger-bg); border-color: var(--danger); }
/* Variante fuer "Favorit"/"Standard"-Umschalter (z.B. Buchungskonten-Favorit,
   Standard-Zahlungsart/Standard-Mail-Backend) im aktiven Zustand. */
.icon-btn-favorite { background: var(--badge-warning-bg); border-color: var(--badge-warning-fg); color: var(--badge-warning-fg); }
.icon-btn-favorite:hover { background: var(--badge-warning-alt-bg); border-color: var(--badge-warning-fg); }

/* Moderner Schieberegler fuer echte binaere (2-Optionen) Auswahlfelder -
   ersetzt frueher an diesen Stellen genutzte Radiobutton-Paare (z.B. Netto/
   Brutto, Betreiber/Kunde, Editor/HTML). Technisch ein <input type=checkbox>
   mit vorangestelltem gleichnamigem <input type=hidden> (identisches Muster
   wie die bestehenden Boolean-Felder im IT-Inventar-Formular) - bei
   unchecked greift der hidden-Wert, bei checked ueberschreibt der Checkbox-
   Wert ihn (PHP/Laravel wertet bei doppeltem Feldnamen den LETZTEN Wert),
   serverseitig also weiterhin ein einzelnes Feld mit zwei moeglichen
   Werten, keine Formular-/Validierungsaenderung noetig. Rein CSS-basiert
   (:checked-Sibling-Selektoren), kein JS noetig. */
.hp-switch { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; user-select: none; }
.hp-switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hp-switch-track {
    position: relative; width: 2.75rem; height: 1.5rem; flex-shrink: 0;
    background: var(--input-border); border-radius: 999px; transition: background .15s;
}
.hp-switch-track::before {
    content: ''; position: absolute; top: .15rem; left: .15rem; width: 1.2rem; height: 1.2rem;
    background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.hp-switch-input:checked + .hp-switch-track { background: var(--accent); }
.hp-switch-input:checked + .hp-switch-track::before { transform: translateX(1.25rem); }
.hp-switch-input:focus-visible + .hp-switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.hp-switch-labels { display: inline-flex; gap: .3rem; font-size: .85rem; color: var(--text-muted); }
.hp-switch-input:not(:checked) ~ .hp-switch-labels .hp-switch-label-off,
.hp-switch-input:checked ~ .hp-switch-labels .hp-switch-label-on { color: var(--text); font-weight: 600; }

/* Kleiner Zaehler-Badge oben rechts auf einem .icon-btn (z.B. Glocke in der
   Kundenbereich-Kopfzeile) - bewusst anderes Erscheinungsbild als .badge-auto
   (das steht INLINE neben einem Text/Link, hier sitzt der Badge ueberlappend
   auf der Ecke eines quadratischen Icon-Buttons). */
.icon-btn-badge {
    position: absolute; top: -.4rem; right: -.4rem; min-width: 1.1rem; text-align: center;
    background: var(--icon-badge-bg); color: #fff; border-radius: 999px; font-size: .65rem;
    line-height: 1.1; padding: .1rem .3rem;
}
.icon-btn-badge--warnung { background: var(--danger); }

/* Einheitliche Icon-Button-Gruppe in der Kundenbereich-Kopfzeile (Hilfe/
   Benachrichtigungen/Service-PIN) - alle drei nebeneinander, gleiche Groesse/
   Rahmen (.icon-btn), Popover oeffnet sich darunter. */
/* Kontaktanfragen-Popup (resources/views/contact-messages/popup-content.blade.php) -
   Nachricht des Kunden vs. eigene Antwort optisch klar unterscheidbar,
   Meta-Zeilen (Von/Datum/Beantwortet) als kompakte Tabelle statt loser
   Absaetze. */
.contact-message-box { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: .85rem 1rem; white-space: pre-wrap; font-size: .875rem; line-height: 1.5; }
.contact-message-box--reply { background: var(--badge-info-bg); border-color: var(--badge-info-fg); }
.contact-message-box--success { background: var(--badge-success-bg); border-color: var(--badge-success-fg); }
.contact-meta-table th { color: var(--text-muted); font-weight: 500; width: 7rem; white-space: nowrap; vertical-align: top; }
.contact-section-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin: 0 0 .4rem; }

.header-icon-group { display: flex; gap: .4rem; align-items: center; }
.header-popover {
    display: none; position: absolute; top: 100%; right: 0; margin-top: .4rem;
    background: var(--popover-bg); border: 1px solid var(--border-strong); border-radius: 6px; padding: .6rem .9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15); z-index: 50; color: var(--popover-text); font-weight: normal;
    font-size: .85rem; line-height: 1.4;
}

/* --- Responsive (Smartphones): Topbar. Die Trigger-Icons sitzen in beiden
   Topbars NICHT ganz rechts (Admin: danach folgen noch Rollen-
   Badges + Usermenü; Kunde: danach folgen noch Kundennr./Avatar/Logout) -
   ein simples Schmaler-Machen der Popover reicht deshalb nicht, ein
   right:0-verankertes Popover kann auf einem 375px-Screen trotzdem über den
   LINKEN Rand hinauslaufen. Fix: ab 768px viewport-verankert statt
   trigger-verankert. */
@media (max-width: 768px) {
    .topbar { flex-wrap: wrap; row-gap: .5rem; padding: .85rem 1rem; }
    /* flex-basis:0 (statt auto) ist der entscheidende Teil: bei "auto"
       zaehlt für die Zeilenumbruch-Entscheidung des Flex-Containers die
       ungeschrumpfte Wunschbreite des Titeltexts - ein langer Seitentitel
       liess dadurch die Icon-Gruppe (.user) je nach Titellaenge in eine
       zweite Zeile rutschen, ein kurzer Titel nicht. Mit Basis 0 traegt
       der Titel zu dieser Entscheidung nichts bei und bekommt erst danach
       per flex-grow den uebrigen Platz zugeteilt - Titel und Icons bleiben
       damit unabhaengig von der Titellaenge zuverlaessig in einer Zeile. */
    .topbar .title { flex: 1 1 0%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-search { order: 3; flex-basis: 100%; }
    .topbar-search-input { min-width: 0; width: 100%; box-sizing: border-box; }
    .roles { display: none; } /* geringer Infowert mobil, im Profil weiterhin einsehbar */
    .topbar-customer-number, .topbar-customer-email { display: none; }
    /* Zusaetzlicher Sicherheitsabstand fuer Geraete mit mehreren gleichzeitig
       sichtbaren Kopfzeilen-Icons (Hilfe/Service-PIN sind optional/pro Seite
       zuschaltbar) - jedes eingesparte Pixel hilft, alles in einer Zeile zu
       halten. */
    .header-icon-group { gap: .3rem; }
    .topbar .user { gap: .5rem; }

    .header-popover {
        position: fixed !important;
        top: 3.75rem !important;
        left: .75rem !important;
        right: .75rem !important;
        width: auto !important;
        max-width: none !important;
        margin-top: 0 !important;
    }
}

table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
/* vertical-align explizit statt Browser-Default: verhindert, dass Zellen
   mit unterschiedlichem Inhalt (z.B. ein Formular mit Input+Button neben
   einer Zelle mit nur Icon-Buttons) je nach Browser unterschiedlich
   ausgerichtet werden und die untere Rahmenlinie dadurch uneinheitlich
   wirkt. */
th, td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--border); font-size: .875rem; vertical-align: middle; }

.table-compact th, .table-compact td { padding: .3rem .5rem; font-size: .8rem; line-height: 1.3; }

/* --- Responsive (Smartphones): Tabellen -> Karten. Siehe
   public/js/responsive-tables.js fuer die automatische data-label-
   Beschriftung/Klassifizierung. Karten-Darstellung ist bewusst ein OPT-IN
   per Klasse (.rt-cards/.rt-keyvalue), NICHT ein Opt-out - jede Tabelle,
   die aus irgendeinem Grund nicht durch das JS laeuft, faellt automatisch
   auf simples horizontales Scrollen zurueck statt visuell kaputt zu sein. */
@media (max-width: 640px) {
    table:not(.rt-cards):not(.rt-keyvalue) {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    table.rt-cards { display: block; }
    table.rt-cards thead { display: none; }
    table.rt-cards tbody, table.rt-cards tr { display: block; width: 100%; }
    table.rt-cards tr {
        margin-bottom: .75rem;
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: .5rem .75rem;
        background: var(--surface);
    }
    table.rt-cards tr.rt-block-row { border: none; background: none; padding: .5rem 0; }
    table.rt-cards td {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: .1rem .5rem;
        padding: .35rem 0;
        border-bottom: 1px dashed var(--border);
        font-size: .875rem;
    }
    table.rt-cards td:last-child { border-bottom: none; }
    table.rt-cards tr.rt-block-row td { border-bottom: none; padding: 0; white-space: normal; }
    table.rt-cards td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        flex: 0 0 auto;
        min-width: 40%;
    }
    /* Zellen OHNE data-label (leere Aktions-/Checkbox-Kopfzellen) rechts
       ausrichten statt am linken Rand zu haengen wie eine beschriftete Zeile. */
    table.rt-cards td:not([data-label]) { justify-content: flex-end; }
    table.rt-cards .icon-btn-group { flex-wrap: wrap; justify-content: flex-end; }

    /* Schluessel/Wert-Tabellen: th IST bereits die Beschriftung, nur gestapelt. */
    table.rt-keyvalue, table.rt-keyvalue tbody, table.rt-keyvalue tr { display: block; }
    table.rt-keyvalue tr { padding: .4rem 0; border-bottom: 1px solid var(--border); }
    table.rt-keyvalue th, table.rt-keyvalue td { display: block; padding: .1rem 0; white-space: normal; }
    table.rt-keyvalue th { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); font-weight: 600; }
}

label { display: block; margin: .75rem 0 .25rem; font-size: .875rem; }
input[type=text], input[type=email], input[type=password], input[type=number], select {
    width: 100%; padding: .5rem; border: 1px solid var(--input-border); border-radius: 4px; box-sizing: border-box;
    background: var(--surface); color: var(--text);
}
button, input[type=submit] {
    margin-top: 1.25rem; padding: .5rem 1rem; background: var(--accent); color: #fff;
    border: none; border-radius: 4px; cursor: pointer; font-size: .875rem;
}
/* .secondary ist der einheitliche Look fuer kleine Tabellenzeilen-/
   Show-Seiten-Aktionen (Bearbeiten, Löschen, Pausieren, Fortsetzen, ...) -
   bewusst kompakter als ein grosser, alleinstehender Formular-Submit-
   Button (dessen groessere Groesse/margin-top ueber button, input[type=submit]
   oben kommt). Gilt fuer <button class="secondary"> UND <a class="secondary">
   gleichermassen, damit beide nebeneinander in derselben Zeile gleich
   aussehen. */
button.secondary, a.secondary {
    display: inline-block;
    margin-top: 0;
    padding: .35rem .75rem;
    background: var(--surface); color: var(--text); border: 1px solid var(--input-border);
    border-radius: 4px; font-size: .8rem;
}
a.secondary:hover { text-decoration: none; background: var(--hover-bg); }
button.secondary:hover { background: var(--hover-bg); }

.error { color: var(--danger); font-size: .8rem; margin-top: .25rem; }
.status-msg { color: var(--success); font-size: .875rem; margin-top: .5rem; }
.status-msg-warning { color: var(--badge-warning-fg); font-size: .875rem; margin-top: .5rem; }

.status { display: inline-block; padding: .1rem .5rem; border-radius: 4px; font-size: .75rem; background: var(--badge-success-bg); color: var(--badge-success-fg); }
.status-cancelled, .status-expired { background: var(--badge-danger-bg); color: var(--badge-danger-fg); }
.status-open { color: var(--badge-warning-fg); }
.status-paid, .status-settled, .status-completed { color: var(--badge-success-fg); }
.status-refunded { color: var(--text-muted); }
.status-partially_paid { color: var(--badge-info-fg); }
.status-pending_verification { background: var(--badge-danger-bg); color: var(--badge-danger-fg); }
.status-pending_template_acceptance { background: var(--badge-warning-alt-bg); color: var(--badge-warning-alt-fg); }
.status-credit_hold { background: var(--badge-danger-bg); color: var(--badge-danger-fg); font-weight: 600; }
.status-in_progress { color: var(--badge-info-fg); }
.status-awaiting_customer { background: var(--badge-warning-alt-bg); color: var(--badge-warning-alt-fg); }
.status-on_hold { color: var(--text-muted); }
.status-closed { color: var(--text-muted); }
.status-running { background: var(--badge-info-bg); color: var(--badge-info-fg); }
.status-planned { color: var(--badge-info-fg); }
.status-done { color: var(--badge-success-fg); }
.status-rejected { background: var(--badge-danger-bg); color: var(--badge-danger-fg); }
.status-failed { background: var(--badge-danger-bg); color: var(--badge-danger-fg); }
.status-draft { background: var(--badge-neutral-bg); color: var(--badge-neutral-fg); font-style: italic; }
.status-overdue { background: var(--badge-danger-bg); color: var(--badge-danger-fg); font-weight: 600; }

/* --- Dienst-Status (Ts3Server/GameServer/StreamserverStream/AzuracastStation) --- */
.status-provisioning { background: var(--badge-info-bg); color: var(--badge-info-fg); }
.status-suspended { background: var(--badge-danger-bg); color: var(--badge-danger-fg); }
.status-terminated { background: var(--badge-neutral-bg); color: var(--badge-neutral-fg); }
.status-offline { background: var(--badge-warning-bg); color: var(--badge-warning-fg); }

/* --- IT-Asset-Status (Modules\Inventory\Models\ItAsset::status) --- */
.status-in_betrieb { background: var(--badge-success-bg); color: var(--badge-success-fg); }
.status-lager { background: var(--badge-neutral-bg); color: var(--badge-neutral-fg); }
.status-defekt { background: var(--badge-danger-bg); color: var(--badge-danger-fg); }
.status-ausgemustert { background: var(--badge-neutral-bg); color: var(--text-muted); font-style: italic; }

/* --- Betrugspraevention-Risikoindex (FraudCustomerRiskSummary::level) --- */
.status-risk-niedrig { background: var(--badge-success-bg); color: var(--badge-success-fg); padding: .1rem .5rem; border-radius: 4px; font-size: .75rem; }
.status-risk-mittel { background: var(--badge-warning-alt-bg); color: var(--badge-warning-alt-fg); padding: .1rem .5rem; border-radius: 4px; font-size: .75rem; }
.status-risk-hoch { background: var(--badge-danger-bg); color: var(--badge-danger-fg); padding: .1rem .5rem; border-radius: 4px; font-size: .75rem; font-weight: 600; }

/* --- TS3-Instanz Live-Dienststatus (Ts3InstanceController::liveStatusFor) --- */
.ts3-live-status-active { background: var(--badge-success-bg); color: var(--badge-success-fg); padding: .15rem .5rem; border-radius: .25rem; font-weight: 600; }
.ts3-live-status-error { background: var(--badge-danger-bg); color: var(--badge-danger-fg); padding: .15rem .5rem; border-radius: .25rem; font-weight: 600; }
.ts3-live-status-pending { background: var(--badge-neutral-bg); color: var(--text-muted); padding: .15rem .5rem; border-radius: .25rem; }

.pay-form, .cancel-form { display: flex; gap: .35rem; align-items: center; }
.pay-form input, .cancel-form input { margin: 0; width: auto; flex: 1; padding: .3rem; font-size: .8rem; }
.pay-form button, .cancel-form button { margin: 0; padding: .3rem .6rem; font-size: .8rem; }

/* --- "Meine Vertraege" (/kunden/vertraege) Kartenraster --- */
.contracts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.contract-card { display: flex; flex-direction: column; gap: .8rem; margin-bottom: 0; }
.contract-card-head { display: flex; gap: .8rem; align-items: flex-start; }
.contract-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 .3rem; }
.contract-icon {
    width: 2.75rem; height: 2.75rem; flex-shrink: 0; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--badge-info-bg); color: var(--badge-info-fg);
}
.contract-icon svg { width: 1.4rem; height: 1.4rem; }
.contract-specs { display: flex; flex-wrap: wrap; gap: .4rem; }
.spec-chip {
    display: inline-flex; align-items: center; background: var(--badge-info-bg); color: var(--badge-info-fg);
    font-size: .75rem; font-weight: 600; padding: .3rem .55rem; border-radius: 6px; white-space: nowrap;
}
.contract-term {
    display: flex; justify-content: space-between; align-items: center; gap: .5rem;
    font-size: .82rem; color: var(--text-muted); border-top: 1px dashed var(--border); padding-top: .7rem;
}
.contract-term b { color: var(--text); }
.contract-actions { display: flex; gap: .5rem; margin-top: auto; padding-top: .2rem; }
.contract-actions a { flex: 1; text-align: center; text-decoration: none; }
.contract-actions a:not(.secondary) { margin-top: 0; padding: .45rem .75rem; background: var(--accent); color: #fff; border-radius: 4px; font-size: .85rem; }
.contract-actions a:not(.secondary):hover { opacity: .9; }
.status-cancelling { background: var(--badge-warning-bg); color: var(--badge-warning-fg); }

/* --- "Verwalten"-Hinweis im Vertrags-Detail-Popup (siehe ContractManagementLinkRegistry) --- */
.contract-popup-manage {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    background: var(--badge-info-bg); border-radius: 6px; padding: .7rem .9rem; margin-top: 1rem;
}
.contract-popup-manage span { font-size: .85rem; font-weight: 600; color: var(--badge-info-fg); }
.contract-popup-manage a {
    white-space: nowrap; text-decoration: none; margin-top: 0;
    padding: .4rem .75rem; background: var(--accent); color: #fff; border-radius: 4px; font-size: .8rem;
}
.contract-popup-manage a:hover { opacity: .9; }

/* --- Support-Ticket-Chatdesign --- */
.chat-thread { max-height: 480px; overflow-y: auto; padding: .25rem; }
.chat-row { display: flex; gap: .5rem; margin-bottom: .75rem; align-items: flex-end; }
.chat-row--mine { justify-content: flex-end; }
.chat-row--mine .chat-avatar { order: 2; }
.chat-avatar {
    flex: none;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--chat-avatar-bg);
    color: var(--chat-avatar-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 600;
}
.chat-bubble { max-width: 75%; padding: .6rem .85rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.chat-row--mine .chat-bubble { background: var(--chat-mine-bg); border-color: var(--chat-mine-border); }
.chat-bubble--internal { background: var(--chat-internal-bg); border-color: var(--chat-internal-border); }
.chat-bubble--system { background: var(--chat-system-bg); border-color: var(--chat-system-border); }
.chat-meta { font-size: .75rem; color: var(--text-muted); margin-bottom: .25rem; }
.chat-body { white-space: pre-wrap; }

/* Audit-Log (/admin/logs) - Filterleiste, "Wer"-Badges, Pagination */
.log-filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin: 1rem 0; padding: .75rem; background: var(--surface); border-radius: 6px; }
.log-filters label { font-size: .75rem; color: var(--text-muted); display: block; margin-bottom: .2rem; }
.log-filters .field { display: flex; flex-direction: column; }
.badge-impersonation { display: inline-block; background: var(--badge-warning-alt-bg); color: var(--badge-warning-alt-fg); border-radius: 4px; padding: .1rem .4rem; font-size: .75rem; margin-left: .4rem; text-decoration: none; }
.pagination { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.pagination li { border: 1px solid var(--border); border-radius: 4px; }
.pagination li span, .pagination li a { display: block; padding: .3rem .6rem; font-size: .8rem; color: inherit; text-decoration: none; }
.pagination li.active span { background: var(--accent); color: #fff; }
.pagination li.disabled span { color: var(--text-muted); }

/* IPAM (/admin/ipam/netze) - Auslastungsbalken in der Netzuebersicht */
.usage-bar { position: relative; width: 6rem; height: .6rem; background: var(--border); border-radius: 4px; overflow: hidden; }
.usage-bar-fill { position: absolute; inset: 0 auto 0 0; height: 100%; background: var(--success); }
.usage-bar-fill--warning { background: var(--badge-warning-fg); }
.usage-bar-fill--critical { background: var(--badge-danger-fg); }
.usage-bar-label { font-size: .75rem; color: var(--text-muted); margin-left: .4rem; }

/* IPAM (/admin/ipam/netze/{ipSubnet}/ips) - Netz-Detailseite: grosser,
   zweigeteilter Zuweisungsbalken (anders als .usage-bar oben, das eine
   kompakte Einzelmetrik-Kachel ist) + Info-Grid + farbige Kopfzeilen-
   Aktionen. */
.ipam-split-bar { display: flex; width: 100%; height: 1.75rem; border-radius: 4px; overflow: hidden; margin: 1rem 0; font-size: .75rem; }
.ipam-split-bar > span { display: flex; align-items: center; justify-content: center; color: #fff; white-space: nowrap; overflow: hidden; min-width: 2.5rem; }
.ipam-split-bar-assigned { background: var(--success); }
.ipam-split-bar-free { background: var(--link); }

.ipam-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 2rem; margin-top: 1rem; }
.ipam-info-grid dt { font-weight: 600; font-size: .8rem; color: var(--text-muted); margin-top: .6rem; }
.ipam-info-grid dd { margin: .1rem 0 0; }

/* Farbige Varianten von .secondary fuer hervorgehobene Kopfzeilen-Aktionen
   (z.B. "Entfernen"/"Bearbeiten" auf der IPAM-Netz-Detailseite) - sonst
   identisch zu .secondary, nur Rahmen-/Textfarbe geaendert. */
button.secondary.btn-outline-danger, a.secondary.btn-outline-danger { border-color: var(--danger-strong); color: var(--danger); }
button.secondary.btn-outline-danger:hover, a.secondary.btn-outline-danger:hover { background: var(--badge-danger-bg); }
button.secondary.btn-outline-primary, a.secondary.btn-outline-primary { border-color: var(--link); color: var(--link); }
button.secondary.btn-outline-primary:hover, a.secondary.btn-outline-primary:hover { background: var(--badge-info-bg); }

/* Volltonige (nicht nur umrandete) Kopfzeilen-Aktionsknoepfe - z.B.
   "Senden starten"/"Testmail senden" auf der Newsletter-Bearbeiten-Seite,
   wo die Aktion selbst (nicht nur eine Randfarbe) hervorstechen soll. */
button.btn-solid-danger, input[type=submit].btn-solid-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
button.btn-solid-danger:hover, input[type=submit].btn-solid-danger:hover { background: var(--danger-strong); }
button.btn-solid-primary, input[type=submit].btn-solid-primary { background: var(--link); color: #fff; border-color: var(--link); }
button.btn-solid-primary:hover, input[type=submit].btn-solid-primary:hover { background: var(--link-strong); }

/* Colocation (/admin/colocation/gestelle/{enclosure}) - visuelle Rack-/Regal-Belegung.
   CSS Grid statt Flex: eine Platzierung, die mehrere HE/Stellplaetze belegt, wird als
   EIN Grid-Item mit grid-row/grid-column span gerendert (siehe _diagram.blade.php) -
   dadurch ein zusammenhaengendes Objekt statt mehrerer Einzelboxen je Einheit. */
.rack-diagram { display: grid; grid-template-columns: 1fr; grid-auto-rows: minmax(1.9rem, auto); gap: 2px; max-width: 28rem; margin-top: 1rem; }
.rack-unit { display: flex; align-items: center; gap: .5rem; padding: .3rem .5rem; border-radius: 4px; font-size: .8rem; background: var(--surface); border: 1px solid var(--border); }
/* Farbcodierung nach Geraete-Status: Frei=gruen, In Betrieb=blau, Standby=orange,
   alles andere (Lager/Defekt/Ausgemustert, falls dennoch platziert)=neutral. */
.rack-unit--free { background: var(--badge-success-bg); border-color: var(--badge-success-fg); }
.rack-unit--in-betrieb { background: var(--badge-info-bg); border-color: var(--badge-info-fg); }
.rack-unit--standby { background: var(--badge-warning-alt-bg); border-color: var(--badge-warning-alt-fg); }
.rack-unit--occupied-other { background: var(--badge-neutral-bg); border-color: var(--border-strong); }
.rack-unit-label { width: 3.5rem; flex-shrink: 0; color: var(--text-muted); font-size: .75rem; }
.rack-unit-assign { margin-left: auto; font-size: .75rem; }
.shelf-diagram { display: flex; flex-direction: column; gap: .75rem; margin-top: 1rem; }
.shelf-level { display: flex; align-items: center; gap: .75rem; }
.shelf-level-label { width: 5rem; flex-shrink: 0; font-size: .8rem; color: var(--text-muted); }
.shelf-level-slots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(4.5rem, 1fr); gap: 4px; overflow-x: auto; padding-bottom: 2px; }
.shelf-slot { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .4rem; border-radius: 4px; font-size: .75rem; background: var(--surface); border: 1px solid var(--border); text-align: center; }
.shelf-slot--free { background: var(--badge-success-bg); border-color: var(--badge-success-fg); }
.shelf-slot--in-betrieb { background: var(--badge-info-bg); border-color: var(--badge-info-fg); }
.shelf-slot--standby { background: var(--badge-warning-alt-bg); border-color: var(--badge-warning-alt-fg); }
.shelf-slot--occupied-other { background: var(--badge-neutral-bg); border-color: var(--border-strong); }
.shelf-slot-label { font-size: .7rem; color: var(--text-muted); }
.rack-unit--highlight, .shelf-slot--highlight { outline: 2px solid var(--badge-warning-fg, #f59e0b); outline-offset: 1px; animation: hostpanel-colocation-pulse 1.6s ease-in-out 2; }
@keyframes hostpanel-colocation-pulse { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, .25); } }
.rack-diagram--compact { max-width: none; grid-auto-rows: minmax(1.3rem, auto); }
.rack-diagram--compact .rack-unit { font-size: .7rem; padding: .15rem .35rem; }
.rack-diagram--compact .rack-unit-label { width: 2.6rem; }
.shelf-diagram--compact .shelf-level-slots { grid-auto-columns: minmax(3.5rem, 1fr); }
.shelf-diagram--compact .shelf-slot { padding: .3rem; font-size: .68rem; }
.colocation-diagram [data-cell][draggable="true"] { cursor: grab; }
.colocation-diagram [data-cell].rack-unit--free, .colocation-diagram [data-cell].shelf-slot--free { cursor: default; }

/* Drag-Vorschau: skizziert beim Halten eines Objekts, welche Plaetze beim
   Loslassen belegt wuerden (siehe providers/index.blade.php, applyPreview()). */
.rack-unit--drag-preview, .shelf-slot--drag-preview { outline: 2px dashed var(--link); outline-offset: -2px; }

/* Colocation Top-Down-Baum (/admin/colocation/betreiber) */
.colocation-tree-list { list-style: none; margin: 0; padding: 0; }
.colocation-tree-list--root { border: 1px solid var(--border); border-radius: 6px; padding: .5rem; }
.colocation-tree-node { margin: 0; }
.colocation-tree-row { display: flex; align-items: center; gap: .5rem; padding: .35rem .3rem; }
.colocation-tree-toggle {
    background: none; border: 1px solid var(--border); border-radius: 4px; width: 1.4rem; height: 1.4rem;
    padding: 0; margin: 0; display: inline-flex; align-items: center; justify-content: center;
    line-height: 1; cursor: pointer; color: var(--text-muted); flex-shrink: 0;
}
.colocation-tree-label { font-weight: 600; }
.colocation-tree-count { color: var(--text-muted); font-size: .8rem; }
.colocation-tree-edit { margin-left: auto; margin-top: 0; text-decoration: none; color: var(--text-muted); font-size: .85rem; padding: 0 .2rem; }
.colocation-tree-children { display: none; margin-left: 1.8rem; padding-left: .75rem; border-left: 1px dashed var(--border); }
.colocation-tree-node.is-open > .colocation-tree-children { display: block; }
.colocation-tree-children--diagram { padding-top: .5rem; padding-bottom: .5rem; }
.colocation-tree-add { padding: .4rem .3rem; }
.colocation-search-results { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.12); max-height: 20rem; overflow-y: auto; }
.colocation-search-result { display: block; padding: .5rem .75rem; text-decoration: none; color: inherit; border-bottom: 1px solid var(--border); }
.colocation-search-result:last-child { border-bottom: none; }
.colocation-search-result:hover { background: var(--badge-info-bg); }
.colocation-search-result--empty { color: var(--text-muted); cursor: default; }
.colocation-visual-grid { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .5rem; }
.colocation-visual-box { border: 1px solid var(--border); border-radius: 6px; padding: .6rem; min-width: 12rem; }

/* --- Responsive (Smartphones): zentrale Dialog-Basis. 18 <dialog>-
   Elemente in 14 Dateien setzen bisher JEDES ihre eigene inline
   width:min(Npx,92vw) - rein additiv (Typ-Selektor verliert immer gegen
   inline styles), schliesst aber eine echte Luecke: ausser
   customer-popup.blade.php setzt AKTUELL KEIN Dialog max-height/overflow -
   bei kurzem Viewport/offener Bildschirmtastatur kann Inhalt schon HEUTE
   unerreichbar abgeschnitten sein, nicht nur auf dem Handy. */
dialog {
    width: min(640px, 92vw);
    max-height: 88vh;
    overflow: auto;
    border: none;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .2);
}
dialog::backdrop { background: rgba(0, 0, 0, .45); }

@media (max-width: 640px) {
    dialog { width: 92vw; padding: 1.25rem 1rem; max-height: 90vh; }
}

/* --- Responsive (Smartphones): Tab-Leisten. Alle 18 im Projekt
   gefundenen Tab-Leisten-Container folgen der Namenskonvention "*-tabs"
   (invoice-tabs, settings-tabs, pm-index-tabs, ...) - EINE Contains-Regel
   deckt alle ab, statt 18 Dateien einzeln zu pflegen. !important noetig, da
   jeder Container sein display:flex inline setzt (Spezifitaet inline >
   externe Klasse) - betrifft nur flex-wrap, kein Container setzt das
   bislang selbst inline, daher risikofrei. Contains- statt Endet-mit-
   Selektor, damit ein kuenftiges class="invoice-tabs mt-2" nicht bricht. */
[class*="-tabs"] { flex-wrap: wrap !important; }
