@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --border: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --primary: #6366f1;
    --primary-light: #ede9fe;
    --primary-hover: #4f46e5;
    --success: #22c55e;
    --success-light: #f0fdf4;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --radius: 12px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    /* Back-compat aliases for pages predating the light-theme rename */
    --muted: var(--text-muted);
    --card: var(--bg-card);
    --card-soft: var(--bg-page);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 12px; }

/* Brief pulse on the targeted section when arrived at via anchor click. */
@keyframes anchor-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.45); }
  100% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
}
:target {
  animation: anchor-pulse 1.4s ease-out 1;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-page);
    color: var(--text-main);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ──────────────────────────────────────────────
   LAYOUT
   ────────────────────────────────────────────── */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ──────────────────────────────────────────────
   SIDEBAR
   ────────────────────────────────────────────── */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 20;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 16px;
    flex-shrink: 0;
}

.sidebar-avatar {
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.sidebar-logo-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.sidebar-logo-sub {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.2;
}

.sidebar-hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0;
    flex-shrink: 0;
}

.nav-menu {
    padding: 10px 10px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 2px;
    transition: background 0.1s, color 0.1s;
}

.nav-item i {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
    flex-shrink: 0;
    font-size: 13px;
}

.nav-item:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.nav-item:hover i {
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-item.active i {
    color: var(--primary);
}

.sidebar-health {
    padding: 10px 16px 14px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-health-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}

.health-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--success);
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 5px;
}

.sidebar-health-main {
    font-weight: 600;
    color: var(--text-main);
    font-size: 11px;
}

.sidebar-health-uptime {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-health-uptime span {
    font-family: var(--font-mono);
}

/* The uptime ticker lives in the shared sidebar partial but is only
   driven on /mta (Overview). Hide on every other page. */
body:not([data-page="overview"]) .sidebar-overview-only { display: none; }

/* ──────────────────────────────────────────────
   MAIN CONTENT
   ────────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ──────────────────────────────────────────────
   TOPBAR
   ────────────────────────────────────────────── */
.topbar {
    min-height: 64px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.topbar-breadcrumb {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.bc-chip {
    background: #1e293b;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 5px;
    display: inline-block;
}

.bc-lane {
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 11px;
}

.topbar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

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

/* ──────────────────────────────────────────────
   BUTTONS
   ────────────────────────────────────────────── */
.btn {
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.1s;
}

.btn:hover { background: #f1f5f9; }

.btn-warning {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}
.btn-warning:hover { background: #ffedd5; }

.btn-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}
.btn-success:hover { background: #dcfce7; }

.btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}
.btn-danger:hover { background: #fee2e2; }

.btn-filter {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    color: var(--text-muted);
    border: 1px solid var(--border);
    white-space: nowrap;
    transition: background 0.1s;
}
.btn-filter:hover { background: #f8fafc; color: var(--text-main); }
.btn-filter.is-active { background: var(--text-main); color: #ffffff; border-color: var(--text-main); }

.engine-filter-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.engine-filter-input {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    width: 180px;
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border);
    transition: width 0.12s ease, opacity 0.12s ease;
}
.engine-filter-input:focus { outline: none; border-color: var(--text-muted); }
.engine-filter-input.is-hidden {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    border-width: 0;
    opacity: 0;
    pointer-events: none;
}

/* ──────────────────────────────────────────────
   DASHBOARD
   ────────────────────────────────────────────── */
.dashboard {
    padding: 20px 24px;
    /* Extra bottom space so anchor clicks can scroll the last section all
       the way to the top of the viewport. */
    padding-bottom: 60vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--bg-page);
    min-height: calc(100vh - 64px);
}

/* ──────────────────────────────────────────────
   CARDS
   ────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.card-full {
    width: 100%;
}

.card-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.card-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.engine-count-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
}

/* ──────────────────────────────────────────────
   BADGE SYSTEM
   ────────────────────────────────────────────── */
/* Global status banner badges (filled, dark bg) */
.badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-block;
    white-space: nowrap;
}

.badge-success { background: #166534; color: #4ade80; }
.badge-warning { background: #78350f; color: #fbbf24; }
.badge-danger  { background: #7f1d1d; color: #fca5a5; }
.badge-violet  { background: #3730a3; color: #a5b4fc; }
.badge-secondary { background: #334155; color: #cbd5e1; }
.badge-info    { background: #1e3a8a; color: #93c5fd; }

/* Section header badges (light, border-based) */
.badge-section {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 0;
    border: 1px solid;
    display: inline-block;
    white-space: nowrap;
}

.badge-teal   { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; }
.badge-green  { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.badge-amber  { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.badge-violet-light { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }

/* Engine state badges */
.badge-running {
    background: #dcfce7;
    color: #166534;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-block;
}
.badge-idle  {
    background: #dbeafe;
    color: #1e40af;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}
.badge-error {
    background: #fee2e2;
    color: #991b1b;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

/* ──────────────────────────────────────────────
   GLOBAL STATUS BANNER
   ────────────────────────────────────────────── */
.global-status-banner {
    background: #0d1117;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-left: 4px solid transparent;
    transition: border-color 0.2s ease;
}

.global-status-banner.holding {
    border-left-color: var(--warning);
    background: linear-gradient(to right, rgba(245,158,11,0.12) 0%, #0d1117 8%);
}

.global-status-banner.error {
    border-left-color: var(--danger);
    background: linear-gradient(to right, rgba(239,68,68,0.18) 0%, #0d1117 8%);
}

.gs-row1 {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gs-label-text {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gs-campaign {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
    font-family: var(--font-mono);
}

.gs-campaign span {
    font-family: var(--font-mono);
}

.gs-meta {
    font-size: 12px;
    color: #94a3b8;
}

.gs-meta span {
    font-family: var(--font-mono);
    color: #cbd5e1;
}

.gs-metrics-row {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.gs-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gs-metric-value {
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: #ffffff;
    line-height: 1.1;
}

.gs-metric-label {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}

/* ──────────────────────────────────────────────
   METRIC CARDS ROW
   ────────────────────────────────────────────── */
.metric-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.metric-card-toprow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.metric-card-icon {
    font-size: 18px;
}

.metric-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-main);
    line-height: 1.1;
    display: block;
    margin-bottom: 6px;
}

.metric-sub {
    font-size: 12px;
    margin-top: auto;
}

.metric-sub-green  { color: #16a34a; }
.metric-sub-violet { color: var(--primary); }
.metric-sub-amber  { color: #d97706; }

/* ──────────────────────────────────────────────
   THREE-COLUMN OPERATIONAL PANEL
   ────────────────────────────────────────────── */
.ops-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Same shape, used by Queues, Lanes, Host Monitor, Reports. */
.three-col-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 1100px) {
    .three-col-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
    .three-col-grid { grid-template-columns: 1fr; }
}

/* ── Command Center button grid ── */
.cmd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 4px;
}

/* Prewarm DNS: span full width, violet filled */
.cmd-btn-prewarm {
    grid-column: 1 / -1;
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}
.cmd-btn-prewarm:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #ffffff;
}

/* Validate Lane: span full width */
.cmd-btn-full {
    grid-column: 1 / -1;
}

.cmd-btn {
    padding: 8px 10px;
    text-align: left;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.1s, color 0.1s;
    white-space: nowrap;
}

.cmd-btn:hover {
    background: #f1f5f9;
}

.cmd-btn-warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}
.cmd-btn-warning:hover {
    background: #ffedd5;
}

.cmd-result {
    margin-top: 10px;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.cmd-result-label {
    color: var(--text-light);
}

.cmd-status-ok  { color: #16a34a; font-weight: 700; }
.cmd-status-err { color: var(--danger); font-weight: 700; }
.cmd-status-warn { color: #d97706; font-weight: 700; }

/* ── Handoff checklist ── */
.hc-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

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

.hc-icon {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.hc-icon .fa-circle-check { color: var(--success); }
.hc-icon .fa-clock         { color: var(--warning); }
.hc-icon .fa-circle-xmark  { color: var(--danger); }

.hc-label {
    flex: 1;
    color: var(--text-main);
    font-size: 12px;
}

.hc-detail {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-light);
}

/* ── Lane Reputation ── */
.lr-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

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

.lr-key {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
}

.lr-val {
    font-family: var(--font-mono);
    color: var(--text-main);
    font-size: 11px;
}

/* ──────────────────────────────────────────────
   DENSE TABLES
   ────────────────────────────────────────────── */
.dense-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.dense-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: transparent;
}

.dense-table th.r,
.dense-table td.r {
    text-align: right;
}

.dense-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    font-size: 12px;
    color: var(--text-main);
    background: #ffffff;
}

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

.dense-table tbody tr:hover td {
    background: #f8fafc;
}

.dense-table .mono {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

/* ──────────────────────────────────────────────
   BOTTOM SECTION GRID
   ────────────────────────────────────────────── */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ──────────────────────────────────────────────
   POLICY BADGES (MX table — text-only, colored)
   ────────────────────────────────────────────── */
.policy-burst    { color: #16a34a; font-size: 12px; font-weight: 600; font-family: var(--font-mono); }
.policy-cautious { color: #d97706; font-size: 12px; font-weight: 600; font-family: var(--font-mono); }
.policy-limited  { color: #dc2626; font-size: 12px; font-weight: 600; font-family: var(--font-mono); }

/* ── MX status badges (light pills) ── */
.badge-status-ok {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    display: inline-block;
}
.badge-status-warn {
    background: #fff7ed;
    color: #c2410c;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    display: inline-block;
}
.badge-status-err {
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    display: inline-block;
}

/* ──────────────────────────────────────────────
   EVENTLOG EVENT TYPE BADGES (filled pills)
   ────────────────────────────────────────────── */
.evt-accepted {
    background: #dcfce7;
    color: #166534;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-block;
    white-space: nowrap;
}
.evt-deferred {
    background: #fff7ed;
    color: #c2410c;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-block;
    white-space: nowrap;
}
.evt-bounce,
.evt-failed {
    background: #fee2e2;
    color: #991b1b;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-block;
    white-space: nowrap;
}

/* ──────────────────────────────────────────────
   SSE INDICATOR
   ────────────────────────────────────────────── */
.sse-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--warning);
    margin-right: 4px;
    vertical-align: middle;
}

.sse-dot.connected {
    background: var(--success);
}

/* ──────────────────────────────────────────────
   UTILITIES
   ────────────────────────────────────────────── */
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-light   { color: var(--text-light); }
.text-muted   { color: var(--text-muted); }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.font-mono    { font-family: var(--font-mono); }

/* ──────────────────────────────────────────────
   /gimta-config — schema-driven editable form
   (preserved for gimta-config page which shares mta.css)
   ────────────────────────────────────────────── */
.cfg-section { padding: 16px 0; }
.cfg-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 24px; }
@media (max-width: 900px) { .cfg-fields { grid-template-columns: 1fr; } }
.cfg-field { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.cfg-field-label { font-size: 13px; font-weight: 600; color: var(--text-main); display: flex; align-items: center; }
.cfg-field-control input[type="text"],
.cfg-field-control input[type="number"],
.cfg-field-control select,
.cfg-field-control textarea {
    width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
    font-size: 13px; font-family: var(--font-mono); background: #0f172a; color: #f1f5f9;
}
.cfg-field-control input[type="checkbox"] { width: 16px; height: 16px; }
.cfg-field-control textarea { resize: vertical; min-height: 60px; }
.cfg-field-path { font-family: var(--font-mono); font-size: 10px; color: var(--text-light); }
.cfg-field-help { font-size: 11px; color: var(--text-muted); }
.cfg-field-error { font-size: 11px; color: var(--danger); padding: 2px 0; }
.cfg-field-edited .cfg-field-label::after {
    content: "● edited"; color: #d97706; font-size: 10px; margin-left: 8px; font-weight: 500;
}
.cfg-field-edited input,
.cfg-field-edited select,
.cfg-field-edited textarea { border-color: #d97706 !important; background: #1a1500; }
.cfg-field-error-state input,
.cfg-field-error-state select,
.cfg-field-error-state textarea { border-color: var(--danger) !important; background: #1a0000; }
.cfg-diff-hidden { display: none; }
.cfg-diff-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
.cfg-diff-table th, .cfg-diff-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.cfg-diff-table th { color: var(--text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; }
.cfg-diff-table td:first-child { font-family: var(--font-mono); font-size: 11px; }

/* `.is-busy` — toggled by ui-actions.js to show a spinner while a button's action is in flight. */
.is-busy {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}
.is-busy > * { visibility: hidden; }
.is-busy::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid #64748b;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ui-spin 0.6s linear infinite;
}
@keyframes ui-spin { to { transform: rotate(360deg); } }
button:disabled { cursor: not-allowed; }
