/* webctl UI — enterprise data-dense.
 * No build step, no CDN. System fonts; monospace for versions/IDs/logs/paths.
 * Palette: B2B-service navy + sky-blue CTA + slate neutrals. WCAG AA-targeted.
 */

/* ============================================================
 * Design tokens
 * ============================================================ */
:root {
  /* ===== V2 Tokens (UI-DESIGN-V2 PR-1): calm tooling, white+indigo =====
   *
   * Filosofia: branco-creme, único acento indigo, status dessaturado pra
   * leitura calma. Inversão completa do V1 enterprise-data-dense. */

  /* Base — warm light */
  --c-bg:               #FAFAF7;
  --c-surface:          #FFFFFF;
  --c-surface-sunken:   #F4F4F0;
  --c-surface-elevated: #FFFFFF;  /* sem elevation tonal — sombra basta */
  --c-divider:          #EBEAE3;
  --c-border:           #E4E2D9;
  --c-border-strong:    #CBC9BD;
  --c-text:             #1A1A1A;
  --c-muted:            #6B6B6B;
  --c-faint:            #9C9C9C;

  /* Acento único — indigo */
  --c-accent:       #4F46E5;
  --c-accent-hover: #4338CA;
  --c-accent-soft:  #EEF0FF;
  /* Aliases pros componentes antigos (botões, focus rings, links) durante
     a migração. Apontam pro acento V2 em vez de sky-blue. */
  --c-primary:   #1A1A1A;
  --c-secondary: #4A4A4A;
  --c-cta:       #4F46E5;
  --c-cta-hover: #4338CA;

  /* Status — dessaturados, terrosos */
  --c-success:    #2F7D5B;
  --c-success-bg: #E6F2EB;
  --c-warn:       #A86A1F;
  --c-warn-bg:    #FBF1DE;
  --c-danger:     #A8341E;
  --c-danger-bg:  #F8E4DC;
  --c-info:       #4F46E5; /* mesmo do acento — único hue */
  --c-info-bg:    #EEF0FF;

  /* Aliases antigos (mantidos pra .term + JS toast helpers) */
  --c-ok: var(--c-success);
  --c-ok-soft: var(--c-success-bg);
  --c-warn-soft: var(--c-warn-bg);
  --c-danger-soft: var(--c-danger-bg);

  /* Terminal pane — neutro carvão (não carbon V1) */
  --c-term-bg:     #1F1F1F;
  --c-term-fg:     #E8E6DF;
  --c-term-fg-dim: #8F8C82;
  --c-term-err:    #E89C8D;
  --c-term-warn:   #E8C77A;

  /* Tipografia — Inter Display + Geist Mono (fallback system stack).
     Fontes self-hosted seriam embeded via go:embed em fase futura; por
     ora, system stack com tabular numerals + ss01 cobre o essencial. */
  --font-ui: "Inter Display", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, "Cascadia Code", Consolas, monospace;
  --fs-xs:  12px;
  --fs-sm:  13px;
  --fs-base: 15px;
  --fs-md:  16px;
  --fs-lg:  20px;
  --fs-xl:  24px;
  --fs-2xl: 30px;

  /* Espaçamento — adiciona space-7/8 pro respiro V2 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Raios — maiores que V1 (cards parecem Linear/Vercel, não Bootstrap 2019) */
  --radius-sm:   6px;
  --radius:      10px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-full: 999px;

  /* Sombras — 90% mais sutis que V1; hierarquia vem de border + bg, não shadow */
  --shadow-xs: 0 1px 0 rgba(26, 26, 26, 0.04);
  --shadow-sm: 0 1px 2px rgba(26, 26, 26, 0.04);
  --shadow:    0 4px 12px -4px rgba(26, 26, 26, 0.06);
  --shadow-lg: 0 16px 32px -12px rgba(26, 26, 26, 0.10); /* só Cmd-K palette */

  /* Easing */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft:   cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1); /* compat */

  /* Font features — tabular numerals + alt 'a' (ss01) quando font suporta */
  font-feature-settings: "tnum" 1, "ss01" 1, "cv11" 1;

  /* Z-index */
  --z-base: 1;
  --z-nav: 10;
  --z-overlay: 20;
  --z-modal: 30;
  --z-toast: 50;
}

/* ============================================================
 * V2 components — page heads, site cards, server list, sections
 * ============================================================ */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
  flex-wrap: wrap;
}
.page-head__meta {
  color: var(--c-muted);
  font-size: var(--fs-sm);
  margin-top: 4px;
}
.page-head__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.site-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.site-card {
  display: block;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  color: inherit;
  transition: border-color 120ms var(--ease-soft), background 120ms var(--ease-soft), transform 120ms var(--ease-soft);
  min-height: 92px;
}
.site-card:hover {
  text-decoration: none;
  background: var(--c-surface-elevated);
  border-color: var(--c-accent);
  border-left-color: var(--c-accent);
}
.site-card--ok      { border-left-color: var(--c-success); }
.site-card--warn    { border-left-color: var(--c-warn); }
.site-card--danger  { border-left-color: var(--c-danger); }

.site-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: 4px;
}
.site-card__name {
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--c-text);
  margin: 0;
}
.site-card__domains {
  color: var(--c-muted);
  font-size: var(--fs-sm);
  font-family: var(--font-mono);
  margin-bottom: var(--space-3);
}
.site-card__status {
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.text-ok     { color: var(--c-success); font-weight: 500; }
.text-warn   { color: var(--c-warn); font-weight: 500; }
.text-danger { color: var(--c-danger); font-weight: 500; }

.empty-state--large {
  padding: var(--space-8) var(--space-5);
  background: var(--c-surface);
  border: 1px solid var(--c-divider);
  border-radius: var(--radius-md);
  text-align: center;
}
.empty-state--large .icon { width: 64px; height: 64px; color: var(--c-faint); margin-bottom: var(--space-4); }
.empty-state--large h2 { margin-bottom: var(--space-2); }
.empty-state--large p  { color: var(--c-muted); margin-bottom: var(--space-4); }

.section-divider {
  height: 1px;
  background: var(--c-divider);
  margin: var(--space-7) 0 var(--space-6);
}

.page-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.server-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.server-list a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  color: inherit;
  transition: background 100ms var(--ease-soft);
}
.server-list a:hover { background: var(--c-surface); text-decoration: none; }

/* Health bar — substitui status-strip em páginas de detalhe */
.health-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
  transition: border-color 240ms var(--ease-soft);
}
.health-bar--ok      { border-left-color: var(--c-success); }
.health-bar--warn    { border-left-color: var(--c-warn); }
.health-bar--danger  { border-left-color: var(--c-danger); }
.health-bar--neutral { border-left-color: var(--c-faint); }

.health-bar__dot {
  width: 12px; height: 12px; border-radius: 50%;
  flex-shrink: 0;
}
.health-bar--ok .health-bar__dot      { background: var(--c-success); }
.health-bar--warn .health-bar__dot    { background: var(--c-warn); }
.health-bar--danger .health-bar__dot  { background: var(--c-danger); }
.health-bar--neutral .health-bar__dot { background: var(--c-faint); }

.health-bar__body { flex: 1; }
.health-bar__title { font-size: var(--fs-md); font-weight: 600; color: var(--c-text); }
.health-bar__detail { color: var(--c-muted); font-size: var(--fs-sm); margin-top: 2px; }
.health-bar__extras { color: var(--c-muted); font-size: var(--fs-xs); margin-top: var(--space-2); display: flex; gap: 6px; flex-wrap: wrap; }
.health-bar__action { flex-shrink: 0; }

/* Action grid — cards de ação no site detail */
.section-title { font-size: var(--fs-md); font-weight: 600; margin-bottom: var(--space-4); color: var(--c-text); }
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.action-card {
  display: block;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 0;
  color: inherit;
  margin: 0;
  transition: border-color 120ms var(--ease-soft), background 120ms var(--ease-soft);
}
.action-card:hover {
  border-color: var(--c-accent);
  background: var(--c-surface-elevated);
  text-decoration: none;
}
.action-card button,
.action-card {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: var(--space-4);
  display: block;
}
.action-card button {
  padding: var(--space-4);
}
.action-card .icon {
  width: 18px; height: 18px;
  color: var(--c-accent);
  margin-bottom: var(--space-2);
}
.action-card__title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 4px;
}
.action-card__sub {
  font-size: var(--fs-xs);
  color: var(--c-muted);
}

/* Advanced disclosure — power features escondidas */
.advanced { margin-bottom: var(--space-6); }
.advanced__summary {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  cursor: pointer;
  list-style: none;
  padding: var(--space-3) 0;
}
.advanced__summary::-webkit-details-marker { display: none; }
.advanced__summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--c-muted);
  font-size: var(--fs-xs);
  transition: transform 180ms var(--ease-soft);
}
.advanced[open] .advanced__summary::after { transform: rotate(180deg); }
.advanced__list {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2px;
}
.advanced__list a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--c-text);
}
.advanced__list a:hover { background: var(--c-surface-sunken); text-decoration: none; }
.advanced__list a .icon { width: 14px; height: 14px; color: var(--c-muted); }
.advanced__danger a { color: var(--c-danger); }
.advanced__danger a:hover { background: var(--c-danger-bg); }

/* Timeline — histórico de jobs + backups */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.timeline__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.timeline__icon {
  width: 28px; height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-surface-sunken);
}
.timeline__icon .icon { width: 14px; height: 14px; }
.timeline__icon--ok      { background: var(--c-success-bg); color: var(--c-success); }
.timeline__icon--warn    { background: var(--c-warn-bg); color: var(--c-warn); }
.timeline__icon--danger  { background: var(--c-danger-bg); color: var(--c-danger); }
.timeline__icon--neutral { color: var(--c-muted); }
.timeline__body { flex: 1; min-width: 0; }
.timeline__body a { color: var(--c-text); font-weight: 500; }

/* DB secret row */
.db-secret { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.db-secret #db-password { font-size: var(--fs-sm); letter-spacing: 2px; word-break: break-all; }

/* Job card — protagonista da página de job */
.job-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}
.job-card--ok      { border-left-color: var(--c-success); }
.job-card--warn    { border-left-color: var(--c-warn); }
.job-card--danger  { border-left-color: var(--c-danger); }
.job-card--info    { border-left-color: var(--c-accent); }

.job-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.job-card__status { font-size: var(--fs-md); font-weight: 500; }
.job-card--ok .job-card__status     { color: var(--c-success); }
.job-card--warn .job-card__status   { color: var(--c-warn); }
.job-card--danger .job-card__status { color: var(--c-danger); }
.job-card--info .job-card__status   { color: var(--c-accent); }

.job-progress__bar {
  height: 8px;
  background: var(--c-surface-sunken);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: var(--space-2) 0 var(--space-2);
}
.job-progress__fill {
  height: 100%;
  background: var(--c-accent);
  transition: width 240ms var(--ease-soft);
}
.job-progress__meta {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--fs-sm);
}
.job-progress__hint { margin-top: var(--space-2); }

.job-steps { margin-bottom: var(--space-5); }
.job-steps .timeline__item { padding: 4px 0; }

.back-arrow {
  display: inline-block;
  color: var(--c-muted);
  margin-right: var(--space-2);
  text-decoration: none;
  font-weight: 400;
}
.back-arrow:hover { color: var(--c-text); }

/* Shortcuts modal — aparece via tecla "?" */
.shortcuts-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
}
.shortcuts-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(26, 26, 26, 0.4);
}
.shortcuts-modal__panel {
  position: relative;
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5);
  width: 420px;
  max-width: calc(100vw - 32px);
}
.shortcuts-modal h3 { margin-bottom: var(--space-4); }
.shortcuts-modal dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: var(--space-2) var(--space-4);
  margin: 0;
}
.shortcuts-modal dt {
  font-size: var(--fs-xs);
  color: var(--c-muted);
}
.shortcuts-modal dd {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--c-text);
}
.shortcuts-modal kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--c-surface-sunken);
  border: 1px solid var(--c-divider);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  color: var(--c-text);
}

/* ============================================================
 * Icons — SVG sprite referenced via <use href="/static/icons.svg#i-name">.
 * Stroke=currentColor, 1.75px, herda cor do contexto. Tamanho 16px
 * (inline em botões/labels) ou 32-48px (.icon--lg em empty states).
 * ============================================================ */
.icon {
  display: inline-block;
  vertical-align: text-bottom;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.icon--sm { width: 12px; height: 12px; }
.icon--lg { width: 32px; height: 32px; }
.icon--xl { width: 48px; height: 48px; }
.btn .icon { margin-right: var(--space-1); }

/* ============================================================
 * Reset / base
 * ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--c-cta); text-decoration: none; }
a:hover { color: var(--c-cta-hover); text-decoration: underline; }

button, input, select, textarea { font-family: inherit; font-size: inherit; }
code, kbd, pre, samp, .mono { font-family: var(--font-mono); }

h1, h2, h3, h4 { margin: 0; color: var(--c-text); font-weight: 600; line-height: 1.25; letter-spacing: -0.018em; }
h1 { font-size: var(--fs-2xl); font-weight: 500; letter-spacing: -0.022em; }
h2 { font-size: var(--fs-xl); font-weight: 500; }
h3 { font-size: var(--fs-lg); font-weight: 600; }
h4 { font-size: var(--fs-md); font-weight: 600; }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

p { margin: 0 0 var(--space-3); }

/* Focus visible — keyboard nav */
:focus-visible {
  outline: 2px solid var(--c-cta);
  outline-offset: 2px;
}

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

/* ============================================================
 * Layout V2 — sidebar fixa esquerda + content
 * ============================================================ */
body.has-sidebar {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
body.has-sidebar main {
  padding: var(--space-7) var(--space-7) var(--space-8);
  max-width: 1000px;
}

.sidebar {
  background: var(--c-surface);
  border-right: 1px solid var(--c-divider);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  font-size: var(--fs-sm);
}
.sidebar__top {
  padding: var(--space-5) var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border-bottom: 1px solid var(--c-divider);
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--c-text);
  letter-spacing: -0.012em;
}
.sidebar__brand:hover { text-decoration: none; }
.sidebar__brand .icon { width: 20px; height: 20px; color: var(--c-accent); margin-right: 0; }
.sidebar__cmdk {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--c-surface-sunken);
  border: 1px solid var(--c-divider);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--c-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--fs-xs);
  transition: background 100ms var(--ease-soft);
}
.sidebar__cmdk:hover { background: var(--c-accent-soft); color: var(--c-accent); }
.sidebar__cmdk kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--c-surface);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--c-border);
  color: var(--c-muted);
}

.sidebar__nav { flex: 1; padding: var(--space-4) var(--space-2); }
.sidebar__section { margin-bottom: var(--space-4); }
.sidebar__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-muted);
  font-weight: 600;
  padding: 4px var(--space-2) 6px;
}
.sidebar__count { font-weight: 500; color: var(--c-faint); }
.sidebar__list { list-style: none; margin: 0; padding: 0; }
.sidebar__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--c-text);
  font-weight: 400;
  transition: background 80ms var(--ease-soft);
}
.sidebar__item:hover { background: var(--c-accent-soft); text-decoration: none; color: var(--c-accent); }
.sidebar__item[aria-current="page"] {
  background: var(--c-accent-soft);
  color: var(--c-accent);
  font-weight: 500;
}
/* "+ Adicionar X" CTA discreto no rodapé de cada lista da sidebar. */
.sidebar__item--add { color: var(--c-muted); font-size: var(--fs-sm); }
.sidebar__item--add:hover { color: var(--c-accent); background: var(--c-accent-soft); }

.sidebar__dot {
  width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0;
  background: var(--c-faint);
}
.sidebar__dot--ok      { background: var(--c-success); }
.sidebar__dot--warn    { background: var(--c-warn); }
.sidebar__dot--danger  { background: var(--c-danger); }
.sidebar__dot--neutral { background: transparent; border: 1px solid var(--c-faint); }
.sidebar__dot--running {
  background: var(--c-accent);
  position: relative;
  animation: sidebarRing 1.4s linear infinite;
}
@keyframes sidebarRing {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-accent) 40%, transparent); }
  70%  { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-accent) 0%, transparent); }
}

.sidebar__footer {
  padding: var(--space-3) var(--space-4) var(--space-4);
  border-top: 1px solid var(--c-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--c-muted);
}
.sidebar__user { font-family: var(--font-mono); }
.sidebar__logout {
  background: none; border: none; color: var(--c-muted);
  cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm);
  font-size: var(--fs-xs); font-family: inherit;
}
.sidebar__logout:hover { background: var(--c-surface-sunken); color: var(--c-text); }

/* Mobile: drawer (hidden by default, opens via hamburguer) */
@media (max-width: 768px) {
  body.has-sidebar { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -260px;
    width: 260px;
    z-index: var(--z-overlay);
    transition: left 180ms var(--ease-soft);
    box-shadow: var(--shadow);
  }
  .sidebar.is-open { left: 0; }
  body.has-sidebar main { padding: var(--space-4); }
}

/* Faixa fina indicando jobs em andamento — só aparece quando RunningJobs>0 */
.job-banner {
  position: fixed;
  top: 0; left: 260px; right: 0;
  background: var(--c-accent-soft);
  color: var(--c-accent);
  font-size: var(--fs-xs);
  padding: 6px var(--space-5);
  border-bottom: 1px solid color-mix(in srgb, var(--c-accent) 12%, transparent);
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  gap: 8px;
}
@media (max-width: 768px) {
  .job-banner { left: 0; }
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-5);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--c-muted);
  margin-bottom: var(--space-3);
}
.breadcrumb a { color: var(--c-muted); }
.breadcrumb a:hover { color: var(--c-cta); }
.breadcrumb .sep { color: var(--c-faint); }

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
/* baseline alinha pelo "ground" do texto — h1 + meta ficam ancorados na
   mesma linha base, sem o meta "levitar" no meio do h1 (que era o
   resultado do align-items: center anterior). */
.page-header__title { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.page-header__meta {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  font-family: var(--font-mono);
}
.page-header__actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ============================================================
 * Card / panel
 * ============================================================ */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card__header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--c-border);
  background: #FCFCFD;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.card__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.card__body { padding: var(--space-4); }
/* --flush is used for tables that should hug the card edges. overflow-x:auto
   prevents wide tables (sites/servers com muitos domínios) de clipar a
   última coluna por causa do overflow:hidden do próprio .card. */
.card__body--flush { padding: 0; overflow-x: auto; }

/* Grid layout for dashboard split */
.grid {
  display: grid;
  gap: var(--space-4);
}
.grid--2 { grid-template-columns: 1fr 1fr; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--sidebar { grid-template-columns: 320px 1fr; }
/* align-items: start evita que cards da coluna esquerda (sidebar de
   saúde/cert/recursos) estiquem pra altura do card direito da mesma
   linha do grid. Cada card cresce só com seu próprio conteúdo. */
.grid--detail { grid-template-columns: minmax(280px, 380px) 1fr; align-items: start; }

@media (max-width: 1024px) {
  .grid--detail { grid-template-columns: minmax(260px, 320px) 1fr; }
}
@media (max-width: 768px) {
  .grid--2, .grid--3, .grid--sidebar, .grid--detail {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  /* Em telas muito pequenas action bars colapsam em coluna; tabelas
     ganham scroll horizontal via .card__body--flush + overflow-x:auto
     já existente. */
  .page-header__actions { flex-direction: column; align-items: stretch; }
}

/* ============================================================
 * Card variants (UX-PLAN §3.3)
 * ============================================================ */
/* compact — padding reduzido pra chips/status. */
.card--compact > .card__header { padding: var(--space-2) var(--space-3); }
.card--compact > .card__body { padding: var(--space-2) var(--space-3); }

/* form — mais espaço pra forms longos respirarem. */
.card--form > .card__body { padding: var(--space-5) var(--space-5); }

/* details-card — o <details>/<summary> faz o papel de card colapsável.
   Mantém visual de card sem precisar de wrapper extra. */
.details-card { padding: 0; }
.details-card > summary { display: flex; justify-content: space-between; align-items: center; }
.details-card > summary::-webkit-details-marker { display: none; }
.details-card[open] > summary { border-bottom: 1px solid var(--c-border); }

/* ============================================================
 * Error page (UX-PLAN §5 — três níveis: what / suggest / technical)
 * ============================================================ */
.error-page {
  max-width: 680px;
  margin: var(--space-6) auto;
  padding: var(--space-5);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  text-align: center;
}
.error-page__icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: var(--space-3);
}
.error-page__title {
  font-size: var(--fs-lg);
  margin: 0 0 var(--space-3);
}
.error-page__what {
  font-size: var(--fs-md);
  color: var(--c-primary);
  margin: 0 0 var(--space-4);
}
.error-page__suggest {
  font-size: var(--fs-sm);
  color: var(--c-primary);
  background: var(--c-bg-alt, #F8FAFC);
  border-left: 3px solid var(--c-cta);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  text-align: left;
  margin: 0 0 var(--space-4);
}
.error-page__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  margin: var(--space-4) 0;
}
.error-page__details {
  margin-top: var(--space-5);
  text-align: left;
  font-size: var(--fs-sm);
}
.error-page__details summary {
  cursor: pointer;
  color: var(--c-muted);
  padding: var(--space-1) 0;
}
.error-page__details pre {
  margin: var(--space-2) 0 0;
  padding: var(--space-3);
  background: #fafafa;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: var(--fs-xs);
  white-space: pre-wrap;
  overflow-x: auto;
}

/* ============================================================
 * Tabs (UX-PLAN Fase 8 item 32 — sub-nav dentro de cards)
 * ============================================================ */
.tabs__nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--c-border);
  margin: 0 calc(-1 * var(--space-4)) var(--space-4);
  padding: 0 var(--space-4);
  flex-wrap: wrap;
}
.tabs__btn {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: var(--space-2) var(--space-3);
  color: var(--c-muted);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 120ms ease, border-color 120ms ease;
}
.tabs__btn:hover { color: var(--c-primary); }
.tabs__btn--active {
  color: var(--c-primary);
  border-bottom-color: var(--c-cta);
  font-weight: 600;
}
.tabs__panel { padding-top: var(--space-2); }

/* ============================================================
 * Settings sidebar (UX-PLAN §4.4)
 * ============================================================ */
.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-5);
  align-items: start;
}
.settings-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: sticky;
  top: var(--space-3);
}
.settings-sidebar__group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-sidebar__group-title {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-1) var(--space-3);
}
.settings-sidebar__item {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-sm);
  color: var(--c-primary);
  text-decoration: none;
  border-radius: var(--radius);
  border-left: 3px solid transparent;
}
.settings-sidebar__item:hover { background: var(--c-bg-alt, #F8FAFC); }
.settings-sidebar__item--active {
  background: var(--c-bg-alt, #F8FAFC);
  border-left-color: var(--c-cta);
  font-weight: 600;
}
@media (max-width: 768px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  .settings-sidebar__group { flex-direction: row; align-items: center; gap: var(--space-1); }
  .settings-sidebar__group-title { display: none; }
}

/* Skeleton loader — substitui "—" mudo dos chips/cards no primeiro load. */
.skeleton {
  display: inline-block;
  background: linear-gradient(90deg, var(--c-surface-sunken) 0%, var(--c-border) 50%, var(--c-surface-sunken) 100%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease infinite;
  border-radius: var(--radius-sm);
  color: transparent;
  min-width: 40px;
  height: 1em;
}
@keyframes skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Cmd-K palette — overlay centralizado com input + lista filtrada.
   `:not([hidden])` é crítico: sem isso, `display: flex` venceria o
   atributo `hidden` do HTML e o palette ficaria sempre aberto. */
.palette[hidden] { display: none; }
.palette {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}
.palette__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 32, 0.4);
  backdrop-filter: blur(2px);
}
.palette__panel {
  position: relative;
  width: 560px;
  max-width: calc(100vw - var(--space-4) * 2);
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--c-border);
}
.palette__input {
  width: 100%;
  border: none;
  outline: none;
  padding: var(--space-4);
  font-size: var(--fs-md);
  font-family: var(--font-ui);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-divider);
  box-sizing: border-box;
}
.palette__list {
  list-style: none;
  margin: 0;
  padding: var(--space-2) 0;
  max-height: 380px;
  overflow-y: auto;
}
.palette__list li {
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
}
.palette__list li.palette__item--active,
.palette__list li:hover {
  background: var(--c-surface-sunken);
}
.palette__list .palette__kind {
  font-size: var(--fs-xs);
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: auto;
}
.palette__footer {
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--c-divider);
  background: var(--c-surface-sunken);
}
.palette__footer kbd {
  display: inline-block;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 3px;
  margin: 0 2px;
}
/* Toast — fixed bottom-right, fade in/out. Pra confirmações leves
   (senha copiada, site reiniciado) onde banner ocupando topo é invasivo. */
.toast-stack {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: var(--z-toast);
  pointer-events: none;
}
.toast {
  background: var(--c-primary);
  color: #FFF;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  pointer-events: auto;
  min-width: 200px;
  max-width: 360px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.toast--show { opacity: 1; transform: translateY(0); }
.toast--success { background: var(--c-success); }
.toast--danger  { background: var(--c-danger); }
.toast--warn    { background: var(--c-warn); }

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

/* ============================================================
 * Status dot — bolinha colorida pra leitura periférica em tabelas
 * (UX-PLAN Fase 8 item 34). Complementa o badge, não substitui.
 * ============================================================ */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: var(--space-2);
  vertical-align: middle;
  background: var(--c-border);
}
.status-dot--ok     { background: var(--c-success); }
.status-dot--warn   { background: var(--c-warn); }
.status-dot--danger { background: var(--c-danger); }

.table tbody tr:nth-child(even) {
  background: var(--c-surface-sunken);
}
.table tbody tr:nth-child(even):hover {
  background: var(--c-divider);
}

/* ============================================================
 * Status strip (UX-PLAN §3.1 — visão rápida no topo de páginas detail)
 * ============================================================ */
@media (max-width: 768px) {
  }
@media (max-width: 480px) {
  }

/* ============================================================
 * Dropdown menus (UX-PLAN §3.2 — action bar compacta)
 * ----
 * Usa <details>/<summary>, zero JS. Click no summary toggla.
 * Click fora não fecha automaticamente (browser default) — pra
 * action bars com 2 menus, operador pode ter outro aberto sem
 * estranhamento.
 * ============================================================ */
.menu { position: relative; display: inline-block; }
.menu > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::marker { display: none; }
.menu__list {
  position: absolute;
  top: calc(100% + var(--space-1));
  right: 0;
  z-index: 20;
  min-width: 220px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.10);
  padding: var(--space-1);
  display: flex;
  flex-direction: column;
}
.menu__item {
  display: block;
  padding: var(--space-2) var(--space-3);
  color: var(--c-primary);
  text-decoration: none;
  border-radius: 4px;
  font-size: var(--fs-sm);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.menu__item:hover, .menu__item:focus {
  background: var(--c-bg-alt, #F8FAFC);
  outline: none;
}
.menu__sep {
  height: 1px;
  margin: var(--space-1) 0;
  background: var(--c-border);
}

/* ============================================================
 * Tables — dense, with row hover
 * ============================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
}
.table th, .table td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
.table th {
  background: #FCFCFD;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--c-border-strong);
  white-space: nowrap;
}
.table tbody tr {
  transition: background-color 150ms ease;
}
/* cursor + hover só pra linhas que de fato são clicáveis (têm onclick) —
   evita o "mentiras visuais" de tabela de componentes ou sumários puros. */
.table tbody tr[onclick] { cursor: pointer; }
.table tbody tr[onclick]:hover { background: #F8FAFC; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .mono { font-family: var(--font-mono); font-size: var(--fs-sm); }
.table .secondary { color: var(--c-muted); }

/* Key-value list (facts) */
.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-2) var(--space-3);
  font-size: var(--fs-base);
}
.kv dt {
  color: var(--c-muted);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  padding-top: 1px;
}
.kv dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  /* Grid items default to min-content = sizing to the longest unbreakable
     token. Strings like git@github.com:user/repo or comma-listed domains
     would overflow the 1fr column. min-width: 0 + overflow-wrap: anywhere
     lets the column reclaim its budget. */
  min-width: 0;
  overflow-wrap: anywhere;
}
.kv dd.ui-text { font-family: var(--font-ui); font-size: var(--fs-base); }

/* ============================================================
 * Buttons
 * ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 6px 12px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
  white-space: nowrap;
  text-decoration: none;
  min-height: 32px;
}
.btn:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
  text-decoration: none;
  color: var(--c-text);
}
.btn:active { background: #E2E8F0; }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--c-cta);
  border-color: var(--c-cta);
  color: #FFF;
}
.btn--primary:hover {
  background: var(--c-cta-hover);
  border-color: var(--c-cta-hover);
  color: #FFF;
}

.btn--danger {
  background: var(--c-surface);
  border-color: #FCA5A5;
  color: var(--c-danger);
}
.btn--danger:hover {
  background: var(--c-danger-bg);
  border-color: var(--c-danger);
  color: var(--c-danger);
}
/* Filled danger — uso reservado pro submit final de operações destrutivas
   (remoção de site/servidor/usuário). Outline (.btn--danger) é o default
   pra botões "Remover…" que abrem a página de confirmação. */
.btn--danger-solid {
  background: var(--c-danger);
  border-color: var(--c-danger);
  color: #FFF;
}
.btn--danger-solid:hover {
  background: #B91C1C;
  border-color: #B91C1C;
  color: #FFF;
}

.btn--sm { padding: 3px 8px; font-size: var(--fs-xs); min-height: 24px; }
.btn--icon { padding: 6px; }

/* ============================================================
 * Form patterns — UI-DESIGN-CONSOLIDATION items 3 + 8
 * ============================================================ */

/* form-footer — substitui o trio `mt-4 flex gap-3 style="justify-content:
   flex-end"` repetido em 18 templates. Borda superior leve dá separação
   visual sem precisar de margin-top exagerado. */
.form-footer {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--c-border);
}
.form-footer--bare {
  border-top: 0;
  padding-top: 0;
}

/* empty-state — padrão "nada aqui ainda" pra tabelas e listas.
   Substitui 7 instâncias de inline padding+text-align+muted color. */
.empty-state {
  padding: var(--space-6) var(--space-5);
  text-align: center;
  color: var(--c-muted);
  font-size: var(--fs-sm);
}
.empty-state .icon {
  width: 40px;
  height: 40px;
  color: var(--c-faint);
  margin-bottom: var(--space-3);
}
.empty-state__title {
  color: var(--c-secondary);
  font-size: var(--fs-md);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.empty-state__hint { margin-top: var(--space-2); }
.empty-state__action { margin-top: var(--space-3); }

/* banner — alerts coloridos pra mensagens de erro/sucesso/aviso em forms.
   Substitui ~26 instâncias do "card vermelho" inline (UI-DESIGN-CONSOLIDATION
   item 1). Borda lateral esquerda 3px sinaliza severidade sem destoar do
   layout cinza-claro dos cards. */
.banner {
  display: block;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--c-border);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: var(--c-surface);
  margin-bottom: var(--space-4);
  font-size: var(--fs-sm);
  color: var(--c-text, var(--c-primary));
}
.banner--success { border-left-color: var(--c-success); }
.banner--success strong { color: #166534; }
.banner--warn    { border-left-color: var(--c-warn); }
.banner--warn strong    { color: #854D0E; }
.banner--danger  { border-left-color: var(--c-danger); }
.banner--danger strong  { color: #991B1B; }
.banner pre {
  margin: var(--space-2) 0 0;
  padding: var(--space-2);
  background: #fafafa;
  border-radius: var(--radius);
  font-size: var(--fs-xs);
  white-space: pre-wrap;
  overflow-x: auto;
}

/* choice — label que envolve um radio/checkbox + texto inline.
   Substitui 15+ instâncias de `style="display:flex; gap:6px; align-items:
   center; font-size: var(--fs-sm); cursor:pointer;"`. */
.choice {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.choice--block {
  display: flex;
  padding: var(--space-1) 0;
}
.choice-group {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ============================================================
 * Status badges
 * ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-family: var(--font-mono);
}
.badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.badge--ok { background: var(--c-success-bg); color: #166534; }
.badge--ok::before { background: var(--c-success); }
.badge--warn { background: var(--c-warn-bg); color: #854D0E; }
.badge--warn::before { background: var(--c-warn); }
.badge--danger { background: var(--c-danger-bg); color: #991B1B; }
.badge--danger::before { background: var(--c-danger); }
.badge--info { background: var(--c-info-bg); color: #1E40AF; }
.badge--info::before { background: var(--c-info); }
.badge--neutral { background: #F1F5F9; color: var(--c-secondary); }
.badge--neutral::before { background: var(--c-faint); }

/* Stack labels (django, php, html, node) */
.stack-tag {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: lowercase;
  border: 1px solid var(--c-border);
  background: #F8FAFC;
  color: var(--c-secondary);
}

/* ============================================================
 * Forms
 * ============================================================ */
.form-group { margin-bottom: var(--space-3); }
.form-label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.form-input,
.form-select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: var(--fs-base);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--c-cta);
  box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.15);
}
.form-help { font-size: var(--fs-xs); color: var(--c-muted); margin-top: 4px; }
.form-error { font-size: var(--fs-xs); color: var(--c-danger); margin-top: 4px; }

/* ============================================================
 * Login (centered card)
 * ============================================================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}
.login-card {
  width: 100%;
  max-width: 360px;
}
.login-card .card__body { padding: var(--space-5); }
.login-card h1 { text-align: center; margin-bottom: var(--space-2); }
.login-card .subtitle {
  text-align: center;
  color: var(--c-muted);
  font-size: var(--fs-sm);
  margin-bottom: var(--space-5);
}
.login-footer {
  margin-top: var(--space-4);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--c-muted);
  font-family: var(--font-mono);
}

/* ============================================================
 * Terminal / log pane (job page, site logs)
 * ============================================================ */
.term {
  background: var(--c-term-bg);
  color: var(--c-term-fg);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.55;
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid #1E293B;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 70vh;
  white-space: pre-wrap;
  word-break: break-word;
}
.term__line { display: block; padding: 0; }
.term__line--err { color: var(--c-term-err); }
.term__line--dim { color: var(--c-term-fg-dim); }
.term__line--ok { color: #86EFAC; }
.term__line--warn { color: var(--c-term-warn); }
.term__ts {
  color: var(--c-term-fg-dim);
  opacity: 0.55;
  margin-right: var(--space-2);
  font-size: 0.85em;
  user-select: none;
}
.term.term--filter-err .term__line:not(.term__line--err) { display: none; }

.job-filter {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.job-filter__btn {
  background: var(--c-surface);
  border: none;
  padding: 2px 8px;
  font-size: var(--fs-xs);
  color: var(--c-muted);
  cursor: pointer;
  border-right: 1px solid var(--c-border);
}
.job-filter__btn:last-child { border-right: none; }
.job-filter__btn:hover { background: var(--c-surface-sunken); }
.job-filter__btn--active {
  background: var(--c-primary);
  color: #FFF;
}
.term__line--head {
  color: var(--c-term-fg-dim);
  border-bottom: 1px dashed #1E293B;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-2);
}

/* Progress indicator */
.progress {
  height: 4px;
  background: var(--c-border);
  border-radius: 99px;
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: var(--c-cta);
  transition: width 250ms ease;
}
.progress__bar--success { background: var(--c-success); }
.progress__bar--fail { background: var(--c-danger); }

/* ============================================================
 * Utility classes
 * ============================================================ */
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--c-muted); }
.text-small { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }

/* Section headings inside cards */
.section-head {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-secondary);
  margin: var(--space-4) 0 var(--space-2);
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--c-border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.section-head:first-child { margin-top: 0; }

/* ---- File editor syntax highlight tokens ---- */
.code-view { background: #0f172a; color: #e2e8f0; border-radius: 6px; }
.code-view .tok-kw   { color: #c084fc; font-weight: 600; }     /* keywords / tags / section headers */
.code-view .tok-str  { color: #86efac; }                       /* strings */
.code-view .tok-com  { color: #64748b; font-style: italic; }   /* comments */
.code-view .tok-num  { color: #fbbf24; }                       /* numbers */
