/* Fluxmox — RBF Studio VFX
   Identité : salle d'étalonnage. Noir chaud profond, accent ambre tungstène,
   grain de pellicule discret, chiffres en mono (feel timecode). */

:root {
  color-scheme: dark;
  --bg: #0a0a0c;
  --bg-elevated: #101014;
  --bg-card: #121218;
  --bg-hover: #1a1a21;
  --border: rgba(255, 244, 230, 0.07);
  --border-strong: rgba(255, 244, 230, 0.14);
  --text: #f0ede6;
  --text-muted: #9a968c;
  --text-faint: #635f57;
  --accent: #f0a13c;
  --accent-bright: #ffc46b;
  --accent-soft: rgba(240, 161, 60, 0.12);
  --accent-glow: rgba(240, 161, 60, 0.35);
  --kitsu: #4dd7b4;
  --kitsu-soft: rgba(77, 215, 180, 0.12);
  --ftrack: #b18cff;
  --ftrack-soft: rgba(177, 140, 255, 0.12);
  --ok: #3ddc97;
  --warn: #f5c04e;
  --err: #f2635f;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --font: "Inter", system-ui, sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Écran de projection : glow tungstène en haut, coins assombris (vignette). */
body {
  background:
    radial-gradient(ellipse 75% 45% at 50% -12%, rgba(240, 161, 60, 0.09), transparent),
    radial-gradient(ellipse 50% 35% at 100% 0%, rgba(77, 215, 180, 0.045), transparent),
    radial-gradient(ellipse 130% 100% at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.5)),
    var(--bg);
  background-attachment: fixed;
}

/* Grain de pellicule — très léger, ne bloque aucun clic. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

h1,
h2,
h3,
.brand-title,
.stat-value,
.login-card h1 {
  font-family: var(--display);
}

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

/* Rôles : les éléments admin sont cachés pour les artistes (double garde avec
   .admin-only togglé en JS) ; .artist-only n'apparaît que pour les artistes. */
body:not(.is-admin) .admin-col {
  display: none;
}

body.is-admin .artist-only {
  display: none;
}

.shell {
  display: grid;
  grid-template-columns: 272px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 1.15rem;
  border-right: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.25rem 0.5rem;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  color: var(--accent);
  filter: drop-shadow(0 4px 14px var(--accent-glow));
}

.brand-title {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

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

.nav-item {
  position: relative;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.92rem;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* Vue active : rail ambre à gauche, comme un témoin d'enregistrement. */
.nav-item.active {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.session-card {
  margin-top: auto;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.session-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  font-weight: 600;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.field input,
.field select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus {
  border-color: rgba(240, 161, 60, 0.5);
  box-shadow: 0 0 0 3px rgba(240, 161, 60, 0.12);
}

.autocomplete {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  max-height: 14rem;
  overflow-y: auto;
}

.autocomplete-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.autocomplete-item:hover,
.autocomplete-item.is-active {
  background: var(--accent-soft);
}

.autocomplete-item-name {
  font-size: 0.82rem;
  color: var(--text);
}

.autocomplete-item-meta {
  font-size: 0.72rem;
  color: var(--text-faint);
}

.session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.password-dialog-card {
  width: min(420px, 92vw);
  text-align: left;
}

.password-dialog-copy {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.password-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.form-hint-error {
  color: var(--err);
}

.vm-status-cell {
  min-width: 10rem;
}

.vm-row-progress {
  margin-top: 0.35rem;
}

.vm-row-progress .progress-track {
  height: 6px;
}

.vm-row-progress .meta {
  font-size: 0.72rem;
  margin-top: 0.2rem;
  line-height: 1.3;
  color: var(--text-faint);
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0 0.5rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
}

.status-dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.15);
}

.status-dot.warn {
  background: var(--warn);
}

.status-dot.err {
  background: var(--err);
}

.main {
  padding: 2rem 2.25rem 3rem;
  max-width: 1280px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

/* Titre de vue avec sa barre-slate ambre. */
.topbar h1 {
  position: relative;
  margin: 0;
  padding-left: 0.9rem;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar h1::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.32rem;
  bottom: 0.32rem;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), rgba(240, 161, 60, 0.25));
}

.subtitle {
  margin: 0.35rem 0 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.meta {
  font-size: 0.82rem;
  color: var(--text-faint);
}

.btn {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(160deg, #f7b354, #e08f22);
  border-color: transparent;
  color: #191104;
  font-weight: 650;
  box-shadow: 0 4px 18px rgba(240, 161, 60, 0.22);
}

.btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 4px 24px rgba(240, 161, 60, 0.32);
}

.btn-ghost {
  background: transparent;
}

.btn-danger {
  background: rgba(242, 99, 95, 0.1);
  border-color: rgba(242, 99, 95, 0.5);
  color: var(--err);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(242, 99, 95, 0.2);
}

.btn-sm {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
}

.vm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  min-width: 11rem;
}

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

tr.vm-row-busy {
  background: rgba(240, 161, 60, 0.05);
}

tr.vm-row-busy code {
  color: var(--accent);
}

.btn-busy {
  pointer-events: none;
}

.btn-spinner {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin-right: 0.15rem;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  vertical-align: -0.1rem;
  animation: spin 0.75s linear infinite;
}

.provision-grid-single {
  grid-template-columns: minmax(0, 520px);
}

.vm-detail-nav {
  margin-bottom: 0.85rem;
}

.vm-detail-grid {
  margin-bottom: 1rem;
}

/* Corps de panel : tout contenu direct doit respirer par rapport aux bords. */
.vm-detail-info,
.vm-detail-actions {
  padding: 1.1rem 1.15rem 1.25rem;
}

.vm-spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1.25rem;
  margin: 0;
}

.vm-spec-grid dt {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 600;
}

.vm-spec-grid dd {
  margin: 0.2rem 0 0;
}

.vm-spec-wide {
  grid-column: 1 / -1;
}

.vm-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.vm-detail-action-grid {
  display: grid;
  gap: 0.55rem;
}

.vm-detail-action-hint {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.btn-link,
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
}

.btn-link:hover,
.link-btn:hover {
  text-decoration: underline;
}

.form-hint {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Les hints posés directement dans un panel (hors .form, qui a déjà son
   padding) ne doivent pas coller aux bords. */
.panel > .form-hint {
  margin: 0.85rem 1.15rem 0;
}

.panel > .form-hint:last-child {
  margin-bottom: 1.15rem;
}

.salt-minion-hint {
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
}

.salt-minion-hint.ok {
  color: var(--kitsu);
}

.salt-minion-hint.warn {
  color: var(--warn);
}

.setup-loading-hint {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

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

.btn-wide {
  width: 100%;
  margin-top: 0.5rem;
}

.hidden {
  display: none !important;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: view-in 0.22s ease;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.banner {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(242, 99, 95, 0.25);
  background: rgba(242, 99, 95, 0.08);
  color: #ffc9c5;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-card), rgba(14, 14, 18, 0.6));
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 600;
}

.stat-value {
  margin-top: 0.45rem;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-detail {
  margin-top: 0.25rem;
  font-size: 0.82rem;
  color: var(--text-faint);
}

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

.provision-grid {
  align-items: start;
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 244, 230, 0.015);
}

.panel-head h2 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.input-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
}

.integration-list,
.activity-list,
.provision-result {
  padding: 1rem 1.15rem 1.15rem;
}

.integration-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.integration-row:last-child {
  border-bottom: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

.chip-ok {
  color: var(--ok);
  background: rgba(61, 220, 151, 0.08);
  border-color: rgba(61, 220, 151, 0.22);
}

.chip-warn {
  color: var(--warn);
  background: rgba(245, 192, 78, 0.08);
  border-color: rgba(245, 192, 78, 0.22);
}

.chip-muted {
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.chip-kitsu {
  color: var(--kitsu);
  background: var(--kitsu-soft);
  border-color: rgba(77, 215, 180, 0.22);
}

.chip-ftrack {
  color: var(--ftrack);
  background: var(--ftrack-soft);
  border-color: rgba(177, 140, 255, 0.22);
}

.activity-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.activity-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.empty-state {
  color: var(--text-faint);
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  text-align: left;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 600;
}

tbody tr {
  transition: background 0.12s;
}

tbody tr:hover {
  background: rgba(240, 161, 60, 0.03);
}

tr.vm-row.selected {
  background: var(--accent-soft);
}

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

.host-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 1.15rem;
}

.host-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.host-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.host-card-excluded {
  opacity: 0.82;
  border-color: color-mix(in srgb, var(--warn) 45%, var(--border));
}

.host-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.deadline-farm-summary {
  padding: 1rem 1.15rem 0.25rem;
}

.deadline-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.deadline-stats strong {
  font-variant-numeric: tabular-nums;
}

.deadline-farm-hint.warn {
  color: var(--warn);
  font-size: 0.85rem;
}

.host-actions {
  margin-bottom: 0.75rem;
}

.meter {
  margin-top: 0.65rem;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.meter-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e08f22, var(--accent));
  transition: width 0.4s ease;
}

.form {
  padding: 1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.checkbox input {
  accent-color: var(--accent);
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}

.step {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.35rem;
  flex-shrink: 0;
  background: var(--text-faint);
}

.step-dot.completed {
  background: var(--ok);
}

.step-dot.pending {
  background: var(--warn);
}

.step-dot.in_progress {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(240, 161, 60, 0.2);
  animation: pulse-dot 1.2s ease-in-out infinite;
}

.step-dot.failed {
  background: var(--err);
}

.step-dot.skipped {
  background: var(--text-faint);
}

.verify-panel {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 244, 230, 0.02);
}

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

.verify-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.verify-lead {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.verify-list {
  display: grid;
  gap: 0.65rem;
}

.verify-row {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.verify-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 0.35rem;
  flex-shrink: 0;
  background: var(--text-faint);
}

.verify-dot.passed {
  background: var(--ok);
}

.verify-dot.failed {
  background: var(--err);
}

.verify-dot.skipped,
.verify-dot.unavailable {
  background: var(--warn);
}

.verify-body strong {
  display: block;
  font-size: 0.88rem;
}

.verify-body span {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 244, 230, 0.06);
  overflow: hidden;
  margin: 0.85rem 0 0.35rem;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e08f22, #ffc46b);
  box-shadow: 0 0 12px rgba(240, 161, 60, 0.35);
  transition: width 0.45s ease;
}

.progress-fill.indeterminate {
  width: 40%;
  animation: progress-slide 1.4s ease-in-out infinite;
}

.provision-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(6, 6, 8, 0.74);
  backdrop-filter: blur(4px);
  padding: 1rem;
}

.provision-overlay-card {
  width: min(460px, 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 1.25rem 1.35rem 1.35rem;
  box-shadow: var(--shadow);
}

.provision-overlay-title {
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--display);
}

.provision-overlay-detail {
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.connection-card {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(77, 215, 180, 0.25);
  background: rgba(77, 215, 180, 0.05);
}

.connection-card h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

.connection-card p,
.connection-card li {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.connection-card a {
  color: var(--accent);
}

.provision-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.redshift-admin-card {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 192, 78, 0.28);
  background: rgba(245, 192, 78, 0.05);
}

.redshift-admin-card.ok {
  border-color: rgba(77, 215, 180, 0.28);
  background: rgba(77, 215, 180, 0.05);
}

.redshift-admin-card.warn {
  border-color: rgba(245, 192, 78, 0.35);
  background: rgba(245, 192, 78, 0.07);
}

.redshift-admin-card.err {
  border-color: rgba(242, 99, 95, 0.35);
  background: rgba(242, 99, 95, 0.05);
}

.redshift-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.redshift-admin-head h3 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
}

.redshift-admin-lead {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 28rem;
  line-height: 1.4;
}

.redshift-admin-detail {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  word-break: break-word;
}

.redshift-admin-actions {
  margin-top: 0.55rem;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  display: block;
  width: 2.75rem;
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(154, 150, 140, 0.35);
  transition: background 0.2s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider.warn {
  background: var(--warn);
}

.toggle-switch input:focus-visible + .toggle-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(1.25rem);
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.55;
  cursor: not-allowed;
}

.toggle-switch:has(input:disabled) {
  cursor: not-allowed;
}

@keyframes pulse-dot {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.75;
  }
}

@keyframes progress-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(260%);
  }
}

.step-body strong {
  display: block;
  font-size: 0.88rem;
}

.step-body span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--bg-elevated);
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
}

.login-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.login-card {
  width: min(420px, 100%);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  text-align: center;
}

.login-mark {
  margin: 0 auto 1rem;
}

.login-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
}

.login-lead {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  text-align: left;
}

.login-error {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(242, 99, 95, 0.12);
  color: var(--err);
  font-size: 0.88rem;
}

.btn-block {
  width: 100%;
  margin-top: 0.35rem;
}

.session-role {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

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

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

@media (max-width: 640px) {
  .main {
    padding: 1.25rem;
  }

  .stats-grid,
  .field-row {
    grid-template-columns: 1fr;
  }
}

.salt-orphans-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 1.15rem 1rem;
}

.salt-orphan-key {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  background: rgba(255, 244, 230, 0.06);
}

.salt-orphans-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 1.15rem 1.15rem;
}
