:root {
    --bg: #0f1419;
    --card: #1a222b;
    --border: #2a3540;
    --text: #dbe4ec;
    --muted: #8a9aa8;
    --accent: #4da3ff;
    --crit: #ff5252;
    --high: #ffb142;
    --med: #8a9aa8;
    --ok: #3ddc84;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg); color: var(--text); min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
code { background: #0a0e12; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; }
.login-box {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 40px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.login-box h1 { font-size: 26px; margin-bottom: 4px; }
.subtitle { color: var(--muted); margin-bottom: 24px; font-size: 14px; }
.login-box label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.login-box input {
    display: block; width: 100%; margin-top: 5px; padding: 10px 12px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text);
}
.login-box button {
    width: 100%; padding: 12px; background: var(--accent); color: #06121f;
    border: 0; border-radius: 8px; font-weight: 700; cursor: pointer; margin-top: 6px;
}

/* Topbar */
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 28px; background: var(--card); border-bottom: 1px solid var(--border);
}
.brand { font-size: 20px; font-weight: 800; }
.version { color: var(--muted); font-size: 12px; font-weight: 400; }
.topbar-right { display: flex; gap: 14px; align-items: center; }
.user { color: var(--muted); font-size: 13px; }

/* Layout */
.container { margin: 28px 32px; display: grid; gap: 24px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 22px; overflow-x: auto; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card h2 { font-size: 17px; }
.notice { background: #123a24; border: 1px solid #1f5c38; padding: 12px 16px; border-radius: 8px; }
.alert-critical { background: #3a1216; border: 1px solid #5c1f24; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .5px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 9px 10px; border-bottom: 1px solid #222c36; vertical-align: top; }
tr:hover td { background: #1f2933; }
td.file { font-family: monospace; font-size: 12px; color: var(--muted); }
td.empty { text-align: center; color: var(--muted); padding: 30px; }
.num-crit { color: var(--crit); font-weight: 800; }
.num-high { color: var(--high); font-weight: 800; }
tr.resolved td { opacity: .45; }

/* Ampel + Badges */
.ampel { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; }
.ampel.gruen { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.ampel.gelb { background: var(--high); box-shadow: 0 0 8px var(--high); }
.ampel.rot { background: var(--crit); box-shadow: 0 0 8px var(--crit); }
.ampel.grau { background: var(--med); }
.badge { font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 20px; letter-spacing: .5px; }
.badge.critical { background: #3a1216; color: var(--crit); border: 1px solid #5c1f24; }
.badge.high { background: #3a2b12; color: var(--high); border: 1px solid #5c4724; }
.badge.medium { background: #232c35; color: var(--med); border: 1px solid var(--border); }
.badge.low { background: #1a222b; color: var(--muted); border: 1px solid var(--border); }

/* Haertungs-Score in der Site-Liste */
.score-sub { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; letter-spacing: .4px; }
.score-ok { background: rgba(61,220,132,.12); color: var(--ok); }
.score-warn { background: rgba(255,177,66,.12); color: var(--high); }
.score-fail { background: rgba(255,82,82,.14); color: var(--crit); }

/* Statistik-Karten */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 18px 20px; text-align: center;
}
.stat-value { font-size: 30px; font-weight: 800; }
.stat-value.crit { color: var(--crit); }
.stat-value.ok { color: var(--ok); }
.stat-sub { font-size: 16px; color: var(--muted); font-weight: 400; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }
.stat-warn { color: var(--crit); font-weight: 700; text-transform: none; }
td.uptime { white-space: nowrap; }

/* Site-Detailseite */
.site-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 24px; margin-bottom: 16px; font-size: 13px; }
.meta-label { color: var(--muted); display: inline-block; min-width: 120px; }
.sev-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.type-head { font-size: 14px; margin-bottom: 10px; }
.type-count { color: var(--muted); font-weight: 400; font-size: 12px; }
.quarantine-view {
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
    padding: 14px; overflow: auto; max-height: 500px; font-size: 12px; line-height: 1.5;
}
/* PHP-Error-Einordnung */
.msg-cell .msg-error { font-family: monospace; font-size: 12px; color: var(--text); line-height: 1.5; }
.err-classify {
    margin-top: 8px; padding: 10px 12px; border-left: 3px solid var(--accent);
    background: rgba(77,163,255,.06); border-radius: 0 8px 8px 0;
    font-size: 12px; line-height: 1.6; color: var(--text);
}
.err-cat {
    display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 10px;
    font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
    background: rgba(77,163,255,.15); color: var(--accent); margin-right: 6px;
}
.err-reco { color: var(--muted); }
.err-reco .err-label { color: var(--ok); font-weight: 700; }

/* Buttons + Forms */
.btn-small {
    display: inline-block; padding: 6px 12px; font-size: 12px; border-radius: 6px;
    background: #26313c; color: var(--text); border: 1px solid var(--border); cursor: pointer;
}
.btn-small:hover { background: #2f3d4a; }
.btn-small.danger { background: #3a1216; color: var(--crit); border-color: #5c1f24; }
.btn-small.active { background: var(--accent); color: #06121f; border-color: var(--accent); }
.inline-form { display: inline; }
.filters { display: flex; gap: 8px; }
.add-site { margin-top: 16px; }
.add-site summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.add-form { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.add-form input {
    padding: 9px 12px; background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); min-width: 240px;
}
.add-form button { padding: 9px 18px; background: var(--accent); color: #06121f; border: 0; border-radius: 8px; font-weight: 700; cursor: pointer; }
.token { color: var(--high); user-select: all; }
.token-reveal summary { list-style: none; display: inline-block; cursor: pointer; }
.token-reveal summary::-webkit-details-marker { display: none; }
.token-reveal[open] summary { display: none; }
.token-reveal code { word-break: break-all; font-size: 11px; }

/* Sites-Tabelle */
.sites-table td { vertical-align: middle; }
.sites-table tbody tr { transition: background .15s; }
.sites-table tbody tr:hover { background: rgba(77,163,255,.05); }
.status-pill {
    display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700;
    padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap;
}
.status-pill .ampel { margin: 0; }
.status-pill.gruen { background: rgba(61,220,132,.12); color: var(--ok); }
.status-pill.gelb { background: rgba(255,177,66,.12); color: var(--high); }
.status-pill.rot { background: rgba(255,82,82,.14); color: var(--crit); }
.status-pill.grau { background: rgba(138,154,168,.12); color: var(--muted); }
.site-name a { font-weight: 600; color: var(--text); }
.site-name a:hover { color: var(--accent); }
.site-url { font-size: 12px; }
.scan-date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.scan-num { text-align: center; }
.scan-num a { font-weight: 700; }
.num-zero { color: var(--muted) !important; font-weight: 400 !important; }
.btn-icon {
    display: inline-block; padding: 5px 9px; font-size: 13px; border-radius: 6px;
    background: transparent; color: var(--muted); border: 1px solid transparent; cursor: pointer;
}
.btn-icon:hover { background: rgba(255,82,82,.12); color: var(--crit); border-color: rgba(255,82,82,.3); }

.btn-pin {
    background: transparent; border: 0; cursor: pointer; font-size: 14px;
    filter: grayscale(1) opacity(.35); padding: 2px 4px; vertical-align: middle;
}
.btn-pin:hover { filter: grayscale(0) opacity(.8); }
.btn-pin.active { filter: none; }
.pin-form { display: inline; }
tr.pinned td { background: rgba(255,177,66,.04); }
tr.pinned:hover td { background: rgba(255,177,66,.08); }
tr.locked td {
    opacity: .55;
    background: repeating-linear-gradient(45deg, rgba(138,154,168,.06) 0 12px, transparent 12px 24px);
}
tr.locked:hover td { opacity: .9; }
tr.locked td:first-child { border-left: 3px solid var(--med); }
tr.locked .site-name a { text-decoration: line-through; text-decoration-color: rgba(138,154,168,.6); }
.btn-icon.lock-active { color: var(--high); }
.btn-update {
    font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; cursor: pointer;
    background: rgba(77,163,255,.1); border: 1px solid rgba(77,163,255,.3); color: var(--accent);
}
.btn-update:hover { background: rgba(77,163,255,.2); }
.actions { white-space: nowrap; }

.site-url-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; text-decoration: none; }
.site-url-sub:hover { color: var(--accent); }
.err-sub { display: block; font-size: 11px; margin-top: 2px; font-weight: 600; }
.err-sub.err-fatal { color: var(--crit); }
.err-sub.err-warn { color: var(--high); }

/* Schutz-Chips (Dashboard) */
.prot-cell .chip { display: block; width: fit-content; }
.chip {
    font-size: 9px; font-weight: 600; padding: 1px 7px;
    border-radius: 999px; margin: 2px 0 0; letter-spacing: .2px;
}
.chip-on  { background: rgba(61,220,132,.12); border: 1px solid rgba(61,220,132,.35); color: var(--ok); }
.chip-off { background: rgba(138,154,168,.08); border: 1px solid rgba(138,154,168,.25); color: var(--muted); }

/* Schutz-Status-Grid (Detailseite) */
.agent-box { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; font-size: 13px; flex-wrap: wrap; }
.prot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.prot-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.prot-item.on { border-color: rgba(61,220,132,.35); }
.prot-item.off { opacity: .55; }
.prot-name { font-weight: 700; font-size: 13px; }
.prot-status { font-size: 11px; margin: 2px 0; }
.prot-item.on .prot-status { color: var(--ok); }
.prot-last { font-size: 11px; color: var(--muted); }

/* Sicherheits-Timeline */
.timeline-table td { vertical-align: top; }
.tl-time { white-space: nowrap; font-size: 12px; color: var(--muted); }
.tl-msg { font-size: 13px; }
.tl-resolved { opacity: .55; }
.pill.info { background: rgba(77,163,255,.12); border: 1px solid rgba(77,163,255,.3); color: var(--accent); }

/* Audit-Formular */
.audit-desc { font-size: 13px; margin-bottom: 14px; max-width: 720px; line-height: 1.5; }
.audit-form { display: flex; gap: 10px; flex-wrap: wrap; }
.audit-input {
    flex: 1; min-width: 260px; padding: 11px 14px; font-size: 14px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text);
}
.audit-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(77,163,255,.15); }
.btn-primary {
    padding: 11px 22px; font-size: 14px; font-weight: 700; border: 0; border-radius: 8px;
    background: var(--accent); color: #06121f; cursor: pointer; white-space: nowrap;
}
.btn-primary:hover { filter: brightness(1.1); }
.chip-block { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; }
.chip-label { font-size: 12px; color: var(--muted); padding-top: 6px; white-space: nowrap; }
.chip-list { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-list .chip {
    font-size: 12px; padding: 5px 12px; border-radius: 999px;
    background: rgba(77,163,255,.08); border: 1px solid rgba(77,163,255,.25); color: var(--accent);
}
.chip-list .chip:hover { background: rgba(77,163,255,.18); border-color: var(--accent); }

/* Audit-Bericht */
.audit-score-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.audit-score {
    background: var(--card); border: 1px solid var(--border); border-radius: 10px;
    padding: 16px 28px; text-align: center; min-width: 150px;
}
.audit-score.ok { border-color: var(--ok); box-shadow: 0 0 24px rgba(61,220,132,.12); }
.audit-score.warn { border-color: var(--high); box-shadow: 0 0 24px rgba(255,177,66,.12); }
.audit-score.crit { border-color: var(--crit); box-shadow: 0 0 24px rgba(255,82,82,.15); }
.audit-score-value { font-size: 38px; font-weight: 800; }
.audit-score-value span { font-size: 18px; color: var(--muted); font-weight: 400; }
.audit-score.ok .audit-score-value { color: var(--ok); }
.audit-score.warn .audit-score-value { color: var(--high); }
.audit-score.crit .audit-score-value { color: var(--crit); }
.audit-score-row .stat-card { flex: 1; min-width: 110px; }
.stat-value.warn-text { color: var(--high); }

.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-row {
    background: var(--bg); border: 1px solid var(--border); border-left-width: 3px;
    border-radius: 8px; padding: 10px 14px;
}
.check-row.ok { border-left-color: var(--ok); }
.check-row.warn { border-left-color: var(--high); }
.check-row.fail { border-left-color: var(--crit); }
.check-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.check-name { font-weight: 600; font-size: 13px; }
.pill {
    font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
    text-transform: uppercase; letter-spacing: .4px; white-space: nowrap;
}
.pill.ok { background: rgba(61,220,132,.12); color: var(--ok); }
.pill.warn { background: rgba(255,177,66,.12); color: var(--high); }
.pill.fail { background: rgba(255,82,82,.14); color: var(--crit); }
.check-detail { font-size: 13px; color: var(--text); margin-top: 4px; }
.check-fix { font-size: 12px; color: var(--muted); margin-top: 3px; }
