@charset "utf-8";
/* Fonts are local/system only — never @import remote CSS (blocks every page paint on tab switch). */

:root {
  color-scheme: dark;
  --bg: #070b16;
  --bg-subtle: #0d1324;
  --panel: rgba(13, 19, 36, 0.94);
  --panel-strong: rgba(17, 25, 45, 0.98);
  --card: rgba(15, 23, 42, 0.86);
  --card-border: rgba(98, 132, 199, 0.16);
  --card-glow: rgba(42, 103, 255, 0.1);
  --text: #e7edf8;
  --text-secondary: #aebbd0;
  --muted: #6f7c92;
  --border: rgba(98, 132, 199, 0.16);
  --accent: #d4a017;
  --accent-hover: #f5b84b;
  --accent-2: #7c3aed;
  --admin-accent: #f5b84b;
  --admin-ink: #1a1406;
  --success: #20d17b;
  --warn: #f5b84b;
  --danger: #f05264;
  --info: #38bdf8;
  --input-bg: rgba(8, 13, 27, 0.86);
  --input-border: rgba(98, 132, 199, 0.22);
  --input-focus: rgba(245, 184, 75, 0.45);
  --table-header: rgba(8, 13, 27, 0.94);
  --table-hover: rgba(245, 184, 75, 0.1);
  --table-stripe: rgba(245, 184, 75, 0.04);
  --sidebar-width: 232px;
  --glow-1: rgba(245, 184, 75, 0.16);
  --glow-2: rgba(37, 99, 235, 0.16);
  --btn-from: #f5b84b;
  --btn-to: #d4a017;
  --btn-ink: #1a1406;
  --btn-shadow: rgba(245, 184, 75, 0.28);
  --btn-shadow-hover: rgba(245, 184, 75, 0.42);
  --nav-hover-bg: rgba(245, 184, 75, 0.1);
  --nav-hover-fg: #f8e7b8;
  --nav-hover-border: rgba(245, 184, 75, 0.2);
  --card-hover-border: rgba(245, 184, 75, 0.32);
  --focus-ring: rgba(245, 184, 75, 0.16);
  --link-color: #f5b84b;
  --radius: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
[hidden] { display: none !important; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  margin: 0;
  background:
    radial-gradient(ellipse 900px 520px at 18% -18%, var(--glow-1), transparent 60%),
    radial-gradient(ellipse 700px 460px at 92% 0%, var(--glow-2), transparent 58%),
    linear-gradient(180deg, rgba(9, 14, 29, 0.92), rgba(5, 9, 19, 0.98)),
    var(--bg);
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Shell ─────────────────────────────────── */

.app-shell {
  display: block;
  min-height: 100vh;
  padding-left: var(--sidebar-width);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(8, 13, 27, 0.98) 0%, rgba(7, 11, 22, 0.99) 100%),
    var(--panel);
  color: #c4ccdf;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid rgba(98, 132, 199, 0.14);
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 18px 0 40px rgba(0, 0, 0, 0.28);
}

.main { min-width: 0; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 13px; letter-spacing: -0.2px; color: #fff; padding: 2px 4px 12px; border-bottom: 1px solid rgba(245, 184, 75, 0.16); }
.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 10px;
  padding: 4px;
  background: linear-gradient(135deg, rgba(245, 184, 75, 0.22), rgba(37, 99, 235, 0.28));
  border: 1px solid rgba(245, 184, 75, 0.35);
  filter: drop-shadow(0 7px 15px rgba(245, 184, 75, 0.22));
}
.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.brand-title {
  color: #fff;
  white-space: nowrap;
}
.brand-subtitle {
  font-size: 0;
  line-height: 1.35;
  font-weight: 650;
}
.brand-subtitle::before {
  content: "ADMIN";
  display: inline-block;
  margin-right: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fde68a;
  background: rgba(245, 184, 75, 0.14);
  border: 1px solid rgba(245, 184, 75, 0.38);
  vertical-align: middle;
}
.brand-subtitle::after {
  content: "Admin portal";
  font-size: 10px;
  font-weight: 650;
  color: #e0b84a;
  vertical-align: middle;
}

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.nav-section {
  margin: 12px 4px 4px;
  color: #56657d;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}
.nav a {
  color: #94a3b8; text-decoration: none; padding: 8px 10px; border-radius: 8px;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 650;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}
.nav a:hover { background: var(--nav-hover-bg); color: var(--nav-hover-fg); border-color: var(--nav-hover-border); }
.nav a.active {
  background: linear-gradient(135deg, var(--btn-from), var(--btn-to));
  color: var(--btn-ink);
  border-color: var(--nav-hover-border);
  box-shadow: 0 8px 22px var(--btn-shadow);
  font-weight: 750;
}
.nav-ico {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 5px;
  border: 1px solid rgba(98, 132, 199, 0.18);
  color: #9eb7e7;
  font-size: 9px;
  font-weight: 850;
}
.nav a.active .nav-ico {
  border-color: rgba(26, 20, 6, 0.28);
  color: #1a1406;
  background: rgba(26, 20, 6, 0.1);
}
.font-size-ctrl {
  margin-top: 4px;
  padding: 10px 0 8px;
  border-top: 1px solid var(--card-border);
}
.font-size-ctrl > span { font-size: 11px; color: #5a6688; letter-spacing: 0.3px; display: block; margin-bottom: 6px; }
.font-size-btns { display: flex; gap: 4px; }
.fs-btn {
  flex: 1; padding: 5px 0; text-align: center;
  font-size: 13px; font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: #8b99b8; border-radius: 6px; cursor: pointer;
  transition: all 0.12s ease; box-shadow: none;
  width: auto;
}
.fs-btn:hover { background: rgba(59, 111, 245, 0.15); color: #c4d0f0; border-color: rgba(59, 111, 245, 0.3); transform: none; }
.fs-btn:active { background: rgba(59, 111, 245, 0.25); }

.sidebar-program {
  margin-top: auto;
  padding: 14px;
  min-height: 112px;
  border: 1px solid rgba(98, 132, 199, 0.12);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(245, 184, 75, 0.12), rgba(15, 23, 42, 0.72)),
    rgba(15, 23, 42, 0.7);
  position: relative;
  overflow: hidden;
}
.sidebar-program::after {
  content: "";
  position: absolute;
  right: -10px;
  bottom: -8px;
  width: 80px;
  height: 80px;
  background: url("assets/usls-logo.png") center / contain no-repeat;
  opacity: 0.08;
}
.sidebar-program strong {
  display: block;
  color: #e7edf8;
  font-size: 12px;
  margin-bottom: 4px;
}
.sidebar-program span {
  display: block;
  color: #7e8da6;
  font-size: 10.5px;
  line-height: 1.35;
}
.sidebar-admin {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(245, 184, 75, 0.18);
  border-radius: 10px;
  background: rgba(8, 13, 27, 0.72);
}
.admin-avatar {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #fde68a;
  background: rgba(245, 184, 75, 0.16);
  border: 1px solid rgba(245, 184, 75, 0.32);
  font-size: 11px;
  font-weight: 850;
}
.admin-meta {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.admin-name {
  color: #dbe7ff;
  font-size: 12px;
  font-weight: 750;
}
.admin-role {
  color: #75849c;
  font-size: 10px;
}
.sidebar-footer { padding-top: 8px; font-size: 11px; color: #64748b; letter-spacing: 0.3px; }

/* ── Main ──────────────────────────────────── */

.main { padding: 18px 20px 34px; width: 100%; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 16px;
}
h1 { margin: 0 0 3px; font-size: 1.55rem; letter-spacing: -0.5px; font-weight: 800; color: #fff; }
.subtitle { margin: 0; color: var(--muted); font-size: 0.78rem; }
.hero-actions { display: flex; gap: 8px; align-items: center; }

.pill-badge {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: rgba(59, 111, 245, 0.12);
  color: var(--accent-hover);
  border: 1px solid rgba(59, 111, 245, 0.2);
  backdrop-filter: blur(8px);
}

/* ── Cards ─────────────────────────────────── */

.content-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.2fr); gap: 18px; align-items: start; }

.combine-card {
  margin-bottom: 18px;
}

.combine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 14px 18px;
  margin-top: 4px;
}

.combine-grid .note {
  margin: 6px 0 0;
}

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

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(285px, 330px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.workspace-side {
  position: sticky;
  top: 18px;
}

.workspace-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.toolbar-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}

.toolbar-row .actions {
  margin: 0;
  flex: 0 1 auto;
}

.toolbar-row input[type="text"],
.toolbar-row input[type="search"] {
  flex: 1;
  min-width: 220px;
  margin: 0;
}

.toolbar-row button {
  width: auto;
  min-width: max-content;
}

.file-card input[type="file"] {
  width: 100%;
  padding: 9px;
  background: rgba(8, 13, 27, 0.68);
  border: 1px dashed rgba(98, 132, 199, 0.28);
}

.file-card label {
  color: #cbd5e1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 6px;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.prefix-mode-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(8, 13, 27, 0.42);
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
}

.radio-row input[type="radio"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

#customPrefix:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.note.err {
  color: var(--danger);
}

.file-card .actions button,
.workspace-side .actions button {
  flex: 1 1 160px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.stat-tile {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 13, 27, 0.52);
}

.stat-tile strong {
  display: block;
  color: #fff;
  font-size: 1.2rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-tile span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.status-panel {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(32, 209, 123, 0.18);
  border-radius: 12px;
  background: rgba(32, 209, 123, 0.08);
}

.status-panel .status {
  margin: 0;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title .title-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 0.78rem;
  font-weight: 850;
  color: #c4b5fd;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(124, 58, 237, 0.28));
  border-color: rgba(124, 58, 237, 0.34);
}

.hero-actions .pill-badge {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.76);
  border: 1px solid rgba(98, 132, 199, 0.2);
  color: #dbeafe;
  box-shadow: none;
}

.hero-actions .pill-badge:last-child {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: rgba(124, 58, 237, 0.34);
  color: #fff;
}

.phase-panel {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(8, 13, 27, 0.42);
}

.phase-panel h3 {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--accent-hover);
}

.phase-panel .row > div,
.field-card {
  padding: 12px;
  border: 1px solid rgba(98, 132, 199, 0.14);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.54);
}

.phase-panel label,
.field-card label {
  margin-top: 0;
}

.phase-grid,
.upload-card-grid,
.email-form-grid {
  display: grid;
  gap: 16px;
}

.phase-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.upload-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.email-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.input-with-action {
  display: flex;
  gap: 6px;
  align-items: center;
}

.input-with-action input {
  flex: 1;
}

.process-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  gap: 14px;
  align-items: stretch;
}

.process-card {
  position: relative;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(8, 13, 27, 0.48);
}

.upload-card-grid .process-card {
  min-height: 130px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(8, 13, 27, 0.5)),
    rgba(8, 13, 27, 0.48);
}

.process-card strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.process-card span {
  color: var(--muted);
  font-size: 0.75rem;
}

.section-divider {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.card {
  background: linear-gradient(180deg, var(--card), var(--panel));
  padding: 18px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.22),
    0 0 1px rgba(255, 255, 255, 0.05) inset;
  min-width: 0;
  transition: border-color 0.2s ease;
}
.card:hover { border-color: var(--card-hover-border); }

.card h2 { display: flex; align-items: center; gap: 10px; }
.card h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.stack { display: flex; flex-direction: column; gap: 16px; }

/* ── Forms ─────────────────────────────────── */

label { display: block; font-weight: 600; margin: 14px 0 6px; color: var(--text-secondary); font-size: 0.8125rem; letter-spacing: 0.2px; }

input, textarea, select, button {
  font: inherit; width: 100%; padding: 0.58rem 0.78rem;
  border-radius: var(--radius);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted); }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
textarea { min-height: 90px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.note { font-size: 0.8125rem; color: var(--muted); margin-top: 8px; }
.actions { margin-top: 18px; display: flex; gap: 12px; flex-wrap: wrap; }

button {
  cursor: pointer;
  background: linear-gradient(135deg, var(--btn-from), var(--btn-to));
  color: var(--btn-ink);
  border: none;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.2px;
  transition: all 0.15s ease;
  box-shadow: 0 7px 18px var(--btn-shadow);
}
button:hover {
  box-shadow: 0 6px 24px var(--btn-shadow-hover);
  transform: translateY(-1px);
}
button:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(245, 184, 75, 0.25); }
button.secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  box-shadow: none;
}
button.secondary:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); border-color: rgba(99, 117, 180, 0.35); }
button.danger {
  background: rgba(240, 82, 100, 0.12);
  border: 1px solid rgba(240, 82, 100, 0.32);
  color: #fb7185;
  box-shadow: none;
}
button.danger:hover { background: rgba(240, 82, 100, 0.2); color: #fecdd3; border-color: rgba(240, 82, 100, 0.5); box-shadow: none; }
button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
/* Primary combine CTA stays clickable for validate-on-click feedback (never leave it disabled when "ready"). */
#startCombine:not(:disabled),
#startMerge:not(:disabled),
#startAudit:not(:disabled) { cursor: pointer; }
.status.error { color: #fb7185; }
.ref-empty { color: var(--muted); font-style: italic; }
.ref-digits { color: var(--warn); font-weight: 600; }

/* ── Client Records Fixer (Prepare Client File) ──────────── */
.prep-issues { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; max-height: 220px; overflow: auto; }
.issue-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: rgba(8, 13, 27, 0.55); font-size: 0.82rem;
}
.issue-item.resolved { opacity: 0.55; background: rgba(32, 209, 123, 0.06); }
.iss-old { color: var(--danger); }
.iss-new { color: #4ade80; }
.iss-accept { padding: 5px 12px; font-size: 0.78rem; width: auto; }
.prep-grid-wrap { overflow: auto; max-height: 460px; border: 1px solid var(--border); border-radius: 10px; background: rgba(7, 11, 22, 0.48); margin-top: 12px; }
.prep-grid { border-collapse: collapse; font-size: 0.78rem; white-space: nowrap; width: 100%; }
.prep-grid th, .prep-grid td { border: 1px solid var(--border); padding: 4px 8px; }
.prep-grid th { position: sticky; top: 0; background: var(--table-header); color: var(--muted); font-size: 0.7rem; text-transform: uppercase; }
.prep-grid td { color: var(--text); min-width: 70px; }
.prep-grid td:focus { outline: 2px solid var(--accent); }
.prep-grid td.cell-zip { background: rgba(32, 209, 123, 0.16); }
.prep-grid td.cell-addr { background: rgba(245, 184, 75, 0.2); }
.prep-grid td.cell-runon { background: rgba(240, 82, 100, 0.2); }
.prep-grid td.cell-fixed { background: rgba(32, 209, 123, 0.16); }

/* ── Output ────────────────────────────────── */

pre {
  background: rgba(8, 11, 24, 0.8); color: #c4d0f0; padding: 16px; border-radius: 12px;
  overflow: auto; min-height: 220px; margin-top: 12px;
  border: 1px solid var(--card-border);
  font-size: 0.8125rem;
}
.diagnostic-log {
  background: rgba(8, 11, 24, 0.8);
  color: #c4d0f0;
  padding: 12px;
  border-radius: 12px;
  max-height: 280px;
  overflow: auto;
  font-size: 0.75rem;
  white-space: pre-wrap;
  border: 1px solid var(--card-border);
}
.output-grid { display: grid; gap: 16px; }
.kv-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.kv-table th, .kv-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.kv-table th { width: 180px; color: var(--muted); font-weight: 600; font-size: 0.8125rem; }
.kv-table td { color: var(--text); }
.pill {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem;
  background: rgba(59, 111, 245, 0.12); color: var(--accent-hover);
}
.empty { color: var(--muted); font-style: italic; }
.status { font-weight: 600; margin-top: 8px; color: var(--text); }
.warning { color: var(--warn); }
.section-title { margin: 0 0 6px; font-size: 1.0625rem; color: var(--text); font-weight: 600; letter-spacing: -0.2px; }

/* ── Progress ──────────────────────────────── */

.progress { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
progress { width: 100%; height: 8px; border-radius: 4px; accent-color: var(--accent); background: var(--input-bg); border: none; }
progress::-webkit-progress-bar { background: rgba(255, 255, 255, 0.05); border-radius: 4px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 4px; }
.progress span { min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.8125rem; }

/* ── Tables ────────────────────────────────── */

.results-table-wrapper {
  max-height: 500px; overflow-y: auto; overflow-x: auto;
  border: 1px solid var(--border); border-radius: 10px; margin-top: 10px;
  background: rgba(7, 11, 22, 0.48);
}
.results-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.results-table th, .results-table td { text-align: left; padding: 0.48rem 0.6rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.results-table thead th { position: sticky; top: 0; background: var(--table-header); z-index: 10; color: var(--muted); font-weight: 600; font-size: 0.75rem; letter-spacing: 0.3px; text-transform: uppercase; backdrop-filter: blur(8px); }
.results-table tbody tr:hover { background: var(--table-hover); }

.badge {
  padding: 3px 10px; border-radius: 999px; font-size: 0.6875rem; display: inline-block;
  font-weight: 600; letter-spacing: 0.2px;
}
.badge.ok { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.badge.warn { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge.err { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge.ready { background: rgba(59, 111, 245, 0.15); color: #93b4ff; }

.preview-table-wrapper {
  max-height: 420px; overflow-y: auto; overflow-x: auto;
  border: 1px solid var(--border); border-radius: 10px; margin-top: 10px;
  background: rgba(8, 11, 24, 0.4);
}
.preview-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
#auditUnprefixed { width: max-content; min-width: 100%; }
#auditUnprefixed th, #auditUnprefixed td { max-width: 280px; }
.preview-table th, .preview-table td { text-align: left; padding: 0.4375rem 0.625rem; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-table th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--table-header); z-index: 10; font-size: 0.75rem; letter-spacing: 0.3px; text-transform: uppercase; backdrop-filter: blur(8px); }
.preview-table tbody tr:hover { background: var(--table-hover); }
.preview-table tbody tr:nth-child(even) { background: var(--table-stripe); }

.log-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.log-table th, .log-table td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-table th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--table-header); z-index: 10; font-size: 0.75rem; letter-spacing: 0.3px; text-transform: uppercase; backdrop-filter: blur(8px); }
.log-table tbody tr:hover { background: var(--table-hover); }

.preview-table input[type="checkbox"] { width: auto; margin: 0; cursor: pointer; accent-color: var(--accent); }
.preview-table tbody tr.row-selected { background: rgba(59, 111, 245, 0.1); }
.preview-table tbody tr.row-selected:hover { background: rgba(59, 111, 245, 0.16); }
.preview-table tbody tr.row-hidden { display: none; }

/* ── Order Matcher ─────────────────────────── */

.history-slot + .history-slot { margin-top: 6px; }

.order-match-list {
  max-height: 620px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 10px;
  background: rgba(8, 11, 24, 0.4);
}
.order-match-row {
  display: grid; grid-template-columns: 40px 140px 1fr 36px; gap: 10px; align-items: center;
  padding: 8px 10px; border-bottom: 1px solid var(--border); min-height: 64px;
  transition: background 0.15s ease;
}
.order-match-row:last-child { border-bottom: none; }
.order-match-row:hover { background: var(--table-hover); }
.order-match-row.drag-over { background: rgba(59, 111, 245, 0.12); outline: 2px dashed var(--accent); outline-offset: -2px; }
.order-match-row.dragging { opacity: 0.35; }
.order-match-num { font-weight: 700; font-size: 0.875rem; color: var(--muted); text-align: center; }
.order-match-thumb {
  border: 1px solid var(--border); border-radius: 6px;
  background: rgba(255, 255, 255, 0.03); overflow: hidden; cursor: grab;
  transition: border-color 0.15s ease;
}
.order-match-thumb:hover { border-color: var(--accent); }
.order-match-thumb:active { cursor: grabbing; }
.order-match-thumb img { display: block; width: 100%; height: auto; }
.order-match-csv { font-size: 0.8125rem; line-height: 1.45; min-width: 0; }
.order-match-csv strong { color: var(--text); }
.order-match-csv .om-detail { color: var(--muted); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-match-grip { color: var(--muted); cursor: grab; text-align: center; font-size: 1.125rem; user-select: none; }
.order-match-grip:hover { color: var(--accent-hover); }
.order-match-grip:active { cursor: grabbing; }

/* ── Editable Cells ────────────────────────── */

.editable-cell { cursor: text; transition: background 0.1s ease; }
.editable-cell:hover { background: rgba(59, 111, 245, 0.08); }
.editable-cell.cell-editing { padding: 2px 3px; background: var(--input-bg); }
.editable-cell.cell-edited { background: rgba(34, 197, 94, 0.08); }
.cell-edit-input {
  width: 100%; padding: 4px 6px; margin: 0; font: inherit; font-size: 0.8125rem;
  border: 1.5px solid var(--accent); border-radius: 4px;
  background: var(--input-bg); color: var(--text);
  outline: none; box-shadow: 0 0 0 3px rgba(59, 111, 245, 0.15);
}

/* ── Copy Buttons ─────────────────────────── */

.copy-btn {
  padding: 1px 6px !important;
  font-size: 0.6rem !important;
  line-height: 1.2 !important;
  white-space: nowrap;
  min-width: auto !important;
  min-height: auto !important;
  height: auto !important;
  letter-spacing: 0;
  border-radius: 4px;
}

/* ── Modal ─────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 24, 0.7);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal.active { display: flex; }
.modal-card {
  background: rgba(20, 24, 48, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  width: min(720px, 92vw);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; color: #fff; }
.modal-close {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 0.8125rem;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* Dashboard */

.dashboard-page {
  max-width: none;
  margin: 0 auto;
  min-height: 100vh;
}

.dashboard-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 14px 0 12px;
  background: linear-gradient(180deg, rgba(7, 11, 22, 0.96), rgba(7, 11, 22, 0.76) 70%, transparent);
  backdrop-filter: blur(16px);
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-icon,
.metric-icon,
.health-icon {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(245, 184, 75, 0.28);
  background: rgba(245, 184, 75, 0.12);
  color: #fde68a;
}

.title-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.toolbar-control {
  width: auto;
  min-height: 34px;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text-secondary);
  font-size: 0.75rem;
  box-shadow: none;
}

.toolbar-button {
  width: auto;
  min-height: 34px;
  padding: 0.45rem 0.75rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 12px;
  margin-bottom: 14px;
  align-items: stretch;
  justify-items: stretch;
}

.metric-card {
  min-height: 106px;
  padding: 15px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 10px;
  width: 82px;
  height: 34px;
  opacity: 0.46;
  background:
    linear-gradient(135deg, transparent 45%, currentColor 46% 54%, transparent 55%) 0 0 / 12px 12px,
    linear-gradient(90deg, transparent, currentColor, transparent);
  color: rgba(96, 165, 250, 0.34);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}

.metric-card.success::after { color: rgba(32, 209, 123, 0.4); }
.metric-card.purple::after { color: rgba(168, 85, 247, 0.42); }
.metric-card.warn::after { color: rgba(245, 184, 75, 0.45); }
.metric-card.danger::after { color: rgba(240, 82, 100, 0.45); }

.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 1.1rem;
}

.metric-card.success .metric-icon { background: rgba(32, 209, 123, 0.12); color: #4ade80; border-color: rgba(32, 209, 123, 0.18); }
.metric-card.purple .metric-icon { background: rgba(124, 58, 237, 0.14); color: #c4b5fd; border-color: rgba(124, 58, 237, 0.22); }
.metric-card.warn .metric-icon { background: rgba(245, 184, 75, 0.12); color: #fbbf24; border-color: rgba(245, 184, 75, 0.2); }
.metric-card.danger .metric-icon { background: rgba(240, 82, 100, 0.12); color: #fb7185; border-color: rgba(240, 82, 100, 0.2); }

.metric-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 3px;
  color: #fff;
  font-size: 1.55rem;
  font-weight: 850;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.metric-delta {
  margin-top: 6px;
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 700;
}

.metric-delta.down { color: var(--danger); }
.metric-delta.neutral { color: var(--muted); }

.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 12px;
  margin-bottom: 14px;
  align-items: stretch;
  justify-items: stretch;
}

.insight-card {
  padding: 14px;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.insight-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.insight-card strong {
  display: block;
  margin: 8px 0 2px;
  color: #fff;
  font-size: clamp(1rem, 1.8vw, 1.45rem);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insight-card span:last-child {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.card-ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
}

.cardops-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cardops-card-wide {
  grid-column: 1 / -1;
}

.cardops-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
  gap: 10px;
}

.cardops-stats.cardops-stats-pair {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
}

.cardops-stats > div {
  background: rgba(15, 18, 35, 0.5);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cardops-stats span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.cardops-stats strong {
  color: #fff;
  font-size: 1.25rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.cardops-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cardops-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.cardops-form-row label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  flex: 1;
  min-width: 96px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.cardops-form-row input,
.cardops-form-row select {
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text);
  font-size: 0.85rem;
}

.cardops-form-row label.cardops-check {
  flex-direction: row;
  align-items: center;
  gap: 7px;
  min-width: auto;
}

.cardops-form-row label.cardops-check input {
  width: auto;
  flex: 0 0 auto;
}

.section-heading {
  margin: 22px 0 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.2px;
}

.section-heading .subtitle {
  margin: 3px 0 0;
}

.cardops-form-row button {
  flex: 0 0 auto;
  padding: 8px 14px;
}

/* ── Guided dashboard flow ─────────────────── */

.section-heading.step-heading {
  margin: 30px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.section-heading.step-heading h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.32);
}

/* Short helper line under an input: what to type, and when. */
.field-hint {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.1px;
  white-space: normal;
}

/* Groups the fields an operator actually types into each day. */
.entry-block {
  margin-top: 14px;
  padding: 12px 14px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 13, 27, 0.42);
}

.entry-block-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--accent-hover);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.entry-block .cardops-form {
  margin-top: 2px;
}

/* Helper lines make the labels taller, so buttons wrap onto their own line.
   Sizing them to their content keeps the actions reading as buttons. */
.entry-block .cardops-form-row button,
.adv-disclosure .cardops-form-row button {
  width: auto;
  min-width: 140px;
}

.adv-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(111, 124, 146, 0.16);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: none;
}

/* Rarely-touched settings stay folded away so the default view is short. */
.adv-disclosure {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 13, 27, 0.32);
}

.adv-disclosure > summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  list-style: none;
}

.adv-disclosure > summary::-webkit-details-marker { display: none; }

.adv-disclosure > summary::before {
  content: '\25B8';
  color: var(--muted);
  font-size: 0.7rem;
  transition: transform 0.15s ease;
}

.adv-disclosure[open] > summary::before { transform: rotate(90deg); }
.adv-disclosure > summary:hover { color: var(--text); }
.adv-disclosure[open] > summary { border-bottom: 1px solid var(--border); }

.adv-disclosure > *:not(summary) {
  padding-left: 14px;
  padding-right: 14px;
}

.adv-disclosure > *:last-child { padding-bottom: 14px; }

/* The stock headline the operator reads first. */
.note.note-strong {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(59, 111, 245, 0.22);
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.5;
}

.cardops-card .stock-remove {
  padding: 4px 10px;
  font-size: 0.72rem;
}

.cardops-stat-sm {
  font-size: 0.95rem !important;
}

.reorder-plan {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.reorder-plan strong {
  color: #fff;
}

.reorder-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
}

@media (max-width: 1100px) {
  .card-ops-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
}

@media (max-width: 640px) {
  .cardops-stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr)); }
}

.bulk-job-card {
  margin-bottom: 14px;
  border-color: rgba(79, 140, 255, 0.28);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.22),
    0 0 34px rgba(37, 99, 235, 0.08);
}

.bulk-job-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.bulk-job-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(98, 132, 199, 0.16);
  background: rgba(8, 13, 27, 0.72);
}

.bulk-job-meter span {
  display: block;
  width: var(--bulk-job-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--success));
  box-shadow: 0 0 18px rgba(79, 140, 255, 0.35);
}

.bulk-job-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(76px, auto));
  gap: 8px;
}

.bulk-job-stats span {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(8, 13, 27, 0.48);
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.bulk-job-stats strong {
  display: block;
  color: #fff;
  font-size: 1rem;
  line-height: 1.1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 14px;
  align-items: stretch;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-header h2 {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  letter-spacing: -0.2px;
}

.panel-link {
  width: auto;
  padding: 0.32rem 0.55rem;
  border-radius: 7px;
  font-size: 0.7rem;
  color: #8db7ff;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.16);
  text-decoration: none;
}

.chart-wrap {
  height: 276px;
  position: relative;
}

.dashboard-chart {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.7rem;
}

.legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 99px;
  margin-right: 5px;
  background: var(--accent);
}

.health-layout {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
}

.health-ring {
  width: 124px;
  height: 124px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #0b1120 56%, transparent 57%),
    conic-gradient(var(--success) var(--health-score, 98%), var(--accent-2) 0 100%);
  box-shadow: 0 0 28px rgba(37, 99, 235, 0.16);
}

.health-ring-inner {
  text-align: center;
}

.health-score {
  display: block;
  font-size: 1.7rem;
  font-weight: 850;
  line-height: 1;
}

.health-caption {
  color: var(--muted);
  font-size: 0.72rem;
}

.health-list {
  display: grid;
  gap: 7px;
}

.health-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(8, 13, 27, 0.42);
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.health-row strong {
  color: var(--success);
  font-size: 0.72rem;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  margin-right: 6px;
  background: var(--success);
  box-shadow: 0 0 10px rgba(32, 209, 123, 0.45);
}

.status-dot.warn { background: var(--warn); box-shadow: 0 0 10px rgba(245, 184, 75, 0.45); }
.status-dot.err { background: var(--danger); box-shadow: 0 0 10px rgba(240, 82, 100, 0.45); }

.table-card .results-table-wrapper {
  max-height: 300px;
  margin-top: 0;
}

.table-card .log-table td:last-child,
.table-card .log-table th:last-child {
  text-align: right;
}

.ops-feed {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.feed-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(8, 13, 27, 0.42);
}

.feed-type {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(37, 99, 235, 0.14);
  color: #9ec5ff;
  font-size: 0.65rem;
  font-weight: 850;
}

.feed-main {
  min-width: 0;
}

.feed-title {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-meta {
  color: var(--muted);
  font-size: 0.7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-time {
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.mix-list {
  display: grid;
  gap: 10px;
}

.mix-row {
  display: grid;
  gap: 6px;
}

.mix-row-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
}

.mix-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(98, 132, 199, 0.12);
}

.mix-bar span {
  display: block;
  height: 100%;
  width: var(--bar, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
}

.mix-bar.success span { background: linear-gradient(90deg, #20d17b, #86efac); }
.mix-bar.warn span { background: linear-gradient(90deg, #f5b84b, #fcd34d); }
.mix-bar.danger span { background: linear-gradient(90deg, #f05264, #fb7185); }
.mix-bar.purple span { background: linear-gradient(90deg, #7c3aed, #c4b5fd); }

.source-summary {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.source-pill {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(8, 13, 27, 0.42);
}

.source-pill strong {
  display: block;
  color: #fff;
  font-size: 1rem;
}

.source-pill span {
  color: var(--muted);
  font-size: 0.68rem;
}

/* ── Scrollbar ─────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99, 117, 180, 0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99, 117, 180, 0.4); }

/* ── Responsive ────────────────────────────── */

@media (max-width: 1100px) {
  .content-grid { grid-template-columns: 1fr; }
  .workspace-grid { grid-template-columns: 1fr; }
  .workspace-side { position: static; }
  .phase-grid,
  .upload-card-grid,
  .email-form-grid,
  .process-flow { grid-template-columns: 1fr; }
  .metric-grid, .insight-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
  .dashboard-grid, .activity-grid, .ops-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
  .bulk-job-layout { grid-template-columns: 1fr; }
  .bulk-job-stats { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
}
@media (max-width: 900px) {
  .row { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .hero-actions { flex-wrap: wrap; }
  .metric-grid, .insight-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
  .health-layout { grid-template-columns: 1fr; justify-items: center; }
  .feed-item { grid-template-columns: auto 1fr; }
  .feed-time { grid-column: 2; }
}

@media (max-width: 760px) {
  .app-shell { padding-left: 0; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; gap: 16px; flex-wrap: wrap; }
  .main { width: 100%; padding: 16px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .font-size-ctrl { margin-top: 0; border-top: none; padding: 0; }
}

@media (min-width: 1500px) {
  .chart-wrap { height: 340px; }
  .table-card .results-table-wrapper { max-height: 380px; }
  .ops-feed { max-height: 340px; }
}

/* ── Messages (client portal chat) ─────────── */

.chat-layout-card { padding: 0; overflow: hidden; }
.chat-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  min-height: 520px;
}

.chat-threads {
  border-right: 1px solid var(--border);
  background: rgba(7, 11, 22, 0.4);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-threads-head {
  padding: 12px 14px;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.thread-list { overflow-y: auto; flex: 1; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.thread-list .note { padding: 10px; }
.thread-item {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-secondary);
  box-shadow: none;
  font-weight: 500;
}
.thread-item:hover { background: rgba(37, 99, 235, 0.1); transform: none; box-shadow: none; }
.thread-item.active {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(96, 165, 250, 0.28);
  color: #fff;
}
.thread-name { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 0.84rem; color: inherit; }
.thread-unread {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.64rem;
  font-weight: 800;
}
.thread-last { font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-when { font-size: 0.66rem; color: var(--muted); }

.chat-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-pane-head {
  padding: 12px 16px;
  font-weight: 750;
  font-size: 0.88rem;
  color: #fff;
  border-bottom: 1px solid var(--border);
}
.chat-box {
  flex: 1;
  min-height: 320px;
  max-height: 560px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  position: relative;
  isolation: isolate;
}
.chat-box::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('assets/usls-logo.png') center / min(42%, 260px) no-repeat;
  opacity: 0.1;
  pointer-events: none;
}
.chat-day {
  align-self: center;
  color: var(--text-secondary);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 8px 0 2px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--card-border);
}
.chat-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 100%;
}
.chat-row.mine { flex-direction: row-reverse; }
.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.3px;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: #9ec5ff;
  position: relative;
  cursor: default;
  overflow: visible;
}
.chat-row.mine .chat-avatar {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-color: rgba(124, 58, 237, 0.4);
  color: #fff;
}
.chat-avatar > .avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
}
.chat-msg {
  max-width: min(72%, 560px);
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.84rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.chat-row.mine .chat-msg {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(29, 78, 216, 0.95));
  color: #fff;
  border-bottom-right-radius: 5px;
}
.chat-row.theirs .chat-msg {
  background: rgba(20, 28, 48, 0.95);
  border: 1px solid var(--card-border);
  color: var(--text);
  border-bottom-left-radius: 5px;
}
.chat-meta { display: block; margin-top: 5px; font-size: 0.64rem; opacity: 0.65; letter-spacing: 0.2px; }
.chat-input {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin: 10px 16px 14px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--card-border);
}
.chat-input:focus-within {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(59, 111, 245, 0.1);
}
.chat-input textarea {
  flex: 1;
  resize: none;
  min-height: 42px;
  max-height: 160px;
  margin: 0;
  padding: 10px 6px;
  background: transparent;
  border: none;
  box-shadow: none;
}
.chat-input textarea:focus { outline: none; border: none; box-shadow: none; }
.chat-input button { flex: 0 0 auto; width: auto; padding: 9px 18px; }
.chat-attach-btn {
  width: 40px !important;
  height: 40px;
  padding: 0 !important;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}
.chat-send-btn { border-radius: 12px; padding: 10px 22px !important; font-weight: 750; }

.nav-msg-dot {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.64rem;
  font-weight: 850;
  animation: msg-pulse 1.2s ease-in-out infinite;
}

@keyframes msg-pulse {
  0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(240, 82, 100, 0.55); }
  50% { transform: scale(1.18); opacity: 0.85; box-shadow: 0 0 0 6px rgba(240, 82, 100, 0); }
}

.chat-file-chip[hidden] { display: none !important; }
.chat-file-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 10px 16px 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: #c7dbff;
  font-size: 0.78rem;
}
.chat-file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file-chip button {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  padding: 0;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgba(240, 82, 100, 0.25);
  color: #fda4af;
  font-size: 0.8rem;
  box-shadow: none;
}

.chat-attach {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(8, 13, 27, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  word-break: break-all;
  width: auto;
  box-shadow: none;
}
.chat-attach::before {
  content: "FILE";
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.6rem;
  font-weight: 850;
  letter-spacing: 0.4px;
}
.chat-attach:hover { border-color: rgba(255, 255, 255, 0.4); transform: none; }

@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-threads { border-right: none; border-bottom: 1px solid var(--border); max-height: 220px; }
}

#clientModulesCard.cardops-card {
  gap: 0;
  padding: 0;
  overflow: hidden;
}
#clientModulesCard h2::after { display: none; }
#clientModulesCard label {
  display: grid;
  margin: 0;
  font-weight: inherit;
  color: inherit;
  font-size: inherit;
}
#clientModulesCard button {
  width: auto;
  transform: none;
}
#clientModulesCard button:hover { transform: none; }

#clientModulesCard .cm-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
#clientModulesCard .cm-head h2 { margin: 0 0 3px; }
#clientModulesCard .cm-head .subtitle { margin: 0; }
#clientModulesCard .cm-head .secondary { flex: none; margin-top: 2px; }

#clientModulesCard .cm-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: rgba(7, 11, 22, 0.45);
  border-bottom: 1px solid var(--border);
}
#clientModulesCard .cm-spacer { flex: 1; min-width: 8px; }
#clientModulesCard .cm-count {
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#clientModulesCard .cm-count b { color: var(--text); font-weight: 650; }

#clientModulesCard .cm-seg {
  display: inline-flex;
  background: rgba(8, 13, 27, 0.7);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
}
#clientModulesCard .cm-seg button {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 12.5px;
  font-weight: 600;
}
#clientModulesCard .cm-seg button:hover { color: var(--text); background: transparent; }
#clientModulesCard .cm-seg button[aria-pressed="true"] {
  background: rgba(37, 99, 235, 0.16);
  color: #cfe0ff;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.client-modules-layout {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
  gap: 0;
  align-items: start;
}
#clientModulesCard .cm-edit {
  padding: 0;
  border-right: 1px solid var(--border);
  min-width: 0;
}
#clientModulesCard .cm-prev {
  padding: 18px 20px;
  min-width: 0;
  position: sticky;
  top: 18px;
}
#clientModulesCard .cm-prev-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
#clientModulesCard .cm-prev-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}
#clientModulesCard .cm-prev-note { font-size: 11px; color: var(--muted); }

#clientModulesCard .module-list { display: block; padding: 6px 12px 14px; }
#clientModulesCard .cm-group { border-bottom: 1px solid var(--border); }
#clientModulesCard .cm-group:last-child { border-bottom: 0; }
#clientModulesCard .cm-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 8px 8px;
}
#clientModulesCard .cm-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
#clientModulesCard .cm-pill {
  font-size: 10.5px;
  font-weight: 650;
  color: #a8c3f0;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 999px;
  padding: 1px 7px;
}
#clientModulesCard .cm-ghost {
  height: 26px;
  padding: 0 8px;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
#clientModulesCard .cm-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

#clientModulesCard .cm-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 9px 8px;
  border-radius: 9px;
  cursor: pointer;
}
#clientModulesCard .cm-row:hover { background: rgba(17, 28, 49, 0.85); }
#clientModulesCard .cm-row-label { font-size: 13.5px; font-weight: 560; color: var(--text); line-height: 1.45; }
#clientModulesCard .cm-row-desc { font-size: 12px; color: var(--muted); line-height: 1.45; margin-left: 6px; }
#clientModulesCard .cm-row.off .cm-row-label { color: var(--text-secondary); }
#clientModulesCard .cm-row.off .cm-row-desc { color: #5a6b88; }

#clientModulesCard .cm-switch {
  position: relative;
  width: 36px;
  height: 20px;
  margin-top: 1px;
}
#clientModulesCard .cm-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  appearance: none;
}
#clientModulesCard .cm-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #1b2740;
  border: 1px solid #2a3a5c;
  pointer-events: none;
}
#clientModulesCard .cm-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #6e809f;
}
#clientModulesCard .cm-switch input:checked + .cm-track {
  background: #2563eb;
  border-color: #2f6fe0;
}
#clientModulesCard .cm-switch input:checked + .cm-track::after {
  transform: translateX(16px);
  background: #fff;
}

.client-preview {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: #070b16;
  padding: 0;
  min-height: 0;
  overflow: hidden;
}
.client-preview.client-preview-live { padding: 0; }
#clientDashPreviewFrame {
  display: block;
  width: 100%;
  height: 720px;
  border: 0;
  background: #070b16;
}
#clientModulesCard .cm-prev-fallback {
  margin: 8px 0 0;
  font-size: 11px;
}
#clientModulesCard .cm-prev-head .secondary {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
#clientModulesCard .cm-prev.is-expanded {
  position: fixed;
  inset: 0;
  z-index: 200;
  padding: 16px 20px 20px;
  background: #070b16;
  border: 0;
  border-radius: 0;
  overflow: auto;
}
#clientModulesCard .cm-prev.is-expanded #clientDashPreviewFrame {
  height: calc(100vh - 92px);
}
body.cm-preview-expanded { overflow: hidden; }
.pv-empty, .pv-hidden { color: var(--muted); font-size: 0.78rem; margin: 8px 0 0; text-align: center; }

#clientModulesCard .cm-savebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  background: rgba(7, 11, 22, 0.45);
}
#clientModulesCard .cm-savebar .note { margin: 0; }
#clientModulesCard .cm-savebar #saveClientModulesBtn { min-width: 140px; }

@media (max-width: 940px) {
  .client-modules-layout { grid-template-columns: minmax(0, 1fr); }
  #clientModulesCard .cm-edit { border-right: 0; border-bottom: 1px solid var(--border); }
  #clientModulesCard .cm-prev { position: static; }
}
details.dash-fold {
  margin: 16px 0 20px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 4px 14px 14px;
  background: rgba(8, 13, 27, 0.35);
}
details.dash-fold > summary {
  cursor: pointer;
  font-weight: 600;
  padding: 12px 4px;
  list-style: none;
}
details.dash-fold > summary::-webkit-details-marker { display: none; }
details.dash-fold > summary .muted { font-weight: 400; margin-left: 8px; }

/* ── Appearance (Settings) ─────────────────── */

html[data-console-btn="outline"] button:not(.secondary):not(.danger):not(.fs-btn):not(.prod-seg-btn):not(.seg-opt):not(.theme-tile):not(.color-swatch) {
  background: transparent;
  color: var(--accent-hover);
  border: 1.5px solid var(--accent);
  box-shadow: none;
}
html[data-console-btn="outline"] button:not(.secondary):not(.danger):not(.fs-btn):not(.prod-seg-btn):not(.seg-opt):not(.theme-tile):not(.color-swatch):hover {
  background: var(--nav-hover-bg);
  box-shadow: none;
}
html[data-console-btn="pill"] button:not(.fs-btn):not(.prod-seg-btn):not(.seg-opt):not(.theme-tile):not(.color-swatch) {
  border-radius: 999px;
}
html[data-console-link="none"] .main a:not(.toolbar-button):not([class*="btn"]) { text-decoration: none; color: var(--link-color); }
html[data-console-link="hover"] .main a:not(.toolbar-button):not([class*="btn"]) { text-decoration: none; color: var(--link-color); }
html[data-console-link="hover"] .main a:not(.toolbar-button):not([class*="btn"]):hover { text-decoration: underline; }
html[data-console-link="always"] .main a:not(.toolbar-button):not([class*="btn"]) { text-decoration: underline; color: var(--link-color); }
html[data-console-density="compact"] .main { padding: 12px 14px 24px; }
html[data-console-density="compact"] .card { padding: 12px; }
html[data-console-density="compact"] input,
html[data-console-density="compact"] textarea,
html[data-console-density="compact"] select,
html[data-console-density="compact"] button { padding: 0.4rem 0.62rem; }

.settings-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  margin: 16px 0;
}
.settings-card { margin-bottom: 16px; }
.settings-card h2 { margin: 0 0 8px; }
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.theme-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid var(--card-border);
  box-shadow: none;
  padding: 12px;
}
.theme-tile strong { font-size: 0.88rem; }
.theme-tile span:last-child { color: var(--muted); font-size: 0.72rem; font-weight: 500; }
.theme-tile.is-on,
.seg-opt.is-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus-ring);
}
.theme-swatch {
  width: 100%;
  height: 28px;
  border-radius: 6px;
  margin-bottom: 4px;
}
.seg-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}
.seg-opt {
  width: auto;
  flex: 1 1 auto;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: none;
}
.seg-opt:hover { box-shadow: none; }
.swatch-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.color-swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  border: 2px solid var(--card-border);
  box-shadow: none;
  min-width: 28px;
}
.color-swatch.is-theme {
  background: conic-gradient(var(--accent), var(--accent-2), var(--accent-hover), var(--accent));
}
.color-swatch.is-on { border-color: #fff; }
.settings-card input[type="color"] { width: 56px; height: 36px; padding: 2px; }
.preview-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.preview-actions button { width: auto; }

/* ── Sync & production hero ────────────────── */

.sync-hero-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 0;
  border-color: color-mix(in srgb, var(--accent) 28%, var(--card-border));
}
.sync-hero-card::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 58%;
  height: 140%;
  background:
    radial-gradient(circle at 60% 40%, rgba(32, 209, 123, 0.16), transparent 58%),
    radial-gradient(circle at 30% 70%, rgba(56, 189, 248, 0.08), transparent 50%);
  animation: syncHeroGlow 10s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.sync-hero-card[data-prod-status="hold"]::before {
  background:
    radial-gradient(circle at 60% 40%, rgba(245, 184, 75, 0.2), transparent 58%),
    radial-gradient(circle at 30% 70%, rgba(245, 184, 75, 0.08), transparent 50%);
}
.sync-hero-card[data-prod-status="stopped"]::before {
  background:
    radial-gradient(circle at 60% 40%, rgba(240, 82, 100, 0.2), transparent 58%),
    radial-gradient(circle at 30% 70%, rgba(240, 82, 100, 0.08), transparent 50%);
}
@keyframes syncHeroGlow {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.85; }
  50% { transform: translate3d(-4%, 3%, 0) scale(1.06); opacity: 1; }
}
.sync-hero-fx {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.sync-hero-canvas { width: 100%; height: 100%; display: block; }
.sync-hero-inner { position: relative; z-index: 1; padding: 20px 22px 18px; }
.sync-hero-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.sync-kicker {
  margin: 0 0 4px;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--accent-hover);
}
.sync-hero-head h2 { margin: 0; }
.sync-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr) minmax(240px, 1fr);
  gap: 12px;
}
.sync-hero-panel {
  background: rgba(6, 10, 20, 0.42);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  backdrop-filter: blur(10px);
  min-width: 0;
}
.sync-hero-panel h3 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.sync-hero-fields { display: grid; gap: 8px; }
.sync-hero-fields label { margin: 0; }
.sync-publish-btn { min-height: 44px; font-size: 0.9rem; }
.sync-hero-publish { display: flex; flex-direction: column; gap: 8px; }
.sync-hero-publish .note { margin: 0; }
.sync-prod-select {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.prod-status-seg {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}
.prod-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: none;
  font-weight: 700;
}
.prod-seg-btn i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
}
.prod-seg-btn[data-prod="running"] i { background: #20d17b; }
.prod-seg-btn[data-prod="hold"] i { background: #f5b84b; }
.prod-seg-btn[data-prod="stopped"] i { background: #f05264; }
.prod-seg-btn.is-on {
  color: var(--text);
  border-color: transparent;
}
.prod-seg-btn[data-prod="running"].is-on { background: rgba(32, 209, 123, 0.16); box-shadow: 0 0 0 1px rgba(32, 209, 123, 0.45); }
.prod-seg-btn[data-prod="hold"].is-on { background: rgba(245, 184, 75, 0.16); box-shadow: 0 0 0 1px rgba(245, 184, 75, 0.45); }
.prod-seg-btn[data-prod="stopped"].is-on { background: rgba(240, 82, 100, 0.16); box-shadow: 0 0 0 1px rgba(240, 82, 100, 0.45); }
.prod-seg-btn.is-on i { animation: prodPulse 1.8s ease-out infinite; }
@keyframes prodPulse {
  0% { box-shadow: 0 0 0 0 currentColor; }
  100% { box-shadow: 0 0 0 8px transparent; }
}
.sync-hero-refresh {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--card-border);
}
.sync-hero-refresh label { margin: 0; }
@media (max-width: 1100px) {
  .sync-hero-grid { grid-template-columns: 1fr; }
  .sync-hero-refresh { grid-template-columns: 1fr; }
}
