:root {
  --ink: #e8f0f2;
  --muted: #8ea0a6;
  --surface: rgba(19, 29, 33, 0.9);
  --surface-2: rgba(28, 41, 46, 0.86);
  --line: rgba(173, 207, 214, 0.14);
  --accent: #69e1c1;
  --accent-dark: #183e38;
  --warning: #f1c66b;
  --danger: #ff7c86;
  --ok: #69e1c1;
  --unknown: #9aa8ad;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #0b1114;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 20% 10%, #15342e 0, transparent 32%), #0b1114; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(105, 225, 193, 0.42); outline-offset: 2px; }

.ambient { position: fixed; width: 28rem; height: 28rem; border-radius: 50%; filter: blur(110px); opacity: .12; pointer-events: none; }
.ambient-one { background: #29d9b0; top: -10rem; right: -8rem; }
.ambient-two { background: #4a7fff; bottom: -14rem; left: -10rem; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.login-card { width: min(28rem, 100%); padding: 2.6rem; border: 1px solid var(--line); border-radius: 1.4rem; background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.eyebrow { color: var(--accent); font-size: .72rem; letter-spacing: .16em; font-weight: 800; margin: 0 0 .65rem; }
h1, h2, h3 { letter-spacing: -.035em; margin-top: 0; }
h1 { font-size: clamp(2.4rem, 7vw, 4rem); margin-bottom: .6rem; }
h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
.lede { color: var(--muted); line-height: 1.6; margin-bottom: 2rem; }
.stack { display: grid; gap: 1rem; }
label { display: grid; gap: .45rem; color: #c5d1d4; font-size: .88rem; font-weight: 650; }
input, select { width: 100%; color: var(--ink); background: #0e171a; border: 1px solid var(--line); border-radius: .7rem; padding: .78rem .88rem; }

.primary, .ghost, .danger-button, nav button { border: 0; border-radius: .65rem; padding: .68rem .88rem; color: var(--ink); background: transparent; }
.primary { color: #071512; background: var(--accent); font-weight: 800; }
.primary:hover { filter: brightness(1.08); }
.ghost { border: 1px solid var(--line); }
.danger-button { color: #2b080c; background: var(--danger); font-weight: 750; }

.topbar { position: sticky; top: 0; z-index: 10; min-height: 4.5rem; display: flex; align-items: center; gap: 1.5rem; padding: .8rem 1.4rem; border-bottom: 1px solid var(--line); background: rgba(11, 17, 20, .88); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; min-width: 12rem; }
.brand-mark { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: .65rem; color: #071512; background: var(--accent); font-size: .78rem; font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: .7rem; margin-top: .12rem; }
nav { display: flex; gap: .2rem; flex: 1; overflow-x: auto; }
nav button { color: var(--muted); white-space: nowrap; }
nav button.active, nav button:hover { color: var(--ink); background: var(--surface-2); }
.session { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .85rem; }

.workspace { width: min(92rem, 100%); margin: 0 auto; padding: 2.2rem 1.4rem 5rem; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.5rem; }
.page-head p { color: var(--muted); margin: .25rem 0 0; }
.filter-control { width: min(20rem, 100%); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.section-head h3 { margin-bottom: 0; }
.prerequisite { max-width: 76rem; line-height: 1.55; margin: -.15rem 0 1rem; }
[data-filter-item][hidden] { display: none !important; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.metric { border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); padding: 1rem; }
.metric span { color: var(--muted); font-size: .78rem; }
.metric strong { display: block; margin-top: .3rem; font-size: 1.8rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.card { border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); padding: 1.1rem; box-shadow: 0 12px 45px rgba(0,0,0,.14); }
.card-head { display: flex; justify-content: space-between; gap: .8rem; align-items: start; }
.card h3 { margin-bottom: .3rem; }
.meta { color: var(--muted); font-size: .82rem; }
.button-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.status { display: inline-flex; align-items: center; gap: .38rem; border-radius: 999px; padding: .34rem .58rem; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.status::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.status.available, .status.running, .status.succeeded, .status.recovered { color: var(--ok); background: rgba(105,225,193,.1); }
.status.degraded, .status.starting, .status.stopping, .status.pending, .status.acknowledged, .status.warning { color: var(--warning); background: rgba(241,198,107,.1); }
.status.unavailable, .status.failed, .status.stopped, .status.active, .status.critical { color: var(--danger); background: rgba(255,124,134,.1); }
.status.unknown { color: var(--unknown); background: rgba(154,168,173,.1); }

.panel { border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); padding: 1.2rem; margin-top: 1.1rem; overflow-x: auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .8rem; align-items: end; }
.form-grid button { min-height: 2.8rem; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { text-align: left; padding: .75rem .65rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }
.message { border: 1px solid var(--line); border-radius: .75rem; padding: .8rem 1rem; margin-bottom: 1rem; background: var(--surface-2); }
.message.error { color: #ffd6da; border-color: rgba(255,124,134,.35); }
.empty { color: var(--muted); text-align: center; padding: 2.5rem 1rem; }
.mono { font: .78rem ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }

dialog { width: min(70rem, calc(100% - 2rem)); max-height: calc(100vh - 2rem); color: var(--ink); background: #101a1e; border: 1px solid var(--line); border-radius: 1rem; box-shadow: var(--shadow); padding: 1.3rem; overflow: auto; }
dialog::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(6px); }
.dialog-head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }

@media (max-width: 850px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  nav { order: 3; flex-basis: 100%; }
  .session { margin-left: auto; }
  .page-head, .section-head { align-items: start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
