/* ============================================================
   EnforceGuard Global Admin — Komponenten (Dark Command Center)
   KPI-Cards, Panels, Charts, Empty-States, Login.
   (Shell/Sidebar/Topbar liegen in den scoped Layout-CSS.)
   ============================================================ */

/* ---------- Seiten-Wrapper & Kopf ---------- */
.dashboard-page { max-width: 1480px; margin: 0 auto; padding: 0.25rem 0 1rem; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-kicker { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 0.5rem; }
.page-kicker::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), transparent); }
.dashboard-title, .page-title { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); margin: 0.25rem 0 0.15rem; display: flex; align-items: center; gap: 0.6rem; }
.page-sub { color: var(--text-dim); font-size: 0.92rem; margin: 0; }

/* ---------- KPI-Cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
    position: relative;
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem 1.2rem 1.2rem;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    display: block;
    color: inherit;
}
.kpi-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--kpi, var(--accent)), transparent 75%); opacity: 0.9; }
.kpi-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--kpi, var(--accent)) 22%, transparent), transparent 70%); pointer-events: none; }
a.kpi-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--kpi, var(--accent)) 50%, var(--border-2)); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4), 0 0 0 1px color-mix(in srgb, var(--kpi, var(--accent)) 30%, transparent); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.85rem; }
.kpi-icon { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; background: color-mix(in srgb, var(--kpi, var(--accent)) 16%, transparent); color: var(--kpi, var(--accent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kpi, var(--accent)) 30%, transparent); }
.kpi-chip { font-size: 0.72rem; font-weight: 600; color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: 0.15rem 0.55rem; }
.kpi-value { font-size: 1.85rem; font-weight: 700; line-height: 1; color: var(--text); letter-spacing: -0.02em; }
.kpi-label { font-size: 0.78rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.35rem; }

/* Accent-Varianten */
.kpi--indigo { --kpi: #6366f1; } .kpi--cyan { --kpi: #22d3ee; } .kpi--purple { --kpi: #a855f7; }
.kpi--amber { --kpi: #f59e0b; } .kpi--emerald { --kpi: #10b981; } .kpi--rose { --kpi: #f43f5e; }

/* alte stat-card als Alias (Kompat) */
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; text-align: center; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: 0.78rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---------- Panels (Karten) ---------- */
.panel-card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0.008)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.panel-title { font-size: 0.95rem; font-weight: 650; margin: 0; color: var(--text); display: flex; align-items: center; gap: 0.5rem; }
.panel-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.panel-sub { font-size: 0.78rem; color: var(--text-faint); margin: 0; }
.panel-body { padding: 1.1rem 1.25rem; }
.panel-body.p-0 { padding: 0; }
.panel-action { font-size: 0.8rem; color: var(--text-dim); }

/* ---------- Charts ---------- */
.chart-box { width: 100%; min-height: 240px; }
.chart-box--tall { min-height: 300px; }

/* Metrik-Zeilen (neben Donuts/Radials) */
.metric-row { display: flex; align-items: center; justify-content: space-between; padding: 0.45rem 0; font-size: 0.88rem; }
.metric-row + .metric-row { border-top: 1px solid var(--border); }
.metric-label { display: flex; align-items: center; gap: 0.55rem; color: var(--text-dim); }
.metric-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.metric-val { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* Aktivitäts-Feed */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 0.8rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: 0; }
.feed-ic { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem; flex: 0 0 auto; background: var(--surface-2); border: 1px solid var(--border); }
.feed-main { flex: 1; min-width: 0; }
.feed-title { font-size: 0.86rem; color: var(--text); font-weight: 500; }
.feed-meta { font-size: 0.76rem; color: var(--text-faint); }

/* Empty-State */
.empty-state { text-align: center; padding: 2.2rem 1rem; color: var(--text-faint); }
.empty-state .ic { font-size: 1.6rem; opacity: 0.6; margin-bottom: 0.4rem; }

/* Such-/Filter-Leiste */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }

/* Segment-Filter */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; }
.seg-btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.85rem; border-radius: 8px; font-size: 0.85rem; font-weight: 500; color: var(--text-dim); text-decoration: none; }
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-2); }
.seg-count { background: rgba(245, 158, 11, 0.18); color: #fbbf24; font-size: 0.72rem; font-weight: 700; border-radius: 99px; padding: 0 0.4rem; min-width: 18px; text-align: center; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.login-card { width: 100%; max-width: 400px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border-2); border-radius: 20px; box-shadow: var(--shadow); padding: 2.2rem 2rem; }
.login-logo { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent), var(--cyan)); color: #fff; font-weight: 800; font-size: 1.25rem; margin-bottom: 1rem; box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.4); }
.login-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.2rem; }
.login-sub { color: var(--text-dim); font-size: 0.88rem; margin-bottom: 1.5rem; }

/* ---------- Reconnect-Overlay (Blazor-Server-Circuit verloren) ---------- */
/* Standardmäßig versteckt; Blazor schaltet die Status-Klassen automatisch. */
#components-reconnect-modal.reconnect-overlay { display: none; }
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
    position: fixed; inset: 0; z-index: 3000;
    align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.6);
}
.reconnect-box {
    background: var(--surface, #161a23); border: 1px solid var(--border, #2a2f3a);
    border-radius: var(--radius, 12px); padding: 1.5rem 1.75rem; text-align: center;
    max-width: 360px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.reconnect-text { color: var(--text, #e6e9ef); margin: 0.75rem 0 1rem; font-size: 0.95rem; }
.reconnect-spinner {
    width: 36px; height: 36px; margin: 0 auto; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: var(--accent, #6c7bff);
    animation: reconnect-spin 0.9s linear infinite;
}
@keyframes reconnect-spin { to { transform: rotate(360deg); } }
