/* PADM Central: an operations console in a professional light theme (light only).
   Sidebar + one working column; severity carries colour, everything else stays neutral.
   The CSP forbids inline style attributes: use these classes (listed in the README, "UI kit"). */
:root {
  --bg: #f5f7fa; --panel: #ffffff; --fg: #101828; --fg-2: #344054; --muted: #667085; --line: #e4e7ec; --soft: #f9fafb;
  --hover: #f2f4f7; --accent: #1d4ed8; --accent-2: #1e40af; --accent-soft: #eff4ff; --accent-fg: #ffffff;
  --info: #175cd3; --success: #067647; --warning: #b54708; --critical: #b42318;
  --info-bg: #eff8ff; --success-bg: #ecfdf3; --warning-bg: #fffaeb; --critical-bg: #fef3f2;
  --info-line: #b2ddff; --success-line: #abefc6; --warning-line: #fedf89; --critical-line: #fecdca;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-lg: 0 20px 40px -8px rgba(16, 24, 40, .18), 0 4px 10px rgba(16, 24, 40, .06);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ring: 0 0 0 3px #c7d7fe;
  --line-2: #d0d5dd; --faint: #98a2b3;
  --radius: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--fg); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
::selection { background: #d1e0ff; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: 12px; z-index: 100; background: var(--panel); padding: 8px 12px; border-radius: 8px; transform: translateY(-300%); }
.skip:focus { transform: none; box-shadow: var(--shadow-lg); }

/* ---- icons (PADM.icon) ---- */
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ic.sm { width: 15px; height: 15px; vertical-align: -2px; }
.ic.lg { width: 26px; height: 26px; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
aside { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px 14px; display: flex; flex-direction: column;
        gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16.5px; letter-spacing: .1px; padding: 2px 8px; color: var(--fg); }
.brand .mark { width: 32px; height: 32px; flex: none; }
.brand small { display: block; font: 600 10.5px var(--font); color: var(--muted); letter-spacing: .4px; text-transform: uppercase; margin-top: -2px; }
nav { display: grid; gap: 1px; }
nav .group { font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--faint); padding: 14px 10px 6px; }
nav .group:first-child { padding-top: 2px; }
nav a { color: var(--fg-2); font-weight: 500; padding: 7px 10px; border-radius: 8px; display: flex; gap: 10px; align-items: center; position: relative; }
nav a .ic { color: var(--faint); }
nav a span.t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav a:hover { background: var(--hover); text-decoration: none; color: var(--fg); }
nav a:hover .ic { color: var(--fg-2); }
nav a.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
nav a.on .ic { color: var(--accent); }
nav a.on::before { content: ""; position: absolute; left: -14px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.badge { background: var(--critical); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 600; padding: 0 7px; line-height: 18px; min-width: 18px; text-align: center; }
.badge.neutral { background: var(--hover); color: var(--fg-2); }
.who { margin-top: auto; color: var(--muted); font-size: 13px; padding: 12px 8px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-2); display: grid; place-items: center;
          font-weight: 700; font-size: 13px; flex: none; text-transform: uppercase; }
.who b { color: var(--fg); font-weight: 600; display: block; line-height: 1.2; }
.who .grow { flex: 1; min-width: 0; }

.work { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 36px; min-height: 58px;
          background: rgba(245, 247, 250, .92); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.topbar .menu { display: none; }
.search { position: relative; flex: 1; max-width: 520px; }
.search .ic { position: absolute; left: 11px; top: 10px; color: var(--faint); pointer-events: none; }
.search input { padding-left: 36px; padding-right: 36px; background: var(--panel); }
.search kbd { position: absolute; right: 9px; top: 8px; }
kbd { font: 600 11px var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--panel); }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
           box-shadow: var(--shadow-lg); max-height: 70vh; overflow-y: auto; padding: 6px; z-index: 40; }
.results .rg { font-size: 11px; font-weight: 600; letter-spacing: .7px; text-transform: uppercase; color: var(--faint); padding: 8px 10px 4px; }
.results a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--fg-2); }
.results a:hover, .results a.on { background: var(--accent-soft); color: var(--accent-2); text-decoration: none; }
.results a .muted { margin-left: auto; font-size: 12px; }
.results .none { padding: 14px 10px; color: var(--muted); }
.live { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; white-space: nowrap; margin-left: auto; }
.live .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.live.paused .pulse { background: var(--faint); box-shadow: 0 0 0 3px var(--hover); }
main { padding: 26px 36px 64px; min-width: 0; max-width: 1480px; width: 100%; }
main:focus { outline: none; }
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-content: start; min-width: 0; }  /* one column that never grows past the screen */

/* ---- type ---- */
h1 { font-size: 22px; line-height: 1.3; font-weight: 650; margin: 0; letter-spacing: -.2px; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; color: var(--fg); }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.err { color: var(--critical); min-height: 1em; margin: 0; }
.ok-text { color: var(--success); }
.warn-text { color: var(--warning); }
.crit-text { color: var(--critical); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.wrap { white-space: normal; word-break: break-word; }
.break { word-break: break-all; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.tight { gap: 6px; }
.row.end { justify-content: flex-end; }
.stack { display: grid; gap: 12px; }
.spacer { flex: 1; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; } .m0 { margin: 0; }
.head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 20px; align-items: flex-end; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; max-width: 760px; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crumb { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--accent); }

/* ---- cards ---- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; box-shadow: var(--shadow); }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush > .panel-head { padding: 16px 20px 0; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.panel-head .muted { font-size: 13px; }
.panel.note { background: var(--soft); box-shadow: none; }
.panel.info { background: var(--info-bg); border-color: var(--info-line); box-shadow: none; }
.panel.warn { background: var(--warning-bg); border-color: var(--warning-line); box-shadow: none; }
.panel.crit { background: var(--critical-bg); border-color: var(--critical-line); box-shadow: none; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-all { grid-column: 1 / -1; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
        display: grid; gap: 2px; position: relative; min-width: 0; }
.stat b { display: block; font-size: 28px; line-height: 1.2; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--fg); }
.stat b.md { font-size: 17px; padding: 6px 0 4px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat .ic.corner { position: absolute; right: 16px; top: 16px; color: var(--faint); }
a.stat { color: inherit; }
a.stat:hover { text-decoration: none; border-color: #b9c6e4; }
.stat.crit b { color: var(--critical); } .stat.warn b { color: var(--warning); } .stat.ok b { color: var(--success); }
dl.kvlist { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.kvlist dt { color: var(--muted); font-size: 13px; }
dl.kvlist dd { margin: 0; min-width: 0; word-break: break-word; }

/* ---- tables (PADM.table) ---- */
.tablewrap { overflow-x: auto; }
.panel > .tablewrap, .panel > .tbl > .tablewrap { margin: 0 -20px -20px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.panel.flush > .tablewrap, .panel.flush > .tbl > .tablewrap { margin: 0; }
.panel > .tbl > .tbar { margin-bottom: 12px; }
.panel.flush > .tbl > .tbar, .panel.flush.tbl > .tbar { padding: 14px 20px 0; margin-bottom: 12px; }
.panel.flush.tbl > .tbar + .tablewrap, .panel.flush > .tbl > .tbar + .tablewrap { border-top: 1px solid var(--line); }
.tbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tbar input[type=search] { max-width: 280px; }
.tbar .count { color: var(--muted); font-size: 12.5px; margin-left: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child > td { border-bottom: 0; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; background: var(--soft); white-space: nowrap; }
th.num, td.num { text-align: right; }
th button.sort { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; border-radius: 4px; white-space: nowrap; }
th button.sort:focus-visible { box-shadow: var(--ring); }
th button.sort .arr { opacity: .35; font-size: 10px; }
th[aria-sort] button.sort .arr { opacity: 1; color: var(--accent); }
td { color: var(--fg-2); }
td.mono { white-space: nowrap; }
td b { color: var(--fg); }
.when { white-space: nowrap; }
tr.click { cursor: pointer; }
tbody tr:hover > td { background: #fcfcfd; }
tr.click:focus-visible { outline: 2px solid #84adff; outline-offset: -2px; }
tr.open > td { background: var(--soft); border-bottom-color: transparent; }
tr.detail > td { background: var(--soft); padding-top: 0; }
td .row { flex-wrap: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .row { justify-content: flex-end; }
.more { display: flex; justify-content: center; padding: 10px; border-top: 1px solid var(--line); }

/* ---- status ---- */
.pill { display: inline-flex; align-items: center; gap: 5px; font: 600 11px/1.6 var(--font); letter-spacing: .3px; padding: 1px 9px; border-radius: 999px;
        white-space: nowrap; border: 1px solid var(--line); background: var(--soft); color: var(--fg-2); }
.pill.INFO { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.pill.SUCCESS { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
.pill.WARNING { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-line); }
.pill.CRITICAL { background: var(--critical-bg); color: var(--critical); border-color: var(--critical-line); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.plain::before { display: none; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--faint); }
.dot.INFO { background: var(--info); } .dot.SUCCESS { background: var(--success); } .dot.WARNING { background: var(--warning); } .dot.CRITICAL { background: var(--critical); }
svg.meter { width: 100%; height: 8px; display: block; }
svg.meter .track { fill: var(--hover); } svg.meter .bar { fill: var(--accent); }
svg.meter .bar.WARNING { fill: #dc6803; } svg.meter .bar.CRITICAL { fill: var(--critical); } svg.meter .bar.SUCCESS { fill: #12b76a; }

/* ---- controls ---- */
button, .btn { font: 500 14px var(--font); border: 1px solid var(--line-2); background: var(--panel); color: var(--fg-2); border-radius: 8px;
               padding: 7px 14px; cursor: pointer; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); display: inline-flex; gap: 7px; align-items: center;
               justify-content: center; white-space: nowrap; line-height: 1.45; transition: background .12s, border-color .12s, color .12s; }
button:hover, .btn:hover { background: var(--hover); color: var(--fg); text-decoration: none; }
button:disabled, .btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button.primary:hover, .btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
button.danger, .btn.danger { color: var(--critical); border-color: var(--critical-line); }
button.danger:hover, .btn.danger:hover { background: var(--critical-bg); }
button.danger.solid { background: var(--critical); color: #fff; border-color: var(--critical); }
button.danger.solid:hover { background: #912018; }
button.ghost, .btn.ghost { border-color: transparent; box-shadow: none; background: transparent; }
button.ghost:hover, .btn.ghost:hover { background: var(--hover); }
button.sm, .btn.sm { font-size: 13px; padding: 4px 10px; border-radius: 7px; }
button.icon-btn { padding: 6px; border-color: transparent; box-shadow: none; background: transparent; color: var(--muted); }
button.icon-btn:hover { background: var(--hover); color: var(--fg); }
button.busy { position: relative; color: transparent !important; }
button.busy::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent);
                     animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
:focus-visible { outline: none; box-shadow: var(--ring); }
button:focus-visible, .btn:focus-visible, a:focus-visible, nav a:focus-visible { outline: none; box-shadow: var(--ring); }
input, select, textarea { font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px;
                          padding: 8px 11px; width: 100%; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: #84adff; outline: none; box-shadow: var(--ring); }
input[aria-invalid=true] { border-color: var(--critical); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; box-shadow: none; accent-color: var(--accent); margin: 0; }
textarea { font-family: var(--mono); font-size: 12.5px; min-height: 90px; }
select.auto, input.auto { width: auto; }
label { font-size: 13px; font-weight: 500; color: var(--fg-2); display: block; margin-bottom: 5px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.form { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.form .full { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 500; margin: 0; cursor: pointer; }
.levels { display: flex; gap: 14px; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters > div { min-width: 160px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; border-radius: 0; box-shadow: none; border-right: 1px solid var(--line-2); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 9px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--fg); background: transparent; }
.tabs button.on { color: var(--accent-2); border-bottom-color: var(--accent); font-weight: 600; }

/* customer settings: key / value rows */
.kv { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 2fr) auto; gap: 8px 10px; align-items: start; padding: 8px 0;
      border-bottom: 1px solid var(--line); }
.kv-head { padding: 0 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; }
.kv-note { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; }
.kv-note:not(:has(span:not(:empty))) { display: none; }

.secret { font-family: var(--mono); background: var(--soft); border: 1px solid var(--line); padding: 12px; border-radius: 8px; word-break: break-all;
          display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.secret code { font: inherit; flex: 1; min-width: 0; }
.secret.masked code { letter-spacing: 2px; color: var(--muted); }
pre.body { white-space: pre-wrap; word-break: break-word; font: 12.5px/1.5 var(--mono); background: var(--panel); border: 1px solid var(--line); padding: 12px;
           border-radius: 8px; margin: 8px 0 0; max-height: 360px; overflow: auto; color: var(--fg-2); }
pre.log { white-space: pre; font: 12px/1.5 var(--mono); background: #0c111d; color: #e4e7ec; padding: 12px 14px; border-radius: 8px; overflow: auto; max-height: 520px; margin: 0; }
iframe.preview { width: 100%; height: 440px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* ---- empty states and skeletons ---- */
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 36px 20px; color: var(--muted); }
.empty .em-ic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }
.empty h3 { color: var(--fg); margin: 0; font-size: 15px; }
.empty p { max-width: 460px; margin: 0; }
.empty .row { margin-top: 10px; justify-content: center; }
.skel { background: linear-gradient(90deg, #eef1f5 0%, #f7f8fa 50%, #eef1f5 100%); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; border-radius: 8px; }
.skel.line { height: 12px; margin: 8px 0; }
.skel.title { height: 26px; width: 260px; }
.skel.block { height: 110px; }
.skel.w60 { width: 60%; } .skel.w40 { width: 40%; } .skel.w80 { width: 80%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---- toasts ---- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 90; width: min(420px, calc(100vw - 32px)); }
.toast { background: #101828; color: #fff; padding: 11px 12px 11px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500;
         display: flex; gap: 10px; align-items: flex-start; animation: tin .18s ease-out; border-left: 4px solid #84adff; }
.toast.success { border-left-color: #47cd89; } .toast.error { border-left-color: #f97066; } .toast.warning { border-left-color: #fdb022; }
.toast .msg { flex: 1; min-width: 0; word-break: break-word; }
.toast button { padding: 0 4px; background: transparent; border: 0; box-shadow: none; color: #98a2b3; }
.toast button:hover { color: #fff; background: transparent; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- modals ---- */
.modal-back { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: grid; place-items: center; padding: 16px; z-index: 80; animation: fade .15s ease-out; }
.modal { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex;
         flex-direction: column; animation: pop .16s ease-out; }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 14px 20px 6px; overflow-y: auto; display: grid; gap: 12px; }
.modal-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 14px 20px 18px; }
.modal .danger-note { display: flex; gap: 10px; color: var(--critical); background: var(--critical-bg); border: 1px solid var(--critical-line); border-radius: 8px; padding: 10px 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(6px) scale(.98); opacity: 0; } }

/* ---- charts (PADM.chart) ---- */
.chart { position: relative; min-height: 120px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 11px var(--font); }
.chart .guide { stroke: var(--faint); stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--fg-2); margin-top: 8px; }
.chart .legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart .legend svg { width: 10px; height: 10px; display: inline-block; }
.chart-tip { position: absolute; pointer-events: none; background: #101828; color: #fff; font-size: 12px; padding: 8px 10px; border-radius: 8px;
             box-shadow: var(--shadow-lg); white-space: nowrap; z-index: 5; }
.chart-tip b { display: block; margin-bottom: 3px; font-weight: 600; }
.chart-tip .r { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.chart-tip .r i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.chart .noda { display: grid; place-items: center; height: 160px; color: var(--muted); }

/* ---- login ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
         background: radial-gradient(1200px 600px at 50% -10%, #e0eaff 0%, var(--bg) 60%); }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px; width: min(400px, 100%);
              display: grid; gap: 12px; box-shadow: 0 12px 32px rgba(16, 24, 40, .08); }
.login-card .brand { padding: 0 0 4px; font-size: 19px; }
.login-card .brand .mark { width: 38px; height: 38px; }
.login-card button { padding: 10px 14px; margin-top: 4px; }
.login-card .foot { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 6px; }

.scrim { display: none; }

@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  aside { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open aside { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 25; }
  nav a.on::before { display: none; }
  .topbar { padding: 8px 16px; gap: 8px; }
  .topbar .menu { display: inline-flex; }
  .search kbd, .live .lbl { display: none; }
  main { padding: 18px 16px 40px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid:has(> .stat) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat b { font-size: 24px; }
  .kv { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  th, td { padding: 9px 12px; }
  .panel { padding: 16px; }
  .panel > .tablewrap, .panel > .tbl > .tablewrap { margin: 0 -16px -16px; }
  .tbar input[type=search] { max-width: none; }
  .modal-foot button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { aside, .topbar { display: none; } .shell { display: block; } }

/* harbor: Builds & scans, Stable & releases, Robots (pages/harbor.js) */
.sev { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.sev b, .sevtag { font: 600 11px/1.7 var(--font); padding: 0 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--soft); color: var(--fg-2); white-space: nowrap; }
.sev b.c, .sevtag.c { background: var(--critical-bg); color: var(--critical); border-color: var(--critical-line); }
.sev b.h, .sevtag.h { background: #fff4ed; color: #c4320a; border-color: #f9dbaf; }
.sev b.m, .sevtag.m { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-line); }
.sev b.l, .sevtag.l { background: var(--hover); color: #475467; border-color: var(--line-2); }
.sev b.ok { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
svg.sevbar { display: block; width: 100%; max-width: 180px; height: 6px; margin-top: 6px; border-radius: 3px; overflow: hidden; background: var(--hover); }
svg.sevbar .c { fill: #d92d20; } svg.sevbar .h { fill: #ef6820; } svg.sevbar .m { fill: #f79009; } svg.sevbar .l { fill: #98a2b3; } svg.sevbar .u { fill: #d0d5dd; }
tr.del > td { background: #fffbfa; }
tr.del > td:first-child { box-shadow: inset 3px 0 0 var(--critical); }
tr.warnrow > td:first-child { box-shadow: inset 3px 0 0 #f79009; }
.robot-detail { padding: 6px 0 4px; }
.robot-detail .row { flex-wrap: wrap; }
.pick { display: grid; gap: 6px; max-height: 46vh; overflow-y: auto; }
.pick label { display: flex; gap: 10px; align-items: center; margin: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 400; }
.pick label:hover { background: var(--soft); }
.pick label:has(input:checked) { border-color: #84adff; background: var(--accent-soft); box-shadow: var(--ring); }
.pick label.cur .mono { color: var(--success); }
.pick .grow { flex: 1; min-width: 0; }
ul.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
ul.checks li { display: grid; grid-template-columns: auto minmax(140px, max-content) 1fr; gap: 10px; align-items: start; padding: 8px 10px; border-radius: 8px; background: var(--soft); }
ul.checks li.ok .ic { color: var(--success); }
ul.checks li.bad { background: var(--critical-bg); }
ul.checks li.bad .ic { color: var(--critical); }
ul.checks li span { color: var(--fg-2); word-break: break-word; }
ul.rel-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ul.rel-list li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
ul.rel-list li a { min-width: 110px; }
.center { text-align: center; }
.filters .seg button { padding: 7px 11px; }
.tbar .seg { max-width: 100%; overflow-x: auto; }
.tbar .seg button { flex: none; }
.panel.banner { flex-wrap: nowrap; align-items: flex-start; }
.panel.banner > .ic { margin-top: 2px; }
@media (max-width: 900px) {
  ul.checks li { grid-template-columns: auto 1fr; }
  ul.checks li span { grid-column: 2; }
}
