/* ========================================
   TOKENS
   ======================================== */
:root {
  --bg-0: #f3f3f4;
  --bg-1: #eaebed;
  --bg-2: #e0e1e3;
  --panel: #fbfbfb;
  --text: #232426;
  --muted: #45494d;
  --line: #d1d3d6;
  --line-strong: #b5b9bd;
  --accent: #186247;
  --accent-strong: #114633;
  --accent-soft: #e5e7ea;
  --accent-focus: #0f9b68;
  --danger: #a0283d;
  --danger-soft: #fde8ec;
  --success: #126043;
  --success-soft: #e2e5ea;
  --info: #2f6fde;
  --warn-soft: #ffedc6;
  --warn-text: #6b4a0c;
  --shadow: 0 8px 24px rgba(22, 25, 28, 0.09);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
}

/* ========================================
   RESET & BASE
   ======================================== */
*,
::before,
::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Sofia Sans", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  background:
    radial-gradient(1000px 600px at 95% -10%, var(--bg-2), transparent 70%),
    radial-gradient(850px 500px at 0% 110%, #e0e2e4, transparent 70%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  background-attachment: fixed;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Skip to content link — visible only on focus */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0.5rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.1s;
}

.skip-link:focus {
  top: 0;
}

/* Screen-reader-only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Global focus — WCAG 2.1 AA high contrast */
:focus-visible {
  outline: 3px solid var(--accent-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ========================================
   LAYOUT
   ======================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding: 0.85rem 1.4rem;
  border-bottom: 1px solid #164b38;
  background: linear-gradient(100deg, #134231, #195740 65%, #206d51);
  color: #f6f6f7;
  box-shadow: 0 10px 22px rgba(17, 19, 22, 0.24);
  backdrop-filter: blur(5px);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.13),
    transparent 38%
  );
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  flex: 0 1 auto;
  position: relative;
  z-index: 1;
}

.topbar-brand-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: min(52vw, 640px);
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.15rem 1rem;
  color: rgba(246, 246, 247, 0.94);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: none;
  white-space: normal;
  z-index: 0;
  text-decoration: none;
}

.topbar-brand-name {
  color: #fafbfc;
  display: block;
  font-size: 1.16rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  line-height: 1;
}

.topbar-brand-tag {
  display: block;
  color: rgba(236, 238, 241, 0.82);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.15;
  text-transform: uppercase;
}

.topbar-brand-center:hover {
  text-decoration: underline;
}

.topbar-brand-center:focus-visible {
  outline-color: rgba(255, 255, 255, 0.85);
}

.topbar {
  flex-wrap: wrap;
}

.topbar-main {
  order: 2;
  flex: 1 1 auto;
}

.topbar-brand-center {
  position: static;
  order: 1;
  width: 100%;
  max-width: none;
  padding: 0;
  transform: none;
  justify-content: flex-start;
}

.userbox {
  order: 3;
  margin-left: auto;
}

.topnav {
  display: flex;
  gap: 0.24rem;
  flex-wrap: wrap;
  flex: 0 1 auto;
  justify-content: flex-start;
  padding: 0.24rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(19, 21, 24, 0.2);
}

.topnav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: #e0e3e6;
  font-weight: 650;
  font-size: 0.86rem;
  letter-spacing: 0.015em;
  padding: 0.46rem 0.74rem;
  border-radius: 999px;
  text-decoration: none;
  transition:
    background 0.12s,
    color 0.12s,
    transform 0.12s;
}

.topnav a::after {
  content: "";
  position: absolute;
  left: 0.66rem;
  right: 0.66rem;
  bottom: 0.18rem;
  height: 2px;
  border-radius: 999px;
  background: #f3f5f8;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.16s ease;
}

.topnav a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.topnav a.active,
.topnav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
  font-weight: 700;
}

.topnav a.active::after,
.topnav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.topnav a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 1px;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #d6d9de;
  font-size: 0.88rem;
  flex-shrink: 0;
  margin-left: auto;
  position: relative;
  z-index: 1;
}

.topbar-status {
  display: flex;
  justify-content: flex-end;
  padding: 0.32rem 1.4rem 0.42rem;
  border-bottom: 1px solid rgba(22, 75, 56, 0.12);
  background: linear-gradient(
    180deg,
    rgba(236, 237, 238, 0.94),
    rgba(245, 246, 247, 0.98)
  );
  backdrop-filter: blur(5px);
}

.queue-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  opacity: 0.95;
  font-size: 0.72rem;
}

.queue-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  color: #5f6369;
  font-size: 0.72rem;
  line-height: 1;
  white-space: nowrap;
  position: relative;
}

.queue-pill + .queue-pill::before {
  content: "";
  width: 1px;
  height: 0.8rem;
  margin-right: 0.1rem;
  background: rgba(24, 98, 71, 0.16);
}

.queue-pill-label {
  color: #70757b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.56rem;
}

.queue-pill strong {
  color: #174f3a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: rgba(24, 98, 71, 0.09);
  border: 1px solid rgba(24, 98, 71, 0.12);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.account-menu {
  position: relative;
}

.account-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  list-style: none;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.34rem 0.66rem;
  color: #fff;
  font-weight: 700;
  font-size: 0.86rem;
  user-select: none;
}

.account-summary {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.08;
}

.account-summary-name {
  font-size: 0.84rem;
  font-weight: 800;
}

.account-summary-role {
  margin-top: 0.08rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #d6d9dd;
}

.account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
}

.account-menu-trigger::-webkit-details-marker {
  display: none;
}

.account-menu[open] .account-menu-trigger,
.account-menu-trigger:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.5);
}

.account-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 310px;
  background: #fff;
  border: 1px solid #dbdcde;
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(24, 26, 28, 0.16);
  padding: 0.35rem;
  z-index: 90;
}

.account-menu-section {
  padding: 0.2rem 0.25rem 0.35rem;
}

.account-menu-section + .account-menu-section {
  margin-top: 0.1rem;
  border-top: 1px solid #e4e5e7;
  padding-top: 0.45rem;
}

.account-menu-section-label {
  margin: 0 0 0.28rem;
  padding: 0 0.35rem;
  color: #64696f;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-menu-meta {
  padding: 0.15rem 0.35rem 0.25rem;
}

.account-menu-name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  color: #144533;
  word-break: break-word;
}

.account-menu-email {
  margin: 0.12rem 0 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: #154a36;
  word-break: break-all;
}

.account-menu-role {
  margin: 0.18rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #56595f;
}

.account-menu-facts {
  display: grid;
  gap: 0.35rem;
  padding: 0.1rem 0.35rem 0.25rem;
}

.account-menu-fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  color: #313438;
}

.account-menu-fact span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #65696f;
}

.account-menu-fact strong {
  font-size: 0.81rem;
  font-weight: 800;
  text-align: right;
  word-break: break-word;
}

.account-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
  color: #18513c;
  background: transparent;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.account-menu-item:hover {
  background: #f0f1f3;
  text-decoration: none;
}

.account-menu-item.is-disabled {
  color: #72777d;
  cursor: not-allowed;
}

.account-menu-logout {
  margin-top: 0.15rem;
  background: var(--danger);
  color: #fff;
}

.account-menu-logout:hover {
  background: #82202f;
  color: #fff;
}

.content {
  max-width: min(1560px, calc(100vw - 2rem));
  margin: 1.45rem auto;
  padding: 0 1rem 3rem;
  display: grid;
  gap: 1.15rem;
}

/* ========================================
   CARDS
   ======================================== */

.card {
  background: linear-gradient(180deg, #ffffff, var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 28px rgba(26, 29, 33, 0.08);
  padding: 1.5rem;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(26, 29, 33, 0.11);
}

.card h1:first-child,
.card h2:first-child,
.card h3:first-child {
  margin-top: 0;
}

.card.narrow {
  max-width: 460px;
  margin: 4rem auto;
  padding: 2rem;
}

/* ========================================
   TYPOGRAPHY HELPERS
   ======================================== */

.muted {
  color: var(--muted);
  margin-top: 0.25rem;
}

.hint {
  font-size: 0.87rem;
  color: var(--muted);
  margin: 0.15rem 0;
}

.section-subheading {
  margin-top: 1rem;
}

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0.25rem 0 0.1rem;
}

.login-eyebrow {
  margin: 0 0 0.15rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.error-text {
  color: #8a1a2d;
  font-weight: 700;
}

/* ========================================
   BUTTONS
   ======================================== */

button,
input,
select,
textarea {
  font: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: var(--accent);
  color: #fff;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.93rem;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
}

.btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  text-decoration: none;
  color: #fff;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
  text-decoration: none;
}

/* Active / pressed state — driven by .active class or aria-pressed="true" */
.btn-ghost.active,
.btn-ghost[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 700;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #82202f;
  border-color: #82202f;
  color: #fff;
  text-decoration: none;
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.83rem;
}

.btn.is-loading,
.btn[aria-busy="true"] {
  position: relative;
}

.btn.is-loading {
  color: inherit;
}

.btn.is-loading::after,
.btn[aria-busy="true"]::after {
  content: none;
  animation: none;
}

.btn-spinner {
  display: inline-flex;
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 0.95rem;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: btn-spin 0.7s linear infinite;
}

.btn.is-loading.btn-ghost,
.btn[aria-busy="true"].btn-ghost {
  color: var(--accent-strong);
}

.btn.is-loading.btn-danger,
.btn[aria-busy="true"].btn-danger {
  color: #fff;
}

.btn-loading-label {
  line-height: 1;
}

/* Loading/disabled state */
[aria-busy="true"] {
  opacity: 0.65;
  pointer-events: none;
  cursor: wait;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.58;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.93rem;
}

.alert[role="alert"] {
  /* Ensure screen readers announce immediately */
}

.alert.error {
  background: var(--danger-soft);
  border: 1px solid #f0b8c3;
  color: #6b1020;
}

.alert.success {
  background: var(--success-soft);
  border: 1px solid #85dcbc;
  color: #22262b;
}

/* ========================================
   FORMS — FIELD WRAPPER
   ======================================== */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field label,
.form-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: #333538;
}

.field .hint {
  order: 3;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
select {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.8rem;
  background: #fff;
  color: var(--text);
  transition: border-color 0.12s;
}

textarea {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.8rem;
  background: #fff;
  color: var(--text);
  resize: vertical;
  min-height: 96px;
  transition: border-color 0.12s;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
select:hover {
  border-color: #9da3aa;
}

textarea:hover {
  border-color: #9da3aa;
}

input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="password"]:focus-visible,
input[type="number"]:focus-visible,
input[type="search"]:focus-visible,
input[type="date"]:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  border-color: var(--accent-focus);
  box-shadow: 0 0 0 3px rgba(15, 155, 104, 0.18);
}

fieldset.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field-group-legend {
  padding: 0;
  margin: 0 0 0.15rem;
  font-weight: 800;
  font-size: 0.92rem;
  color: #144332;
}

/* ========================================
   FORMS — LAYOUT
   ======================================== */

.form-batch,
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-row > label:first-child,
.form-row > .form-label:first-child {
  font-weight: 700;
  font-size: 0.9rem;
  color: #333538;
}

.form-col {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 0.65rem;
  padding-top: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Inline row (config + button side by side) */
.form-inline {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-inline .field {
  flex: 1;
  min-width: 0;
}

.password-input-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.password-input-row input {
  flex: 1;
}

code {
  display: inline-block;
  padding: 0.08rem 0.35rem;
  border-radius: 6px;
  background: #f0f1f3;
  color: #23272c;
  font-family:
    "SFMono-Regular", "SF Mono", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

/* ========================================
   SETTINGS FORM GROUPING
   ======================================== */

.settings-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 6.6rem;
}

.settings-nav-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 251, 251, 0.88);
  box-shadow: 0 6px 18px rgba(22, 25, 28, 0.06);
}

.settings-nav-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.settings-nav-copy {
  margin: 0;
  color: #686d73;
  font-size: 0.8rem;
  line-height: 1.45;
}

.settings-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.settings-nav-link {
  display: block;
  padding: 0.56rem 0.68rem;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #195640;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.settings-nav-link:hover {
  text-decoration: none;
  background: #f0f1f2;
  border-color: #dcdee0;
}

.settings-nav-link.is-active,
.settings-nav-link[aria-current="location"] {
  background: linear-gradient(90deg, #e5e8eb, #f1f2f4);
  border-color: #9aa0a7;
  color: #202328;
  box-shadow:
    inset 5px 0 0 var(--accent),
    0 0 0 1px rgba(24, 98, 71, 0.18);
}

.settings-nav-link:focus-visible {
  outline-offset: 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.2rem;
  background: #f7f7f8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  scroll-margin-top: 8.8rem;
  position: relative;
  overflow: hidden;
}

.settings-section:target {
  border-color: #757d87;
  background: linear-gradient(180deg, #f9f9fa, #f2f3f4);
  box-shadow:
    0 0 0 4px rgba(24, 98, 71, 0.16),
    0 14px 30px rgba(17, 70, 51, 0.12);
}

.settings-section:target::before,
.home-section:target::before,
.reports-section:target::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  background: linear-gradient(90deg, #114633, #186247 46%, #34b586);
}

.settings-section-head {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.settings-section-wide {
  grid-column: 1 / -1;
}

.settings-section-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}

.settings-section-copy {
  margin: 0;
  color: #666a70;
  font-size: 0.84rem;
  line-height: 1.45;
}

.settings-note {
  padding: 0.65rem 0.75rem;
  border: 1px solid #dadcde;
  border-radius: var(--radius-sm);
  background: #f8f9fa;
  color: #42454a;
  font-size: 0.86rem;
  line-height: 1.4;
}

.settings-note-strong {
  display: block;
}

.settings-subtitle {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: #144533;
}

.settings-preflight {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.settings-remote-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.settings-surface {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid #dadcde;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fcfcfc, #f6f7f8);
}

.settings-surface-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.settings-preflight-header {
  padding-bottom: 0.1rem;
}

.settings-actions-row {
  align-items: stretch;
}

.settings-actions-row .btn {
  min-width: 8.75rem;
}

.settings-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.settings-fact {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 7.25rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #dcdddf;
  border-radius: var(--radius-sm);
  background: #fff;
}

.settings-fact strong {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.settings-fact span {
  color: #23262c;
  font-size: 0.88rem;
  font-weight: 700;
}

.preflight-summary {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.preflight-summary-main {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.preflight-summary-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.preflight-summary-copy strong {
  color: #144533;
  font-size: 0.92rem;
  line-height: 1.35;
}

.preflight-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.preflight-fact {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  background: #f0f1f2;
  color: #3c4045;
  font-size: 0.78rem;
}

.preflight-fact strong {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #696d74;
}

.preflight-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  margin-right: 0.45rem;
  padding: 0.18rem 0.52rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preflight-status.is-ok {
  background: #e6e9ec;
  color: #16513b;
}

.preflight-status.is-fail {
  background: #fde5ea;
  color: #7d1930;
}

.preflight-status.is-idle {
  background: #eeeff0;
  color: #565a5f;
}

.vm-status-chip {
  margin-left: 0.35rem;
  margin-right: 0;
  vertical-align: middle;
}

.preflight-list {
  display: grid;
  gap: 0.6rem;
}

.preflight-blockers {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.preflight-blockers-title {
  margin: 0;
  color: #6d2235;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.preflight-disclosure {
  margin-top: 0.55rem;
}

.preflight-disclosure summary {
  cursor: pointer;
  color: #3c4045;
  font-size: 0.8rem;
  font-weight: 700;
}

.preflight-disclosure summary:hover {
  color: #186247;
}

.preflight-technical {
  margin-top: 0.5rem;
  max-height: 220px;
  font-size: 0.75rem;
  line-height: 1.45;
}

.preflight-item {
  padding: 0.7rem 0.8rem;
  border: 1px solid #dddfe1;
  border-radius: var(--radius-sm);
  background: #fcfcfc;
}

.preflight-item.is-blocker {
  border-color: #efc0ca;
  background: #fff7f8;
}

.preflight-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.28rem;
}

.preflight-item-head strong {
  color: #154a36;
}

.preflight-item p {
  margin: 0;
  color: #505358;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.preflight-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.46rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preflight-chip.is-ok {
  background: #e6e9ec;
  color: #16513b;
}

.preflight-chip.is-fail {
  background: #fde5ea;
  color: #7d1930;
}

.preflight-chip.is-info {
  background: #e6eef9;
  color: #234a77;
}

.preflight-success-note {
  border-color: #d2d5da;
  background: #f6f7f9;
  color: #19553f;
}

.execution-note {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.execution-note.is-ok {
  border-color: #d2d5da;
  background: #f6f7f9;
  color: #19553f;
}

.execution-note.is-warn {
  border-color: #ecd7a0;
  background: #fff8e7;
  color: #6b4a0c;
}

.execution-note.is-fail {
  border-color: #efc0ca;
  background: #fff4f6;
  color: #7d1930;
}

.execution-note a {
  font-weight: 700;
}

.alerts-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.page-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.page-title {
  margin: 0;
}

.page-header-copy {
  margin: 0;
  max-width: 60ch;
}

.hero-note-title {
  margin: 0 0 0.8rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* ========================================
   FILTERS BAR
   ======================================== */

.filters-bar {
  display: flex;
  flex-wrap: wrap;
}

.filters-bar .field {
  flex: 1 1 140px;
}

.filters-bar .field-actions {
  display: flex;
  gap: 0.5rem;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.preset-active-label {
  margin-bottom: 0.65rem;
}

.filter-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  flex-wrap: wrap;
}

.filter-panel-copy {
  margin-bottom: 0;
  max-width: 60ch;
}

.filter-panel-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.8rem 0.9rem;
}

.filter-grid .field {
  grid-column: span 3;
  min-width: 0;
}

.filter-grid .field.is-wide {
  grid-column: span 4;
}

.filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.filter-summary-label {
  color: #65696f;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.38rem 0.65rem;
  border: 1px solid #dbdddf;
  border-radius: 999px;
  background: #f1f2f3;
  color: #19553f;
  font-size: 0.8rem;
  line-height: 1.2;
}

.filter-chip strong {
  color: #676c72;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.filter-chip.is-neutral {
  background: #f6f6f6;
  border-color: #e1e2e4;
}

.filter-chip.is-ready {
  background: #e8ebee;
  border-color: #c6cbd1;
  color: #195740;
}

.filter-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.filter-toolbar-note {
  margin: 0;
}

.admin-directory-head {
  align-items: flex-end;
}

.admin-directory-note {
  margin-bottom: 0;
}

.admin-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(180px, 0.7fr);
  gap: 0.85rem 0.9rem;
  align-items: end;
}

.admin-create-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 0.9rem;
  align-items: start;
}

.admin-create-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: stretch;
}

.admin-create-grid .field {
  min-width: 0;
  width: 100%;
}

.admin-create-panel {
  min-height: 100%;
}

.admin-create-actions {
  padding-top: 0.1rem;
}

.admin-create-actions-standalone {
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem 1rem;
  margin-top: 0.9rem;
  padding-top: 0.95rem;
  border-top: 1px solid #e2e3e5;
}

.admin-create-validation {
  margin: 0;
  flex: 1;
}

.admin-create-summary {
  flex: 1;
  min-width: 260px;
}

.admin-create-errors {
  margin-top: 0.45rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid #f0b8c3;
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: #6b1020;
}

.admin-create-errors[hidden] {
  display: none;
}

.admin-create-errors-title {
  margin: 0 0 0.35rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.admin-create-errors-list {
  margin: 0;
  padding-left: 1.2rem;
}

.admin-create-errors-list li + li {
  margin-top: 0.2rem;
}

.admin-field-feedback {
  margin: 0;
  color: #8a1a2d;
  font-size: 0.82rem;
  line-height: 1.35;
}

.admin-field-feedback[hidden] {
  display: none;
}

.admin-check-row {
  align-self: flex-start;
}

.admin-row-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  width: min(100%, 42rem);
  gap: 0.65rem;
}

.admin-row-actions-panel {
  width: 100%;
  max-width: none;
}

.admin-select-user[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.admin-selected-user-shell {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e3e5;
}

.admin-selected-user-empty {
  padding: 1rem 1.05rem;
  border: 1px dashed #d3d5d8;
  border-radius: var(--radius);
  background: #f8f9fa;
}

.admin-selected-user-empty h3 {
  margin: 0 0 0.3rem;
  font-size: 0.92rem;
}

.admin-selected-user-panel {
  display: grid;
  gap: 0.9rem;
  padding: 1rem 1.05rem;
  border: 1px solid #dcdee0;
  border-radius: var(--radius);
  background: #fafafb;
}

.admin-selected-user-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.admin-selected-user-name {
  margin: 0;
  font-size: 1.1rem;
  color: #23272c;
}

.admin-selected-user-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.admin-selected-user-created {
  color: var(--muted);
  font-size: 0.84rem;
}

.admin-action-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #dcdee0;
  border-radius: var(--radius);
  background: #f9f9fa;
}

.admin-action-group-wide {
  grid-column: 1 / -1;
  background: #f6f7f8;
}

.admin-action-group-compact {
  min-height: 100%;
}

.admin-action-title {
  margin: 0;
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-action-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.admin-inline-form {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.admin-inline-form select,
.admin-inline-form input[type="password"] {
  width: auto;
  min-width: 0;
}

.admin-inline-form input[type="password"] {
  min-width: 190px;
}

.admin-inline-form-wide {
  width: 100%;
}

.admin-inline-form-split {
  justify-content: space-between;
}

.admin-inline-form-stack {
  flex-direction: column;
  align-items: stretch;
}

.admin-inline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.admin-inline-check {
  padding: 0;
  white-space: nowrap;
  font-size: 0.88rem;
}

.admin-audit-details dt,
.admin-audit-details dd {
  line-height: 1.35;
}

.admin-audit-details {
  margin: 0;
  display: grid;
  gap: 0.3rem;
}

.admin-audit-details div {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.admin-audit-details dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-audit-details dd {
  margin: 0;
}

.admin-self-note {
  margin: 0;
}

.admin-user-name {
  display: block;
  font-weight: 700;
  color: #23272c;
}

.admin-user-email {
  display: block;
  color: var(--muted);
}

.platform-access-form-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.platform-access-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.platform-access-review-card {
  min-width: 0;
}

.platform-access-review-card.is-active {
  border-color: #c3c7cd;
  box-shadow: 0 12px 30px rgba(26, 29, 33, 0.12);
}

.platform-access-prep-card {
  background: linear-gradient(180deg, #f8f9fa, #f1f2f3);
}

.platform-access-prep-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.platform-access-prep-step {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #dcdee0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.platform-access-prep-step strong {
  color: #23272c;
}

.platform-access-prep-step span {
  color: var(--muted);
  font-size: 0.86rem;
}

.platform-access-single-email-field input {
  width: 100%;
}

.platform-access-scope-preview,
.platform-access-result-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.platform-access-scope-preview {
  margin-top: 0.25rem;
}

.platform-access-scope-stat,
.platform-access-result-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #dcdee0;
  border-radius: var(--radius);
  background: #f9f9fa;
}

.platform-access-scope-stat strong,
.platform-access-result-stat strong {
  font-size: 1.25rem;
  line-height: 1.1;
  color: #23272c;
}

.platform-access-scope-stat span,
.platform-access-result-stat span {
  color: var(--muted);
  font-size: 0.85rem;
}

.platform-access-scope-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.platform-access-input-field textarea,
.platform-access-note-field textarea {
  min-height: 132px;
}

.platform-access-results-head {
  align-items: flex-start;
}

.platform-access-result-summary {
  margin-bottom: 1rem;
}

.platform-access-result-stat.is-danger {
  border-color: #f0b8c3;
  background: var(--danger-soft);
}

.platform-access-result-stat.is-danger strong {
  color: #7f1730;
}

.page-platform-access .page-header-copy {
  max-width: 90ch;
}

.platform-access-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.platform-access-toolbar-actions {
  padding-top: 0;
}

.platform-access-check {
  justify-content: center;
  padding: 0;
}

.platform-access-email {
  font-weight: 700;
  color: #23272c;
}

.platform-access-user-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.platform-access-provider-list {
  color: #404449;
  font-size: 0.87rem;
}

.platform-access-grants-table {
  min-width: 900px;
}

.platform-access-grants-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 320px) auto;
  gap: 0.85rem;
  align-items: end;
  margin-bottom: 1rem;
}

.platform-access-grants-filter-actions {
  padding-top: 0;
}

.platform-access-grant-actions {
  display: grid;
  gap: 0.45rem;
  min-width: 240px;
}

.platform-access-grant-form,
.platform-access-grant-cancel-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.platform-access-grant-form input[type="datetime-local"] {
  min-width: 180px;
}

.platform-access-grant-form input[type="text"] {
  min-width: 180px;
  flex: 1 1 180px;
}

.platform-access-review-status {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}

.platform-access-row-note {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.platform-access-apply-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(280px, 1fr) minmax(
      280px,
      1fr
    );
  gap: 1rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid #dcdee0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fcfcfc, #f6f7f8);
}

.platform-access-note-field,
.platform-access-temporary-field,
.platform-access-confirmation-field {
  min-width: 0;
}

.platform-access-apply-copy h3 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: #23272c;
}

.platform-access-apply-copy p {
  margin: 0;
}

.platform-access-prod-warning {
  margin: 0;
}

.platform-access-prod-warning strong {
  display: block;
  margin-bottom: 0.2rem;
}

.platform-access-prod-warning p {
  margin: 0;
}

.platform-access-selection-summary {
  grid-column: 1 / -1;
  padding: 0.8rem 0.9rem;
  border: 1px solid #dcdee0;
  border-radius: var(--radius);
  background: #f9f9fa;
  color: #23272c;
  font-weight: 700;
}

.platform-access-confirmation-field {
  grid-column: auto;
}

.platform-access-apply-actions {
  grid-column: 1 / -1;
  padding-top: 0;
}

.platform-access-table {
  min-width: 1240px;
}

.platform-access-table td:first-child,
.platform-access-table th:first-child {
  width: 72px;
}

.platform-access-table td:nth-child(2),
.platform-access-table th:nth-child(2) {
  min-width: 180px;
}

.platform-access-table td:nth-child(3),
.platform-access-table th:nth-child(3) {
  min-width: 220px;
}

.platform-access-table td:nth-child(4),
.platform-access-table th:nth-child(4) {
  min-width: 210px;
}

.platform-access-table td:nth-child(7),
.platform-access-table th:nth-child(7) {
  min-width: 150px;
}

.platform-access-table td:nth-child(9),
.platform-access-table th:nth-child(9) {
  min-width: 200px;
}

.filter-presets {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  padding: 0.7rem 0.85rem;
  border: 1px solid #e0e2e4;
  border-radius: var(--radius);
  background: #f8f9fa;
}

.filter-presets-label {
  color: #65696f;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.reporting-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.reporting-intro-main {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reporting-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.reporting-intro-copy {
  margin: 0;
  max-width: 60ch;
}

.reporting-scope-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid #dddfe1;
  border-radius: 14px;
  background: linear-gradient(180deg, #f9fafb, #f1f2f4);
}

.reporting-scope-kicker {
  margin: 0;
  color: #676c72;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.reporting-scope-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid #e0e2e4;
}

.reporting-scope-total span {
  color: #56595e;
  font-size: 0.84rem;
  font-weight: 700;
}

.reporting-scope-total strong {
  color: #212429;
  font-size: 1.8rem;
  line-height: 1;
}

.reporting-scope-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
}

.reporting-scope-row {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.reporting-scope-row dt {
  color: #676c72;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.reporting-scope-row dd {
  margin: 0;
  color: #144533;
  font-size: 0.92rem;
  font-weight: 700;
}

.reporting-filter-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e2e4;
}

.reporting-filter-presets {
  background: #f8f8f9;
}

.reporting-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(170px, 0.7fr));
  gap: 0.85rem 0.9rem;
  align-items: end;
}

.reporting-filter-environment,
.reporting-filter-date {
  min-width: 0;
}

.reporting-filter-toolbar {
  align-items: center;
}

.reporting-filter-toolbar .filter-toolbar-note {
  max-width: 48ch;
}

/* ========================================
   CHECKBOXES
   ======================================== */

.items-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.45rem;
  padding: 0.9rem;
  background: #f6f6f7;
  border-radius: var(--radius);
  border: 1px solid #d9dbdd;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.1s;
  user-select: none;
}

.checkbox-label:hover {
  background: var(--accent-soft);
}

.checkbox-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.checkbox-label span {
  font-size: 0.94rem;
  line-height: 1.3;
}

/* Standalone toggle row (e.g. "Send output notifications") */
.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.94rem;
  cursor: pointer;
  padding: 0.2rem 0;
}

.check-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
}

/* ========================================
   TABLES
   ======================================== */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}

.table-wrap:focus-visible {
  outline: 3px solid var(--accent-focus);
  outline-offset: 2px;
}

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

table.table-medium {
  min-width: 620px;
}

table.table-wide {
  min-width: 760px;
}

caption {
  padding: 0.75rem 0.85rem 0.4rem;
  text-align: left;
  color: #393d41;
  font-size: 0.84rem;
  font-weight: 700;
}

th,
td {
  border-bottom: 1px solid #e7e8e9;
  text-align: left;
  padding: 0.62rem 0.75rem;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

th {
  background: #f0f1f2;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #424548;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody th[scope="row"] {
  background: transparent;
  color: var(--text);
  font-size: 0.91rem;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
  position: static;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:last-child th[scope="row"] {
  border-bottom: none;
}

tbody tr:hover td {
  background: #f6f6f7;
}

tbody tr:hover th[scope="row"] {
  background: #f6f6f7;
}

.td-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.table-top-actions {
  margin-bottom: -0.1rem;
}

.selection-counter {
  margin-left: auto;
  font-weight: 700;
}

.selection-row {
  margin-top: 0.7rem;
}

.table-cell-subtle {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.82rem;
}

.specific-targets-table th.col-select,
.specific-targets-table td.col-select {
  width: 72px;
  min-width: 72px;
  text-align: center;
}

.specific-targets-table td.col-select input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

/* ========================================
   BADGES
   ======================================== */

.badge {
  display: inline-block;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.queued {
  background: var(--warn-soft);
  color: var(--warn-text);
}

.badge.running,
.badge.cancelling {
  background: #d8e8ff;
  color: #163d6e;
  animation: badge-pulse 1.8s ease-in-out infinite;
}

.badge.success {
  background: var(--success-soft);
  color: #212429;
}

.badge.fail,
.badge.cancelled {
  background: #fddde3;
  color: #6e1527;
}

@keyframes badge-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* ========================================
   STATS GRID
   ======================================== */

.batch-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.2rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat strong {
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat span {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.home-stats {
  margin-bottom: 0;
}

/* ---------- Batch progress bar ---------- */
.batch-progress {
  margin: 0 0 1.1rem;
}

.batch-progress-track {
  display: flex;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--line);
}

.batch-progress-seg {
  height: 100%;
  transition: width 0.4s ease;
}

.batch-progress-seg.seg-success {
  background: var(--success);
}

.batch-progress-seg.seg-running {
  background: var(--info);
  animation: badge-pulse 1.8s ease-in-out infinite;
}

.batch-progress-seg.seg-fail {
  background: var(--danger);
}

.batch-progress-seg.seg-queued {
  background: var(--line-strong);
}

.batch-progress-label {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ---------- Status-tinted stat cards ---------- */
.stat {
  border-left: 3px solid var(--line);
  transition:
    opacity 0.2s ease,
    border-color 0.2s ease;
}

.stat--running {
  border-left-color: var(--info);
}
.stat--success {
  border-left-color: var(--success);
}
.stat--fail {
  border-left-color: var(--danger);
}
.stat--cancelled {
  border-left-color: var(--danger);
}
.stat--queued {
  border-left-color: var(--warn-text);
}

/* De-emphasize a stat that's currently zero so the eye lands on what matters. */
.stat.is-zero {
  opacity: 0.5;
  border-left-color: var(--line);
}

/* ---------- Directional cross-env deploy button ---------- */
.deploy-to-other-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.deploy-to-other-btn .btn-cross-arrow {
  font-size: 1.05em;
  line-height: 1;
}

.deploy-to-other-btn .btn-direction {
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.12em 0.5em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  white-space: nowrap;
}

/* ========================================
   META GRID (deployment detail)
   ======================================== */

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem 1rem;
  margin-bottom: 1.2rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.meta-item dt {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.meta-item dd {
  margin: 0;
  font-size: 0.94rem;
  word-break: break-all;
}

.meta-item-full {
  grid-column: 1 / -1;
}

.profile-mfa-qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 1.2rem;
  padding: 1rem;
  border: 1px solid #dadcde;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fcfcfc, #f6f7f8);
}

.profile-mfa-qr-title {
  margin: 0;
  font-size: 1rem;
}

.profile-mfa-qr-image {
  width: min(240px, 100%);
  height: auto;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.profile-mfa-manual-hint {
  margin-top: -0.4rem;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.detail-header .page-title {
  margin: 0;
}

.detail-command {
  margin-top: 0.3rem;
}

/* ========================================
   LOG OUTPUT
   ======================================== */

pre {
  margin: 0;
  background: #181a1c;
  color: #dcdfe3;
  border-radius: var(--radius);
  padding: 1rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.83rem;
  line-height: 1.55;
}

.logbox {
  max-height: 480px;
}

.log-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

/* ========================================
   HOME PAGE
   ======================================== */

.home-hero {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) minmax(220px, 1fr);
  gap: 1.5rem;
  align-items: start;
  background:
    radial-gradient(560px 250px at 12% -8%, #d8dbdf, transparent 68%),
    radial-gradient(420px 220px at 100% 0%, #ebedef, transparent 70%),
    var(--panel);
}

.home-hero h1 {
  margin-bottom: 0.4rem;
}

.home-hero h2 {
  margin: 0 0 0.2rem;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.home-actions {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}

.home-nav {
  position: sticky;
  top: 6.6rem;
}

.home-nav-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 251, 251, 0.88);
  box-shadow: 0 6px 18px rgba(22, 25, 28, 0.06);
}

.home-nav-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.home-nav-copy {
  margin: 0;
  color: #686d73;
  font-size: 0.8rem;
  line-height: 1.45;
}

.home-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.home-nav-link {
  display: block;
  padding: 0.56rem 0.68rem;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #195640;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.home-nav-link:hover {
  text-decoration: none;
  background: #f0f1f2;
  border-color: #dcdee0;
}

.home-nav-link.is-active,
.home-nav-link[aria-current="location"] {
  background: linear-gradient(90deg, #e5e8eb, #f1f2f4);
  border-color: #9aa0a7;
  color: #202328;
  box-shadow:
    inset 5px 0 0 var(--accent),
    0 0 0 1px rgba(24, 98, 71, 0.18);
}

.home-nav-link:focus-visible {
  outline-offset: 0;
}

.home-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.home-section {
  scroll-margin-top: 8.8rem;
  position: relative;
  overflow: hidden;
}

.home-section:target {
  border-color: #757d87;
  background: linear-gradient(180deg, #f9f9fa, #f2f3f4);
  box-shadow:
    0 0 0 4px rgba(24, 98, 71, 0.16),
    0 14px 30px rgba(17, 70, 51, 0.12);
}

.reports-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}

.reports-nav {
  position: sticky;
  top: 6.6rem;
}

.reports-nav-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 251, 251, 0.88);
  box-shadow: 0 6px 18px rgba(22, 25, 28, 0.06);
}

.reports-nav-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.reports-nav-copy {
  margin: 0;
  color: #686d73;
  font-size: 0.8rem;
  line-height: 1.45;
}

.reports-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.reports-nav-link {
  display: block;
  padding: 0.56rem 0.68rem;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #195640;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.reports-nav-link:hover {
  text-decoration: none;
  background: #f0f1f2;
  border-color: #dcdee0;
}

.reports-nav-link.is-active,
.reports-nav-link[aria-current="location"] {
  background: linear-gradient(90deg, #e5e8eb, #f1f2f4);
  border-color: #9aa0a7;
  color: #202328;
  box-shadow:
    inset 5px 0 0 var(--accent),
    0 0 0 1px rgba(24, 98, 71, 0.18);
}

.reports-nav-link:focus-visible {
  outline-offset: 0;
}

.reports-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.reports-section {
  scroll-margin-top: 8.8rem;
  position: relative;
  overflow: hidden;
}

.reports-section:target {
  border-color: #757d87;
  background: linear-gradient(180deg, #f9f9fa, #f2f3f4);
  box-shadow:
    0 0 0 4px rgba(24, 98, 71, 0.16),
    0 14px 30px rgba(17, 70, 51, 0.12);
}

.hero-note {
  border: 1px solid #dadcde;
  border-radius: var(--radius);
  background: #f6f7f8;
  padding: 1.1rem;
}

.hero-note h3 {
  margin: 0 0 0.8rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.hero-note p {
  margin: 0.35rem 0;
  font-size: 0.91rem;
  color: #35383c;
}

.section-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}

.section-nav {
  position: sticky;
  top: 6.6rem;
}

.section-nav-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 251, 251, 0.88);
  box-shadow: 0 6px 18px rgba(22, 25, 28, 0.06);
}

.section-nav-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.section-nav-copy {
  margin: 0;
  color: #686d73;
  font-size: 0.8rem;
  line-height: 1.45;
}

.section-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.section-nav-link {
  display: block;
  padding: 0.56rem 0.68rem;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #195640;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.section-nav-link:hover {
  text-decoration: none;
  background: #f0f1f2;
  border-color: #dcdee0;
}

.section-nav-link.is-active,
.section-nav-link[aria-current="location"] {
  background: linear-gradient(90deg, #e5e8eb, #f1f2f4);
  border-color: #9aa0a7;
  color: #202328;
  box-shadow:
    inset 5px 0 0 var(--accent),
    0 0 0 1px rgba(24, 98, 71, 0.18);
}

.section-nav-link:focus-visible {
  outline-offset: 0;
}

.section-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.page-section {
  scroll-margin-top: 8.8rem;
  position: relative;
  overflow: hidden;
}

.page-section:target {
  border-color: #757d87;
  background: linear-gradient(180deg, #f9f9fa, #f2f3f4);
  box-shadow:
    0 0 0 4px rgba(24, 98, 71, 0.16),
    0 14px 30px rgba(17, 70, 51, 0.12);
}

.page-section:target::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #186247, #0f9b68 72%, #71d6b1);
}

.page-section-head {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.page-section-head h2 {
  margin: 0;
}

.section-card-copy {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.deploy-chooser {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.deploy-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.deploy-choice-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(
      320px 140px at 100% 0%,
      rgba(24, 98, 71, 0.08),
      transparent 72%
    ),
    #f8f9fa;
}

.deploy-choice-card h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #144533;
}

.deploy-choice-card p {
  margin: 0;
}

.deploy-choice-kicker {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.7rem;
}

.insight-card {
  background: #f7f7f8;
  border: 1px solid #dadcde;
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
}

.insight-card h3 {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.insight-value {
  margin: 0.4rem 0 0.2rem;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}

.utilization {
  margin-top: 0.9rem;
}

.utilization-bar {
  width: 100%;
  height: 10px;
  background: #e7e8e9;
  border-radius: 999px;
  border: 1px solid #d5d7d9;
  overflow: hidden;
}

.utilization-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #44c998, #298c67);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1100px) {
  .platform-access-review-grid,
  .platform-access-prep-grid,
  .platform-access-grants-filter,
  .admin-create-layout,
  .admin-create-grid,
  .admin-filter-grid,
  .platform-access-form-grid,
  .platform-access-apply-shell {
    grid-template-columns: 1fr;
  }

  .admin-row-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .admin-selected-user-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-inline-form,
  .admin-inline-form-wide {
    width: 100%;
  }

  .admin-inline-form-split,
  .admin-inline-actions {
    justify-content: flex-start;
  }

  .admin-inline-form select,
  .admin-inline-form input[type="password"] {
    width: 100%;
  }

  .reporting-intro {
    grid-template-columns: 1fr;
  }

  .reporting-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reporting-filter-environment {
    grid-column: 1 / -1;
  }

  .filter-grid .field,
  .filter-grid .field.is-wide {
    grid-column: span 6;
  }

  .filters-bar .field {
    flex: 1 1 160px;
  }
}

@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .topbar-brand-center {
    position: static;
    order: 1;
    width: 100%;
    max-width: none;
    padding: 0;
    transform: none;
    justify-content: center;
    text-align: center;
  }

  .topbar-main {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.7rem;
    order: 2;
  }

  .topnav {
    width: 100%;
    order: 2;
    justify-content: flex-start;
    border-radius: var(--radius);
  }

  .userbox {
    order: 3;
    margin-left: auto;
    justify-content: flex-end;
  }

  .account-summary-role {
    font-size: 0.66rem;
  }

  .topbar-status {
    justify-content: flex-start;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .queue-summary {
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .home-hero {
    grid-template-columns: 1fr;
  }

  .section-layout,
  .home-layout {
    grid-template-columns: 1fr;
  }

  .reports-layout {
    grid-template-columns: 1fr;
  }

  .section-nav,
  .home-nav {
    position: static;
  }

  .reports-nav {
    position: static;
  }

  .items-checkboxes {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .batch-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .settings-actions-row .btn {
    flex: 1 1 12rem;
  }
}

@media (max-width: 1180px) {
  .topbar {
    flex-wrap: wrap;
    gap: 0.7rem;
  }

  .topbar-brand-center {
    position: static;
    order: 1;
    width: 100%;
    max-width: none;
    padding: 0;
    transform: none;
    justify-content: flex-start;
    text-align: left;
  }

  .topbar-main {
    order: 2;
    flex: 1 1 auto;
  }

  .userbox {
    order: 3;
    margin-left: auto;
  }
}

@media (max-width: 620px) {
  .topbar-status {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .queue-summary {
    width: 100%;
    justify-content: space-between;
    gap: 0.45rem;
  }

  .queue-pill {
    flex: 0 1 auto;
    min-width: auto;
  }

  .queue-pill + .queue-pill::before {
    display: none;
  }

  .queue-pill-label {
    font-size: 0.54rem;
  }

  .queue-pill strong {
    min-width: 1.2rem;
    height: 1.2rem;
    font-size: 0.68rem;
  }

  .topbar-brand-center {
    gap: 0.14rem;
  }

  .topbar-brand-name {
    font-size: 0.94rem;
    letter-spacing: 0.06em;
  }

  .topbar-brand-tag {
    margin-top: 0.18rem;
    font-size: 0.54rem;
    letter-spacing: 0.12em;
  }

  .content {
    margin-top: 0.6rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .card {
    padding: 1.1rem;
    border-radius: var(--radius);
  }

  .card.narrow {
    padding: 1.5rem;
    margin-top: 1.5rem;
  }

  .batch-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .detail-header {
    align-items: flex-start;
  }

  .form-inline,
  .password-input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .password-input-row .btn,
  .form-inline .btn,
  .settings-actions-row .btn {
    width: 100%;
  }

  .filters-bar .field {
    flex: 1 1 100%;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .reporting-filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-grid .field,
  .filter-grid .field.is-wide {
    grid-column: auto;
  }

  .filter-presets {
    align-items: flex-start;
  }

  .section-layout,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .section-nav,
  .settings-nav {
    position: static;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  table.table-medium,
  table.table-wide {
    min-width: 540px;
  }

  .preflight-summary-main {
    flex-direction: column;
  }

  .preflight-facts {
    flex-direction: column;
  }

  .preflight-fact {
    justify-content: space-between;
  }
}

/* ============================================================
   UI Refresh Layer — smoother interactions + theme toggle
   Additive only; layers on top of the existing system.
   ============================================================ */
:root {
  --ring: 0 0 0 3px rgba(15, 155, 104, 0.32);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --lift: 0 16px 36px rgba(26, 29, 33, 0.16);
}

/* Smooth, consistent transitions across interactive surfaces */
a,
.btn,
.card,
.badge,
.filter-chip,
.stat,
.insight-card,
.topnav a,
input,
select,
textarea {
  transition:
    background-color 0.18s var(--ease),
    border-color 0.18s var(--ease),
    color 0.18s var(--ease),
    box-shadow 0.18s var(--ease),
    transform 0.14s var(--ease);
}

/* Buttons: subtle lift + crisp keyboard focus */
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible,
.topnav a:focus-visible,
.account-menu-item:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}

/* Cards: gentle hover elevation */
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--lift);
}

/* Inputs: smooth focus glow */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-focus);
  box-shadow: var(--ring);
}

/* Table rows: hover highlight for scanability */
tbody tr { transition: background-color 0.14s var(--ease); }
tbody tr:hover td,
tbody tr:hover th[scope="row"] { background: var(--accent-soft); }

/* Status badges: leading status dot (deployment states only) */
.badge { display: inline-flex; align-items: center; gap: 0.42em; }
.badge.queued::before,
.badge.running::before,
.badge.cancelling::before,
.badge.success::before,
.badge.fail::before,
.badge.cancelled::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.9;
  flex: none;
}
.badge.running::before,
.badge.cancelling::before {
  animation: badge-dot-pulse 1.4s var(--ease) infinite;
}
@keyframes badge-dot-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(0.55); opacity: 0.4; }
}

/* Gentle page entrance */
@media (prefers-reduced-motion: no-preference) {
  #main-content { animation: page-rise 0.28s var(--ease) both; }
  @keyframes page-rise {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
  }
}

/* Respect reduced-motion globally */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Theme toggle button (sits in the topbar) */
.theme-toggle {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.18s var(--ease), transform 0.14s var(--ease);
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.18); transform: translateY(-1px); }
.theme-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4); }

/* ---------- Dark theme (opt-in via html[data-theme="dark"]) ---------- */
html[data-theme="dark"] {
  --bg-0: #111213;
  --bg-1: #0d0e0f;
  --bg-2: #191b1d;
  --panel: #191a1b;
  --text: #eaebec;
  --muted: #a5a8ad;
  --line: #2d2f31;
  --line-strong: #3d4044;
  --accent: #34b384;
  --accent-strong: #288e69;
  --accent-soft: #202327;
  --accent-focus: #43cc9a;
  --danger: #f0768a;
  --danger-soft: #38161e;
  --success: #5cd1a6;
  --success-soft: #1d2025;
  --info: #38bdf8;
  --warn-soft: #38300f;
  --warn-text: #e8c479;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  --ring: 0 0 0 3px rgba(67, 204, 154, 0.35);
  --lift: 0 16px 36px rgba(0, 0, 0, 0.55);
}
/* Re-skin the structural surfaces that use hardcoded colors */
html[data-theme="dark"] body {
  background:
    radial-gradient(1000px 600px at 95% -10%, var(--bg-2), transparent 70%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
}
html[data-theme="dark"] .card {
  background: linear-gradient(180deg, #1e1f21, var(--panel));
  border-color: var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .topbar {
  background: linear-gradient(100deg, #191c20, #22262c 65%, #17513c);
  border-bottom-color: #131619;
}
html[data-theme="dark"] th { background: #1d1f21; color: var(--muted); }
html[data-theme="dark"] th,
html[data-theme="dark"] td { border-bottom-color: var(--line); }
html[data-theme="dark"] caption { color: var(--muted); }
html[data-theme="dark"] .field label,
html[data-theme="dark"] .form-label { color: var(--text); }
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line-strong);
}
html[data-theme="dark"] .badge.running,
html[data-theme="dark"] .badge.cancelling { background: #15324f; color: #bcd8ff; }
html[data-theme="dark"] .badge.fail,
html[data-theme="dark"] .badge.cancelled { background: #3a1620; color: #f3b0bd; }
html[data-theme="dark"] .badge.success { background: var(--success-soft); color: #d2d6db; }
html[data-theme="dark"] tbody tr:hover td,
html[data-theme="dark"] tbody tr:hover th[scope="row"] { background: rgba(52, 179, 132, 0.12); }
/* Dark: re-skin remaining light surface components */
html[data-theme="dark"] .stat,
html[data-theme="dark"] .table-wrap { background: var(--panel); border-color: var(--line); }
html[data-theme="dark"] .insight-card,
html[data-theme="dark"] .hero-note { background: #1c1d1e; border-color: var(--line); }
html[data-theme="dark"] .section-nav-card {
  background: rgba(25, 26, 27, 0.9);
  border-color: var(--line);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] .filter-chip {
  background: var(--accent-soft);
  border-color: var(--line);
  color: var(--text);
}

/* ============================================================
   Modern SaaS neutral — crisp emerald accent + neutral top bar
   (appended last so it wins; token-driven so it auto-themes)
   ============================================================ */
:root {
  --accent: #059669;
  --accent-strong: #047857;
  --accent-focus: #10b981;
  --accent-soft: #ecfdf5;
}

/* Neutral top bar in both themes */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  backdrop-filter: none;
}
html[data-theme="dark"] .topbar {
  background: var(--panel);
  border-bottom-color: var(--line);
}
.topbar::before { display: none; }
.topbar-brand-name { color: var(--text); }
.topbar-brand-tag { color: var(--muted); }
.topnav a { color: var(--muted); }
.topnav a:hover { color: var(--text); background: var(--bg-1); }
.topnav a.active,
.topnav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.account-summary-name { color: var(--text); }
.account-summary-role { color: var(--muted); }
.account-avatar { background: var(--accent); color: #fff; }
.theme-toggle { border-color: var(--line); background: transparent; color: var(--text); }
.theme-toggle:hover { background: var(--bg-1); }
/* Dark: neutralize the queue-status strip */
html[data-theme="dark"] .topbar-status { background: var(--bg-1); border-bottom-color: var(--line); }
html[data-theme="dark"] .queue-pill { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
html[data-theme="dark"] .queue-pill strong { color: var(--text); }

/* ============================================================
   DARK THEME — "cyber" terminal vibe (amber/cyan on near-black)
   Scoped entirely to html[data-theme="dark"]; light theme untouched.
   ============================================================ */
html[data-theme="dark"] {
  --bg-0: #0a0f14;
  --bg-1: #070b0f;
  --bg-2: #0e1822;
  --panel: #0c131c;
  --text: #c9e9f2;
  --muted: #6f8b97;
  --line: #15303a;
  --line-strong: #1d4250;
  --accent: #22d3ee;        /* cyan primary */
  --accent-strong: #06b6d4;
  --accent-focus: #67e8f9;
  --accent-soft: #0c2630;
  --danger: #ff5d73;
  --danger-soft: #2a0f16;
  --success: #5ef2c0;
  --success-soft: #0a2620;
  --warn-soft: #2a2008;
  --warn-text: #ffc857;     /* amber secondary */
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  --ring: 0 0 0 2px rgba(34, 211, 238, 0.45), 0 0 14px rgba(34, 211, 238, 0.3);
  --lift: 0 14px 36px rgba(0, 0, 0, 0.7);
}

/* Monospace everything in dark for the terminal feel */
html[data-theme="dark"] body,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] button,
html[data-theme="dark"] .btn {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo,
    Consolas, "Liberation Mono", monospace;
  letter-spacing: 0.01em;
}

/* Duotone glow backdrop */
html[data-theme="dark"] body {
  background:
    radial-gradient(900px 520px at 100% -5%, rgba(34, 211, 238, 0.09), transparent 70%),
    radial-gradient(820px 520px at 0% 105%, rgba(255, 176, 0, 0.055), transparent 70%),
    linear-gradient(180deg, #0a0f14, #070b0f);
}

/* Surfaces: near-black panels, dim cyan hairlines */
html[data-theme="dark"] .card,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .insight-card,
html[data-theme="dark"] .hero-note,
html[data-theme="dark"] .section-nav-card {
  background: linear-gradient(180deg, #0d1622, #0b121b);
  border-color: var(--line);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.04), 0 12px 30px rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] .topbar {
  background: #0a1119;
  border-bottom-color: var(--accent-soft);
  box-shadow: 0 1px 0 rgba(34, 211, 238, 0.15);
}
html[data-theme="dark"] th { background: #0c1722; color: var(--accent); border-bottom-color: var(--line); }
html[data-theme="dark"] th, html[data-theme="dark"] td { border-bottom-color: var(--line); }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { background: #0a121b; color: var(--text); border-color: var(--line-strong); }

/* Neon glow on accent text */
html[data-theme="dark"] .topbar-brand-name,
html[data-theme="dark"] a { color: var(--accent); }
html[data-theme="dark"] .topbar-brand-name { text-shadow: 0 0 10px rgba(34, 211, 238, 0.5); }
html[data-theme="dark"] .topbar-brand-tag,
html[data-theme="dark"] .page-kicker,
html[data-theme="dark"] .section-kicker { color: var(--warn-text); text-shadow: 0 0 8px rgba(255, 176, 0, 0.35); }
html[data-theme="dark"] .topnav a { color: var(--muted); }
html[data-theme="dark"] .topnav a:hover { color: var(--accent); background: rgba(34, 211, 238, 0.08); }
html[data-theme="dark"] .topnav a.active,
html[data-theme="dark"] .topnav a[aria-current="page"] {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.1);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.35), 0 0 12px rgba(34, 211, 238, 0.2);
}
html[data-theme="dark"] h1, html[data-theme="dark"] h2 { color: #e3f6fb; }

/* Primary buttons: cyan with glow; accents on focus */
html[data-theme="dark"] .btn {
  background: var(--accent);
  color: #042029;
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.35);
}
html[data-theme="dark"] .btn:hover { box-shadow: 0 0 22px rgba(34, 211, 238, 0.55); }
html[data-theme="dark"] .account-avatar { background: var(--accent); color: #042029; box-shadow: 0 0 12px rgba(34, 211, 238, 0.4); }

/* Badges: mono + neon, semantic mapped to the cyber palette */
html[data-theme="dark"] .badge { font-family: ui-monospace, "SF Mono", Menlo, monospace; border: 1px solid transparent; }
html[data-theme="dark"] .badge.success { background: rgba(94, 242, 192, 0.12); color: #5ef2c0; border-color: rgba(94, 242, 192, 0.4); text-shadow: 0 0 8px rgba(94, 242, 192, 0.5); }
html[data-theme="dark"] .badge.fail,
html[data-theme="dark"] .badge.cancelled { background: rgba(255, 93, 115, 0.12); color: #ff7d8e; border-color: rgba(255, 93, 115, 0.4); text-shadow: 0 0 8px rgba(255, 93, 115, 0.45); }
html[data-theme="dark"] .badge.running,
html[data-theme="dark"] .badge.cancelling { background: rgba(34, 211, 238, 0.12); color: #67e8f9; border-color: rgba(34, 211, 238, 0.4); text-shadow: 0 0 8px rgba(34, 211, 238, 0.5); }
html[data-theme="dark"] .badge.queued { background: rgba(255, 200, 87, 0.12); color: #ffc857; border-color: rgba(255, 200, 87, 0.4); text-shadow: 0 0 8px rgba(255, 176, 0, 0.4); }

/* Queue status strip */
html[data-theme="dark"] .topbar-status { background: #080d13; border-bottom-color: var(--line); }
html[data-theme="dark"] .queue-pill { background: rgba(34, 211, 238, 0.07); color: var(--muted); }
html[data-theme="dark"] .queue-pill strong { color: var(--accent); }
/* Dark cyber: preserve button hierarchy (ghost outline, danger red) */
html[data-theme="dark"] .btn-ghost { background: transparent; color: var(--accent); border-color: var(--accent); box-shadow: none; }
html[data-theme="dark"] .btn-ghost:hover { background: rgba(34, 211, 238, 0.1); box-shadow: 0 0 12px rgba(34, 211, 238, 0.25); }
html[data-theme="dark"] .btn-danger { background: var(--danger); color: #1a0710; border-color: var(--danger); box-shadow: 0 0 14px rgba(255, 93, 115, 0.4); }
html[data-theme="dark"] .btn-danger:hover { box-shadow: 0 0 20px rgba(255, 93, 115, 0.6); }
/* Dark cyber: cover components the base overrides missed (cards/notes/sections/alerts) */
html[data-theme="dark"] { --muted: #8aa9b6; }  /* brighter secondary text for contrast */
html[data-theme="dark"] .deploy-choice-card,
html[data-theme="dark"] .settings-section,
html[data-theme="dark"] .settings-surface,
html[data-theme="dark"] .settings-nav-card,
html[data-theme="dark"] .execution-note,
html[data-theme="dark"] .settings-note {
  background: linear-gradient(180deg, #0d1622, #0b121b);
  border-color: var(--line);
  color: var(--text);
}
html[data-theme="dark"] .deploy-choice-card h2 { color: #e3f6fb; }
html[data-theme="dark"] .deploy-choice-card p,
html[data-theme="dark"] .settings-section-copy,
html[data-theme="dark"] .settings-note,
html[data-theme="dark"] .execution-note { color: var(--text); }
html[data-theme="dark"] .settings-section-title {
  color: var(--warn-text);
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.3);
  border-bottom-color: var(--line);
}
html[data-theme="dark"] .settings-note-strong,
html[data-theme="dark"] .execution-note strong { color: var(--accent); }
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .field label { color: var(--text); }
html[data-theme="dark"] .hint,
html[data-theme="dark"] .settings-subtitle { color: var(--muted); }
/* Alerts */
html[data-theme="dark"] .alert { border-color: var(--line); color: var(--text); }
html[data-theme="dark"] .alert.success { background: var(--success-soft); border-color: rgba(94, 242, 192, 0.4); color: #bff7e2; }
html[data-theme="dark"] .alert.error { background: var(--danger-soft); border-color: rgba(255, 93, 115, 0.4); color: #ffc4cc; }
/* Settings nav active */
html[data-theme="dark"] .settings-nav-link.is-active,
html[data-theme="dark"] .settings-nav-link[aria-current="location"] { color: var(--accent); background: rgba(34, 211, 238, 0.1); }
/* Dark cyber: inline code chips */
html[data-theme="dark"] code,
html[data-theme="dark"] kbd {
  background: rgba(34, 211, 238, 0.1);
  color: #9fe9f6;
  border: 1px solid var(--line);
}

/* Live-log streaming indicator */
.log-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--success);
  text-transform: uppercase;
}
.log-live-dot {
  width: 0.55em;
  height: 0.55em;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: log-live-pulse 1.3s ease-in-out infinite;
}
@keyframes log-live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.6); }
}
html[data-theme="dark"] .log-live { color: #5ef2c0; text-shadow: 0 0 8px rgba(94, 242, 192, 0.5); }
/* Batch header action row */
.batch-header-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* Dark: re-apply the status tints the cyber `.stat` border-color reset clears,
   and tune the cross-env direction pill for the dark (cyan) button. */
html[data-theme="dark"] .stat { border-left: 3px solid var(--line); }
html[data-theme="dark"] .stat--running { border-left-color: var(--info); }
html[data-theme="dark"] .stat--success { border-left-color: var(--success); }
html[data-theme="dark"] .stat--fail,
html[data-theme="dark"] .stat--cancelled { border-left-color: var(--danger); }
html[data-theme="dark"] .stat--queued { border-left-color: var(--warn-text); }
html[data-theme="dark"] .stat.is-zero { border-left-color: var(--line); }
html[data-theme="dark"] .deploy-to-other-btn .btn-direction { background: rgba(0, 0, 0, 0.2); }
html[data-theme="dark"] .batch-progress-track { background: #0a121b; border-color: var(--line); }

/* ---------- Log action toolbar spacer ---------- */
.log-actions-spacer { flex: 1 1 auto; }

/* ---------- Branded confirm dialog ---------- */
.app-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 460px;
  width: calc(100% - 2rem);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}
.app-dialog::backdrop {
  background: rgba(16, 20, 24, 0.5);
  backdrop-filter: blur(2px);
}
.app-dialog-body {
  padding: 1.4rem 1.5rem;
}
.app-dialog-title {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
}
.app-dialog-message {
  margin: 0 0 1.3rem;
  color: var(--muted);
  line-height: 1.5;
}
.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}
@media (prefers-reduced-motion: no-preference) {
  .app-dialog[open] {
    animation: app-dialog-in 0.16s var(--ease, ease) both;
  }
  @keyframes app-dialog-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: none; }
  }
}
html[data-theme="dark"] .app-dialog {
  background: linear-gradient(180deg, #0d1622, #0b121b);
  border-color: var(--line);
}
html[data-theme="dark"] .app-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}
