:root {
  --bg: #f4f6f9; --panel: #ffffff; --text: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --brand: #0b4f8a; --brand-2: #0e6bb8; --ok: #15803d; --warn: #b45309; --crit: #b91c1c; --high: #c2410c; --med: #a16207;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1220; --panel: #111a2c; --text: #e2e8f0; --muted: #94a3b8; --line: #1f2a40;
          --brand: #3b82f6; --brand-2: #60a5fa; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand-2); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; } h1 small { color: var(--muted); font-weight: 400; font-size: .9rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .75rem; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85em; }
.top { display: flex; align-items: center; gap: 1rem; padding: .6rem 1.25rem; background: var(--brand); color: #fff; }
.top a, .top .link { color: #fff; }
.brand { font-weight: 700; letter-spacing: .02em; } .brand.big { font-size: 1.4rem; text-align: center; color: var(--brand); margin: 0 0 1rem; }
.tenant { opacity: .95; } .tenant small { opacity: .8; }
.user { margin-left: auto; display: flex; gap: 1rem; align-items: center; }
.layout { display: flex; min-height: calc(100vh - 48px); }
.side { width: 210px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--line); padding: 1rem .75rem; }
.side a { display: block; padding: .4rem .6rem; border-radius: 6px; color: var(--text); }
.side a:hover { background: var(--bg); text-decoration: none; }
.side-title { margin: 1rem .6rem .3rem; font-size: .75rem; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.content { flex: 1; padding: 1.5rem 2rem; min-width: 0; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; margin-bottom: 1rem; }
.card.narrow { width: 100%; max-width: 420px; } .narrow-left { max-width: 480px; }
.card.highlight { border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 20%, transparent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.pick { display: flex; flex-direction: column; gap: .4rem; } .pick small { color: var(--muted); }
label { display: block; margin: .6rem 0; font-size: .9rem; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
textarea.mono { font-size: .82rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); outline-offset: 0; }
.check { display: flex; align-items: center; gap: .4rem; } .check input { width: auto; margin: 0; display: inline; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row input, .row select { width: auto; flex: 1 1 160px; margin: 0; } .row .check { flex: 0 0 auto; margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; align-items: center; }
.filters input, .filters select { width: auto; margin: 0; }
.btn { display: inline-block; padding: .5rem 1rem; border: 0; border-radius: 6px; background: var(--brand); color: #fff; font: inherit; cursor: pointer; }
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn.wide { width: 100%; text-align: center; margin-top: .5rem; } .btn.small { padding: .25rem .6rem; font-size: .85rem; }
.btn.ghost { background: transparent; color: var(--brand-2); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--crit); border: 1px solid var(--line); }
.btn.ms { background: #2f2f2f; } .link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.inline { display: inline; } .actions { white-space: nowrap; } .actions form { margin-left: .25rem; }
.sep { text-align: center; color: var(--muted); font-size: .85rem; margin: 1rem 0 0; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 1rem; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg); }
tr:last-child td { border-bottom: 0; } td select { display: inline-block; width: auto; margin: 0; padding: .2rem .4rem; }
.small { font-size: .82rem; } .muted { color: var(--muted); } .hint { font-size: .82rem; color: var(--muted); }
.badge { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; border: 1px solid currentColor; }
.badge.ok { color: var(--ok); } .badge.muted { color: var(--muted); }
.p-critical { color: var(--crit); } .p-high { color: var(--high); } .p-medium { color: var(--med); } .p-low { color: var(--muted); }
.flash { padding: .6rem .9rem; border-radius: 6px; margin: 0 0 1rem; border: 1px solid; }
.flash.ok { color: var(--ok); } .flash.err { color: var(--crit); } .flash.warn { color: var(--warn); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; color: var(--muted); font-size: .85rem; }
.kpi span { display: block; font-size: 1.7rem; font-weight: 700; color: var(--text); }
.kpi.crit span { color: var(--crit); }
dl { display: grid; grid-template-columns: 150px 1fr; gap: .4rem .8rem; margin: 0; } dt { color: var(--muted); font-size: .85rem; } dd { margin: 0; }
.qr { background: #fff; display: inline-block; padding: .5rem; border-radius: 8px; }
.pager a { margin-right: 1rem; }
@media (max-width: 760px) {
  .layout { flex-direction: column; } .side { width: auto; border-right: 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .25rem; }
  .side-title { width: 100%; margin: .5rem .6rem .1rem; } .content { padding: 1rem; } table { display: block; overflow-x: auto; }
  .top { flex-wrap: wrap; } dl { grid-template-columns: 1fr; }
}
