/* IT Provisioning web console. Colors = desktop "Good One" theme. */
:root {
  --bg: #0a0f15; --sidebar: #0d131b; --panel: #111923; --panel-2: #16212e; --panel-3: #1c2a3a;
  --border: #223144; --input: #0c131b;
  --text: #d5e1ec; --bright: #f1f6fb; --muted: #7b8da3; --dim: #4d5f73;
  --accent: #00b4d8; --accent-hover: #0094b3; --accent-dim: #0b3442; --accent-text: #04131a;
  --term: #9fd8b0;
  --ok: #2ecc71; --warn: #f0a020; --fail: #ef4c4c; --info: #3d9be9; --critical: #ff2e63;
  --danger: #c0392b; --danger-hover: #922b21;
  --radius: 8px;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text);
  display: grid; grid-template-columns: 220px 1fr;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 2px 0; color: var(--bright); font-weight: 600; }
h2 { font-size: 15px; margin: 0 0 12px; color: var(--bright); font-weight: 600; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; margin: 12px 0; }
.error { color: var(--fail); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- layout ---------- */
.sidebar {
  background: var(--sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 20px; }
.brand b { display: block; color: var(--bright); font-size: 15px; }
.brand small { color: var(--muted); font-size: 11px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-text); font-weight: 800; letter-spacing: .5px;
}
.brand.big { justify-content: center; padding-bottom: 8px; }
.brand.big .brand-mark { width: 42px; height: 42px; font-size: 17px; }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
nav a, .me a {
  color: var(--text); padding: 8px 10px; border-radius: 6px; display: block;
}
nav a:hover, .me a:hover { background: var(--panel-2); text-decoration: none; }
nav a.active, .me a.active { background: var(--accent-dim); color: var(--bright); box-shadow: inset 3px 0 0 var(--accent); }
.nav-sep { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 14px 10px 4px; }
.me { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.me b { display: block; color: var(--bright); }
.me small { color: var(--muted); }
main { padding: 24px 32px 48px; min-width: 0; max-width: 1400px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  main { padding: 16px; }
}

/* ---------- cards, tiles ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 520px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.tile .num { font-size: 28px; font-weight: 600; color: var(--bright); font-variant-numeric: tabular-nums; }
.tile .lbl { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--bright); word-break: break-word; }
.banner { border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; border: 1px solid; }
.banner.warn { border-color: var(--warn); background: #2a1e08; }
.banner.info { border-color: var(--info); background: #0d2033; }
.empty { color: var(--muted); padding: 20px; text-align: center; }

/* ---------- table ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; background: var(--panel-2); }
tbody tr:hover { background: var(--panel-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
.card:not(.flush) table th { background: transparent; }

/* ---------- badges ---------- */
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600;
  border: 1px solid currentColor; white-space: nowrap; line-height: 18px;
}
.b-ok, .b-PASS, .b-succeeded, .b-online, .b-CLEAN { color: var(--ok); }
.b-warn, .b-WARN, .b-MEDIUM, .b-queued, .b-sent { color: var(--warn); }
.b-fail, .b-FAIL, .b-HIGH, .b-failed, .b-CRITICAL { color: var(--fail); }
.b-INFO, .b-running, .b-LOW, .b-info { color: var(--info); }
.b-offline, .b-UNKNOWN, .b-cancelled, .b-muted, .b-revoked { color: var(--muted); }
.b-CRITICAL { color: var(--critical); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--dim); }
.dot.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }

/* ---------- forms, buttons ---------- */
input, select, textarea {
  background: var(--input); color: var(--bright); border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 10px; font: inherit; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--text); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input[type=search] { width: 280px; }
.btn {
  background: var(--panel-3); color: var(--bright); border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 14px; font: inherit; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-hover); }
.btn.ghost { background: transparent; }
.btn.small { padding: 3px 10px; font-size: 12.5px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button {
  background: none; border: 0; color: var(--muted); padding: 9px 14px; font: inherit; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--bright); }
.tabs button.active { color: var(--bright); border-bottom-color: var(--accent); }

/* ---------- console ---------- */
.console {
  background: #060a0e; border: 1px solid var(--border); border-radius: 6px; color: var(--term);
  font: 12.5px/1.55 var(--mono); padding: 10px 12px; height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
.console .stderr { color: var(--fail); }
.console .system { color: var(--accent); }
.console.short { height: 260px; }
pre.json { background: var(--input); border: 1px solid var(--border); border-radius: 6px; padding: 10px; overflow: auto; max-height: 420px; font: 12px/1.5 var(--mono); margin: 0; }

/* ---------- security ---------- */
.score { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.score .big { font-size: 40px; font-weight: 700; color: var(--bright); line-height: 1; font-variant-numeric: tabular-nums; }
.score .big small { font-size: 16px; color: var(--muted); font-weight: 400; }
.check-row td:first-child { width: 80px; }
.check-name { color: var(--bright); font-weight: 500; }
.check-detail { color: var(--muted); font-size: 12.5px; }
.check-impact { color: var(--dim); font-size: 12px; font-style: italic; }

/* ---------- apps ---------- */
.app-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.app-group { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.app-group h3 { margin: 0 0 8px; font-size: 13px; color: var(--bright); display: flex; justify-content: space-between; }
.app-group label.check { padding: 3px 0; }
.sticky-bar {
  position: sticky; bottom: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; margin-top: 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between;
}

/* ---------- dialog, toasts ---------- */
dialog {
  background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px; width: min(560px, 92vw); max-height: 90vh;
}
dialog.wide { width: min(960px, 96vw); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog h2 { margin-bottom: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast {
  background: var(--panel-3); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  padding: 10px 14px; border-radius: 6px; max-width: 420px; box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.toast.error { border-left-color: var(--fail); }
.toast.ok { border-left-color: var(--ok); }
.code-box {
  font: 600 26px/1.2 var(--mono); letter-spacing: 3px; color: var(--bright); background: var(--input);
  border: 1px dashed var(--accent); border-radius: 8px; padding: 14px; text-align: center; user-select: all;
}

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; grid-template-columns: 1fr; min-height: 100vh; }
.login-card { width: min(400px, 92vw); background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 28px; }
.login-card h2 { margin: 8px 0 0; }
.qr { width: 200px; height: 200px; background: #fff; border-radius: 8px; padding: 6px; align-self: center; }
.secret { display: block; margin-top: 6px; word-break: break-all; color: var(--bright); user-select: all; }
dialog p { white-space: pre-line; }
pre.json.wrap { white-space: pre-wrap; word-break: break-all; }
.steps { margin: 0; padding-left: 20px; } .steps li { margin: 2px 0; }
.subtabs { display: flex; gap: 6px; margin-bottom: 12px; }
.subtabs button { background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); border-radius: 16px; padding: 4px 14px; cursor: pointer; font: inherit; }
.subtabs button.active { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
.bar { height: 8px; background: var(--panel-3); border-radius: 4px; overflow: hidden; min-width: 120px; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.bar.warn > span { background: var(--warn); }
.bar.fail > span { background: var(--fail); }
.tag { display: inline-block; background: var(--accent-dim); color: var(--bright); border-radius: 4px; padding: 0 6px; font-size: 11.5px; margin: 0 3px 2px 0; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--muted); padding: 5px 12px; cursor: pointer; font: inherit; }
.seg button.active { background: var(--accent-dim); color: var(--bright); }
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 16px; }
.dim-row { opacity: .45; }
td.check, th.check { width: 32px; }

/* ---------- threat report ---------- */
.verdict { display: flex; flex-direction: column; gap: 4px; padding: 8px 14px; border-left: 4px solid currentColor;
  background: var(--panel-3); border-radius: 6px; min-width: 260px; }
.verdict b { color: var(--bright); }
.verdict span { color: var(--text); }
.verdict-level { font-size: 28px; font-weight: 700; line-height: 1.1; }
.card-head.pad { padding: 12px 16px 4px; align-items: center; }

/* ---------- OU picker ---------- */
.ou-list { max-height: 34vh; overflow: auto; border: 1px solid var(--border); border-radius: 6px; margin-top: 8px; }
.ou-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border);
  color: var(--bright); padding: 6px 8px; cursor: pointer; font: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ou-item:hover { background: var(--panel-3); }
.ou-item.active { background: var(--panel-3); box-shadow: inset 3px 0 0 var(--accent); }

/* ---------- network tab ---------- */
.adapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; margin-top: 10px; }
.adapter { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px;
  display: flex; flex-direction: column; gap: 8px; }
.adapter .kv { grid-template-columns: 80px 1fr; }
.notice { border-left: 4px solid currentColor; background: var(--panel-3); padding: 8px 12px; border-radius: 6px; margin: 8px 0; }
.notice.warn { color: var(--warn); }
.notice.warn > * { color: var(--text); }
.user-drives { margin-top: 14px; }
.user-drives h3 { margin: 0; font-size: 14px; color: var(--bright); }

/* ---------- software audit ---------- */
button.tile { text-align: left; cursor: pointer; font: inherit; color: inherit; }
button.tile.active { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.tile-v { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--bright); }
.tile-v.b-warn { color: var(--warn); } .tile-v.b-ok { color: var(--ok); } .tile-v.b-muted { color: var(--muted); }
.audit-bar { margin-top: 12px; align-items: center; flex-wrap: wrap; gap: 8px; }
label.inline { flex-direction: row; align-items: center; gap: 6px; }

/* ---------- repair tab ---------- */
.fix-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0;
  border-top: 1px solid var(--border); }
.fix-row:first-of-type { border-top: 0; }
.error.small { font-size: 12px; margin-top: 4px; }
