:root {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-surface-2: #293548;
    --color-surface-3: #334155;
    --color-border: #334155;
    --color-border-soft: rgba(51, 65, 85, .58);
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-primary-light: #818cf8;
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-danger: #ef4444;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;
    --sidebar-width: 230px;
    --header-height: 56px;
    --radius: 8px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / .3);
    --shadow-lg: 0 18px 42px rgb(0 0 0 / .34);

    --BgDark: var(--color-bg);
    --BgMedium: var(--color-surface);
    --BgCard: var(--color-surface);
    --BgSidebar: var(--color-surface);
    --BgInput: var(--color-surface-2);
    --BgHeader: var(--color-surface);
    --Accent: var(--color-primary);
    --AccentHover: var(--color-primary-hover);
    --AccentLight: var(--color-primary-light);
    --Success: var(--color-success);
    --Warning: var(--color-warning);
    --Danger: var(--color-danger);
    --Info: var(--color-info);
    --TextPrimary: var(--color-text);
    --TextSecondary: var(--color-text-muted);
    --TextMuted: #64748b;
    --Border: var(--color-border);
    --BorderActive: var(--color-primary);

    --bs-body-bg: var(--color-bg);
    --bs-body-color: var(--color-text);
    --bs-border-color: var(--color-border);
    --bs-primary: var(--color-primary);
    --bs-secondary: var(--color-text-muted);
    --bs-success: var(--color-success);
    --bs-warning: var(--color-warning);
    --bs-danger: var(--color-danger);
    --bs-info: var(--color-info);
    --bs-link-color: var(--color-primary-light);
    --bs-link-hover-color: var(--color-primary);
}

/* ── Light Theme (MSM Hell) ─────────────────────────────────────────────────────
   Nur die Farb-Tokens werden ueberschrieben; alle Komponenten leiten daraus ab. */
:root[data-theme="light"] {
    --color-bg: #eef2f6;
    --color-surface: #ffffff;
    --color-surface-2: #f1f5f9;
    --color-surface-3: #e2e8f0;
    --color-border: #dbe2ea;
    --color-border-soft: rgba(148, 163, 184, .35);
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-primary-light: #4f46e5;
    --color-text: #0f172a;
    --color-text-muted: #52607a;
    --TextMuted: #64748b;
    --shadow: 0 4px 6px -1px rgb(15 23 42 / .10);
    --shadow-lg: 0 18px 42px rgb(15 23 42 / .16);
}
:root[data-theme="light"] ::selection { background: var(--color-primary); color: #fff; }
/* Wortmarke/Produktname im Hellmodus solide und kontraststark statt Leuchtkontur. */
:root[data-theme="light"] .msm-wordmark { filter: none; }
:root[data-theme="light"] .sidebar-suite {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--color-primary);
    text-shadow: none;
}

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

* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

html, body {
    min-height: 100%;
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

body { overflow: hidden; }
button, input, select, textarea { font: inherit; }
a { color: var(--color-primary-light); text-decoration: none; }
a:hover { color: var(--color-primary); }
::selection { background: var(--color-primary); color: #fff; }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: #475569; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:active { background: var(--color-primary); background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }

.app-layout, .app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--color-bg);
}

.sidebar, .app-sidebar {
    width: var(--sidebar-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

/* ── MSM-Branding (Herstellermarke) ──────────────────────────────────────────
   Originale MSM-Assets: Wortmarke (dunkle Buchstaben, transparent) erhaelt auf dem
   Dark-Theme eine dezente Leuchtkontur (drop-shadow im Indigo des UIs) statt einer
   hellen Platte. Der Produktname "PinForge" steht darunter — Wirkung: MSM / PinForge. */
.sidebar-logo {
    padding: 12px 18px 10px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-height: 78px;
    overflow: hidden;
    text-align: center;
}

.msm-wordmark {
    display: block;
    height: 30px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter:
        drop-shadow(0 0 0.5px rgba(129, 140, 248, .95))
        drop-shadow(0 1px 5px rgba(99, 102, 241, .45));
}
.sidebar-logo .sidebar-wordmark {
    width: min(156px, 100%);
    height: auto;
    max-height: 28px;
    object-fit: contain;
}
.msm-icon {
    display: block;
    height: 30px;
    width: 30px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-suite {
    display: inline-block;
    color: #c4b5fd;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: .02em;
    text-shadow: 0 0 16px rgba(99, 102, 241, .28);
}
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
    .sidebar-suite {
        background: linear-gradient(90deg, #eef2ff 0%, var(--color-primary-light) 50%, #a78bfa 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

.nav-section { padding: 8px 0; }
.nav-section-static { margin-bottom: 2px; }
.nav-section-footer {
    margin-top: auto;
    border-top: 1px solid var(--color-border);
    padding: 12px 16px;
}
.nav-footer-note { display: grid; gap: 2px; color: var(--color-text); font-size: 12px; }
.nav-footer-note small { color: var(--color-text-muted); }
.sidebar-theme { margin-bottom: 12px; }
.sidebar-theme .theme-toggle { width: 100%; justify-content: center; }
.nav-vendor { display: flex; align-items: center; gap: 10px; }
.nav-vendor .msm-icon { height: 26px; width: 26px; }
.nav-vendor-copy { display: grid; gap: 1px; min-width: 0; line-height: 1.2; }
.nav-vendor-copy span { color: var(--color-text); font-size: 12px; font-weight: 600; letter-spacing: .01em; }
.nav-vendor-copy small { color: var(--color-text-muted); font-size: 11px; }

.nav-section-title {
    padding: 8px 16px 4px;
    color: var(--color-text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

button.nav-section-title.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: calc(100% - 16px);
    margin: 0 8px;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: color .15s ease, background .15s ease;
}
button.nav-section-title.nav-toggle:hover { color: var(--color-text); background: var(--color-surface-2); }
button.nav-section-title.nav-toggle:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--color-primary); }
.nav-chevron { font-size: 10px; opacity: .7; }

.nav-item, .sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    margin: 1px 8px;
    padding: 9px 16px;
    border-radius: var(--radius);
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 13.5px;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.nav-item:hover, .sidebar-link:hover { background: var(--color-surface-2); color: var(--color-text); text-decoration: none; }
.nav-item.active, .sidebar-link.active { background: rgba(99, 102, 241, .2); color: var(--color-primary-light); font-weight: 600; }
.nav-icon, .sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 800;
}
.nav-icon > svg, .sidebar-icon > svg { width: 18px; height: 18px; flex-shrink: 0; }

.main-area, .app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.topbar {
    height: var(--header-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-brand { display: none; align-items: center; flex-shrink: 0; }
.topbar-page { display: flex; flex-direction: column; justify-content: center; min-width: 0; line-height: 1.15; }
.topbar-page-title { color: var(--color-text); font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-page-sub { color: var(--color-text-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
}
.hamburger-btn:hover { background: var(--color-surface-2); }
.hamburger-icon { display: flex; flex-direction: column; gap: 5px; width: 22px; }
.hamburger-icon span { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform .25s, opacity .25s; }
.hamburger-icon.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-icon.open span:nth-child(2) { opacity: 0; }
.hamburger-icon.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 199;
    border: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(2px);
}

.page-content, .content-frame {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 24px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.page-title { margin: 0; color: var(--color-text); font-size: 20px; font-weight: 700; line-height: 1.25; }
.page-description, .page-subtitle { margin-top: 2px; color: var(--color-text-muted); font-size: 13px; }
.page-actions, .quick-actions, .drawer-actions, .actions, .btn-group, .toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.page-actions, .quick-actions, .drawer-actions { justify-content: flex-end; }

.card, .panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    color: var(--color-text);
}
.compact-panel { padding: 14px; }
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -2px 0 16px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--color-border);
    background: transparent;
}
.card-title, .section-heading h2, .drawer-section h3, .empty-state h2 {
    margin: 0;
    color: var(--color-text);
    font-size: 15px;
    font-weight: 600;
}
.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.section-heading p, .empty-state p, .form-hint, .text-secondary, .text-muted, small { color: var(--color-text-muted) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-info { color: var(--color-info) !important; }
.text-success { color: var(--color-success) !important; }

.detail-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    padding: 18px 20px;
    margin-bottom: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.detail-title { margin: 0; font-size: 22px; line-height: 1.2; color: var(--color-text); }
.detail-subtitle { margin: 4px 0 0; color: var(--color-text-muted); font-size: 13px; }
.detail-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.detail-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.project-settings-strip {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px;
    margin-bottom: 12px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.project-settings-strip > div { min-width: min(300px, 100%); }
.toolbar-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    margin: 0;
    color: var(--color-text-muted);
}

.summary-grid, .stat-grid, .metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.summary-item, .stat-card, .metric-card {
    min-width: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    display: grid;
    gap: 5px;
}
.summary-item span, .stat-label, .metric-label {
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.summary-item strong, .stat-value, .metric-value {
    color: var(--color-text);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.summary-item small, .stat-sub, .metric-sub { color: var(--color-text-muted); font-size: 11px; }
a.summary-item { text-decoration: none; color: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
a.summary-item:hover { border-color: var(--color-primary); background: var(--color-surface-2); }
.summary-item.summary-attention { border-color: rgba(245, 158, 11, .5); }
.summary-item.summary-attention-error { border-color: rgba(239, 68, 68, .5); }

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
}
.dashboard-main, .dashboard-side { display: grid; gap: 16px; }
.dashboard-main .card, .dashboard-side .card { margin-bottom: 0; }
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, max-content));
    grid-auto-rows: 1fr;
    align-items: stretch;
    justify-content: start;
    gap: 8px;
}
.quick-tile {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 11px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    text-align: left;
}
.quick-tile:hover { background: rgba(99, 102, 241, .15); border-color: var(--color-primary); color: var(--color-primary-light); }

.tabs-bar {
    position: sticky;
    top: -24px;
    z-index: 30;
    margin: 0 0 16px;
    padding: 4px;
    overflow-x: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.tabs, .tab-strip { display: flex; gap: 4px; min-width: max-content; }
.tab-btn, .tab-strip .filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.tab-btn:hover, .tab-strip .filter-chip:hover { color: var(--color-text); background: var(--color-surface-2); }
.tab-btn.active, .tab-strip .filter-chip.active { color: #fff; background: var(--color-primary); }

.table-wrapper, .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    -webkit-overflow-scrolling: touch;
}
.table-scroll { max-height: none; overflow: visible; }
table.data-table, .data-table, .app-table, .table {
    width: 100%;
    min-width: max-content;
    margin-bottom: 0;
    border-collapse: collapse;
    color: var(--color-text);
    --bs-table-bg: var(--color-surface);
    --bs-table-color: var(--color-text);
    --bs-table-border-color: var(--color-border);
    --bs-table-striped-bg: var(--color-surface-2);
    --bs-table-hover-bg: rgba(99, 102, 241, .05);
    --bs-table-hover-color: var(--color-text);
}
.data-table th, .app-table thead th {
    background: var(--color-surface-2);
    padding: 10px 14px;
    text-align: left;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}
.data-table td, .app-table > :not(caption) > * > * {
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border-soft);
    color: var(--color-text);
    font-size: 13.5px;
    vertical-align: top;
    overflow-wrap: anywhere;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td, .clickable-row:hover td { background: rgba(99, 102, 241, .05); }
.data-table .actions, .app-table .actions { justify-content: flex-end; gap: 6px; }
.data-table code, .data-table .badge, .app-table code, .app-table .badge { overflow-wrap: normal; white-space: nowrap; }
.clickable-row { cursor: pointer; }
.muted-row td { color: var(--color-text-muted); background: var(--color-surface-2); }
.assigned-row td:first-child { box-shadow: inset 3px 0 0 var(--color-info); }
.updated-row td { animation: row-flash 1.25s ease-out; }
@keyframes row-flash { 0% { background: rgba(34, 197, 94, .20); } 100% { background: transparent; } }
.data-table tr.row-error td { background: rgba(239, 68, 68, .10); }
.data-table tr.row-error:hover td { background: rgba(239, 68, 68, .16); }
.data-table tr.row-error td:first-child { box-shadow: inset 3px 0 0 var(--color-danger); }
.data-table tr.row-warn td { background: rgba(245, 158, 11, .10); }
.data-table tr.row-warn:hover td { background: rgba(245, 158, 11, .16); }
.data-table tr.row-warn td:first-child { box-shadow: inset 3px 0 0 var(--color-warning); }

.compact-filterbar, .filterbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.filterbar { justify-content: flex-end; margin-bottom: 0; }
.compact-filterbar .search-box, .filterbar .search-box { flex: 1 1 280px; max-width: 440px; }
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 420px; }
/* Platz links fuer das Lupen-Icon freihalten. !important schlaegt die generische, hoch-
   spezifische input-Basisregel (padding: 8px 12px), die sonst den Text ueber das Icon schiebt. */
.search-box input { width: 100%; padding-left: 40px !important; }
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 15px;
    height: 15px;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}
.filter-panel-wrap { position: relative; }
.filter-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 120;
    width: min(420px, 92vw);
    padding: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.filter-panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filter-panel-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.filter-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
    margin: -2px 0 12px;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
}
button.filter-chip:hover, button.filter-chip:focus-visible { color: var(--color-text); border-color: var(--color-primary); }
.filter-chip.active { color: #fff; background: var(--color-primary); border-color: var(--color-primary); }
.result-count { color: var(--color-text-muted); font-size: 12px; white-space: nowrap; }

.form-group { margin-bottom: 14px; }
.form-grid, .settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.form-stack { display: grid; gap: 14px; }
.form-label, .form-check-label {
    display: block;
    margin-bottom: 5px;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.form-control, .form-select,
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=submit]):not([type=button]):not([type=reset]),
select, textarea {
    width: 100%;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface-2);
    color: var(--color-text);
    font-size: 13.5px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:hover, .form-select:hover, input:hover, select:hover, textarea:hover { border-color: var(--color-text-muted); }
.form-control:focus, .form-select:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, .25);
}
.form-control::placeholder, textarea::placeholder { color: var(--color-text-muted); opacity: 1; }
select option { background: var(--color-surface-2); color: var(--color-text); }
input[type=checkbox], input[type=radio] { accent-color: var(--color-primary); width: 16px; height: 16px; }
input[type=file]::file-selector-button {
    margin-right: 10px;
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    color: var(--color-text);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 14px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn-primary, .btn-success { background: var(--color-primary); border: 1px solid var(--color-primary); color: #fff; }
.btn-primary:hover, .btn-primary:active, .btn-success:hover, .btn-success:active { background: var(--color-primary-hover) !important; border-color: var(--color-primary-hover) !important; color: #fff !important; }
.btn-secondary, .btn-outline-secondary { background: var(--color-surface-2); border: 1px solid var(--color-border); color: var(--color-text); }
.btn-secondary:hover, .btn-outline-secondary:hover { background: var(--color-border) !important; color: var(--color-text) !important; }
.btn-subtle, .btn-outline-primary { background: transparent; border: 1px solid transparent; color: var(--color-primary-light); }
.btn-subtle:hover, .btn-outline-primary:hover { background: var(--color-surface-2) !important; border-color: var(--color-border) !important; color: var(--color-text) !important; }
.btn-danger, .btn-outline-danger { background: rgba(239, 68, 68, .15); border: 1px solid rgba(239, 68, 68, .56); color: #fecaca; }
.btn-danger:hover, .btn-outline-danger:hover { background: var(--color-danger) !important; border-color: var(--color-danger) !important; color: #fff !important; }
.btn-warning, .btn-outline-warning { background: rgba(245, 158, 11, .15); border: 1px solid rgba(245, 158, 11, .55); color: #fbbf24; }
.btn-warning:hover, .btn-outline-warning:hover { background: rgba(245, 158, 11, .26) !important; color: #fff !important; }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.btn-icon, .icon-button {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface-2);
    color: var(--color-text);
}
.btn-icon:hover, .icon-button:hover { background: var(--color-border); }

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface-2);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
}
.theme-toggle:hover { color: var(--color-text); background: var(--color-border); }
.theme-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--color-primary-light); box-shadow: 0 0 12px rgba(129, 140, 248, .8); }

.badge, .badge-capability, .badge-warning-soft, .badge-restriction, .status-badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}
.badge-primary { background: rgba(99, 102, 241, .2); color: var(--color-primary-light); }
.badge-success, .text-bg-success { background: rgba(34, 197, 94, .2) !important; color: #4ade80 !important; }
.badge-warning, .text-bg-warning, .status-badge-warning { background: rgba(245, 158, 11, .2) !important; color: #fbbf24 !important; }
.badge-danger, .text-bg-danger, .status-badge-error { background: rgba(239, 68, 68, .2) !important; color: #f87171 !important; }
.badge-info, .text-bg-info { background: rgba(59, 130, 246, .2) !important; color: #93c5fd !important; }
.badge-muted, .status-badge-free, .status-badge-reserved, .status-badge-disabled { background: rgba(148, 163, 184, .15); color: var(--color-text-muted); }
.badge-capability { background: rgba(59, 130, 246, .18); color: #93c5fd; border: 1px solid rgba(59, 130, 246, .34); margin: 1px; }
.badge-warning-soft { background: rgba(245, 158, 11, .16); color: #fbbf24; border: 1px solid rgba(245, 158, 11, .32); margin: 1px; }
.badge-restriction { background: rgba(239, 68, 68, .16); color: #f87171; border: 1px solid rgba(239, 68, 68, .32); margin: 1px; }
.status-badge-used, .status-badge-ok { background: rgba(34, 197, 94, .2); color: #4ade80; }

.alert {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface-2);
    color: var(--color-text);
    padding: 10px 12px;
}
.alert-info { border-color: rgba(59, 130, 246, .36); background: rgba(59, 130, 246, .10); }
.alert-success { border-color: rgba(34, 197, 94, .36); background: rgba(34, 197, 94, .10); }
.alert-warning { border-color: rgba(245, 158, 11, .40); background: rgba(245, 158, 11, .10); }
.alert-danger { border-color: rgba(239, 68, 68, .40); background: rgba(239, 68, 68, .10); }

.module-workbench { display: grid; gap: 16px; }
.module-workbench-grid {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.module-add-wizard, .proposal-panel {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px;
}
/* Kein eigener innerer Scrollbereich - das Panel fliesst im normalen Seitenfluss. */
.module-add-wizard {
    align-self: start;
}
.wizard-steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.wizard-step {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 700;
}
.wizard-step.active { color: #fff; background: var(--color-primary); border-color: var(--color-primary); }
.module-picker-grid, .controller-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.module-picker-grid { grid-template-columns: 1fr; }
.module-picker-card, .controller-card {
    display: grid;
    gap: 4px;
    width: 100%;
    min-height: 76px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    text-align: left;
    cursor: pointer;
}
.module-picker-card span, .module-picker-card small,
.controller-card span, .controller-card small { color: var(--color-text-muted); }
.module-picker-card:hover, .controller-card:hover { background: var(--color-surface-2); border-color: var(--color-primary); }
.module-picker-card.selected, .controller-card.selected { background: rgba(99, 102, 241, .16); border-color: var(--color-primary); }

/* Controllerliste: Gruppierung nach Familie + Karten mit Badges */
.controller-group { margin-bottom: 16px; }
.controller-group-head { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.controller-group-head h2 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .02em; color: var(--color-text); }
.controller-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.controller-list-card { cursor: default; gap: 8px; }
.controller-list-card:hover { background: var(--color-surface); border-color: var(--color-border); }
.controller-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.controller-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.req-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.module-list-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }

.open-signals-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid rgba(245, 158, 11, .38);
    border-radius: var(--radius);
    background: rgba(245, 158, 11, .08);
}
.open-signals-panel strong { color: var(--color-text); }
.open-signals-panel span { display: block; color: var(--color-text-muted); font-size: 12px; }
.open-signals-list { display: flex; gap: 6px; flex-wrap: wrap; }
.open-signal-item {
    display: grid;
    gap: 2px;
    min-width: 160px;
    padding: 7px 9px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    text-align: left;
}
.open-signal-item:hover { border-color: var(--color-primary); background: var(--color-surface-2); }

.pin-source-stack { display: grid; gap: 10px; }
.pin-source-panel {
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.pin-source-panel summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    cursor: pointer;
    background: var(--color-surface-2);
    border-bottom: 1px solid var(--color-border);
}
.pin-source-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pin-source-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-stats { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.bus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.bus-card { background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 14px; }
.bus-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.bus-card-head h3 { margin: 0; font-size: 15px; margin-right: auto; }
.bus-card h3 { margin: 0 0 8px; font-size: 15px; }
.bus-facts { display: grid; gap: 7px; margin-top: 10px; }
.bus-fact { display: flex; justify-content: space-between; gap: 12px; color: var(--color-text-muted); font-size: 13px; }
.bus-fact strong { color: var(--color-text); font-weight: 600; text-align: right; }
.bus-pins { margin-top: 10px; display: grid; gap: 6px; }
.bus-pin-list { display: flex; flex-wrap: wrap; gap: 4px; }

/* Katalog: Favoriten/Zuletzt-verwendet + Filterleiste + Favoriten-Stern */
.catalog-quicklist { margin-bottom: 14px; }
.catalog-quicklist .eyebrow { display: block; margin-bottom: 6px; }
.catalog-filterbar { margin-bottom: 12px; }
.quick-card { text-decoration: none; color: inherit; gap: 4px; }
.quick-card:hover { border-color: var(--color-primary); }
.fav-star {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 2px 4px;
    color: var(--color-text-muted);
}
.fav-star:hover { color: var(--color-primary-light); }

/* Modul-Picker im Wizard: Favoriten-Stern + Schnellzeilen */
.module-picker-cell { position: relative; }
.picker-star { position: absolute; top: 4px; right: 4px; }
.picker-quickrow { margin: 6px 0 4px; }
.picker-quickrow .eyebrow { display: block; margin-bottom: 4px; }
.picker-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.picker-chip {
    padding: 5px 10px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface-2);
    color: var(--color-text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.picker-chip:hover { border-color: var(--color-primary); color: var(--color-primary-light); }

/* Zentrierte Tabellen-Aktionen */
.text-center { text-align: center; }
td.actions-cell { text-align: center; }
.actions.actions-center { justify-content: center; }

.validation-list, .validation-live { display: grid; gap: 8px; }
.validation-ok {
    padding: 10px 12px;
    border: 1px solid rgba(34, 197, 94, .35);
    border-radius: var(--radius);
    background: rgba(34, 197, 94, .10);
    color: #4ade80;
}
.validation-line, .validation-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface-2);
}
.validation-error { border-color: rgba(239, 68, 68, .42); background: rgba(239, 68, 68, .08); }
.validation-warning { border-color: rgba(245, 158, 11, .42); background: rgba(245, 158, 11, .08); }
.validation-info { border-color: rgba(59, 130, 246, .36); background: rgba(59, 130, 246, .07); }
.problem-section { display: grid; gap: 8px; margin-bottom: 16px; }
.problem-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.problem-heading h2 { margin: 0; font-size: 15px; }

.drawer-backdrop, .modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: rgba(0, 0, 0, .60);
    backdrop-filter: blur(2px);
}
/* Bearbeiten-Dialoge sind zentrierte Popups (kein seitliches Panel). Der Backdrop
   zentriert per Flex; das Popup selbst scrollt nur bei Bedarf (eine Scrollleiste). */
.pin-drawer {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1050;
    width: min(760px, 95vw);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}
.drawer-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}
.drawer-header h2 { margin: 2px 0 0; font-size: 20px; line-height: 1.2; }
.drawer-header p { margin: 2px 0 0; color: var(--color-text-muted); }
.drawer-body { padding: 16px 18px 18px; }
.drawer-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--color-border); }
.drawer-actions {
    position: sticky;
    bottom: 0;
    margin: 18px -18px -18px;
    padding: 12px 18px;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}
.pin-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eyebrow { color: var(--color-text-muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

.modal {
    display: block; /* ueberschreibt Bootstraps .modal { display:none } */
    position: static;
    width: min(560px, 95vw);
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}
.modal-header, .modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0;
    border-color: var(--color-border);
    background: transparent;
}
.modal-header { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--color-border); }
.modal-footer { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--color-border); justify-content: flex-end; }
.modal-title { color: var(--color-text); font-size: 16px; font-weight: 700; }
.module-wizard-modal { width: min(680px, 95vw); }
.export-modal .tabs-bar { position: static; top: auto; margin: 0 0 14px; }
.proposal-modal { width: min(960px, 96vw); }
.delete-confirmation { border-color: rgba(239, 68, 68, .42); background: rgba(239, 68, 68, .08); }

.empty-state {
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 160px;
    text-align: center;
}
.import-mode-select { max-width: 240px; }
.module-count-input { width: 6rem; min-width: 6rem; }
.font-monospace, code, pre { overflow-wrap: anywhere; word-break: break-word; }

/* ── Import / Export ─────────────────────────────────────────────────────────── */
.toolbar-spread { justify-content: space-between; width: 100%; }
.io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.io-card { margin-bottom: 0; }
.io-card .card-header { align-items: flex-start; }
.io-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.io-icon {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(99, 102, 241, .16);
    color: var(--color-primary-light);
    border: 1px solid rgba(129, 140, 248, .28);
}
.io-icon svg { width: 20px; height: 20px; }
.io-sub { margin: 2px 0 0; color: var(--color-text-muted); font-size: 12.5px; }
.io-file { margin-top: 8px; display: flex; align-items: center; gap: 8px; color: var(--color-text); font-size: 13px; overflow-wrap: anywhere; }
.io-empty { min-height: 90px; padding: 16px; border: 1px dashed var(--color-border); border-radius: var(--radius); }
.io-result {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border: 1px solid rgba(34, 197, 94, .34);
    border-radius: var(--radius);
    background: rgba(34, 197, 94, .09);
}
.io-result-head { display: flex; align-items: center; gap: 10px; color: var(--color-text); font-size: 14px; }
.io-result-stats { display: flex; gap: 20px; margin-left: auto; }
.io-result-stats > div { display: grid; }
.io-result-stats strong { font-size: 18px; font-weight: 700; color: var(--color-text); line-height: 1.1; }
.io-result-stats span { font-size: 11px; color: var(--color-text-muted); }
@media (max-width: 960px) { .io-grid { grid-template-columns: 1fr; } }

@media (max-width: 1180px) {
    .dashboard-grid, .module-workbench-grid { grid-template-columns: 1fr; }
    .module-add-wizard { position: static; max-height: none; }
}

@media (max-width: 960px) {
    :root { --sidebar-width: 260px; }
    body { overflow: auto; }
    .app-layout, .app-shell { min-height: 100vh; height: auto; }
    .hamburger-btn, .topbar-brand { display: flex; }
    .sidebar, .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform .28s cubic-bezier(.4,0,.2,1);
        box-shadow: none;
    }
    .sidebar.sidebar-open, .app-sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.45); }
    .sidebar-overlay { display: block; }
    .main-area, .app-main { min-height: 100vh; }
    .page-content, .content-frame { padding: 16px; }
    .topbar { padding: 0 12px; }
}

@media (max-width: 640px) {
    .page-content, .content-frame { padding: 12px; }
    .detail-header { grid-template-columns: 1fr; }
    .detail-actions, .page-actions, .quick-actions, .drawer-actions { justify-content: flex-start; }
    .summary-grid, .stat-grid, .metric-grid { grid-template-columns: 1fr 1fr; }
    .compact-filterbar, .filterbar, .toolbar { align-items: stretch; flex-direction: column; }
    .compact-filterbar > *, .filterbar > *, .toolbar > * { width: 100%; }
    .search-box, .compact-filterbar .search-box, .filterbar .search-box { max-width: 100%; width: 100%; }
    .filter-panel { position: fixed; left: 12px; right: 12px; top: 72px; width: auto; max-height: calc(100vh - 96px); overflow-y: auto; }
    .filter-panel-grid { grid-template-columns: 1fr; }
    .open-signals-panel { grid-template-columns: 1fr; }
    .pin-source-panel summary { grid-template-columns: 1fr; }
    .pin-drawer { top: auto; bottom: 0; left: 0; transform: none; width: 100%; max-width: 100%; max-height: 88vh; border-radius: 16px 16px 0 0; }
    .modal { width: 100%; max-width: 100%; max-height: 88vh; border-radius: 16px 16px 0 0; padding: 20px 16px; position: fixed; bottom: 0; }
    .drawer-backdrop, .modal-overlay { align-items: flex-end; }

    .table-card-mode > .table-wrapper > table.data-table,
    .table-card-mode > .table-wrapper > table.data-table > thead,
    .table-card-mode > .table-wrapper > table.data-table > tbody,
    .table-card-mode > .table-wrapper > table.data-table > thead > tr > th,
    .table-card-mode > .table-wrapper > table.data-table > tbody > tr,
    .table-card-mode > .table-wrapper > table.data-table > tbody > tr > td {
        display: block;
        min-width: 0;
    }
    .table-card-mode > .table-wrapper > table.data-table { min-width: 0; }
    .table-card-mode > .table-wrapper > table.data-table > thead { display: none; }
    .table-card-mode > .table-wrapper > table.data-table > tbody > tr {
        margin-bottom: 10px;
        padding: 12px;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
    }
    .table-card-mode > .table-wrapper > table.data-table > tbody > tr > td {
        display: flex;
        gap: 8px;
        padding: 4px 0;
        border: none;
        font-size: 13px;
    }
    .table-card-mode > .table-wrapper > table.data-table > tbody > tr > td::before {
        content: attr(data-label);
        min-width: 92px;
        flex-shrink: 0;
        padding-top: 2px;
        color: var(--color-text-muted);
        font-size: 10px;
        font-weight: 600;
        letter-spacing: .05em;
        text-transform: uppercase;
    }
    .table-card-mode > .table-wrapper > table.data-table > tbody > tr > td:last-child {
        margin-top: 6px;
        padding-top: 10px;
        border-top: 1px solid var(--color-border);
    }
    .table-card-mode .table-wrapper { border: none; background: transparent; overflow: visible; }
}

@media (max-width: 380px) {
    .summary-grid, .stat-grid, .metric-grid { grid-template-columns: 1fr; }
    .page-content, .content-frame { padding: 8px; }
}

/* --- Anmeldung / Ersteinrichtung ------------------------------------------- */
.auth-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: var(--color-bg);
    color: var(--color-text);
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.auth-brand img { border-radius: 10px; }
.auth-brand-title { display: block; font-weight: 700; font-size: 1.15rem; }
.auth-brand-sub { display: block; font-size: .8rem; color: var(--color-text-muted); }
.auth-card h1 { font-size: 1.4rem; margin: 0 0 6px; }
.auth-sub { color: var(--color-text-muted); margin: 0 0 18px; font-size: .92rem; }
.auth-form { display: flex; flex-direction: column; gap: 6px; }
.auth-label { font-size: .82rem; font-weight: 600; margin-top: 10px; }
.auth-input {
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    background: var(--color-surface-2);
    color: var(--color-text);
    font-size: .95rem;
}
.auth-input:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; border-color: var(--color-primary); }
.auth-hint { font-size: .78rem; color: var(--color-text-muted); margin: 4px 0 0; }
.auth-btn {
    margin-top: 18px;
    padding: 11px 16px;
    border: none;
    border-radius: 9px;
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    font-size: .98rem;
    cursor: pointer;
}
.auth-btn:hover { background: var(--color-primary-hover); }
.auth-error {
    background: rgba(239, 68, 68, .12);
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
    padding: 9px 12px;
    border-radius: 9px;
    font-size: .88rem;
    margin: 0 0 14px;
}
.auth-loading { padding: 40px; text-align: center; color: var(--color-text-muted); }

/* Topbar: Benutzer + Abmelden */
.topbar-user {
    font-size: .85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 0 4px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.logout-form { margin: 0; }
.btn-logout {
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-2);
    color: var(--color-text);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-logout:hover { background: var(--color-surface-3); }
@media (max-width: 640px) {
    .topbar-user { display: none; }
}
