/* ============================================================================
   Operator admin of Aist Compute (docs/architecture.md, 14).
   Aist design system, product mode: tokens in aist/core.css, aist/semantic.css,
   aist/product.css are verbatim copies of pankratsamsung/aist-design-system
   (commit ab76ba8) — do not edit them, copy them again on update. Everything
   below uses only role tokens (--color-*, --radius-*, --font-*, --fs-*).
   Fonts: Geist and Geist Mono, self-hosted (npm geist 1.9.2, SIL OFL 1.1,
   ../fonts/OFL.txt). Nothing is loaded from other servers.
   ========================================================================== */

@font-face { font-family: "Geist"; src: url("/assets/Geist-Variable-28ba82b0.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/assets/GeistMono-Variable-f0716b79.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font: var(--prod-body-size)/var(--lh-normal) var(--font-sans);
  overflow-wrap: anywhere;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: var(--prod-heading-weight); }
p { margin: 0; }
code, .mono { font-family: var(--font-mono); font-size: 0.93em; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }

/* ---- Frame: sidebar + content (>= 1024px), top bar + menu (< 1024px) ------ */
.adm { display: flex; min-height: 100vh;
  /* the sidebar column runs the full page height even when the sidebar itself is sticky */
  background: linear-gradient(to right, var(--color-surface-2) 247px, var(--color-border) 247px, var(--color-border) 248px, transparent 248px); }
.adm-side {
  position: sticky; top: 0; flex: 0 0 248px; height: 100vh;
  display: flex; flex-direction: column; gap: 20px; padding: 22px 16px 18px;
  background: var(--color-surface-2); border-right: 1px solid var(--color-border);
}
@media (max-width: 1023px) { .adm { background: none; } }
.adm-main {
  flex: 1; min-width: 0; padding: 32px 40px 56px;
  background: var(--prod-bg-image);
}
.adm-content { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--color-text); }
.brand svg { width: 64px; height: auto; display: block; }
.brand-label {
  font: 500 var(--fs-3xs)/1 var(--font-mono); letter-spacing: var(--tracking-caps-x);
  text-transform: uppercase; color: var(--color-text-3);
}
.brand-label b { display: block; margin-top: 4px; color: var(--color-accent); font-weight: 500; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: var(--radius-sm); text-decoration: none; color: var(--color-text-2);
}
.nav a:hover { background: var(--color-hover); color: var(--color-text); }
.nav a[aria-current="page"] { background: var(--color-surface); color: var(--color-text); box-shadow: inset 0 0 0 1px var(--color-border); }
.nav a[aria-current="page"] .nav-dot { background: var(--color-accent); }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-border-strong); flex: none; }
.nav-count { margin-left: auto; font: 500 var(--fs-2xs)/1 var(--font-mono); color: var(--color-danger-text); }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--color-border); }
.who { font-size: var(--fs-sm); color: var(--color-text-2); }
.who b { display: block; color: var(--color-text); font-weight: 600; }

.topbar { display: none; }

@media (max-width: 1023px) {
  .adm { display: block; }
  .adm-side { display: none; }
  .topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
    height: 52px; padding: 0 16px; background: var(--color-surface-2); border-bottom: 1px solid var(--color-border);
  }
  .topbar .brand svg { width: 52px; }
  .menu > summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--color-border-strong);
    background: var(--color-surface); font-weight: 500;
  }
  .menu > summary::-webkit-details-marker { display: none; }
  .menu[open] > summary { border-color: var(--color-text); }
  .menu-panel {
    position: fixed; left: 0; right: 0; top: 52px; bottom: 0; z-index: 30; overflow-y: auto;
    padding: 16px; display: flex; flex-direction: column; gap: 16px; background: var(--color-surface-2);
  }
  .menu-panel .nav a { padding: 12px; font-size: var(--fs-md); }
  .adm-main { padding: 20px 16px 48px; background: var(--color-bg); }
}

/* ---- Page head -------------------------------------------------------------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.page-head h1 { font-size: var(--prod-h1-size); line-height: var(--lh-snug); letter-spacing: var(--tracking-tight); }
.page-head .sub { margin-top: 6px; color: var(--color-text-2); }
.eyebrow {
  font: 500 var(--fs-2xs)/1 var(--font-mono); letter-spacing: var(--tracking-caps);
  text-transform: uppercase; color: var(--color-text-3);
}
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { color: var(--color-text); }
.page-head .eyebrow { margin-bottom: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 1023px) { .page-head h1 { font-size: 26px; } }

/* ---- Cards and sections -------------------------------------------------------- */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--prod-radius-card); padding: 20px;
}
.card.flush { padding: 0; overflow: hidden; }
.section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.section-head h2 { font-size: var(--fs-xl); }
.section-head .hint { color: var(--color-text-3); font-size: var(--fs-sm); }
.card h3 { font-size: var(--fs-lg); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1023px) { .grid-2 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stat { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--radius-md);
  background: var(--color-surface); border: 1px solid var(--color-border); min-width: 0; }
.stat-value { font-size: var(--fs-3xl); font-weight: 700; letter-spacing: var(--tracking-tight); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-value small { font-size: var(--fs-sm); font-weight: 500; color: var(--color-text-3); letter-spacing: 0; }
.stat-sub { font-size: var(--fs-sm); color: var(--color-text-2); }
.bar { height: 6px; border-radius: var(--radius-full); background: var(--color-chip); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--color-text-2); border-radius: inherit; }
/* Bar widths in 5 % steps (no inline styles under the CSP). */
.bar i.w-0 { width: 0%; } .bar i.w-5 { width: 5%; } .bar i.w-10 { width: 10%; } .bar i.w-15 { width: 15%; } .bar i.w-20 { width: 20%; }
.bar i.w-25 { width: 25%; } .bar i.w-30 { width: 30%; } .bar i.w-35 { width: 35%; } .bar i.w-40 { width: 40%; } .bar i.w-45 { width: 45%; }
.bar i.w-50 { width: 50%; } .bar i.w-55 { width: 55%; } .bar i.w-60 { width: 60%; } .bar i.w-65 { width: 65%; } .bar i.w-70 { width: 70%; }
.bar i.w-75 { width: 75%; } .bar i.w-80 { width: 80%; } .bar i.w-85 { width: 85%; } .bar i.w-90 { width: 90%; } .bar i.w-95 { width: 95%; }
.bar i.w-100 { width: 100%; }
.bar.is-warn i { background: var(--color-warn); }
.bar.is-danger i { background: var(--color-danger); }

/* ---- Key / value list ---------------------------------------------------------- */
.kv { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 10px 20px; margin: 0; }
.kv dt { color: var(--color-text-3); font-size: var(--fs-sm); padding-top: 1px; }
.kv dd { margin: 0; min-width: 0; }
@media (max-width: 639px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 10px; } }

/* ---- Tags (state; they do nothing) ------------------------------------------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: var(--radius-xs);
  background: var(--color-chip); color: var(--color-text-2);
  font: 500 var(--fs-2xs)/1.3 var(--font-mono); letter-spacing: var(--tracking-wide); text-transform: uppercase; white-space: nowrap;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--color-text-3); }
.tag.plain::before { display: none; }
.tag.is-ok { background: var(--color-ok-bg); color: var(--color-ok-text); }
.tag.is-ok::before { background: var(--color-ok); }
.tag.is-warn { background: var(--color-warn-bg); color: var(--color-warn-text); }
.tag.is-warn::before { background: var(--color-warn); }
.tag.is-danger { background: var(--color-danger-bg); color: var(--color-danger-text); }
.tag.is-danger::before { background: var(--color-danger); }
.tag.is-info { background: var(--color-info-bg); color: var(--color-info-text); }
.tag.is-info::before { background: var(--color-info); }

/* ---- Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 7px 14px;
  border-radius: var(--prod-radius-control); border: 1px solid var(--color-border-strong);
  background: var(--color-surface); color: var(--color-text); font: 500 var(--fs-base)/1.2 var(--font-sans);
  text-decoration: none; cursor: pointer; white-space: nowrap; overflow-wrap: normal;
  transition: border-color var(--aist-dur-fast) var(--aist-ease), background var(--aist-dur-fast) var(--aist-ease);
}
.btn:hover { border-color: var(--color-border-hover); }
.btn-primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-on-accent); }
.btn-primary:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }
.btn-danger { color: var(--color-danger-text); }
.btn-danger:hover { border-color: var(--color-danger); }
.btn-danger.solid { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.btn-text { border-color: transparent; background: transparent; padding-left: 8px; padding-right: 8px; color: var(--color-text-2); }
.btn-text:hover { color: var(--color-text); border-color: transparent; background: var(--color-hover); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: var(--fs-sm); }
.btn-block { width: 100%; }
.btn[disabled] { background: var(--color-chip); border-color: transparent; color: var(--color-text-3); cursor: not-allowed; }
form.inline { display: inline; margin: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Confirm without confirm(): a disclosure that reveals the real button. */
.confirm { display: inline-block; position: relative; }
.confirm > summary { list-style: none; }
.confirm > summary::-webkit-details-marker { display: none; }
.confirm[open] > summary { border-color: var(--color-text); }
.confirm-panel {
  margin-top: 8px; padding: 14px; border-radius: var(--radius-md); background: var(--color-surface);
  border: 1px solid var(--color-border-strong); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; gap: 10px; width: min(340px, calc(100vw - 32px));
  position: absolute; z-index: 10; right: 0;
}
.confirm-panel p { color: var(--color-text-2); font-size: var(--fs-sm); }
.btn-row .confirm:first-child .confirm-panel { right: auto; left: 0; }

/* ---- Forms --------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .label { font-weight: 500; font-size: var(--fs-sm); }
.field .hint { color: var(--color-text-3); font-size: var(--fs-sm); }
.input, .textarea {
  width: 100%; padding: 9px 12px; border-radius: var(--prod-radius-control); border: 1px solid var(--color-border-strong);
  background: var(--color-surface); color: var(--color-text); font: var(--fs-md)/1.4 var(--font-sans);
}
.input.mono, .textarea.mono { font-family: var(--font-mono); font-size: var(--fs-base); }
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .textarea:focus { outline: none; border-color: var(--color-text); box-shadow: 0 0 0 3px var(--color-accent-tint); }
.input.otp { font: 600 var(--fs-3xl)/1 var(--font-mono); letter-spacing: 0.3em; text-align: center; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-row .field { flex: 1 1 180px; }
.errors { color: var(--color-danger-text); font-size: var(--fs-sm); }

/* Segmented choice: radios styled as pills (no native select). */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: var(--radius-sm); background: var(--color-chip); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: var(--fs-sm); color: var(--color-text-2); font-weight: 500; }
.seg label small { color: var(--color-text-3); font-weight: 400; margin-left: 4px; }
.seg input:checked + label { background: var(--color-surface); color: var(--color-text); box-shadow: 0 0 0 1px var(--color-border-strong); }
.seg input:focus-visible + label { outline: 2px solid var(--color-focus-ring); }
.choice-list { display: flex; flex-direction: column; gap: 6px; }
.choice-list label { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); cursor: pointer; }
.choice-list label:has(input:checked) { border-color: var(--color-text); }

/* ---- Tables (cards below 640px) -------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--prod-body-size); }
.table th {
  text-align: left; padding: 10px 14px; background: var(--color-surface-2); color: var(--color-text-3);
  font: 500 var(--fs-2xs)/1.2 var(--font-mono); letter-spacing: var(--tracking-wide); text-transform: uppercase; white-space: nowrap;
  border-bottom: 1px solid var(--color-border);
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--color-border-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--color-hover); }
.table .main a { font-weight: 600; text-decoration: none; }
.table td { overflow-wrap: normal; }
.table time, .table a, .table .tag, .table .mono.muted { white-space: nowrap; }
.table .main a:hover { text-decoration: underline; }
.table .muted, .muted { color: var(--color-text-3); }
.table .right { text-align: right; }
.table .mono { font-size: var(--fs-sm); }
@media (max-width: 639px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 14px; border-bottom: 1px solid var(--color-border); }
  .table tr:last-child { border-bottom: 0; }
  .table td { padding: 3px 0; border: 0; display: flex; gap: 10px; justify-content: space-between; }
  .table td::before { content: attr(data-label); color: var(--color-text-3); font-size: var(--fs-sm); flex: none; }
  .table td.main { font-size: var(--fs-md); }
  .table td.main::before { display: none; }
  .table td > * { text-align: right; }
  .table td.main > * { text-align: left; }
  .table .right { text-align: right; }
}

/* ---- Notices, flash, empty states ----------------------------------------------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); background: var(--color-surface); }
.alert-mark { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--color-text-3); }
.alert.is-warn { border-color: color-mix(in srgb, var(--color-warn) 45%, transparent); background: var(--color-warn-bg); }
.alert.is-warn .alert-mark { background: var(--color-warn); }
.alert.is-danger { border-color: color-mix(in srgb, var(--color-danger) 45%, transparent); background: var(--color-danger-bg); }
.alert.is-danger .alert-mark { background: var(--color-danger); }
.alert.is-ok { background: var(--color-ok-bg); border-color: transparent; }
.alert.is-ok .alert-mark { background: var(--color-ok); }
.alert-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.alert-body b { font-weight: 600; }
.alert-meta { font-size: var(--fs-sm); color: var(--color-text-2); }
.alerts { display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 10px 14px; border-radius: var(--radius-md); background: var(--color-ok-bg); color: var(--color-ok-text); font-weight: 500; }
.flash.is-error { background: var(--color-danger-bg); color: var(--color-danger-text); }
.empty { padding: 18px; text-align: center; color: var(--color-text-3); }

/* ---- Secret-ish values ---------------------------------------------------------------- */
.reveal { display: inline; }
.reveal > summary { display: inline; cursor: pointer; color: var(--color-text-2); font-size: var(--fs-sm); list-style: none; text-decoration: underline dotted; }
.reveal > summary::-webkit-details-marker { display: none; }
.reveal[open] > summary { display: none; }
.secret-box { display: flex; flex-direction: column; gap: 6px; }
.secret-box code {
  display: block; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--color-surface-2);
  border: 1px solid var(--color-border); word-break: break-all; font-size: var(--fs-sm); user-select: all;
}
.callout { padding: 14px 16px; border-radius: var(--radius-md); background: var(--color-accent-tint); color: var(--color-text); }

/* ---- Pagination and filters -------------------------------------------------------- */
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.7fr) auto; gap: 12px; align-items: end;
  padding: 16px; border-radius: var(--radius-md); background: var(--color-surface-2); border: 1px solid var(--color-border); }
@media (max-width: 1023px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .filters { grid-template-columns: 1fr; } }
/* Two dates side by side; wide enough for the ГГГГ-ММ-ДД placeholder at 1280 px (P5). */
.date-range { display: flex; gap: 6px; }
.date-range .input { flex: 1 1 0; min-width: 0; padding-left: 10px; padding-right: 10px; }
.kv dt.key-name { color: var(--color-text); }
.stat-value.is-md { font-size: var(--fs-xl); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--color-text-3); font-size: var(--fs-sm); }

/* ---- Sign-in -------------------------------------------------------------------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--prod-bg-image); }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 22px; padding: 28px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--prod-radius-panel); }
.login-card h1 { font-size: var(--fs-3xl); letter-spacing: var(--tracking-tight); }
.login-card .sub { color: var(--color-text-2); margin-top: 6px; }
.login-card.wide { width: min(520px, 100%); }
.qr { display: flex; justify-content: center; padding: 14px; background: #fff; border-radius: var(--radius-md); border: 1px solid var(--color-border); }
.qr svg { width: 200px; height: 200px; display: block; }
.steps { margin: 0; padding-left: 20px; color: var(--color-text-2); display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 1023px) { .login { background: var(--color-bg); } }

/* ---- Phase 3: versions, addresses, copies, abuse, recovery keys ------------------------ */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.dns-record { display: grid; grid-template-columns: auto auto 1fr; gap: 4px 14px; align-items: baseline;
  padding: 10px 12px; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  font-family: var(--font-mono); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.dns-record b { font-weight: 600; }
.check-row { display: flex; gap: 8px; align-items: flex-start; }
.check-row input { margin-top: 3px; }
.note { color: var(--color-text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.report-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.inline-forms { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* Larger confirm forms (rollback, restore, block) open in the flow, not as a popover: a popover inside
   .table-wrap (overflow-x: auto) is cut off. */
.confirm.is-block { display: block; }
.confirm.is-block .confirm-panel { position: static; width: auto; max-width: 480px; }
.table td .confirm.is-block .confirm-panel { min-width: min(320px, calc(100vw - 64px)); }
.table .id-wrap { white-space: normal; overflow-wrap: anywhere; }
