/* ───────────────────────────────────────────────────────────────────────────
 * Vallumio Portal — main.css (Batch 1)
 *
 * Slim version of the marketing-site CSS. Batch 1 only needs: nav, footer,
 * a simple hero for the placeholder/404/500 pages. Batch 2 adds signup,
 * login forms, etc.
 *
 * Design tokens exactly mirror the marketing site — same colours, same
 * fonts, same spacing. The Vallumio design system is one thing, the
 * portal is a different surface that happens to wear the same clothes.
 * ────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── SELF-HOSTED FONTS ─────────────────────────────────────────────── */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/instrument-serif-v5-latin-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic; font-weight: 400; font-display: swap;
  src: url("/static/fonts/instrument-serif-v5-latin-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal; font-weight: 300; font-display: swap;
  src: url("/static/fonts/geist-v4-latin-300.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/geist-v4-latin-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("/static/fonts/geist-v4-latin-500.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/geist-v4-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/geist-mono-v4-latin-regular.woff2") format("woff2");
}

/* ─── DESIGN TOKENS ──────────────────────────────────────────────────── */
:root {
  --white:  #FAFAF8;
  --off:    #F2F0EC;
  --rule:   #DDDAD4;
  --mid:    #6E6B65;
  --body:   #2E2C29;
  --ink:    #0F0E0C;
  --teal:   #1A4A4A;
  --teal-d: #0F3333;
  --pop:    #2D7A6A;
  --glow:   #3ABFA0;

  --serif: "Instrument Serif", Georgia, serif;
  --sans:  "Geist", system-ui, Arial, sans-serif;
  --mono:  "Geist Mono", Consolas, monospace;
}

/* ─── BASE ────────────────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-weight: 300;
  color: var(--body);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; padding-top: 56px; /* account for fixed nav */ }

a { color: inherit; text-decoration: none; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--white);
}
.skip-link:focus { left: 0; z-index: 999; }

/* ─── NAV ─────────────────────────────────────────────────────────────── */
nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 200;
  height: 56px;
  background: rgba(250,250,248,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.logo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--glow);
  display: inline-block;
}
.nav-r { display: flex; align-items: center; gap: 1.5rem; }
.nav-link {
  font-size: 0.8rem;
  color: var(--mid);
  letter-spacing: 0.01em;
}
.nav-link:hover { color: var(--ink); }

/* ─── HERO-SIMPLE (placeholder / 404 / 500) ──────────────────────────── */
.hero-simple {
  padding: 7rem 0 5rem;
  min-height: calc(100vh - 56px - 120px);  /* fill space above footer */
  display: flex;
  align-items: center;
}
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem;
  width: 100%;
}

.lbl {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.lbl::after {
  content: "";
  width: 3rem;
  height: 1px;
  background: var(--rule);
}

.h1 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 4.5vw, 4.5rem);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.022em;
  line-height: 1.05;
  margin-bottom: 2rem;
  max-width: 640px;
}
.h1 em {
  font-style: italic;
  color: var(--pop);
}

.lead {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1rem;
  color: var(--mid);
  max-width: 540px;
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

.text-link {
  color: var(--teal);
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s ease;
}
.text-link:hover {
  border-bottom-color: var(--teal);
}

/* ─── FOOTER ──────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0;
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}
.footer-copy,
.footer-link {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--mid);
}
.footer-link:hover { color: var(--ink); }
.footer-sep { color: var(--rule); font-size: 0.72rem; }

/* ─── RESPONSIVE ──────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .nav-inner { padding: 0 1.5rem; }
  .wrap { padding: 0 1.5rem; }
  .hero-simple { padding: 5rem 0 3rem; }
  .footer-inner {
    padding: 0 1.5rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  .footer-sep { display: none; }
}
/* ───────────────────────────────────────────────────────────────────────────
 * Vallumio Portal — main.css (Batch 2 additions)
 *
 * New styles for: auth forms, flash messages, TOTP enrolment layout,
 * backup code display, dashboard cards, rate-limit page.
 *
 * Appended to the Batch 1 main.css during deploy. Design tokens
 * (colours, fonts) are inherited from Batch 1.
 * ────────────────────────────────────────────────────────────────────── */

/* ─── AUTH LAYOUT ─────────────────────────────────────────────────────── */
.auth-section {
  padding: 5rem 0 4rem;
  min-height: calc(100vh - 56px - 120px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.auth-wrap {
  width: 100%;
  max-width: 440px;
  padding: 0 2rem;
}

.auth-h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.022em;
  line-height: 1.05;
  margin-bottom: 1.25rem;
}
.auth-h1 em {
  font-style: italic;
  color: var(--pop);
}

.auth-form {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ─── FIELDS ──────────────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink);
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.72rem 0.85rem;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 74, 74, 0.1);
}

.field .muted {
  color: var(--mid);
  font-weight: 300;
  text-transform: none;
  letter-spacing: 0;
}

.field-check label {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 300;
  text-transform: none;
  letter-spacing: 0;
  color: var(--body);
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}
.field-check input[type="checkbox"] {
  margin-top: 0.18rem;
  accent-color: var(--teal);
  flex-shrink: 0;
}

.code-input {
  font-family: var(--mono);
  font-size: 1.4rem !important;
  letter-spacing: 0.4em;
  text-align: center;
  padding: 0.9rem !important;
}
.code-input-wide {
  font-family: var(--mono);
  font-size: 1.1rem !important;
  letter-spacing: 0.2em;
  text-align: center;
  padding: 0.9rem !important;
}

.err {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #B42828;
  background: rgba(180, 40, 40, 0.06);
  border: 1px solid rgba(180, 40, 40, 0.15);
  border-radius: 3px;
  padding: 0.4rem 0.6rem;
  margin: 0.25rem 0 0;
}

/* ─── BUTTONS ─────────────────────────────────────────────────────────── */
.btn-primary {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #FFFFFF;
  background: var(--teal);
  border: none;
  border-radius: 4px;
  padding: 0.85rem 1.5rem;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-top: 0.25rem;
}
.btn-primary:hover { background: var(--teal-d); }

.btn-secondary {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--body);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.78rem 1.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-secondary:hover {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
}

.inline-form { display: inline-block; }

/* ─── AUTH LINKS ──────────────────────────────────────────────────────── */
.auth-links {
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--mid);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.auth-links a {
  color: var(--teal);
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.15s ease;
}
.auth-links a:hover { border-bottom-color: var(--teal); }
.auth-links .sep { color: var(--rule); }

.helper {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--mid);
}

/* ─── FLASH MESSAGES ──────────────────────────────────────────────────── */
.flashes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}
.flash {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1.5;
  padding: 0.75rem 1rem;
  border-radius: 3px;
  border: 1px solid;
}
.flash-info {
  background: rgba(26, 74, 74, 0.05);
  border-color: rgba(26, 74, 74, 0.2);
  color: var(--teal);
}
.flash-warning {
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.2);
  color: #92400E;
}
.flash-error {
  background: rgba(180, 40, 40, 0.06);
  border-color: rgba(180, 40, 40, 0.15);
  color: #B42828;
}

/* ─── TOTP ENROLMENT ──────────────────────────────────────────────────── */
.totp-enrol {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  align-items: start;
  margin: 2rem 0;
  padding: 2rem;
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.totp-qr svg {
  width: 180px;
  height: 180px;
  background: #FFFFFF;
  padding: 0.5rem;
  border-radius: 3px;
}
.totp-info p {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--body);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}
.totp-info .step-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--glow);
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}
.totp-info .step-label:first-child { margin-top: 0; }
.totp-secret {
  font-family: var(--mono) !important;
  font-size: 1rem !important;
  letter-spacing: 0.1em;
  background: #FFFFFF;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.5rem 0.75rem;
  word-break: break-all;
  color: var(--ink) !important;
}
.totp-info .small { font-size: 0.75rem !important; color: var(--mid); }
.totp-info .muted { color: var(--mid); }

.step-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--glow);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* ─── BACKUP CODES ────────────────────────────────────────────────────── */
.backup-codes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.backup-code {
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: #FFFFFF;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.75rem 1rem;
  text-align: center;
}

/* ─── DASHBOARD ───────────────────────────────────────────────────────── */
.dash-section {
  padding: 5rem 0 4rem;
  min-height: calc(100vh - 56px - 120px);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  margin: 2.5rem 0 2rem;
}

.dash-card {
  background: var(--white);
  padding: 2rem;
}

.dash-lbl {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--glow);
  margin-bottom: 0.75rem;
}

.dash-val {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 0.4rem;
  line-height: 1.3;
  word-break: break-word;
}
.dash-val-ok { color: var(--pop); }
.dash-val-warn { color: #92400E; }

.dash-sub {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--mid);
  line-height: 1.6;
}

.dash-actions { margin-top: 2rem; }

/* ─── NAV USER MENU (when logged in) ─────────────────────────────────── */
.nav-user {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--mid);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-user-email {
  color: var(--body);
}

/* ─── RESPONSIVE ──────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .auth-section { padding: 3rem 0 2rem; }
  .auth-wrap { padding: 0 1.5rem; }
  .totp-enrol {
    grid-template-columns: 1fr;
    padding: 1.25rem;
  }
  .totp-qr svg { width: 160px; height: 160px; margin: 0 auto; display: block; }
  .dash-grid { grid-template-columns: 1fr; }
  .backup-codes { grid-template-columns: 1fr; }
}

/* Nav logout button — look like an inline link, not a button */
.nav-logout-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  color: var(--mid);
  transition: color 0.15s ease;
}
.nav-logout-btn:hover { color: var(--ink); }
/* ───────────────────────────────────────────────────────────────────────────
 * Vallumio Portal — main.css (Batch 3 additions)
 *
 * New styles for: multi-link nav, users table, role/status pills, inline
 * action forms, account overview, admin dashboard, audit log table,
 * Google SSO button, search forms, danger zone.
 *
 * Appended to the existing main.css during deploy. Design tokens inherited
 * from Batch 1/2.
 * ────────────────────────────────────────────────────────────────────── */

/* ─── NAV MULTI-LINK ──────────────────────────────────────────────────── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-right: 1.5rem;
}
.nav-link-active {
  color: var(--ink);
  border-bottom: 1px solid var(--teal);
  padding-bottom: 2px;
}

/* ─── H1 / H2 DASHBOARD STYLES ────────────────────────────────────────── */
.h1 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.022em;
  line-height: 1.05;
  margin-bottom: 2rem;
}
.h1 em { font-style: italic; color: var(--pop); }

.h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.018em;
  line-height: 1.15;
  margin: 3rem 0 1.5rem;
}
.h2 em { font-style: italic; color: var(--pop); }
.h2-admin { margin-top: 3.5rem; }

.dash-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 960px) {
  .dash-grid-4 { grid-template-columns: 1fr 1fr; }
}

/* ─── USERS TABLE ─────────────────────────────────────────────────────── */
.users-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  margin-top: 2rem;
}
.users-list { min-width: 0; }
@media (max-width: 1100px) {
  .users-layout { grid-template-columns: 1fr; }
  .users-invite { order: -1; }
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  font-size: 0.85rem;
}
.users-table thead th {
  background: var(--off);
  color: var(--mid);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}
.users-table tbody td {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--rule);
  vertical-align: top;
  color: var(--body);
}
.users-table tbody tr:first-child td { border-top: none; }
.users-table .user-name { font-weight: 400; color: var(--ink); margin-bottom: 2px; }
.users-table .user-email { color: var(--mid); font-size: 0.8rem; font-family: var(--mono); }
.users-table .col-actions { text-align: right; white-space: nowrap; }

/* ─── PILLS ───────────────────────────────────────────────────────────── */
.role-pill, .status-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.55rem;
  border-radius: 2px;
  border: 1px solid var(--rule);
  color: var(--body);
}
.role-agency_owner { background: rgba(26, 74, 74, 0.08); border-color: rgba(26, 74, 74, 0.25); color: var(--teal); }
.role-agency_admin { background: rgba(58, 191, 160, 0.08); border-color: rgba(58, 191, 160, 0.25); color: #1B7964; }
.role-agency_viewer { background: var(--off); }
.role-company_owner { background: var(--ink); border-color: var(--ink); color: #fff; }
.role-company_admin { background: rgba(15, 14, 12, 0.08); }
.role-self {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--mid);
  margin-left: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-active { background: rgba(5, 150, 105, 0.08); border-color: rgba(5, 150, 105, 0.25); color: #047857; }
.status-pending { background: rgba(217, 119, 6, 0.08); border-color: rgba(217, 119, 6, 0.25); color: #92400E; }
.status-disabled { background: rgba(180, 40, 40, 0.06); border-color: rgba(180, 40, 40, 0.2); color: #B42828; }

.ok-dot { color: var(--pop); font-size: 0.7rem; }
.muted-dot { color: var(--rule); font-size: 0.7rem; }

/* ─── INLINE ACTION BUTTONS ──────────────────────────────────────────── */
.btn-mini {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--body);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.35rem 0.75rem;
  margin: 0 0.15rem 0.15rem 0;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn-mini:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-mini.btn-danger { color: #B42828; border-color: rgba(180, 40, 40, 0.25); }
.btn-mini.btn-danger:hover { background: #B42828; color: #fff; border-color: #B42828; }
.btn-mini.btn-warning { color: #92400E; border-color: rgba(217, 119, 6, 0.25); }
.btn-mini.btn-warning:hover { background: #92400E; color: #fff; border-color: #92400E; }

.btn-secondary.btn-danger {
  color: #B42828;
  border-color: rgba(180, 40, 40, 0.25);
}
.btn-secondary.btn-danger:hover { background: #B42828; color: #fff; border-color: #B42828; }

.btn-primary.btn-danger {
  background: #B42828;
  color: #fff;
}
.btn-primary.btn-danger:disabled,
.btn-primary.btn-danger[disabled] {
  background: var(--rule);
  color: var(--mid);
}
.btn-primary.btn-danger:hover { background: #8C1515; }

/* ─── ROLE SELECT (inline dropdown in users table) ────────────────────── */
.role-form { margin: 0; }
.role-select {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.55rem;
  border-radius: 2px;
  border: 1px solid var(--rule);
  background: var(--white);
  color: var(--body);
  cursor: pointer;
}
.role-select:focus { outline: none; border-color: var(--teal); }

/* ─── INVITE CARD ─────────────────────────────────────────────────────── */
.invite-card {
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.75rem;
}
.invite-card .lbl { margin-bottom: 0.75rem; }
.invite-card .auth-form { margin-top: 1rem; gap: 1rem; }
.invite-card .btn-primary { width: 100%; }

/* ─── ACCOUNT PAGE ────────────────────────────────────────────────────── */
.account-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  margin: 2.5rem 0;
}
.account-card {
  background: var(--white);
  padding: 1.75rem;
}
.account-val {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--ink);
  margin: 0.5rem 0 0.75rem;
  line-height: 1.3;
  word-break: break-word;
}
@media (max-width: 960px) {
  .account-grid { grid-template-columns: 1fr; }
}

/* ─── GOOGLE SSO BUTTON ───────────────────────────────────────────────── */
.oauth-divider {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--mid);
  margin: 1.5rem 0 1rem;
  position: relative;
}
.oauth-divider::before, .oauth-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--rule);
}
.oauth-divider::before { left: 0; }
.oauth-divider::after { right: 0; }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--body);
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-google:hover { background: var(--off); border-color: var(--mid); }

/* ─── SEARCH FORM ─────────────────────────────────────────────────────── */
.search-form {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin: 1.5rem 0 1rem;
  flex-wrap: wrap;
}
.search-input, .search-select {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ink);
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.5rem 0.75rem;
}
.search-input { min-width: 220px; }
.search-input:focus, .search-select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 74, 74, 0.1);
}

/* ─── ADMIN DETAILS / COLLAPSIBLE ACTION FORMS ────────────────────────── */
.action-details, .danger-zone {
  display: inline-block;
  margin: 0 0.15rem 0.15rem 0;
}
.action-details summary, .danger-zone summary {
  cursor: pointer;
  list-style: none;
}
.action-details summary::-webkit-details-marker,
.danger-zone summary::-webkit-details-marker { display: none; }

.inline-action-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 3px;
  min-width: 260px;
  max-width: 320px;
  position: absolute;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.small-input, .small-textarea {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.4rem 0.6rem;
  width: 100%;
  box-sizing: border-box;
}
.small-textarea { resize: vertical; min-height: 60px; font-family: var(--sans); }

.danger-zone { display: block; margin-top: 2rem; }
.danger-zone[open] summary { margin-bottom: 1rem; }
.danger-body {
  background: rgba(180, 40, 40, 0.03);
  border: 1px solid rgba(180, 40, 40, 0.2);
  border-radius: 4px;
  padding: 1.5rem;
  margin-top: 0.75rem;
}
.danger-body .auth-form { margin-top: 1rem; }

/* ─── AUDIT TABLE (denser) ─────────────────────────────────────────────── */
.audit-table {
  font-size: 0.8rem;
}
.audit-table td.mono { font-family: var(--mono); }
.audit-table td.small { font-size: 0.72rem; }

/* ─── UTILITIES ───────────────────────────────────────────────────────── */
.mono { font-family: var(--mono); }
.small { font-size: 0.78rem !important; }
.text-link {
  color: var(--teal);
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.15s ease;
  text-decoration: none;
}
.text-link:hover { border-bottom-color: var(--teal); }

/* ─── RESPONSIVE ──────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .nav-links { display: none; }  /* on mobile hide main nav; keep logo + logout */
  .users-table { font-size: 0.8rem; }
  .users-table th:nth-child(5),
  .users-table td:nth-child(5) { display: none; }  /* hide last login on mobile */
  .search-input { min-width: 0; width: 100%; }
  .inline-action-form { position: static; }
}
/* ═════════════════════════════════════════════════════════════════════
 * Vallumio Portal — Stage 3 Batch 1 CSS additions
 *
 * Appended to existing main.css during deployment.
 * Covers: capacity bars, environment pills, server detail UI, form rows
 * ══════════════════════════════════════════════════════════════════ */

/* ── Environment pills ─────────────────────────────────────────────── */
.env-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.55rem;
  border-radius: 2px;
  border: 1px solid var(--rule);
}
.env-prod {
  background: rgba(26, 74, 74, 0.08);
  border-color: rgba(26, 74, 74, 0.25);
  color: var(--teal);
}
.env-test {
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.22);
  color: #92400E;
}

/* ── Capacity bars (used in tables + cards) ────────────────────────── */
.cap-cell { min-width: 130px; }
.cap-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--body);
  margin-bottom: 0.25rem;
}
.cap-bar {
  height: 6px;
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.cap-bar-large { height: 12px; margin: 0.5rem 0; }
.cap-fill {
  height: 100%;
  transition: width 0.5s ease;
  border-radius: 1px;
}
.cap-teal { background: var(--teal); }
.cap-yellow { background: #D97706; }
.cap-red { background: #DC2626; }

/* ── Heartbeat status dots ─────────────────────────────────────────── */
.ok-dot { color: #059669; font-size: 0.7rem; }
.warn-dot { color: #D97706; font-size: 0.7rem; }
.err-dot { color: #DC2626; font-size: 0.7rem; }

/* ── Servers toolbar with inline add form ──────────────────────────── */
.servers-toolbar { margin: 1.5rem 0 2rem; }

.add-server-details { display: inline-block; }
.add-server-details > summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
}
.add-server-details > summary::-webkit-details-marker { display: none; }

.add-server-form-wrap {
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.75rem;
  margin-top: 0.75rem;
  max-width: 540px;
}
.add-server-form-wrap .auth-form { margin-top: 1rem; gap: 1.1rem; }
.add-server-form-wrap .btn-primary { width: 100%; margin-top: 0.25rem; }

/* Horizontal row for env/ram/disk trio on the add-server form */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}
.field-half { margin: 0; }
@media (max-width: 760px) {
  .field-row { grid-template-columns: 1fr; }
}

/* ── Key-value detail strips ───────────────────────────────────────── */
.detail-kv {
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.detail-kv > div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
}
.detail-kv > div:first-child { border-top: none; }
.kv-key {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-top: 0.15rem;
}
.kv-val {
  color: var(--body);
  word-break: break-all;
}

/* ── Dash alert boxes (used on server detail when agent unreachable) ─ */
.dash-alert {
  padding: 1rem 1.25rem;
  border-radius: 4px;
  margin: 1rem 0;
  font-size: 0.85rem;
  border-left-width: 3px;
  border-left-style: solid;
}
.dash-alert p { margin: 0; }
.dash-alert-warn {
  background: rgba(217, 119, 6, 0.06);
  border: 1px solid rgba(217, 119, 6, 0.22);
  border-left-color: #D97706;
  color: #92400E;
}
.dash-alert-err {
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-left-color: #DC2626;
  color: #991B1B;
}

/* ── dash-val colour helpers for status words ──────────────────────── */
.dash-val-ok { color: #059669; }
.dash-val-warn { color: #D97706; }
.dash-val-err { color: #DC2626; }
.small-val { font-size: 1.5rem; }

/* ── In-flight progress row under the status pill (#70) ────────────── */
/* Shown by static/site_status_poll.js during transitional states.
   The icon spins so users get a visual signal that polling is live
   even when the step text doesn't change for a while. */
.dash-progress {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--mid);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.dash-progress-icon {
  display: inline-block;
  animation: dash-progress-spin 2s linear infinite;
}
@keyframes dash-progress-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Action row on detail pages ────────────────────────────────────── */
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 1rem 0;
}

.back-link { margin-top: 3rem; }

/* ── Empty state ────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 4px;
  margin-top: 1.5rem;
}
.empty-state p:first-child {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

/* ── Mobile tweaks ──────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .servers-table th:nth-child(5),
  .servers-table td:nth-child(5),
  .servers-table th:nth-child(7),
  .servers-table td:nth-child(7) {
    display: none;  /* hide disk + heartbeat on mobile */
  }
  .detail-kv > div { grid-template-columns: 1fr; gap: 0.25rem; }
}
/* ═════════════════════════════════════════════════════════════════════
 * Vallumio Portal — Stage 3 Batch 1.1 hotfix CSS
 *
 * Appended to existing main.css during deployment.
 * Fixes form styling to match the site's design system, adds CPU bar,
 * and removes the scattered inline-ish styling from Batch 1.
 * ══════════════════════════════════════════════════════════════════ */

/* ── Server form — matches .auth-form pattern ──────────────────────── */
.server-form input[type="text"],
.server-form input[type="password"],
.server-form input[type="number"],
.server-form input[type="url"],
.server-form select,
.server-form textarea {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--body);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.65rem 0.85rem;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.4;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

.server-form select {
  /* Match the native select, but with our chevron */
  background-image: url("/static/img/chevron-down-sm.svg");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 10px 6px;
  padding-right: 2rem;
}

.server-form input[type="text"]:focus,
.server-form input[type="password"]:focus,
.server-form input[type="number"]:focus,
.server-form input[type="url"]:focus,
.server-form select:focus,
.server-form textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 74, 74, 0.1);
}

.server-form textarea {
  resize: vertical;
  min-height: 3.5rem;
  font-family: var(--sans);
}

.server-form label {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mid);
  margin-bottom: 0.5rem;
  display: block;
}

.server-form label .muted {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--rule);
}

.server-form .field {
  margin: 0 0 1.25rem;
}

/* Three-up row for env/ram/disk */
.server-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.server-form-row .field {
  margin-bottom: 0.75rem;
}

@media (max-width: 760px) {
  .server-form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* Help text under fields */
.helper-sm {
  font-size: 0.72rem;
  margin: 0.35rem 0 0;
  line-height: 1.5;
}

/* Compact label for the form header */
.lbl-small { margin-bottom: 0.4rem; }

/* ── Add-server details/summary toggle styling ─────────────────────── */
.add-server-details > summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
  user-select: none;
}
.add-server-details > summary::-webkit-details-marker { display: none; }
.add-server-details[open] > summary {
  /* keep the button style but make it feel "active" when open */
  background: var(--teal-d, var(--teal));
}

.add-server-form-wrap {
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.75rem 2rem;
  margin-top: 1rem;
  max-width: 560px;
}

.add-server-form-wrap .btn-primary {
  width: 100%;
  margin-top: 0.5rem;
}

/* ── Edit server page ──────────────────────────────────────────────── */
.edit-server-wrap {
  max-width: 620px;
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 2rem;
  margin-top: 1rem;
}

.read-only-input {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--mid);
  background: rgba(221, 218, 212, 0.4);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.65rem 0.85rem;
  width: 100%;
  box-sizing: border-box;
  cursor: not-allowed;
}

.edit-form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.edit-form-actions .btn-primary {
  flex: 0 0 auto;
}

.btn-ghost {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--mid);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.72rem 1.25rem;
  text-decoration: none;
  display: inline-block;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.btn-ghost:hover {
  border-color: var(--body);
  color: var(--body);
}

/* ── Dash grid variants ────────────────────────────────────────────── */
.dash-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 760px) {
  .dash-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Empty state tweaks */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 4px;
  margin-top: 1.5rem;
}
.empty-state p:first-child {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

/* ── Button warning / danger variants ──────────────────────────────── */
.btn-warning {
  border-color: rgba(217, 119, 6, 0.4);
  color: #92400E;
}
.btn-warning:hover {
  background: rgba(217, 119, 6, 0.08);
  border-color: #D97706;
}

.btn-danger {
  border-color: rgba(220, 38, 38, 0.4);
  color: #8C1515;
}
.btn-danger:hover {
  background: rgba(220, 38, 38, 0.08);
  border-color: #DC2626;
}
/* ═════════════════════════════════════════════════════════════════════
 * Vallumio Portal — Stage 3 Batch 2 CSS additions
 * Appended to main.css during deployment.
 * ══════════════════════════════════════════════════════════════════ */

/* ── Sites toolbar (filters + new button) ──────────────────────────── */
.sites-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.sites-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sites-filters select,
.sites-filters input[type="text"] {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--body);
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.55rem 0.8rem;
}
.sites-filters input[type="text"] {
  min-width: 220px;
}
.sites-filters select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("/static/img/chevron-down-sm.svg");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 10px 6px;
  padding-right: 2rem;
}
.sites-filters select:focus,
.sites-filters input[type="text"]:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26,74,74,0.1);
}

/* ── Modal system ──────────────────────────────────────────────────── */
.ps-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}
.ps-modal.is-open { display: flex; }
.ps-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 14, 12, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.ps-modal-box {
  position: relative;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 4px;
  max-width: 460px;
  width: 100%;
  padding: 2.25rem 2.25rem 1.75rem;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.ps-modal-box-wide { max-width: 540px; }

.ps-modal-kicker {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--glow);
  margin: 0 0 0.5rem;
}
.ps-modal-kicker-warn { color: #B45309; }
.ps-modal-title {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.ps-modal-title em {
  font-style: italic;
  color: var(--pop);
}
.ps-modal-desc {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--mid);
  line-height: 1.7;
  margin: 0 0 1.5rem;
}
.ps-modal-form .field {
  margin-bottom: 1.1rem;
}
.ps-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

/* ── Progress list ─────────────────────────────────────────────────── */
.progress-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}
.progress-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--mid);
}
.progress-step:last-child { border-bottom: none; }
.progress-icon {
  display: inline-block;
  width: 1.2rem;
  text-align: center;
  font-family: var(--mono);
  flex-shrink: 0;
}
.progress-label { flex: 1; }
.progress-step-detail {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #8C1515;
  margin-top: 0.35rem;
  padding-left: 1.95rem;
  word-wrap: break-word;
}
.progress-pending .progress-icon { color: var(--rule); }
.progress-running { color: var(--ink); }
.progress-running .progress-icon {
  color: var(--glow);
  animation: ps-pulse 1.3s ease-in-out infinite;
}
.progress-done { color: var(--body); }
.progress-done .progress-icon { color: var(--glow); }
.progress-failed { color: #8C1515; }
.progress-failed .progress-icon { color: #DC2626; }

@keyframes ps-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.progress-warn {
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.25);
  padding: 0.85rem 1rem;
  border-radius: 3px;
  font-size: 0.82rem;
  color: #78350F;
  margin-bottom: 1rem;
}

.progress-success {
  background: var(--off);
  border: 1px solid var(--rule);
  padding: 1.25rem;
  border-radius: 3px;
  margin-bottom: 1rem;
}
.progress-success-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 0.35rem;
}

.progress-error {
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.2);
  padding: 1.25rem;
  border-radius: 3px;
  margin-bottom: 1rem;
}
.progress-error-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: #8C1515;
  margin: 0 0 0.35rem;
}

/* ── Credentials display ───────────────────────────────────────────── */
.cred-box {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.95rem 1rem;
  margin: 0.9rem 0;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.cred-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--rule);
}
.cred-row:last-child { border-bottom: none; }
.cred-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mid);
}
.cred-val {
  font-family: var(--mono);
  color: var(--ink);
  word-break: break-all;
}
.btn-copy {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--teal);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
}
.btn-copy:hover {
  border-color: var(--teal);
  color: var(--teal-d);
}
.cred-confirm {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--body);
  margin: 1rem 0 0;
}
.cred-confirm input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* ── Danger zone ───────────────────────────────────────────────────── */
.danger-zone {
  background: rgba(220, 38, 38, 0.04);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 4px;
  padding: 1.5rem 1.75rem;
  margin-top: 1rem;
}
.danger-zone p {
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 300;
  color: var(--body);
  line-height: 1.7;
  margin: 0 0 1rem;
}

/* ── Monospace links ───────────────────────────────────────────────── */
.mono-link {
  font-family: var(--mono);
  font-size: 0.82rem;
  word-break: break-all;
}

/* ── Back link ─────────────────────────────────────────────────────── */
.back-link {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

/* ── Stage 3 Batch 2.1 — modal form styling (CSP-safe, matches design tokens) ── */
.ps-modal-form input[type="text"],
.ps-modal-form input[type="email"],
.ps-modal-form input[type="password"],
.ps-modal-form input[type="number"],
.ps-modal-form select,
.ps-modal-form textarea {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--body);
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.65rem 0.85rem;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.4;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

.ps-modal-form select {
  background-image: url("/static/img/chevron-down-sm.svg");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 10px 6px;
  padding-right: 2rem;
  background-color: var(--off);
}

.ps-modal-form input:focus,
.ps-modal-form select:focus,
.ps-modal-form textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 74, 74, 0.1);
}

.ps-modal-form textarea {
  resize: vertical;
  min-height: 3.5rem;
}

.ps-modal-form label {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mid);
  margin-bottom: 0.5rem;
  display: block;
}

.ps-modal-form label .muted {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--rule);
}

.ps-modal-form .field {
  margin: 0 0 1.1rem;
}

.ps-modal-form .helper-sm {
  font-size: 0.72rem;
  margin: 0.35rem 0 0;
  line-height: 1.5;
  color: var(--mid);
}

/* Hidden-by-default panels — used in place of inline style="display:none" 
   because strict CSP (style-src 'self') blocks inline style attributes. */
.is-hidden {
  display: none !important;
}

/* ── Stage 3 Batch 2.2 — polish fixes ──────────────────────────────── */

/* Danger button — proper button styling (was missing padding/font/background) */
.btn-danger {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  color: #8C1515;
  background: rgba(220, 38, 38, 0.04);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 3px;
  padding: 0.65rem 1.15rem;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn-danger:hover {
  background: #B42828;
  color: #fff;
  border-color: #B42828;
}

/* Ghost cancel button inside modals */
.btn-ghost {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--mid);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.65rem 1.15rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* Server environment pill — small mono badge next to server name */
.env-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.env-test {
  background: rgba(217, 119, 6, 0.08);
  color: #92400E;
  border: 1px solid rgba(217, 119, 6, 0.2);
}
.env-production {
  background: rgba(26, 74, 74, 0.08);
  color: var(--teal);
  border: 1px solid rgba(26, 74, 74, 0.15);
}

/* small-val cell — contain second line (environment pill) properly */
.dash-val.small-val {
  font-size: 1rem;
  line-height: 1.3;
}

/* ── Stage 3 Batch 3.1 — Edit site button + form layout ─────────── */
.section-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.section-heading-row .h2 {
  margin: 0;
}

/* ─── BACKUP SECTION ─────────────────────────────────────────────── */
.backup-summary {
  color: var(--mid);
  line-height: 2;
  padding-bottom: 0.6rem;
}
.backup-summary .pill-inline {
  vertical-align: middle;
}
.backup-error-msg {
  color: #b42828;
}

/* ─── BACKUP ERROR ROW (admin report) ─────────────────────────── */
.backup-error-row {
  background: var(--off);
  color: #b42828;
  font-family: var(--mono);
  padding: 0.8rem 1rem !important;
}


/* ─── REASON PILLS (backup snapshots) ──────────────────────────── */
/* Stage 3 Batch 3.3 Stage D */
.reason-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.12rem 0.55rem;
  border-radius: 3px;
  border: 1px solid var(--rule);
  color: var(--mid);
  background: var(--off);
}
.reason-pill.reason-daily {
  color: var(--body);
  background: var(--off);
  border-color: var(--rule);
}
.reason-pill.reason-pre-restore {
  color: #92400E;
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.25);
}
.reason-pill.reason-pre-deprovision {
  color: #B42828;
  background: rgba(180, 40, 40, 0.06);
  border-color: rgba(180, 40, 40, 0.2);
}
.reason-pill.reason-on-demand {
  color: var(--teal);
  background: rgba(26, 74, 74, 0.08);
  border-color: rgba(26, 74, 74, 0.2);
}

/* Modal warning text (used on restore modal) */
.ps-modal-warn {
  color: #92400E;
  background: rgba(217, 119, 6, 0.06);
  border-left: 3px solid #D97706;
  padding: 0.7rem 1rem;
  border-radius: 2px;
  margin: 0.8rem 0 1rem 0;
}

.restore-confirm-input {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Small word styling — the inline 'RESTORE' keyword in the modal label */
.restore-keyword {
  color: var(--ink);
}

/* Retention footer under snapshots table */
.retention-note {
  margin-top: 1rem;
  color: var(--mid);
}

/* Disabled primary button (restore modal submit gate) */
.btn-primary:disabled,
.btn-primary[disabled] {
  background: var(--rule);
  color: var(--mid);
  cursor: not-allowed;
  border-color: var(--rule);
}
.btn-primary:disabled:hover,
.btn-primary[disabled]:hover {
  background: var(--rule);
  color: var(--mid);
}

/* Stage 3 Batch 3.4 Stage A — .field select + textarea
 * The original .field rules only covered text/email/password inputs.
 * Forms in the new admin area (and elsewhere going forward) use select
 * and textarea inside .field — keep them visually consistent with text
 * inputs. */
.field select,
.field textarea {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink);
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.72rem 0.85rem;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Strip Safari/Chrome native chrome on the select so it matches the
   design system inputs. Paint a small chevron on the right using a
   static SVG file in /static/img/ — works under style-src 'self' CSP. */
.field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("/static/img/chevron-down.svg");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 12px 12px;
  padding-right: 2.5rem;
  cursor: pointer;
}
.field textarea {
  min-height: 5rem;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.83rem;
  line-height: 1.55;
}
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 74, 74, 0.1);
}


/* ═════════════════════════════════════════════════════════════════════
 * Vallumio Portal — Stage 3 Batch 3.4 Stage B Chunk 10b
 *
 * Connect-domain wizard waiting page. Per Design System v1.2 §5.13.
 * Calm, low-stimulation polling status block. No spinners.
 * ══════════════════════════════════════════════════════════════════ */

/* ── Two-column wizard layout ──────────────────────────────────────── */
.connect-wizard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2.5rem;
  margin-top: 2rem;
}
@media (max-width: 960px) {
  .connect-wizard-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.connect-wizard-section-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--mid);
  margin-bottom: 1rem;
}

/* ── DNS record blocks (per §5.13.3) ──────────────────────────────── */
.dns-record {
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.dns-record:last-child {
  border-bottom: none;
}
.dns-record-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mid);
  margin-bottom: 0.5rem;
}
.dns-record-value {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.dns-record-value code {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--off);
  padding: 0.5rem 0.75rem;
  border-radius: 2px;
  border: 1px solid var(--rule);
  word-break: break-all;
}
.dns-record-value .btn-mini {
  flex-shrink: 0;
  margin: 0;
  /* #53 fix: match the adjacent <code> block's vertical padding so the
     two children align in the flex row. The default .btn-mini padding
     is tighter (0.35rem) than the code block (0.5rem), producing a
     visual height mismatch. */
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

/* Placeholder shown by Bug 2 fix when name_servers is empty at first
   render (cloudflare_ns: worker hadn't called create-zone yet). JS
   replaces the placeholder with real .dns-record blocks once the
   polling response brings name_servers populated. */
.dns-record-placeholder {
  padding: 1rem;
  border: 1px dashed var(--rule);
  border-radius: 2px;
  margin: 0.5rem 0;
}

/* ── Polling status panel (per §5.13.2) ───────────────────────────── */
.ps-poll-status {
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1.25rem;
}
.ps-poll-status-header {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--mid);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}
.ps-poll-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.5rem 0;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.ps-poll-row + .ps-poll-row {
  border-top: 1px dashed var(--rule);
}
.ps-poll-row-key {
  color: var(--mid);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ps-poll-row-val {
  font-family: var(--mono);
  font-size: 0.82rem;
  word-break: break-all;
}
/* State colours per §5.13.2 */
.ps-poll-state-ok { color: var(--glow); }
.ps-poll-state-mismatch { color: #92400E; }
.ps-poll-state-pending { color: var(--mid); }

.ps-poll-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--mid);
  line-height: 1.5;
}

/* ── Reason / observation feedback banner (per §5.13.4) ───────────── */
.reason-message {
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(217, 119, 6, 0.06);
  border: 1px solid rgba(217, 119, 6, 0.22);
  border-left: 3px solid #D97706;
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 300;
  color: #78350F;
  line-height: 1.65;
}
.reason-message-info {
  background: rgba(26, 74, 74, 0.04);
  border: 1px solid rgba(26, 74, 74, 0.15);
  border-left: 3px solid var(--teal);
  color: var(--teal);
}

/* ── Layout utilities for the wizard pages ─────────────────────────── */
/* Defined here rather than as inline style attrs because portal CSP
   blocks inline style. These small spacing helpers are reused in 10c. */
.helper-tip {
  margin-top: 1.5rem;
}
.action-row-end {
  margin-top: 2rem;
}

/* Amber-warning variant of .helper for instructions where getting it
   wrong wastes the user's time (e.g. host-name format on the
   connect-domain wizard's partial_a flow — see #72). */
.helper-warning {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #92400E;
  background: #FFFBEB;
  border: 1px solid rgba(217, 119, 6, 0.35);
  border-left: 3px solid #D97706;
  border-radius: 3px;
}
.helper-warning .mono {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: #FEF3C7;
  padding: 0.05rem 0.3rem;
  border-radius: 2px;
}

/* Three-column registrar-style A-record table (#72). The leading
   Host column shows literal registrar-input strings (@, www) rather
   than FQDNs — customers were entering the FQDN at registrars that
   accept it but resolve to a parking page. */
.dns-record-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}
.dns-record-table th,
.dns-record-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
.dns-record-table th {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mid);
  border-bottom-width: 1px;
}
.dns-record-table tbody tr:last-child td {
  border-bottom: none;
}
.dns-record-table td > code {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--off);
  padding: 0.4rem 0.6rem;
  border-radius: 2px;
  border: 1px solid var(--rule);
}


/* ═════════════════════════════════════════════════════════════════════
 * Vallumio Portal — Stage 3 Batch 3.4 Stage B Chunk 10c
 *
 * Connect-domain verified state + go-live modal styling.
 * ══════════════════════════════════════════════════════════════════ */

.connect-verified-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}


/* ═════════════════════════════════════════════════════════════════════
 * Vallumio Portal — Stage 3 Batch 3.4 Stage B Issue 6
 *
 * Muted variant of .kv-val — used on site_detail to show the
 * decommissioned staging URL after promotion. Greyed but readable;
 * no underline implying clickability.
 * ══════════════════════════════════════════════════════════════════ */

.kv-val-muted {
  color: var(--mid);
}
