/* ============================================================
   Chinaski Manager — Design System
   Fonts: Source Sans 3 (UI) · Lora (headings) · IBM Plex Mono (code/data)
   Palette: Chinaski brand — cream / ink / brown / gold
   ============================================================ */

/* ── Tokens ───────────────────────────────────────────────── */
:root {
  /* Chinaski brand palette */
  --c-ink:       #2C1A0E;
  --c-brown:     #7C5038;
  --c-brown-d:   #5C3420;
  --c-cream:     #FAF7F2;
  --c-surface-w: #F4EFE6;
  --c-gold:      #D99A30;
  --c-rule:      #E2D8CC;

  /* Functional aliases */
  --c-primary:   #2C1A0E;
  --c-accent:    #7C5038;
  --c-accent-d:  #5C3420;
  --c-success:   #16a34a;
  --c-warn:      #b45309;
  --c-danger:    #dc2626;
  --c-bg:        #FAF7F2;
  --c-surface:   #ffffff;
  --c-border:    #E2D8CC;
  --c-border-md: #D0C4B4;
  --c-text:      #2C1A0E;
  --c-muted:     #9C8878;
  --c-sidebar:   #2C1A0E;
  --c-sidebar-hi:#3d2518;
  --c-sidebar-t: rgba(250, 247, 242, 0.58);
  --c-sidebar-a: #FAF7F2;

  --r-sm: 3px;
  --r-md: 4px;
  --r-lg: 6px;

  --sh-sm: 0 1px 3px 0 rgb(44 26 14 / .06);
  --sh-md: 0 4px 8px -1px rgb(44 26 14 / .08), 0 2px 4px -1px rgb(44 26 14 / .04);

  --sidebar-w: 240px;
  --topbar-h:  56px;

  --font-ui:      ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;
  --font-mono:    ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
}

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

html { font-size: 14px; }

body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

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

/* ── App Shell ────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  grid-row: 1 / -1;
  background: var(--c-sidebar);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  height: var(--topbar-h);
  flex-shrink: 0;
  border-bottom: 3px solid var(--c-gold);
  text-decoration: none;
}

.sidebar-brand-logo {
  max-height: 32px;
  width: auto;
  /* Invert dark logo for the dark sidebar */
  filter: brightness(0) invert(1);
  object-fit: contain;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.sidebar-section {
  padding: 16px 20px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-sidebar-t);
}

.sidebar-section:first-child { padding-top: 8px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 20px;
  font-size: 13px;
  font-weight: 400;
  color: var(--c-sidebar-t);
  text-decoration: none;
  transition: background .12s, color .12s;
  position: relative;
}

.sidebar-link svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .65; }

.sidebar-link:hover {
  background: var(--c-sidebar-hi);
  color: var(--c-cream);
  text-decoration: none;
}

.sidebar-link:hover svg { opacity: .9; }

.sidebar-link.active {
  background: rgba(217, 154, 48, .12);
  color: var(--c-gold);
  font-weight: 600;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--c-gold);
  border-radius: 0 2px 2px 0;
}

.sidebar-link.active svg { opacity: 1; }

.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(250, 247, 242, .08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-brown);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--c-cream);
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.sidebar-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-cream);
  line-height: 1.2;
}

.sidebar-user-role {
  font-size: 10px;
  color: var(--c-sidebar-t);
}

.sidebar-user-logout {
  margin-left: auto;
  font-size: 11px;
  color: var(--c-sidebar-t);
  text-decoration: none;
}

.sidebar-user-logout:hover { color: #fca5a5; text-decoration: none; }

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  background: var(--c-bg);
  border-bottom: 3px solid var(--c-gold);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  flex: 1;
  font-family: var(--font-heading);
  letter-spacing: .01em;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── Main Content ─────────────────────────────────────────── */
.main {
  padding: 28px 32px;
  min-width: 0;
}

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header-left h1 {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: -.01em;
  line-height: 1.2;
  color: var(--c-ink);
}

.page-header-left .breadcrumb {
  font-size: 12px;
  color: var(--c-muted);
  margin-top: 2px;
}

.page-header-left .breadcrumb a {
  color: var(--c-muted);
}

.page-header-left .breadcrumb a:hover { color: var(--c-accent); }

.page-header-right { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* shorthand for simple pages that don't use page-header-left/right */
.page-header h1 { font-size: 22px; font-weight: 700; font-family: var(--font-heading); letter-spacing: -.01em; }
.page-header p.muted { font-size: 13px; color: var(--c-muted); margin-top: 2px; }

/* ── Flash messages ───────────────────────────────────────── */
.flash {
  padding: 11px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
}

.flash-success { background: #eef6ee; color: #2c5e2c; border-color: #4a7c4a; }
.flash-error   { background: #fbece9; color: #8a3526; border-color: #b3503f; }
.flash-warn    { background: #fef9ec; color: #7c4a0a; border-color: #d99a30; }

.flash-token {
  background: #fef9ec;
  color: #7c4a0a;
  border-color: #d99a30;
  flex-direction: column;
  gap: 6px;
}

.flash-token code {
  font-family: var(--font-mono);
  font-size: 12px;
  word-break: break-all;
  background: #faf0d0;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  display: block;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h2 {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--c-muted);
}

.card-body { padding: 20px; }

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-w);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* ── Stat Cards ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--sh-sm);
}

.stat-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--c-text);
  font-family: var(--font-heading);
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-top: 6px;
  font-weight: 600;
}

.stat-card.accent .stat-value { color: var(--c-accent); }
.stat-card.success .stat-value { color: var(--c-success); }
.stat-card.warn .stat-value { color: var(--c-warn); }

/* ── Table ────────────────────────────────────────────────── */
.table-wrap {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: var(--c-surface-w);
  text-align: left;
  padding: 10px 16px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--c-muted);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  font-size: 13px;
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #f9f5ef; }

.data-table .col-actions {
  white-space: nowrap;
  text-align: right;
  width: 1%;
}

.data-table .col-mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--c-muted);
}

.empty-state p { font-size: 14px; margin-bottom: 16px; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  font-family: var(--font-mono);
}

.badge-running     { background: #dcfce7; color: #15803d; }
.badge-stopped     { background: var(--c-surface-w); color: #7C6050; }
.badge-failed      { background: #fef2f2; color: #b91c1c; }
.badge-provisioning{ background: #fef9ec; color: #7c5038; }
.badge-deploying   { background: #fef3c7; color: #92400e; }
.badge-queued      { background: #fdf6e3; color: #7c5038; }
.badge-active      { background: #dcfce7; color: #15803d; }
.badge-inactive    { background: var(--c-surface-w); color: var(--c-muted); }
.badge-ok          { background: #dcfce7; color: #15803d; }
.badge-warn        { background: #fef3c7; color: #92400e; }
.badge-err, .badge-error { background: #fef2f2; color: #b91c1c; }
.badge-superadmin  { background: #fef3c7; color: #7c4a0a; }
.badge-admin       { background: var(--c-surface-w); color: var(--c-brown); }
.badge-user        { background: var(--c-surface-w); color: var(--c-muted); }

/* Status dot */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.running {
  background: var(--c-success);
  box-shadow: 0 0 0 0 rgb(22 163 74 / .4);
  animation: pulse-green 2s infinite;
}

.status-dot.stopped     { background: var(--c-muted); }
.status-dot.failed      { background: var(--c-danger); }
.status-dot.provisioning{ background: var(--c-gold); }
.status-dot.deploying   { background: var(--c-warn); }
.status-dot.queued      { background: var(--c-brown); }

@keyframes pulse-green {
  0%   { box-shadow: 0 0 0 0 rgb(22 163 74 / .4); }
  70%  { box-shadow: 0 0 0 6px rgb(22 163 74 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(22 163 74 / 0); }
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-ui);
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:hover { background: var(--c-surface-w); text-decoration: none; border-color: var(--c-border-md); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--c-ink);
  color: var(--c-cream);
  border-color: var(--c-ink);
}

.btn-primary:hover {
  background: var(--c-brown);
  border-color: var(--c-brown);
  color: var(--c-cream);
}

.btn-danger {
  background: #fef2f2;
  color: var(--c-danger);
  border-color: #fecaca;
}

.btn-danger:hover { background: #fee2e2; border-color: #fca5a5; color: var(--c-danger); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--c-muted);
}

.btn-ghost:hover { background: var(--c-surface-w); border-color: var(--c-border); color: var(--c-text); }

.btn-sm { padding: 3px 10px; font-size: 11px; }

.btn-block { display: flex; width: 100%; justify-content: center; }

/* Inline action links (tables) */
.act {
  font-size: 12px;
  color: var(--c-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-ui);
  text-decoration: none;
  margin-left: 8px;
}

.act:first-child { margin-left: 0; }
.act:hover { color: var(--c-accent); }
.act.danger:hover { color: var(--c-danger); }

/* ── Forms ────────────────────────────────────────────────── */
.form-grid { display: grid; gap: 18px; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3{ display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }

label {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-muted);
  letter-spacing: .07em;
  text-transform: uppercase;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
textarea,
select {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border-md);
  border-radius: var(--r-sm);
  padding: 8px 11px;
  transition: border-color .12s, box-shadow .12s;
  line-height: 1.4;
  width: 100%;
}

input[readonly], input[disabled] {
  background: var(--c-surface-w);
  color: var(--c-muted);
  cursor: not-allowed;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--c-brown);
  box-shadow: 0 0 0 3px rgb(124 80 56 / .12);
}

.field-hint {
  font-size: 11px;
  color: var(--c-muted);
  line-height: 1.4;
}

.field-error { font-size: 11px; color: var(--c-danger); }

.form-section {
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: grid;
  gap: 16px;
}

.form-section legend {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--c-muted);
  padding: 0 4px;
}

.form-actions { display: flex; gap: 8px; margin-top: 4px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.checkbox-row input[type="checkbox"] { width: auto; cursor: pointer; }

/* ── Log Viewer ───────────────────────────────────────────── */
.log-viewer {
  background: #0d1117;
  color: #c9d1d9;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  border-radius: var(--r-lg);
  overflow: auto;
  max-height: 600px;
  border: 1px solid #30363d;
}

.log-viewer pre {
  padding: 20px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 100%;
}

.log-viewer .log-line-err { color: #ff7b72; }
.log-viewer .log-line-ok  { color: #7ee787; }
.log-viewer .log-line-warn{ color: #e3b341; }
.log-viewer .log-empty    { color: #484f58; font-style: italic; }

/* ── Live progress card (provisioning / deploying / queued) ── */
.progress-card {
  background: #1e120a;
  border-radius: 4px;
  padding: 12px 14px;
  color: rgba(250, 247, 242, 0.7);
  font-size: 12px;
  margin-top: 4px;
  border: 1px solid #3d2518;
}
.progress-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 13px;
}
.progress-spinner {
  width: 13px; height: 13px;
  border: 2px solid #3d2518;
  border-top-color: var(--c-gold);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pcspin .8s linear infinite;
}
@keyframes pcspin { to { transform: rotate(360deg); } }
.progress-elapsed {
  font-size: 11px;
  font-family: var(--font-mono);
  color: #7C5038;
  margin-left: 4px;
}
.progress-logs-link {
  margin-left: auto;
  font-size: 11px;
  font-weight: 400;
  color: var(--c-gold);
  text-decoration: none;
}
.progress-logs-link:hover { text-decoration: underline; }
.progress-offline {
  font-size: 11px;
  color: #d99a30;
  margin-bottom: 8px;
  padding: 4px 8px;
  background: #3d2200;
  border: 1px solid #7c4a00;
  border-radius: 3px;
}
.progress-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 10px;
}
.progress-stage {
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-family: var(--font-mono);
  background: #0f0a06;
  color: #5c3a24;
  border: 1px solid #3d2518;
}
.progress-stage.ps-done   { background: #052e16; color: #86efac; border-color: #166534; }
.progress-stage.ps-active { background: #3d2200; color: var(--c-gold); border-color: #7c4a00; font-weight: 600; }
.progress-stage.ps-skip   { color: #3d2518; border-color: #1e120a; text-decoration: line-through; }
.progress-stage.ps-fail   { background: #450a0a; color: #fca5a5; border-color: #7f1d1d; }
.progress-log-live {
  background: #0f0a06;
  border-radius: 4px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.55;
  color: rgba(250, 247, 242, 0.5);
  max-height: 140px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 6px;
  scroll-behavior: smooth;
}
.progress-queue-note {
  padding: 8px 10px;
  background: #3d2200;
  border: 1px solid #7c4a00;
  border-radius: 4px;
  color: #fcd34d;
  font-size: 11px;
  line-height: 1.5;
  margin-bottom: 6px;
}

/* ── Tabs (CSS-only) ──────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--c-border); margin-bottom: 20px; }

.tab-btn {
  padding: 9px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--c-muted);
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: var(--font-ui);
  transition: color .12s;
}

.tab-btn:hover { color: var(--c-text); }
.tab-btn.active { color: var(--c-accent); border-bottom-color: var(--c-accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Collapsible Details ──────────────────────────────────── */
details.collapsible {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
}

details.collapsible summary {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: var(--c-surface-w);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

details.collapsible summary::after {
  content: '▸';
  font-size: 10px;
  color: var(--c-muted);
  transition: transform .15s;
}

details.collapsible[open] summary::after { transform: rotate(90deg); }

details.collapsible .details-body { padding: 16px; }

/* ── Dashboard quick-action strip ────────────────────────── */
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 4px;
  padding: 14px 20px;
  border-top: 1px solid var(--c-border);
  font-size: 13px;
  align-items: center;
}

.pagination a, .pagination strong {
  padding: 4px 10px;
  border-radius: var(--r-sm);
  color: var(--c-muted);
  text-decoration: none;
}

.pagination a:hover { background: var(--c-surface-w); color: var(--c-text); }
.pagination strong  { background: var(--c-ink); color: var(--c-cream); }

/* ── Auth (bare) layout ───────────────────────────────────── */
body.auth-page {
  background: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-wrap {
  width: 100%;
  max-width: 400px;
  padding: 24px 16px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo-img {
  max-height: 60px;
  max-width: 100%;
  width: auto;
}

.auth-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  overflow: hidden;
}

/* Dark branded header band — mirrors the site header */
.auth-card-brand {
  background: var(--c-ink);
  border-bottom: 3px solid var(--c-gold);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  gap: 0;
}

.auth-brand-logo {
  max-height: 40px;
  max-width: 100%;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: .95;
  flex-shrink: 0;
}

.auth-brand-sep {
  width: 1px;
  height: 20px;
  background: rgba(250, 247, 242, .2);
  margin: 0 14px;
  flex-shrink: 0;
}

.auth-brand-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--c-gold);
}

.auth-card-body {
  padding: 28px 28px 24px;
}

.auth-card h2 {
  font-size: 19px;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: -.01em;
  margin-bottom: 4px;
}

.auth-card .subtitle {
  font-size: 13px;
  color: var(--c-muted);
  margin-bottom: 22px;
}

.auth-card .form-grid { gap: 14px; }
.auth-card .btn-block { margin-top: 4px; padding: 10px; font-size: 13px; }

.auth-divider {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 20px 0;
}

/* ── Utility ──────────────────────────────────────────────── */
.muted   { color: var(--c-muted); }
.mono    { font-family: var(--font-mono); font-size: 12px; }
.mt-0    { margin-top: 0; }
.mt-1    { margin-top: 8px; }
.mt-2    { margin-top: 16px; }
.mb-2    { margin-bottom: 16px; }
.mb-3    { margin-bottom: 24px; }
.gap-2   { gap: 8px; }
.flex    { display: flex; }
.flex-col{ flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full  { width: 100%; }
.w-32    { width: 32px; }
.text-sm { font-size: 12px; }
.font-mono { font-family: var(--font-mono); }
.text-center { text-align: center; }
.m-0 { margin: 0 !important; }
.mb-16 { margin-bottom: 16px !important; }
.mt-16 { margin-top: 16px !important; }
.truncate{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.form-inline  { display: inline; }
.form-nomargin{ margin: 0; }
.cursor-pointer { cursor: pointer; }
.no-underline { text-decoration: none; }

.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.pagination { margin-top: 12px; }

/* (#3806) Utility classes extracted from inline styles */
.hidden { display: none !important; }
.flex-1 { flex: 1; }
.max-w-320 { max-width: 320px; }
.max-w-480 { max-width: 480px; }
.max-w-560 { max-width: 560px; }
.gap-24 { gap: 24px; }
.gap-8 { gap: 8px; }
.ml-auto { margin-left: auto; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.p-10 { padding: 10px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.grid-dashboard { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.status-strip {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.status-strip-label {
  font-size: 11px;
  color: var(--c-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.log-viewer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}
.edit-row { display: none; background: var(--c-surface-w); }
.pw-row   { display: none; background: #fef9ec; }
.form-actions-inline { margin: 0; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    grid-row: auto;
    position: static;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar-nav { display: flex; flex-direction: row; padding: 0; }
  .sidebar-section { display: none; }
  .sidebar-link { padding: 12px 14px; flex-direction: column; gap: 2px; font-size: 10px; }
  .sidebar-footer { display: none; }
  .main { padding: 16px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .status-dot.running { animation: none; }
  .progress-spinner   { animation: none; }
  .sidebar-link,
  .btn,
  input:focus, textarea:focus, select:focus,
  .tab-btn,
  details.collapsible summary::after { transition: none; }
}
