/* Shared styles for all UI pages — the "control plane" design system.

   The whole palette is derived from the tokens in :root, so a future light
   theme is just a second :root block away; component rules must never
   hardcode a color. Monospace carries all technical/numeric data (refs,
   counts, metrics, lock keys) — that is where a deploy tool earns character. */
:root {
  color-scheme: dark;

  --bg:            #0b0e13;
  --bg-grad-a:     #11161e;
  --bg-grad-b:     #0a0d12;
  --panel:         #12171f;
  --panel-2:       #161c26;
  --border:        #222b37;
  --border-strong: #303b4a;

  --fg:        #e8eef6;
  --fg-muted:  #93a1b3;
  --fg-dim:    #5b6675;

  --accent:      #36d6a8;          /* spring-teal: "go / healthy" */
  --accent-deep: #1d9c7a;
  --accent-glow: rgba(54, 214, 168, 0.22);

  --ok:   #3fb950;
  --warn: #d6a022;
  --err:  #f8645a;

  --ok-soft:   rgba(63, 185, 80, 0.14);
  --warn-soft: rgba(214, 160, 34, 0.15);
  --err-soft:  rgba(248, 100, 90, 0.14);

  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 1px 0 rgba(255, 255, 255, 0.02) inset,
               0 8px 24px -12px rgba(0, 0, 0, 0.7);

  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--fg);
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--accent-glow), transparent 60%),
    linear-gradient(180deg, var(--bg-grad-a), var(--bg-grad-b) 40%, var(--bg));
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Faint grain / scanline texture for depth without imagery. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: repeating-linear-gradient(
    0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

/* Hide the page until Vue has compiled the in-DOM template, preventing a
   flash of the raw, un-compiled markup (literal {{ }} bindings, v-if/v-for
   elements) while the page's JS module is still loading. Each mount root
   (#app) carries the v-cloak attribute; Vue removes it automatically once
   .mount() finishes, revealing the compiled page. */
[v-cloak] {
  display: none;
}

main {
  position: relative;
  z-index: 1;
  padding: 1.8rem 1.6rem 3rem;
  max-width: 76rem;
  margin: 0 auto;
}

/* Mono carries the technical/numeric data throughout. */
code, .mono { font-family: var(--mono); }

/* Section eyebrow above a page or panel group. */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin: 0 0 0.9rem;
}

/* ───────── top bar / navigation ───────── */

.shell-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.6rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(22, 28, 38, 0.7), rgba(18, 23, 31, 0.4));
  backdrop-filter: blur(8px);
}

.shell-header nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-right: 0.6rem;
}

.brand .mark {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 0 12px var(--accent-glow);
}

.shell-header nav a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.3rem 0;
  position: relative;
  transition: color 0.15s;
}

.shell-header nav a:hover { color: var(--fg); }
.shell-header nav a.active { color: var(--fg); }

.shell-header nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.75rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  box-shadow: 0 0 10px var(--accent-glow);
}

.whoami {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--fg-muted);
  font-size: 0.88rem;
}

/* Username in the header doubles as the link to the profile page. */
.whoami-user {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 0.18rem 0.5rem 0.18rem 0.18rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.whoami-user:hover { color: var(--fg); border-color: var(--border-strong); background: var(--panel); }
.whoami-user.active { color: var(--fg); border-color: var(--accent); }

.whoami-avatar {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #06281e;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ───────── flash messages ───────── */

.flash {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.flash-info    { background: rgba(54, 214, 168, 0.10); color: var(--accent); }
.flash-success { background: var(--ok-soft);   color: var(--ok); }
.flash-error   { background: var(--err-soft);  color: var(--err); }

.flash-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: inherit;
  padding: 0 0.25rem;
}

/* ───────── panels / cards ───────── */

.card, .panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* Panel with a header row (title left, hint right). */
.panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 1.1rem;
}

.panel > header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.panel > header .hint {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--fg-dim);
}

/* ───────── forms ───────── */

label {
  display: block;
  margin: 0.75rem 0 0.25rem;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

input, select, textarea {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--fg);
  min-width: 16rem;
  box-sizing: border-box;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

button {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-deep);
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #06281e;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, border-color 0.15s;
}

button:hover { filter: brightness(1.08); }

button.secondary {
  background: var(--panel-2);
  color: var(--fg);
  border-color: var(--border-strong);
  font-weight: 500;
}

button.secondary:hover { border-color: var(--accent); filter: none; }

button.danger {
  background: var(--panel-2);
  color: var(--err);
  border-color: rgba(248, 100, 90, 0.4);
  font-weight: 500;
}

button.danger:hover { background: var(--err-soft); filter: none; }

button:disabled { opacity: 0.5; cursor: default; filter: none; }

.form-actions { margin-top: 1rem; }

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

/* ───────── tables ───────── */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th {
  text-align: left;
  font-weight: 600;
  color: var(--fg-dim);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 0.4rem 0.6rem;
}

td {
  padding: 0.62rem 0.4rem;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

td.mono { font-family: var(--mono); }
.app-cell { font-weight: 550; }
.when { color: var(--fg-dim); font-family: var(--mono); font-size: 0.8rem; }

td .row-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

td .row-actions button { padding: 0.2rem 0.55rem; font-size: 0.82rem; }

.muted { color: var(--fg-muted); }
.error-text { color: var(--err); margin: 0.5rem 0 0; }

summary { cursor: pointer; }
/* A <details class="card"> reads as a collapsible section with a heading. */
details.card > summary {
  font-weight: 650;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
details.card[open] > summary { margin-bottom: 0.6rem; }

details pre {
  margin: 0.4rem 0 0;
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.85rem;
}

.status-ok   { color: var(--ok); }
.status-err  { color: var(--err); }
.status-warn { color: var(--warn); }

/* ───────── badges ───────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-family: var(--mono);
  border: 1px solid var(--border-strong);
  color: var(--fg-muted);
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.ok   { color: var(--ok);   border-color: rgba(63, 185, 80, 0.4);  background: var(--ok-soft); }
.badge.bad  { color: var(--err);  border-color: rgba(248, 100, 90, 0.4); background: var(--err-soft); }
.badge.warn { color: var(--warn); border-color: rgba(214, 160, 34, 0.4); background: var(--warn-soft); }

.pager, .pager .pager-inner {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}

/* ───────── usage meters (dashboard) ───────── */

.meter { margin: 0 0 1.15rem; }
.meter:last-child { margin-bottom: 0.2rem; }
.meter .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}
.meter .label { font-size: 0.82rem; color: var(--fg-muted); letter-spacing: 0.01em; }
.meter .value { font-family: var(--mono); font-size: 0.8rem; color: var(--fg-muted); }
.meter .pct {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
  margin-left: 0.55rem;
}

.track {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: #0c1118;
  box-shadow: inset 0 0 0 1px var(--border);
}
.fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  box-shadow: 0 0 12px var(--accent-glow);
  transform-origin: left;
  animation: grow 0.9s cubic-bezier(.2, .8, .2, 1) both;
}
.fill.warn { background: linear-gradient(90deg, #9a7415, var(--warn)); box-shadow: 0 0 12px var(--warn-soft); }
.fill.crit { background: linear-gradient(90deg, #b53029, var(--err)); box-shadow: 0 0 12px var(--err-soft); }
@keyframes grow { from { transform: scaleX(0); } }

.substats {
  display: flex;
  gap: 1.6rem;
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}
.substats .stat .k {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.substats .stat .v { font-family: var(--mono); font-size: 1.0rem; color: var(--fg); margin-top: 0.2rem; }

/* ───────── service health tiles ───────── */

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
.tile {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--border);
}
.tile .name { font-size: 0.86rem; }
.tile .state { margin-left: auto; font-family: var(--mono); font-size: 0.76rem; color: var(--fg-muted); }

.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.dot.ok   { background: var(--ok);     box-shadow: 0 0 0 3px var(--ok-soft); animation: pulse 2.4s ease-in-out infinite; }
.dot.warn { background: var(--warn);   box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.err  { background: var(--err);    box-shadow: 0 0 0 3px var(--err-soft); }
.dot.idle { background: var(--fg-dim); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }

/* Degraded panel: when the agent is unreachable, host facts are UNKNOWN, not
   failing — render them muted/striped, never red, so the dashboard does not
   misleadingly read as "all services down". */
.panel.degraded .track, .panel.degraded .tiles { opacity: 0.5; filter: grayscale(0.6); }
.panel.degraded .fill { background: var(--border-strong); box-shadow: none; animation: none; }
.unavail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  border: 1px solid rgba(214, 160, 34, 0.35);
  color: #f0c560;
  font-size: 0.82rem;
}

/* ───────── counters ───────── */

.counters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin-bottom: 1.4rem; }
.counter {
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.counter .n { font-family: var(--mono); font-size: 1.7rem; font-weight: 650; letter-spacing: -0.02em; }
.counter .n.accent { color: var(--accent); }
.counter .n.warn { color: var(--warn); }
.counter .l { font-size: 0.78rem; color: var(--fg-muted); margin-top: 0.15rem; }

/* ───────── responsive grids ───────── */

.grid { display: grid; gap: 1.1rem; }
.grid.cols-3 { grid-template-columns: 1.4fr 1fr; }
@media (max-width: 860px) {
  .grid.cols-3 { grid-template-columns: 1fr; }
  .counters { grid-template-columns: repeat(2, 1fr); }
}

/* ───────── container resource table (dashboard) ───────── */

.ctable td { padding: 0.7rem 0.5rem; }
.ctable .svc { font-family: var(--mono); font-size: 0.8rem; color: var(--fg-muted); }
.res { display: flex; flex-direction: column; gap: 0.32rem; min-width: 7.5rem; }
.res .rv { font-family: var(--mono); font-size: 0.8rem; color: var(--fg-muted); }
.res .rv b { color: var(--fg); font-weight: 600; }
.res .rb { height: 5px; border-radius: 999px; background: #0c1118; box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.res .rf { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); }
.res .rf.warn { background: linear-gradient(90deg, #9a7415, var(--warn)); }
.res .rf.crit { background: linear-gradient(90deg, #b53029, var(--err)); }
.res.none .rv { color: var(--fg-dim); }
tr.hot td { background: linear-gradient(90deg, var(--err-soft), transparent 70%); }
tr.hot .app-cell { color: var(--err); }

/* ───────── active locks list ───────── */

.lock {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}
.lock:first-of-type { border-top: none; }
.lock .key { font-family: var(--mono); color: var(--accent); }
.lock .held { margin-left: auto; color: var(--fg-dim); font-family: var(--mono); font-size: 0.78rem; }

/* Orchestrated page-load: staggered reveal of the top-level sections. */
.reveal { opacity: 0; transform: translateY(8px); animation: rise 0.55s cubic-bezier(.2, .8, .2, 1) forwards; }
.reveal:nth-child(1) { animation-delay: 0.02s; }
.reveal:nth-child(2) { animation-delay: 0.08s; }
.reveal:nth-child(3) { animation-delay: 0.14s; }
.reveal:nth-child(4) { animation-delay: 0.20s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ───────── update-available banner ───────── */

.update-banner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(54, 214, 168, 0.35);
  background: rgba(54, 214, 168, 0.08);
  color: var(--fg);
  text-decoration: none;
  font-size: 0.88rem;
}
.update-banner:hover { border-color: var(--accent); }

/* ───────── apps overview ───────── */

.apps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.apps-head .eyebrow { margin: 0; }

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(28rem, 1fr));
  gap: 1.1rem;
}

.url-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.url-chip {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
}
.url-chip:hover { border-color: var(--accent); }

/* App View/Edit header: title block left, the cross-link action right. */
.app-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.app-head-text h2 { margin: 0; }
.app-head .repo-line { margin: 0.4rem 0 0; word-break: break-all; font-size: 0.82rem; }
.head-action { flex: 0 0 auto; text-decoration: none; }

.stage-block { margin: 0 0 1rem; }
.stage-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
}

/* ───────── resource cards ───────── */

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(24rem, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.5rem;
}
.resource-grid .card { margin-bottom: 0; }
/* The Caddy routing card carries more columns — let it span the full width. */
.resource-card.wide { grid-column: 1 / -1; }
.resource-card { transition: border-color 0.15s; }
.resource-card:hover { border-color: var(--border-strong); }

.resource-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
.resource-head h2 { margin: 0; }
.resource-head .hint {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--fg-dim);
}
.resource-glyph {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(54, 214, 168, 0.35);
}

/* ───────── field-help tooltip ───────── */

.field-help { position: relative; display: inline-block; }
.field-help-btn {
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  width: 1.05rem;
  height: 1.05rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--panel-2);
  color: var(--fg-muted);
  cursor: pointer;
  vertical-align: middle;
}
.field-help-btn:hover { border-color: var(--accent); color: var(--fg); filter: none; }
.field-help-pop {
  position: absolute;
  z-index: 60;
  left: 0;
  top: calc(100% + 0.5rem);
  width: max-content;
  max-width: 18rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  color: var(--fg-muted);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.45;
  white-space: normal;
}
/* Keep the popover on-screen at the right viewport edge. */
.field-help-pop { right: auto; }
@media (max-width: 480px) { .field-help-pop { left: auto; right: 0; } }
.field-help-pop code { font-size: 0.92em; color: var(--fg); }
/* Arrow. */
.field-help-pop::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0.4rem;
  width: 8px;
  height: 8px;
  background: var(--panel-2);
  border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong);
  transform: rotate(45deg);
}

/* ───────── create wizard ───────── */

.wizard-steps {
  list-style: none;
  display: flex;
  gap: 0.6rem;
  padding: 0;
  margin: 0 0 1.2rem;
}
.wizard-steps li {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--fg-dim);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.wizard-steps li.active {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.wizard-steps li.done { color: var(--ok); border-color: rgba(63, 185, 80, 0.4); }

/* ───────── profile identity header ───────── */

.profile-id {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.profile-avatar {
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  flex: 0 0 auto;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: #06281e;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 0 18px var(--accent-glow);
}
.profile-id-text h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.profile-id-text p { margin: 0.25rem 0 0; display: flex; align-items: center; gap: 0.5rem; }
.profile-id-link {
  margin-left: auto;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.85rem;
}
.profile-id-link:hover { color: var(--accent); }

.totp-secret {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  font-size: 1rem;
  letter-spacing: 0.12em;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--accent);
}

/* ───────── login page ───────── */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 2.25rem;
  width: 22rem;
}

.login-card h1 {
  margin: 0 0 1.25rem;
  font-size: 1.2rem;
  text-align: center;
  letter-spacing: -0.01em;
}

.login-card input { width: 100%; }

.login-card button[type="submit"] {
  width: 100%;
  margin-top: 1.25rem;
}

/* ───────── live log view ───────── */

.log-view {
  margin: 0;
  padding: 0.75rem 1rem;
  background: #080b10;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 60vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Log view: error lines stay red but legible on the dark pane; search
   matches get a subtle highlight, the current match a stronger one. */
.log-view .error-text { color: #fca5a5; }
.log-view .log-match { background: rgba(214, 160, 34, 0.18); }
.log-view .log-current { background: rgba(214, 160, 34, 0.45); }

/* ───────── stage status control group ───────── */

.status-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.25rem 0 0.75rem;
}
.status-control button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #06281e;
  border-color: var(--accent-deep);
}
.status-history { margin-left: auto; font-size: 0.85rem; }

/* ───────── modal dialog (deploy dialog) ───────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 1rem;
  overflow-y: auto;
  z-index: 50;
}
.modal {
  width: 38rem;
  max-width: 100%;
  margin: 0;
}
.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.modal-close:hover { filter: none; color: var(--fg); }

/* Deployability / precondition lists and stage facts. */
.check-list, .facts-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}
.check-list li, .facts-list li { margin: 0.25rem 0; }

/* ───────── deployment timeline (detail page) ───────── */

.timeline {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}
.timeline li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
  color: var(--fg-muted);
}
.timeline li .step-marker { width: 1.2rem; text-align: center; }
.timeline li.done { color: var(--fg); }
.timeline li.current { color: var(--accent); font-weight: 600; }
.timeline li.failed { color: var(--err); font-weight: 600; }

/* Manual-intervention banner. */
.mir-box {
  border: 1px solid rgba(248, 100, 90, 0.4);
  background: var(--err-soft);
  color: var(--err);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
}
