/* aye Corporate Design: Rot #E30613, Schwarz #1A1A1A, Hellgrau #F2F2F2, Grün #00A550, Weiß */
:root {
    --aye-red: #E30613;
    --aye-black: #1A1A1A;
    --aye-grey: #F2F2F2;
    --aye-green: #00A550;
    --aye-yellow: #F5A800;
    --aye-blue: #2B6CB0;
    --text: #1A1A1A;
    --muted: #6b6b6b;
    --border: #e1e1e1;
    --bg: #ffffff;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* must win over class rules such as .wall-overlay { display:flex } */
html, body { margin: 0; padding: 0; background: var(--aye-grey); color: var(--text); font-size: 14px; }
a { color: var(--aye-red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 16px; font-weight: 600; }
h2 { font-size: 17px; margin: 24px 0 10px; font-weight: 600; }
h3 { font-size: 15px; margin: 0 0 10px; font-weight: 600; }
code, pre { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; }
pre { background: var(--aye-black); color: #f2f2f2; padding: 10px 12px; border-radius: var(--radius); overflow: auto; max-height: 420px; white-space: pre-wrap; }

.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: var(--aye-black); color: #fff; display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 52px; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-logo { display: flex; align-items: center; background: #fff; border-radius: 6px; padding: 4px 10px; height: 36px; }
.brand-logo img { height: 24px; width: auto; display: block; }
.brand-mark { color: var(--aye-red); font-weight: 800; font-size: 20px; letter-spacing: -0.5px; }
.brand-name { font-weight: 600; font-size: 16px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav-link { color: #ddd; padding: 8px 12px; border-radius: 6px; font-weight: 500; }
.nav-link:hover { background: rgba(255,255,255,.08); text-decoration: none; color: #fff; }
.nav-link.active { color: #fff; box-shadow: inset 0 -3px 0 var(--aye-red); }
.topbar-user { display: flex; align-items: center; gap: 10px; color: #ccc; }
.user-name { font-size: 13px; }
.inline { display: inline; }

.content { flex: 1; padding: 24px; max-width: 1600px; width: 100%; margin: 0 auto; }
.footer { background: var(--aye-black); color: #bbb; padding: 12px 24px; display: flex; justify-content: space-between; font-size: 12px; }
.footer .claim { color: #fff; font-weight: 600; letter-spacing: .3px; }

/* ---- buttons, forms */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 6px; padding: 7px 12px; font-size: 13px; font-weight: 500; cursor: pointer; background: #fff; color: var(--text); border-color: var(--border); line-height: 1.2; }
.btn:hover { background: #f7f7f7; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--aye-red); color: #fff; border-color: var(--aye-red); }
.btn-primary:hover { background: #c50511; }
.btn-danger { background: var(--aye-black); color: #fff; border-color: var(--aye-black); }
.btn-danger:hover { background: #000; }
.btn-ghost { background: transparent; border-color: transparent; color: inherit; }
.btn-ghost:hover { background: rgba(0,0,0,.06); }
.topbar .btn-ghost { color: #ddd; }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-sm { padding: 4px 8px; font-size: 12px; }
.btn-xs { padding: 2px 6px; font-size: 11px; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(227,6,19,.25); border-color: var(--aye-red); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--aye-red); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field-row .field { flex: 1; min-width: 160px; }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; }
.hint { color: var(--muted); font-size: 12px; }

/* ---- cards, tables */
.card { background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card-title h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }              /* grid items must be allowed to shrink, otherwise wide tables overflow the card */
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card > table, .card .table-wrap { max-width: 100%; }
.card table { overflow-wrap: anywhere; }
.break-all { word-break: break-all; overflow-wrap: anywhere; }
.span-all { grid-column: 1 / -1; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; background: var(--aye-grey); }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--text); }
th.sorted { color: var(--aye-red); }
.sort-icon { display: inline-block; width: 1em; margin-left: 2px; font-size: 9px; vertical-align: middle; }
tr:hover td { background: #fafafa; }
td.num, th.num { text-align: right; }
.table-wrap { overflow-x: auto; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; border-left: 4px solid; }
.alert-error { background: #fdecec; border-color: var(--aye-red); color: #7a0009; }
.alert-info { background: #e8f5ee; border-color: var(--aye-green); color: #0b4d2a; }
.alert-warn { background: #fff6e0; border-color: var(--aye-yellow); color: #6b4a00; }
.section-sep { border-top: 3px solid var(--aye-grey); margin: 20px 0; }
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 8px 14px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; color: var(--muted); font-weight: 500; background: none; border-top: 0; border-left: 0; border-right: 0; font: inherit; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--aye-red); border-bottom-color: var(--aye-red); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.progress { height: 8px; background: var(--aye-grey); border-radius: 4px; overflow: hidden; }
.progress > div { height: 100%; background: var(--aye-red); transition: width .3s; }
.progress.ok > div { background: var(--aye-green); }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* ---- status colors */
.ok { color: var(--aye-green); }
.warn { color: #b57a00; }
.crit { color: var(--aye-red); }
.patch { color: var(--aye-blue); }
.maint { color: #777; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.badge-ok { background: #e3f4ea; color: #0b6b36; }
.badge-warn { background: #fff1cc; color: #7a5200; }
.badge-crit { background: #fde3e5; color: #9a000a; }
.badge-patch { background: #e2ecf8; color: #1d4b83; }
.badge-maint { background: #e9e9e9; color: #555; }
.badge-muted { background: #eee; color: #777; }
.badge-unknown { background: #eee; color: #555; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-ok { background: var(--aye-green); }
.dot-warn { background: var(--aye-yellow); }
.dot-crit { background: var(--aye-red); }
.dot-patch { background: var(--aye-blue); }
.dot-maint { background: #999; }
.dot-unknown { background: #bbb; }

/* ---- host tiles */
.host-groups { display: flex; flex-direction: column; gap: 22px; }
.host-group h2 { margin: 0 0 10px; padding-bottom: 6px; border-bottom: 3px solid var(--aye-grey); display: flex; justify-content: space-between; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tile { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; border-top: 4px solid #bbb; display: flex; flex-direction: column; gap: 8px; color: inherit; transition: transform .08s; }
.tile:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.12); }
.tile.ok { border-top-color: var(--aye-green); }
.tile.warn { border-top-color: var(--aye-yellow); }
.tile.crit { border-top-color: var(--aye-red); }
.tile.patch { border-top-color: var(--aye-blue); }
.tile.maint { border-top-color: #999; }
.tile-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-os { color: var(--muted); font-size: 13px; }
.tile-problem { font-size: 12.5px; min-height: 17px; }
.tile-metrics { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); }
.tile-metrics .sparkline { flex: 1; height: 28px; }
.tile-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.sparkline { width: 100%; height: 28px; display: block; }

/* ---- modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(26,26,26,.55); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 10px; padding: 22px 24px; width: min(520px, 92vw); box-shadow: 0 12px 40px rgba(0,0,0,.3); border-top: 5px solid var(--aye-red); }
.modal-lg { width: min(860px, 94vw); max-height: 90vh; overflow: auto; }
.modal-text { white-space: pre-line; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---- login */
.login-wrap { display: flex; justify-content: center; padding-top: 8vh; }
.login-card { width: 380px; }
.login-card h1 { text-align: center; }

/* ---- summary bar */
.summary-bar { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 16px; min-width: 120px; }
.stat .n { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat .l { font-size: 12px; color: var(--muted); }

/* ---- wallboard */
.wall { position: fixed; inset: 0; background: #0f0f0f; color: #fff; padding: 2vh 2vw; display: flex; flex-direction: column; gap: 1.5vh; font-size: 2vh; overflow: hidden; }
.wall.night { filter: brightness(.55); }
.wall-head { display: flex; justify-content: space-between; align-items: baseline; }
.wall-title { font-size: 3vh; font-weight: 700; display: flex; align-items: center; gap: 1.5vw; }
.wall-logo { height: 5vh; padding: .6vh 1.2vh; border-radius: .8vh; }
.wall-logo img { height: 3.6vh; }
.wall-clock { font-size: 3.2vh; font-variant-numeric: tabular-nums; }
.wall-meta { color: #999; font-size: 1.8vh; }
.wall-allgood { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; }
.wall-allgood .big { font-size: 22vh; font-weight: 800; color: var(--aye-green); line-height: 1; font-variant-numeric: tabular-nums; }
.wall-allgood .sub { font-size: 4vh; color: #ccc; }
.wall-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile-min, 18vw), 1fr)); grid-auto-rows: minmax(9vh, auto); gap: 1.2vh; align-content: start; overflow: hidden; }
.wtile { background: #1c1c1c; border-radius: 1vh; padding: 1.2vh 1.5vh; border-left: 1.2vh solid #444; display: flex; flex-direction: column; justify-content: center; gap: .6vh; min-width: 0; }
.wtile .name { font-weight: 700; font-size: 2.6vh; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wtile .prob { color: #ddd; font-size: 2vh; }
.wtile .dur { color: #999; font-size: 1.7vh; }
.wtile.ok { border-left-color: var(--aye-green); }
.wtile.warn { border-left-color: var(--aye-yellow); }
.wtile.crit { border-left-color: var(--aye-red); background: #2a1113; }
.wtile.crit.blink { animation: wall-blink 1.2s ease-in-out infinite; }
.wtile.patch { border-left-color: var(--aye-blue); }
.wtile.maint { border-left-color: #666; color: #aaa; }
.wtile.big { grid-column: span 2; grid-row: span 2; }
.wtile.big .name { font-size: 4.2vh; }
.wtile.big .prob { font-size: 2.8vh; }
.wtile.small .name { font-size: 2vh; }
.wtile.small .prob { display: none; }
.wall-foot { display: flex; align-items: center; gap: 2vw; color: #aaa; font-size: 1.8vh; }
.wall-patch { flex: 1; background: #1c1c1c; border-radius: 1vh; padding: 1vh 1.5vh; display: flex; align-items: center; gap: 2vw; }
.wall-patch .progress { flex: 1; height: 1.4vh; background: #333; }
.wall-patch .progress > div { background: var(--aye-blue); }
.wall-overlay { position: fixed; inset: 0; background: rgba(120,0,6,.94); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; z-index: 200; text-align: center; }
.wall-overlay .big { font-size: 7vh; font-weight: 800; }
.wall-overlay .sub { font-size: 3vh; color: #fdd; }
.wall-denied { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #111; color: #fff; }
@keyframes wall-blink { 0%, 100% { background: #2a1113; } 50% { background: #5a0a12; } }

/* ---- blazor */
#components-reconnect-modal { background: rgba(26,26,26,.85) !important; color: #fff; }
.blazor-error-ui { background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
.blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.chart-wrap { position: relative; width: 100%; }
.log { background: var(--aye-black); color: #eee; font-family: Consolas, monospace; font-size: 12px; padding: 10px; border-radius: 6px; max-height: 320px; overflow: auto; white-space: pre-wrap; }
.copy-box { display: flex; gap: 6px; align-items: center; }
.copy-box code { flex: 1; background: var(--aye-grey); padding: 6px 8px; border-radius: 6px; overflow-x: auto; white-space: nowrap; }
.checkbox-cell { width: 30px; }
.actions-cell { white-space: nowrap; text-align: right; }
.problem-list { margin: 0; padding-left: 18px; }
.problem-list li { margin: 2px 0; }

/* ---- Abnahme (post-patch acceptance) ---- */
.acceptance { border-left: 4px solid var(--aye-yellow); }
.acceptance-failed { border-left-color: var(--aye-red); }
.acceptance-auto { background: var(--aye-grey); border-radius: 6px; padding: 8px 10px; }
.acceptance-close { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
tr.row-crit td { background: #fdecec; }

/* ---- Berichte / Druckansicht ---- */
.report { max-width: 1000px; margin: 0 auto; background: #fff; padding: 24px 32px 32px; min-height: 100vh; }
.report-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.report-head { display: flex; gap: 18px; align-items: center; border-bottom: 3px solid var(--aye-red); padding-bottom: 12px; margin-bottom: 14px; }
.report-head img { height: 48px; }
.report-head h1 { margin: 2px 0; }
.report-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.report-summary { background: var(--aye-grey); border-left: 4px solid var(--aye-red); padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.report h2 { background: var(--aye-black); color: #fff; padding: 6px 10px; border-left: 4px solid var(--aye-red); border-radius: 4px; font-size: 15px; margin: 22px 0 8px; page-break-after: avoid; }
.report h3 { font-size: 13px; margin: 14px 0 6px; page-break-after: avoid; }
.report-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.report-table th, .report-table td { border: 1px solid var(--border); padding: 5px 8px; vertical-align: top; text-align: left; }
.report-table th { background: var(--aye-grey); }
.report-host { page-break-inside: avoid; }
.report-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); }
.report-foot .claim { color: var(--aye-red); font-weight: 600; }
@media print {
    .no-print, #blazor-error-ui { display: none !important; }
    html, body { background: #fff; }
    .report { padding: 0; max-width: none; min-height: 0; }
    .report h2 { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .report-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .report-foot { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; }
    a[href]::after { content: none !important; }
}

/* ---- Health-Check-Editor (Host → Konfiguration) ---- */
.hc-table { min-width: 960px; table-layout: fixed; }
.hc-table th { white-space: nowrap; }
.hc-table td { vertical-align: middle; }
.hc-table input:not([type=checkbox]), .hc-table select { width: 100%; min-width: 0; }
.hc-inline { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.hc-inline input { width: 64px !important; padding-left: 6px; padding-right: 4px; }
.hc-http { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hc-http .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-http .btn { flex: none; }

/* ---- Anmeldung erforderlich (Post-Logon-Skripte) ---- */
.logon-required { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.logon-required .btn { flex: none; }

/* bulk selection on Einstellungen → Hosts */
tr.selected td { background: rgba(43, 108, 176, .08); }
