/* Provax Himmelsbach Dashboard – Unified Platform */

:root {
    --gruen: #22c55e;
    --gelb: #eab308;
    --rot: #ef4444;
    --blau: #3b82f6;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --primary: #2563eb;
    --rg-navy: #1a3a5c;
    --rg-red: #D0101C;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* ── Header ── */
.main-header {
    background: var(--rg-navy);
    color: white;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.header-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0;
    min-height: 44px;
}

/* Brand */
.brand {
    text-decoration: none;
    color: white;
    flex-shrink: 0;
    margin-right: 1.25rem;
    display: flex;
    align-items: baseline;
    gap: 0;
}
.brand-provax {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.03em;
}
.brand-sub {
    font-size: 0.7rem;
    font-weight: 400;
    color: rgba(255,255,255,0.5);
    margin-left: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.brand:hover .brand-provax { color: #93c5fd; }

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    flex: 1;
    flex-wrap: wrap;
    gap: 0;
    overflow: hidden;
}
.nav-item {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.78rem;
    padding: 0 0.6rem;
    height: 44px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.nav-item:hover { color: white; }
.nav-item.active { color: white; border-bottom-color: #60a5fa; }
.nav-sep {
    color: rgba(255,255,255,0.15);
    font-size: 0.9rem;
    padding: 0 0.1rem;
    user-select: none;
}
.nav-ext { color: rgba(255,255,255,0.4); font-size: 0.74rem; }
.nav-ext:hover { color: rgba(255,255,255,0.85); }

/* Header right */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 1rem;
}
.header-time { color: rgba(255,255,255,0.4); font-size: 0.74rem; white-space: nowrap; }
.header-user { color: rgba(255,255,255,0.75); font-size: 0.78rem; white-space: nowrap; }
.role-badge {
    font-size: 0.64rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background: rgba(96,165,250,0.2);
    color: #93c5fd;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.btn-logout {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.74rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    white-space: nowrap;
}
.btn-logout:hover { color: white; border-color: rgba(255,255,255,0.6); }

/* Main content */
.main-content {
    max-width: 1200px;
    margin: 1.75rem auto;
    padding: 0 1.5rem;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}
.footer-sep { margin: 0 0.5rem; opacity: 0.4; }

/* ── Legacy compat (header/main without class) ── */
header { background: var(--rg-navy); }
main { max-width: 1200px; margin: 1.75rem auto; padding: 0 1.5rem; }
footer { text-align: center; padding: 1.5rem; color: var(--text-muted); font-size: 0.78rem; }

/* ── Hub Dashboard ── */
.hub-kpi-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.hub-kpi {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.hub-kpi-num { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.hub-kpi-label { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; white-space: nowrap; }
.hub-kpi-gruen .hub-kpi-num { color: var(--gruen); }
.hub-kpi-gelb .hub-kpi-num { color: var(--gelb); }
.hub-kpi-rot .hub-kpi-num { color: var(--rot); }
.hub-kpi-total .hub-kpi-num { color: var(--primary); }
.hub-kpi-date { background: transparent; border-color: transparent; box-shadow: none; }
.hub-kpi-date .hub-kpi-num { font-size: 0.85rem; color: var(--text-muted); }

.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.hub-tile {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.25rem 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}
.hub-tile:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #94a3b8;
    transform: translateY(-1px);
}
.hub-tile-icon {
    font-size: 1.4rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
    opacity: 0.75;
}
.hub-tile-agents .hub-tile-icon { background: rgba(37,99,235,0.08); color: var(--primary); }
.hub-tile-sales .hub-tile-icon { background: rgba(34,197,94,0.1); color: #16a34a; }
.hub-tile-marketing .hub-tile-icon { background: rgba(168,85,247,0.1); color: #7c3aed; }
.hub-tile-finance .hub-tile-icon { background: rgba(234,179,8,0.1); color: #92400e; }
.hub-tile-controlling .hub-tile-icon { background: rgba(14,165,233,0.1); color: #0369a1; }
.hub-tile-vv .hub-tile-icon { background: rgba(239,68,68,0.08); color: var(--rg-red); }

.hub-tile-body { flex: 1; min-width: 0; }
.hub-tile-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.2rem; }
.hub-tile-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }

.hub-tile-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 12px;
    flex-shrink: 0;
    white-space: nowrap;
}
.hub-tile-status.hs-gruen { background: rgba(34,197,94,0.1); color: #16a34a; }
.hub-tile-status.hs-gelb { background: rgba(234,179,8,0.12); color: #92400e; }
.hub-tile-status.hs-rot { background: rgba(239,68,68,0.1); color: #dc2626; }

.hub-tile-arrow {
    font-size: 1.1rem;
    color: var(--text-muted);
    flex-shrink: 0;
    opacity: 0.5;
}

/* Page Header */
.page-header { margin-bottom: 1.5rem; }
.page-header h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.page-subtitle { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.25rem; }
.results-header { margin-bottom: 1.5rem; }
.results-header h2 { font-size: 1.125rem; color: var(--text-muted); }

/* Breadcrumb */
.breadcrumb {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card h3 { font-size: 1.05rem; margin-bottom: 1rem; }
.card h4 { font-size: 0.9rem; margin: 1rem 0 0.5rem; color: var(--text-muted); }

/* Ampel Summary */
.ampel-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.ampel {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}
.ampel-gruen { background: #dcfce7; color: #166534; }
.ampel-gelb { background: #fef9c3; color: #854d0e; }
.ampel-rot { background: #fee2e2; color: #991b1b; }
.total { color: var(--text-muted); font-size: 0.875rem; line-height: 2; }

/* Dots */
.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot-gruen { background: var(--gruen); }
.dot-gelb { background: var(--gelb); }
.dot-rot { background: var(--rot); }

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
th, td {
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.row-gruen { background: #f0fdf4; }
.row-gelb { background: #fffbeb; }
.row-rot { background: #fef2f2; }

/* Conflicts */
.conflict {
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin: 1px 0;
}
.conflict-kritisch { background: #fee2e2; color: #991b1b; }
.conflict-warnung { background: #fef9c3; color: #854d0e; }
.conflict-info { background: #e0e7ff; color: #3730a3; }

/* Agent Overview Grid (Dashboard) */
.agent-overview-card { }
.agent-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.agent-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
}
.agent-chip:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(37,99,235,0.1);
}
.agent-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.agent-chip.status-active .agent-chip-dot { background: var(--gruen); }
.agent-chip.status-priority .agent-chip-dot { background: var(--rot); }
.agent-chip.status-planned .agent-chip-dot { background: var(--border); }
.agent-chip-label { font-weight: 500; }
.agent-chip-company { color: var(--text-muted); font-size: 0.75rem; }

/* Agent Results (Dashboard) */
.agent-result {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s;
}
.agent-result:hover { border-color: var(--primary); }
.result-arrow { margin-left: auto; color: var(--text-muted); }
.recommendation {
    width: 100%;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}
.run-meta { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.5rem; }

/* Agent Structure Page */
.agent-structure { }
.company-card { }
.company-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.company-header h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.agent-count { color: var(--text-muted); font-size: 0.8rem; }
.tier-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tier-1 { background: #dbeafe; color: #1e40af; }
.tier-2 { background: #e0e7ff; color: #3730a3; }

.agent-list { }
.agent-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.375rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
}
.agent-row:hover {
    border-color: var(--primary);
    background: #f8faff;
}
.agent-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.agent-status-indicator.status-active { background: var(--gruen); }
.agent-status-indicator.status-priority { background: var(--rot); }
.agent-status-indicator.status-planned { background: #cbd5e1; }
.agent-info { flex: 1; }
.agent-name { font-weight: 500; font-size: 0.9rem; }
.agent-file { display: block; color: var(--text-muted); font-size: 0.75rem; font-family: monospace; }
.row-arrow { color: var(--text-muted); font-size: 0.9rem; }

/* Status Tags */
.status-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.tag-active { background: #dcfce7; color: #166534; }
.tag-priority { background: #fee2e2; color: #991b1b; }
.tag-planned { background: #f1f5f9; color: #64748b; }

/* Agent Detail Page */
.role-content { }
.role-markdown {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    font-size: 0.85rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
    max-height: 600px;
    overflow-y: auto;
}
.result-json {
    background: #0f172a;
    color: #a5f3fc;
    border-radius: 6px;
    padding: 1rem;
    font-size: 0.8rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 500px;
    overflow-y: auto;
}
.tool-calls-list {
    list-style: none;
    padding: 0;
}
.tool-calls-list li {
    padding: 0.4rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}
.tool-calls-list code {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.8rem;
}
.tool-input { color: var(--text-muted); font-size: 0.8rem; margin-left: 0.5rem; }
.empty-hint { color: var(--text-muted); font-style: italic; }

/* Buttons */
.btn-back {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0;
}
.btn-back:hover { text-decoration: underline; }
.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
}
.btn-primary:hover { background: #1d4ed8; }
.detail-actions { margin-top: 1rem; }

/* Security Page */
.infra-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}
.infra-item {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
}
.infra-item h4 { font-size: 0.9rem; margin-bottom: 0.25rem; color: var(--text); }
.infra-ip { font-family: monospace; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.infra-services { list-style: none; padding: 0; }
.infra-services li {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.15rem 0;
}
.security-agent-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Legend */
.legend-items { display: flex; gap: 2rem; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }

/* Date nav */
.date-nav { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.date-chip {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: #f1f5f9;
    color: var(--text-muted);
}
.date-chip.active { background: var(--primary); color: white; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}
.empty-state h2 { color: var(--text); margin-bottom: 0.5rem; }
.empty-state code {
    display: inline-block;
    margin-top: 1rem;
    background: var(--text);
    color: #a5f3fc;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
}

/* ── Login Page ── */
.login-page {
    min-height: 100vh;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-wrap { width: 100%; padding: 1rem; }
.login-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.login-logo {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0;
    margin-bottom: 0.25rem;
}
.brand-sub-login {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.login-tagline { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 1.75rem; }
.login-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}
.login-form { display: flex; flex-direction: column; gap: 0.75rem; }
.login-form input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}
.login-form input:focus { border-color: var(--primary); }
.login-form button {
    width: 100%;
    padding: 0.7rem;
    background: var(--rg-navy);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 0.25rem;
}
.login-form button:hover { background: #122d4a; }
.btn-login-primary {
    display: block;
    padding: 0.7rem;
    background: var(--rg-navy);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}
.btn-login-primary:hover { background: #122d4a; }

/* ── Legacy login compat ── */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0f172a; }

/* ── Alert ── */
.alert { padding: 0.5rem 0.75rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.875rem; }
.alert-error { background: #fee2e2; color: #991b1b; }

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.summary-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.summary-number { font-size: 2.25rem; font-weight: 800; line-height: 1; }
.summary-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.35rem; }
.card-ok { border-left: 4px solid var(--gruen); background: linear-gradient(135deg, #f0fdf4 0%, var(--card-bg) 100%); }
.card-ok .summary-number { color: var(--gruen); }
.card-warn { border-left: 4px solid var(--gelb); background: linear-gradient(135deg, #fffbeb 0%, var(--card-bg) 100%); }
.card-warn .summary-number { color: var(--gelb); }
.card-critical { border-left: 4px solid var(--rot); background: linear-gradient(135deg, #fef2f2 0%, var(--card-bg) 100%); }
.card-critical .summary-number { color: var(--rot); }
.card-total { border-left: 4px solid var(--blau); background: linear-gradient(135deg, #eff6ff 0%, var(--card-bg) 100%); }
.card-total .summary-number { color: var(--blau); }
.summary-card.clickable { cursor: pointer; transition: all 0.2s; }
.summary-card.clickable:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,0.12); }
.summary-card.filter-active { outline: 3px solid var(--primary); outline-offset: 2px; box-shadow: 0 4px 12px rgba(37,99,235,0.15); }

/* Filter info bar */
.filter-badge {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid #bfdbfe;
}
.filter-badge a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 0.75rem;
    font-weight: 400;
}
.filter-badge a:hover { color: var(--rot); }

/* Agent Status Grid */
.agent-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.6rem;
}
.agent-status-card {
    display: block;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.agent-status-card:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(37,99,235,0.12); transform: translateY(-1px); }
.agent-status-header { margin-bottom: 0.5rem; }
.agent-status-name { font-weight: 600; font-size: 0.82rem; display: block; line-height: 1.3; }
.agent-status-company { font-size: 0.68rem; color: var(--text-muted); display: block; margin-top: 0.15rem; }
.agent-status-body { display: flex; align-items: center; gap: 0.4rem; }
.agent-status-dot {
    width: 12px; height: 12px; border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}
.dot-rot { background: var(--rot); box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }
.dot-gelb { background: var(--gelb); box-shadow: 0 0 0 3px rgba(234,179,8,0.15); }
.dot-gruen { background: var(--gruen); box-shadow: 0 0 0 3px rgba(34,197,94,0.15); }
.dot-grau { background: #cbd5e1; }
.status-text { font-size: 0.78rem; color: var(--text-muted); }
.agent-status-time { font-size: 0.68rem; color: var(--text-muted); margin-top: 0.35rem; }

/* Tier Results */
.tier-results { margin-bottom: 1rem; }
.results-list { display: flex; flex-direction: column; gap: 0.375rem; }
.result-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s;
}
.result-row:hover { border-color: var(--primary); background: #f8faff; }
.result-name { font-size: 0.85rem; font-weight: 500; flex: 1; }
.error-badge { font-size: 0.7rem; background: #fee2e2; color: #991b1b; padding: 0.1rem 0.4rem; border-radius: 3px; }

/* Result Cards */
.result-card { transition: all 0.15s; }
.result-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.result-card[data-farbe="rot"] { border-left: 4px solid var(--rot); }
.result-card[data-farbe="gelb"] { border-left: 4px solid var(--gelb); }
.result-card[data-farbe="gruen"] { border-left: 4px solid var(--gruen); }
.result-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.result-card-header h3 { margin-bottom: 0; font-size: 0.95rem; }
.badge { font-size: 0.7rem; font-weight: 700; padding: 0.25rem 0.6rem; border-radius: 12px; letter-spacing: 0.03em; }
.badge-gruen { background: #dcfce7; color: #166534; }
.badge-gelb { background: #fef9c3; color: #854d0e; }
.badge-rot { background: #fee2e2; color: #991b1b; }

/* Parsed Result Display */
.parsed-result { }
.result-section {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: #f8fafc;
    border-left: 3px solid var(--border);
}
.result-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}
.result-section-text {
    font-size: 0.85rem;
    line-height: 1.65;
    white-space: pre-line;
}
.result-empfehlung {
    background: #eff6ff;
    border-left-color: var(--primary);
}
.result-reichweite {
    background: #f0fdf4;
    border-left-color: var(--gruen);
}
.result-events-compact {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.result-event-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    padding: 0.25rem 0;
}
.event-name { flex: 1; font-weight: 500; }
.event-date { color: var(--text-muted); font-size: 0.75rem; }
.result-more {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0.25rem 0;
}
.result-raw-toggle {
    margin-top: 0.75rem;
}
.result-raw-toggle summary {
    font-size: 0.8rem;
    color: var(--primary);
    cursor: pointer;
    user-select: none;
}
.result-raw-toggle summary:hover { text-decoration: underline; }
.result-raw-toggle .result-json {
    margin-top: 0.5rem;
    max-height: 300px;
}

/* Start Options */
.start-options { margin-top: 1.5rem; }
.start-options p { margin-top: 0.75rem; font-size: 0.85rem; }

/* Mapping Table */
.mapping-table { margin-top: 0.5rem; }
.mapping-table td { font-size: 0.85rem; }

/* Approval Items */
.fix-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: border-color 0.15s;
}
.fix-item:hover { border-color: var(--primary); }
.fix-status-pending { border-left: 4px solid var(--gelb); }
.fix-status-on_hold { border-left: 4px solid #94a3b8; }
.fix-status-approved { border-left: 4px solid var(--blau); }
.fix-status-executed { border-left: 4px solid var(--gruen); }
.fix-status-failed { border-left: 4px solid var(--rot); }
.fix-status-rejected { border-left: 4px solid #94a3b8; opacity: 0.7; }
.fix-status-rolled_back { border-left: 4px solid #f97316; }

.fix-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.fix-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.fix-type-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-security_headers { background: #dbeafe; color: #1e40af; }
.badge-wp_plugin_update { background: #fef9c3; color: #854d0e; }
.badge-wp_plugin_delete { background: #f1f5f9; color: #64748b; }

.fix-severity {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}
.severity-high { background: #fee2e2; color: #991b1b; }
.severity-medium { background: #fef9c3; color: #854d0e; }
.severity-low { background: #e0e7ff; color: #3730a3; }

.fix-domain {
    font-weight: 600;
    font-size: 0.85rem;
    font-family: monospace;
}
.fix-server {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.fix-status-tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.fix-tag-pending { background: #fef9c3; color: #854d0e; }
.fix-tag-on_hold { background: #f1f5f9; color: #64748b; }
.fix-tag-approved { background: #dbeafe; color: #1e40af; }
.fix-tag-executed { background: #dcfce7; color: #166534; }
.fix-tag-failed { background: #fee2e2; color: #991b1b; }
.fix-tag-rejected { background: #f1f5f9; color: #64748b; }
.fix-tag-rolled_back { background: #ffedd5; color: #9a3412; }

.fix-description {
    font-size: 0.875rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.fix-details {
    margin-bottom: 0.75rem;
}
.fix-details summary {
    font-size: 0.8rem;
    color: var(--primary);
    cursor: pointer;
    user-select: none;
}
.fix-details summary:hover { text-decoration: underline; }
.fix-commands {
    margin-top: 0.5rem;
}
.fix-commands strong {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}
.fix-commands pre {
    background: #0f172a;
    color: #a5f3fc;
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.75rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}

.fix-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.fix-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.btn-approve, .btn-reject, .btn-rollback {
    border: none;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-approve {
    background: var(--gruen);
    color: white;
}
.btn-approve:hover { background: #16a34a; }
.btn-approve:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
}
.btn-reject {
    background: #f1f5f9;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-reject:hover { background: #e2e8f0; }
.btn-rollback {
    background: #ffedd5;
    color: #9a3412;
    border: 1px solid #fed7aa;
}
.btn-rollback:hover { background: #fed7aa; }

.fix-timestamp {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: auto;
}

/* HTMX loading indicator */
.fix-item.htmx-request {
    opacity: 0.6;
    pointer-events: none;
}

/* KPI Dashboard Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.kpi-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
}
.kpi-platform {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
}
.kpi-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 0.15rem 0;
}
.kpi-label {
    color: var(--text-muted);
}
.kpi-value {
    font-weight: 600;
    color: var(--text);
}

/* Marketing Page – KPI Detail Cards */
.kpi-grid-large {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}
.kpi-detail-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    transition: box-shadow 0.15s;
}
.kpi-detail-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.kpi-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}
.kpi-detail-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
}
.kpi-detail-status {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: #f0fdf4;
    color: #166534;
}
.kpi-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.875rem;
    border-bottom: 1px solid #f1f5f9;
}
.kpi-detail-row:last-child { border-bottom: none; }
.kpi-detail-label {
    color: var(--text-muted);
}
.kpi-detail-value {
    font-weight: 600;
    color: var(--text);
}

/* Sales Page – Coverage Bars */
.coverage-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}
.coverage-bar {
    height: 8px;
    border-radius: 4px;
    min-width: 2px;
    transition: width 0.3s;
}
.bar-gruen { background: var(--gruen); }
.bar-gelb { background: var(--gelb); }
.bar-rot { background: var(--rot); }
.coverage-pct {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Sales Page – Star Rating */
.star-rating {
    font-size: 0.95rem;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* Sales Page – VV Badge */
.vv-badge {
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    background: #f1f5f9;
    color: var(--text);
    white-space: nowrap;
}

/* Footer (legacy compat above) */

/* Responsive */
@media (max-width: 768px) {
    main { padding: 0 1rem; }
    .header-content { gap: 0.5rem; padding: 0.5rem 0; }
    .main-nav { justify-content: center; }
    table { font-size: 0.75rem; }
    th, td { padding: 0.4rem; }
    .infra-grid { grid-template-columns: 1fr; }
    .security-agent-link { flex-direction: column; gap: 0.75rem; }
    .summary-cards { grid-template-columns: repeat(2, 1fr); }
    .coverage-bar-wrapper { min-width: 80px; }
}
