:root {
  --bg: #08111f;
  --surface: #0f1b30;
  --surface2: #14243d;
  --surface3: #1a2d49;
  --border: #223754;
  --accent: #1476ff;
  --accent-glow: rgba(20, 118, 255, 0.16);
  --accent-hover: #0f63dd;
  --green: #14b8a6;
  --green-dim: rgba(20, 184, 166, 0.16);
  --blue: #38bdf8;
  --blue-dim: rgba(56, 189, 248, 0.16);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.16);
  --yellow: #f59e0b;
  --orange: #f77f37;
  --orange-dim: rgba(247, 127, 55, 0.16);
  --purple: #0ea5e9;
  --purple-dim: rgba(14, 165, 233, 0.16);
  --text: #e8efff;
  --text-muted: #8fa5c2;
  --text-dim: #bfd0e6;
  --sidebar-w: 248px;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Manrope', system-ui, sans-serif;
  background:
    radial-gradient(circle at top, rgba(20, 118, 255, 0.08), transparent 24%),
    linear-gradient(180deg, #08111f 0%, #091423 100%);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
}

body.auth-loading .sidebar,
body.auth-loading .main,
body.auth-guest .sidebar,
body.auth-guest .main {
  display: none;
}

body.auth-loading #authGate,
body.auth-guest #authGate {
  display: flex;
}

body.auth-authenticated #authGate {
  display: none;
}

#authGate {
  display: none;
  width: 100%;
  min-height: 100vh;
  padding: 32px;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(20, 118, 255, 0.26), transparent 32%),
    radial-gradient(circle at 85% 15%, rgba(247, 127, 55, 0.18), transparent 22%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.18), transparent 34%),
    linear-gradient(180deg, #07101d 0%, #0c1728 100%);
}

.auth-layout {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 430px);
  gap: 28px;
  align-items: stretch;
}

.auth-hero,
.auth-panel {
  background: rgba(10, 18, 32, 0.9);
  border: 1px solid rgba(159, 181, 214, 0.1);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(3, 8, 18, 0.45);
  backdrop-filter: blur(14px);
}

.auth-hero {
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.auth-brand-logo {
  width: min(230px, 100%);
  height: auto;
}

.auth-badge {
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(20, 118, 255, 0.26);
  background: rgba(20, 118, 255, 0.14);
  color: #dbeafe;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-hero h1 {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  max-width: 12ch;
}

.auth-copy {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.75;
  max-width: 60ch;
}

.auth-feature-list {
  display: grid;
  gap: 14px;
}

.auth-feature-item {
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(20, 118, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(159, 181, 214, 0.09);
}

.auth-feature-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.auth-feature-item span {
  color: var(--text-dim);
  line-height: 1.6;
}

.auth-panel {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: center;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-tab {
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-dim);
  padding: 12px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.auth-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 18px 40px rgba(20, 118, 255, 0.24);
}

.auth-panel-header h2 {
  font-size: 28px;
  margin-bottom: 6px;
}

.auth-panel-header p {
  color: var(--text-dim);
  line-height: 1.6;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-alert {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: rgba(59, 130, 246, 0.12);
  color: #dbeafe;
  line-height: 1.6;
}

.auth-alert.error {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.auth-alert.success {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
}

.users-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 24px;
  align-items: start;
}

.marketplace-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 320px);
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}

.marketplace-title {
  font-size: 28px;
  line-height: 1.15;
  margin: 8px 0 10px;
}

.marketplace-copy {
  max-width: 72ch;
  line-height: 1.7;
}

.marketplace-plan-card {
  border-radius: 18px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(20, 118, 255, 0.16), rgba(59, 130, 246, 0.12));
  border: 1px solid rgba(20, 118, 255, 0.22);
}

.social-scheduler-grid {
  display: grid;
  gap: 18px;
}

.social-scheduler-workspace-card {
  margin-bottom: 24px;
}

.social-scheduler-workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.social-scheduler-workspace-head h3 {
  font-size: 22px;
  line-height: 1.2;
}

.social-scheduler-workspace-head p {
  margin-top: 8px;
  color: var(--text-dim);
  line-height: 1.7;
}

.social-scheduler-workspace-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.social-scheduler-workspace-meta div {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.social-scheduler-workspace-meta strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.social-scheduler-agent-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.social-scheduler-empty-card {
  padding: 24px;
  border-radius: 18px;
  border: 1px dashed rgba(34, 55, 84, 0.92);
  background: rgba(255, 255, 255, 0.02);
}

.social-scheduler-empty-card h3 {
  font-size: 20px;
  line-height: 1.25;
}

.social-scheduler-empty-card p {
  margin-top: 10px;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 72ch;
}

.social-scheduler-card {
  display: grid;
  gap: 16px;
}

.social-scheduler-topline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.social-scheduler-excerpt {
  line-height: 1.7;
}

.social-scheduler-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.social-scheduler-meta div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.social-scheduler-meta strong {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.social-scheduler-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.social-scheduler-copy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.social-copy-card {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.social-copy-card h4 {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.social-copy-card pre {
  margin: 0;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: var(--text);
  max-height: 320px;
  overflow: auto;
}

.marketplace-plan-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.marketplace-plan-value {
  font-size: 26px;
  font-weight: 800;
  margin-top: 6px;
}

.marketplace-plan-sub {
  margin-top: 6px;
  color: var(--text-dim);
}

.marketplace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
  gap: 24px;
  align-items: start;
}

.marketplace-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(180px, 220px);
  gap: 12px;
  margin-bottom: 16px;
}

.form-row-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.marketplace-service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.marketplace-service-card {
  border-radius: 18px;
  padding: 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.marketplace-service-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.marketplace-service-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.marketplace-service-category {
  font-size: 11px;
  color: var(--accent);
  background: rgba(20, 118, 255, 0.12);
  border: 1px solid rgba(20, 118, 255, 0.18);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.marketplace-service-price {
  font-size: 26px;
  font-weight: 800;
}

.marketplace-service-price span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.marketplace-service-meta {
  color: var(--text-dim);
  line-height: 1.7;
  min-height: 72px;
}

.marketplace-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.marketplace-feature-chip {
  font-size: 11px;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.marketplace-orders-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.marketplace-order-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface2);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.marketplace-order-card.selected {
  border-color: rgba(20, 118, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(20, 118, 255, 0.18);
}

.marketplace-order-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.marketplace-order-title {
  font-size: 15px;
  font-weight: 700;
}

.marketplace-order-subtitle {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.marketplace-order-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.marketplace-order-grid div {
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.6;
}

.marketplace-order-grid strong {
  color: var(--text);
  display: block;
}

.marketplace-order-notes {
  color: var(--text-dim);
  line-height: 1.7;
  white-space: pre-wrap;
}

.marketplace-agent-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.marketplace-agent-chip {
  font-size: 11px;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(20, 118, 255, 0.14);
  border: 1px solid rgba(20, 118, 255, 0.2);
  color: var(--accent);
}

.marketplace-agent-status {
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 14px;
}

.marketplace-agent-status.is-info {
  border-color: rgba(59, 130, 246, 0.24);
  color: #bfdbfe;
}

.marketplace-agent-status.is-success {
  border-color: rgba(34, 197, 94, 0.24);
  color: #bbf7d0;
}

.marketplace-agent-status.is-error {
  border-color: rgba(248, 113, 113, 0.24);
  color: #fecaca;
}

.marketplace-agent-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.marketplace-agent-field-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.marketplace-agent-field-top label {
  margin-bottom: 0;
}

.marketplace-agent-textarea {
  min-height: 160px;
  font-family: inherit;
  line-height: 1.7;
}

.marketplace-publisher-list,
.marketplace-publisher-match-list,
.marketplace-prospect-list,
.marketplace-outreach-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.marketplace-publisher-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.marketplace-publisher-card.selected {
  border-color: rgba(20, 118, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(20, 118, 255, 0.18);
}

.marketplace-publisher-card.match-card {
  border-color: rgba(20, 118, 255, 0.25);
}

.marketplace-publisher-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.marketplace-publisher-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.marketplace-publisher-meta div {
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.6;
}

.marketplace-publisher-meta strong {
  color: var(--text);
  display: block;
}

.marketplace-match-reasons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.marketplace-match-reason {
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(20, 118, 255, 0.08);
  border: 1px solid rgba(20, 118, 255, 0.12);
  color: var(--text-dim);
  line-height: 1.6;
}

.marketplace-assigned-publisher {
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.marketplace-assigned-publisher strong {
  color: var(--text);
}

.status-requested { background: rgba(245, 158, 11, 0.15); color: var(--yellow); border: 1px solid rgba(245, 158, 11, 0.2); }
.status-draft { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.2); }
.status-queued { background: rgba(59, 130, 246, 0.15); color: var(--blue); border: 1px solid rgba(59, 130, 246, 0.22); }
.status-in_progress { background: rgba(59, 130, 246, 0.15); color: var(--blue); border: 1px solid rgba(59, 130, 246, 0.22); }
.status-delivered { background: rgba(34, 197, 94, 0.15); color: var(--green); border: 1px solid rgba(34, 197, 94, 0.2); }
.status-sent { background: rgba(34, 197, 94, 0.15); color: var(--green); border: 1px solid rgba(34, 197, 94, 0.2); }
.status-replied { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.22); }
.status-error { background: rgba(248, 113, 113, 0.14); color: #fecaca; border: 1px solid rgba(248, 113, 113, 0.22); }
.status-revision { background: rgba(249, 115, 22, 0.15); color: var(--orange); border: 1px solid rgba(249, 115, 22, 0.2); }
.status-cancelled { background: rgba(107, 114, 128, 0.15); color: var(--text-dim); border: 1px solid rgba(107, 114, 128, 0.22); }

.users-admin-stats {
  margin-bottom: 20px;
}

.users-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(150px, 180px));
  gap: 12px;
  margin-bottom: 16px;
}

.users-table-wrap {
  overflow-x: auto;
}

.requirements-cell {
  min-width: 280px;
  max-width: 380px;
  color: var(--text-dim);
  white-space: normal;
  line-height: 1.55;
}

.user-name-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-name-cell strong {
  color: var(--text);
}

.user-name-cell span {
  color: var(--text-muted);
  font-size: 12px;
}

.badge-inactive {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-dim);
  border: 1px solid rgba(107, 114, 128, 0.22);
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background:
    linear-gradient(180deg, rgba(11, 20, 35, 0.98) 0%, rgba(11, 20, 35, 0.92) 100%);
  border-right: 1px solid var(--border);
  box-shadow: 24px 0 60px rgba(2, 8, 18, 0.28);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  padding: 0 12px;
  overflow-y: auto;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 8px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.brand-lockup { width: 178px; height: auto; display: block; }
.logo-text { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; line-height: 1.5; color: var(--text); }
.logo-kicker { color: var(--text); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.logo-text small { color: var(--text-muted); font-weight: 500; font-size: 12px; line-height: 1.6; }

.sidebar-workspace {
  flex: 0 0 auto;
  margin: 0 2px 12px;
  border: 1px solid rgba(34, 55, 84, 0.9);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 27, 48, 0.96), rgba(9, 18, 32, 0.98));
  overflow: hidden;
}

.sidebar-workspace-toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.sidebar-workspace-toggle-icon {
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
}

.sidebar-workspace-body {
  border-top: 1px solid rgba(34, 55, 84, 0.7);
  padding: 12px;
  display: grid;
  gap: 12px;
}

.sidebar-workspace.is-collapsed .sidebar-workspace-body {
  display: none;
}

.sidebar-workspace-summary {
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-workspace-website-list {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 2px;
}

.sidebar-workspace-site {
  border: 1px solid rgba(34, 55, 84, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-workspace-site.active {
  border-color: rgba(20, 118, 255, 0.34);
  background: linear-gradient(180deg, rgba(20, 118, 255, 0.16), rgba(10, 19, 34, 0.96));
  box-shadow: 0 14px 28px rgba(20, 118, 255, 0.12);
}

.sidebar-workspace-site-select {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.sidebar-workspace-site-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: #bae6fd;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-workspace-site-name {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.sidebar-workspace-site-meta {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
}

.sidebar-workspace-site-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.sidebar-workspace-site-action {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.sidebar-workspace-site-action:hover {
  border-color: rgba(20, 118, 255, 0.28);
  background: rgba(20, 118, 255, 0.1);
  color: #eff6ff;
}

.sidebar-workspace-summary-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: #bae6fd;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-workspace-summary-title {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.sidebar-workspace-summary-meta {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
}

.sidebar-workspace-stage-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 2px;
}

.sidebar-workspace-stage {
  width: 100%;
  border: 1px solid rgba(34, 55, 84, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.sidebar-workspace-stage:hover {
  border-color: rgba(20, 118, 255, 0.24);
  background: rgba(20, 118, 255, 0.08);
  color: var(--text);
  transform: translateX(2px);
}

.sidebar-workspace-stage.active {
  border-color: rgba(20, 118, 255, 0.28);
  background: linear-gradient(135deg, rgba(20, 118, 255, 0.18), rgba(20, 118, 255, 0.06));
  color: #eff6ff;
}

.sidebar-workspace-stage-index {
  display: block;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-workspace-stage-label {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
}

.sidebar-workspace-agent-list {
  display: grid;
  gap: 10px;
}

.sidebar-workspace-section-title {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-workspace-agent-buttons {
  display: grid;
  gap: 8px;
}

.sidebar-workspace-agent {
  width: 100%;
  border: 1px solid rgba(34, 55, 84, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.sidebar-workspace-agent:hover {
  border-color: rgba(20, 118, 255, 0.28);
  background: rgba(20, 118, 255, 0.08);
  transform: translateX(2px);
}

.sidebar-workspace-agent strong {
  display: block;
  font-size: 12px;
}

.sidebar-workspace-agent span {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.03); color: var(--text); transform: translateX(2px); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(20, 118, 255, 0.14), rgba(20, 118, 255, 0.06));
  color: #eff6ff;
  border: 1px solid rgba(20, 118, 255, 0.24);
}
.ui-icon {
  width: 1em;
  height: 1em;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-shell,
.nav-icon,
.stat-icon,
.activity-icon,
.automation-card-icon,
.workflow-node-icon,
.plan-spec-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  color: var(--text-dim);
}
.nav-item:hover .nav-icon { border-color: rgba(143, 165, 194, 0.18); color: var(--text); }
.nav-item.active .nav-icon {
  background: rgba(20, 118, 255, 0.16);
  border-color: rgba(20, 118, 255, 0.24);
  color: var(--accent);
}
.sidebar-footer { border-top: 1px solid var(--border); padding: 12px 0; }

/* ===== MAIN ===== */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(10, 18, 32, 0.86);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
}
.page-title { font-size: 20px; font-weight: 700; }
.page-context {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-workspace-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(34, 55, 84, 0.92);
  border-radius: 14px;
  background: rgba(12, 21, 38, 0.88);
}
.topbar-workspace-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topbar-workspace-select {
  min-width: 240px;
  padding: 8px 12px;
  background: rgba(8, 16, 30, 0.92);
  border-color: rgba(49, 77, 118, 0.92);
  font-size: 12px;
}
.topbar-workspace-select:focus {
  border-color: var(--accent);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}
.status-label { font-size: 12px; color: var(--text-muted); }

.website-workspace-bar {
  padding: 18px 28px 16px;
  border-bottom: 1px solid rgba(34, 55, 84, 0.85);
  background:
    linear-gradient(180deg, rgba(9, 20, 35, 0.98), rgba(7, 15, 28, 0.96)),
    radial-gradient(circle at top left, rgba(20, 118, 255, 0.12), transparent 28%);
}

.website-workspace-bar.hidden {
  display: none !important;
}

.website-workspace-bar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.website-workspace-kicker {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.website-workspace-title {
  margin-top: 6px;
  font-size: 21px;
  line-height: 1.2;
}

.website-workspace-copy {
  margin-top: 6px;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 70ch;
}

.website-workspace-tabs {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.website-workspace-tab {
  min-width: 180px;
  border: 1px solid rgba(34, 55, 84, 0.92);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 27, 48, 0.96), rgba(10, 19, 34, 0.98));
  color: var(--text);
  padding: 14px 15px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.website-workspace-tab:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 118, 255, 0.34);
  box-shadow: 0 18px 34px rgba(4, 10, 20, 0.28);
}

.website-workspace-tab.active {
  border-color: rgba(20, 118, 255, 0.38);
  background: linear-gradient(180deg, rgba(20, 118, 255, 0.22), rgba(11, 23, 40, 0.98));
  box-shadow: 0 18px 40px rgba(20, 118, 255, 0.14);
}

.website-workspace-tab-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: #bae6fd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.website-workspace-tab-label {
  display: block;
  margin-top: 10px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.website-workspace-tab-meta {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.website-workspace-tab-agents {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.website-workspace-tab-agent {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  text-transform: uppercase;
}

.website-agent-focus-card {
  margin-bottom: 24px;
  background:
    linear-gradient(135deg, rgba(20, 118, 255, 0.12), rgba(15, 27, 48, 0.94)),
    radial-gradient(circle at top right, rgba(247, 127, 55, 0.14), transparent 26%);
}

.website-agent-focus-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.website-agent-focus-head h3 {
  font-size: 22px;
  line-height: 1.2;
}

.website-agent-focus-head p {
  margin-top: 8px;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 72ch;
}

.website-agent-focus-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.website-agent-focus-meta div {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(7, 14, 24, 0.42);
  padding: 14px;
}

.website-agent-focus-meta strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.website-agent-phase-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.website-agent-phase-chip {
  border-radius: 999px;
  border: 1px solid rgba(159, 181, 214, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-size: 12px;
  padding: 6px 10px;
}

.website-agent-phase-chip.active {
  border-color: rgba(20, 118, 255, 0.28);
  background: rgba(20, 118, 255, 0.16);
  color: #eff6ff;
}

/* ===== PAGES ===== */
.page { display: none; padding: 28px; animation: fadeIn 0.2s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer; border: none;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  color: #fff;
  box-shadow: 0 14px 30px rgba(20, 118, 255, 0.2);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-hover), #0284c7); box-shadow: 0 0 18px rgba(20,118,255,0.32); }
.btn-secondary { background: var(--surface3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface2); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; width: 100%; justify-content: center; }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: linear-gradient(180deg, rgba(15, 27, 48, 0.98), rgba(12, 22, 40, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(2,8,18,0.35); }
.stat-card.accent { border-color: rgba(20,118,255,0.3); background: linear-gradient(180deg, rgba(20,118,255,0.12), rgba(12,22,40,0.98)); }
.stat-card.green { border-color: rgba(20,184,166,0.3); background: linear-gradient(180deg, rgba(20,184,166,0.12), rgba(12,22,40,0.98)); }
.stat-card.blue { border-color: rgba(56,189,248,0.3); background: linear-gradient(180deg, rgba(56,189,248,0.12), rgba(12,22,40,0.98)); }
.stat-card.red { border-color: rgba(239,68,68,0.3); background: linear-gradient(180deg, rgba(239,68,68,0.12), rgba(12,22,40,0.98)); }
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(20, 118, 255, 0.14);
  color: var(--accent);
  font-size: 22px;
}
.stat-card.green .stat-icon { background: rgba(20, 184, 166, 0.14); color: var(--green); }
.stat-card.blue .stat-icon { background: rgba(56, 189, 248, 0.14); color: var(--blue); }
.stat-card.red .stat-icon { background: rgba(239, 68, 68, 0.14); color: var(--red); }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== SECTION ===== */
.section { margin-bottom: 28px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-header h2 { font-size: 16px; font-weight: 600; }

/* ===== CARDS ===== */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.form-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

/* ===== INPUTS ===== */
.input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.input-sm { width: auto; min-width: 160px; }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn .input { flex: 1; }
select.input { cursor: pointer; }
textarea.input { resize: vertical; min-height: 80px; }
.code-editor { font-family: 'Courier New', monospace; font-size: 12.5px; min-height: 200px; }

/* ===== FORM GROUPS ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 500; color: var(--text-dim); margin-bottom: 6px; }
.form-row { display: flex; gap: 8px; align-items: flex-start; }
.form-row .input { flex: 1; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.editor-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.editor-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.editor-hint code { background: var(--surface3); padding: 1px 5px; border-radius: 4px; color: var(--accent); }
.action-bar { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; }

.client-dashboard-card {
  margin-bottom: 24px;
}

.client-dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 340px);
  gap: 22px;
  align-items: start;
}

.client-dashboard-copy h2 {
  margin: 10px 0 12px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.client-dashboard-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.client-dashboard-meta {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.client-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 16px;
  margin-top: 18px;
}

.client-dashboard-panel {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  padding: 18px;
}

.client-dashboard-area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.client-dashboard-area-card {
  width: 100%;
  border: 1px solid rgba(34,55,84,0.9);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  color: var(--text);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.client-dashboard-area-card:hover {
  border-color: rgba(20,118,255,0.28);
  background: rgba(20,118,255,0.08);
  transform: translateY(-1px);
}

.client-dashboard-area-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.client-dashboard-area-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(20,118,255,0.12);
  border: 1px solid rgba(20,118,255,0.16);
  color: var(--accent);
}

.client-dashboard-area-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.client-dashboard-area-copy {
  margin-top: 14px;
}

.client-dashboard-area-copy h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.client-dashboard-area-copy p {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.client-dashboard-area-phase {
  display: block;
  margin-top: 14px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.client-dashboard-stage-grid {
  display: grid;
  gap: 10px;
}

.client-dashboard-stage-card {
  width: 100%;
  border: 1px solid rgba(34,55,84,0.9);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  color: var(--text);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.client-dashboard-stage-card:hover {
  border-color: rgba(20,118,255,0.24);
  background: rgba(20,118,255,0.08);
  transform: translateX(2px);
}

.client-dashboard-stage-card.active {
  border-color: rgba(20,118,255,0.3);
  background: linear-gradient(135deg, rgba(20,118,255,0.18), rgba(20,118,255,0.05));
}

.client-dashboard-stage-index {
  display: block;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.client-dashboard-stage-card strong {
  display: block;
  margin-top: 6px;
  font-size: 13px;
}

.client-dashboard-stage-card span:last-child {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.client-dashboard-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(20,118,255,0.12);
  background: rgba(20,118,255,0.08);
  color: var(--text-dim);
  line-height: 1.7;
}

.dashboard-stats-section {
  margin-top: 18px;
}

.empty-state.compact {
  padding: 14px 16px;
}

/* ===== OPS DECK ===== */
.ops-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 360px);
  gap: 22px;
}

.ops-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ops-hero-copy h2 {
  margin: 10px 0 12px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.ops-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.ops-hero-meta {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.ops-meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(56,189,248,0.12);
  color: #bae6fd;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ops-meta-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ops-meta-row span {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ops-meta-row strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.ops-tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.ops-tab {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ops-tab:hover {
  color: var(--text);
  border-color: rgba(20,118,255,0.28);
}

.ops-tab.active {
  color: #eff6ff;
  background: linear-gradient(135deg, rgba(20,118,255,0.18), rgba(20,118,255,0.08));
  border-color: rgba(20,118,255,0.28);
}

.ops-pane {
  display: none;
}

.ops-pane.active {
  display: block;
}

.ops-grid-2,
.ops-grid-3 {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.ops-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ops-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-span-2 {
  grid-column: 1 / -1;
}

.ops-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.ops-overview-tile {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  padding: 14px;
}

.ops-overview-tile span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.ops-overview-tile strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.ops-action-grid {
  display: grid;
  gap: 10px;
}

.ops-action-card {
  border: 1px solid rgba(34,55,84,0.9);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  padding: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ops-action-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.ops-action-card span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.ops-output {
  margin-top: 14px;
  min-height: 90px;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed rgba(143,165,194,0.28);
  background: rgba(8,17,31,0.92);
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  overflow-x: auto;
}

.ops-output:empty::before {
  content: 'Output will appear here';
  color: var(--text-muted);
  font-style: italic;
}

.ops-serp-preview,
.ops-contrast-preview {
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-top: 10px;
  padding: 16px;
}

.ops-serp-preview {
  background: #ffffff;
  color: #202124;
}

.ops-serp-url {
  color: #4d5156;
  font-size: 13px;
}

.ops-serp-title {
  color: #1a0dab;
  font-size: 21px;
  line-height: 1.35;
  margin: 5px 0;
}

.ops-serp-desc {
  color: #4d5156;
  font-size: 14px;
  line-height: 1.5;
}

.ops-contrast-preview {
  text-align: center;
  font-size: 18px;
}

.ops-color-input {
  min-height: 42px;
  padding: 6px;
}

.ops-checklist {
  list-style: none;
  display: grid;
  gap: 8px;
}

.ops-checklist li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.ops-checklist li:last-child {
  border-bottom: none;
}

.ops-checklist input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

.ops-checklist label {
  cursor: pointer;
  color: var(--text-dim);
  line-height: 1.5;
}

.ops-checklist input[type="checkbox"]:checked + label {
  color: var(--text-muted);
  text-decoration: line-through;
}

.ops-checklist .sub {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 4px;
}

@media (max-width: 1100px) {
  .ops-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .ops-hero-card,
  .ops-grid-2,
  .ops-grid-3,
  .ops-overview-grid {
    grid-template-columns: 1fr;
  }

  .ops-span-2 {
    grid-column: auto;
  }
}

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 10px 14px;
  font-size: 11.5px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(42,46,69,0.5);
  font-size: 13.5px;
  color: var(--text-dim);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table tr { transition: background 0.1s; }

/* ===== STATUS BADGES ===== */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  text-transform: capitalize;
}
.badge-sent { background: var(--accent-glow); color: var(--accent); border: 1px solid rgba(20,118,255,0.3); }
.badge-draft { background: rgba(107,114,128,0.15); color: var(--text-muted); border: 1px solid rgba(107,114,128,0.2); }
.badge-sending { background: rgba(245,158,11,0.15); color: var(--yellow); border: 1px solid rgba(245,158,11,0.2); }
.badge-active { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.badge-unsubscribed { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }

/* ===== CONTACTS LAYOUT ===== */
.contacts-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; min-height: calc(100vh - 120px); }
.lists-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; height: fit-content; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-header h3 { font-size: 13px; font-weight: 600; }
.contacts-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }

.list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 4px;
  transition: background 0.1s;
}
.list-item:hover { background: var(--surface2); }
.list-item.active { background: var(--accent-glow); border: 1px solid rgba(20,118,255,0.2); }
.list-name { font-size: 13px; font-weight: 500; }
.list-count { font-size: 11px; color: var(--text-muted); background: var(--surface3); padding: 2px 7px; border-radius: 20px; }

/* ===== ACTIVITY FEED ===== */
.activity-feed { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.activity-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(42,46,69,0.5);
  transition: background 0.1s;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: rgba(255,255,255,0.02); }
.activity-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(20, 118, 255, 0.12);
  color: var(--accent);
}
.activity-info { flex: 1; }
.activity-email { font-size: 13.5px; font-weight: 500; }
.activity-meta { font-size: 12px; color: var(--text-muted); }
.activity-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ===== COMPOSE ===== */
.compose-layout { max-width: 800px; }
.tab-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted);
  transition: all 0.15s;
}
.tab-btn.active { background: var(--accent-glow); color: var(--accent); border-color: rgba(20,118,255,0.3); }

/* ===== AI WRITER ===== */
.ai-layout { max-width: 800px; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ===== ANALYTICS ===== */
.analytics-layout { max-width: 900px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.link-bar { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(42,46,69,0.4); }
.link-bar:last-child { border-bottom: none; }
.link-bar-url { font-size: 12px; color: var(--text-dim); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-bar-count { font-size: 12px; font-weight: 600; color: var(--accent); }
.link-bar-fill { height: 4px; border-radius: 2px; background: var(--accent); margin-top: 4px; }
.timeline-bar { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 10px 0; }
.timeline-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.timeline-col-bar { width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 4px; transition: height 0.3s; }
.timeline-col-label { font-size: 9px; color: var(--text-muted); writing-mode: vertical-rl; transform: rotate(180deg); }

/* ===== SEO REPORTS ===== */
.seo-workspace {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.seo-tabbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.seo-tab {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.seo-tab.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: rgba(20,118,255,0.3);
}
.seo-workspace-pane { display: none; }
.seo-workspace-pane.active { display: block; }
.seo-report-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 20px;
}
.seo-dashboard-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) 160px 160px;
  gap: 10px;
  margin-bottom: 16px;
}
.seo-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 220px;
  gap: 18px;
  align-items: stretch;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.15), transparent 35%),
    linear-gradient(135deg, rgba(59,130,246,0.14), rgba(247,127,55,0.1));
}
.seo-hero-copy h2 {
  font-size: 28px;
  line-height: 1.15;
  margin-bottom: 12px;
  max-width: 580px;
}
.seo-kicker {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: #93c5fd;
  margin-bottom: 10px;
  font-weight: 700;
}
.seo-score-mini {
  border-radius: var(--radius);
  padding: 20px;
  background: rgba(10,14,30,0.55);
  border: 1px solid rgba(147,197,253,0.18);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.seo-score-mini-label { color: var(--text-muted); font-size: 12px; margin-bottom: 10px; }
.seo-score-mini-value { font-size: 40px; font-weight: 800; line-height: 1; }
.seo-score-mini-sub { color: var(--text-dim); font-size: 13px; margin-top: 8px; }
.seo-form-block {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.seo-keyword-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.seo-keyword-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.35fr) 105px 115px 145px 90px 95px 110px minmax(180px, 1.2fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.02);
}
.seo-keyword-row.active {
  border-color: rgba(59,130,246,0.45);
  background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(15,23,42,0.4));
}
.seo-report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.seo-summary-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.seo-summary-card strong {
  display: block;
  font-size: 26px;
  line-height: 1;
  margin-bottom: 8px;
}
.seo-summary-card span { color: var(--text-muted); font-size: 12px; }
.seo-report-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.seo-panel-wide {
  margin-bottom: 16px;
}
.seo-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.seo-panel h4 { font-size: 14px; margin-bottom: 12px; }
.seo-keyword-table-wrap,
.seo-audits-table-wrap {
  overflow-x: auto;
}
.seo-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.seo-dashboard-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
}
.seo-dashboard-card strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  margin-bottom: 6px;
}
.seo-dashboard-card span {
  color: var(--text-muted);
  font-size: 12px;
}
.seo-audit-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.seo-audit-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top right, rgba(59,130,246,0.12), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.seo-audit-card:hover {
  transform: translateY(-1px);
  border-color: rgba(59,130,246,0.45);
  box-shadow: 0 16px 40px rgba(2,6,23,0.35);
}
.seo-audit-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.seo-audit-card-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}
.seo-audit-card-url {
  color: var(--text-muted);
  font-size: 12px;
  word-break: break-all;
}
.seo-audit-card-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
.seo-audit-metric {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(8,12,24,0.54);
}
.seo-audit-metric span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.seo-audit-metric strong {
  font-size: 22px;
  line-height: 1;
  color: var(--text);
}
.seo-keyword-title {
  max-width: 900px;
  font-size: 44px;
  line-height: 1.08;
  margin-bottom: 10px;
}
.seo-keyword-subtitle {
  max-width: 820px;
  font-size: 15px;
}
.seo-keyword-search-card {
  margin-top: 20px;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid rgba(59,130,246,0.18);
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.06), transparent 28%),
    linear-gradient(135deg, rgba(59,130,246,0.12), rgba(14,116,144,0.08));
}
.seo-keyword-search-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.seo-keyword-count {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}
.seo-keyword-count span {
  color: var(--text);
  font-size: 16px;
}
.seo-keyword-examples {
  color: var(--text-muted);
  font-size: 13px;
}
.seo-keyword-examples button {
  border: none;
  background: transparent;
  color: #93c5fd;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  margin-left: 6px;
}
.seo-keyword-query {
  min-height: 86px;
  margin-bottom: 12px;
}
.seo-keyword-search-bottom {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) 120px 170px auto;
  gap: 12px;
}
.seo-keyword-result-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.seo-keyword-result-tab {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border-radius: 16px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.seo-keyword-result-tab:hover,
.seo-keyword-result-tab.active {
  border-color: rgba(59,130,246,0.45);
  background: rgba(59,130,246,0.1);
  transform: translateY(-1px);
}
.seo-keyword-result-tab strong {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
}
.seo-keyword-result-tab span,
.seo-keyword-result-tab small {
  display: block;
  color: var(--text-muted);
}
.seo-keyword-result-tab small {
  margin-top: 4px;
  color: #bfdbfe;
}
.seo-keyword-result-shell {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(247,127,55,0.1), transparent 25%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}
.seo-keyword-result-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.seo-keyword-result-head h3 {
  font-size: 28px;
  margin: 6px 0 8px;
}
.seo-keyword-result-head p {
  color: var(--text-muted);
  margin: 0;
}
.seo-keyword-result-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #93c5fd;
  font-size: 11px;
  font-weight: 700;
}
.seo-kd-badge {
  min-width: 108px;
  padding: 16px;
  border-radius: 18px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
}
.seo-kd-badge span {
  display: block;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}
.seo-kd-badge small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
}
.seo-kd-badge.kd-easy {
  background: rgba(34,197,94,0.12);
  color: #86efac;
}
.seo-kd-badge.kd-mid {
  background: rgba(245,158,11,0.12);
  color: #fcd34d;
}
.seo-kd-badge.kd-hard {
  background: rgba(239,68,68,0.12);
  color: #fca5a5;
}
.seo-keyword-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.seo-keyword-metric-card,
.seo-keyword-insight-card {
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(8,12,24,0.5);
  padding: 16px;
}
.seo-keyword-metric-card span,
.seo-keyword-insight-card span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.seo-keyword-metric-card strong,
.seo-keyword-insight-card strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  margin-bottom: 8px;
}
.seo-keyword-metric-card small,
.seo-keyword-insight-card small {
  color: var(--text-muted);
  line-height: 1.5;
}
.seo-keyword-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.seo-keyword-trend-card {
  min-height: 220px;
}
.seo-trend-chart {
  height: 120px;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  margin: 6px 0 12px;
}
.seo-trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.seo-trend-bar {
  width: 100%;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}
.seo-trend-col span {
  margin: 0;
  font-size: 10px;
  color: var(--text-dim);
}
.seo-meter {
  height: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-bottom: 8px;
}
.seo-meter div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4ade80, #22c55e);
}
.seo-meter-orange div {
  background: linear-gradient(90deg, #fdba74, #f97316);
}
.seo-insight-copy {
  line-height: 1.25;
}
.seo-keyword-active-row {
  background: rgba(59,130,246,0.1);
}
.seo-keyword-table-wrap tr[onclick] {
  cursor: pointer;
}
.seo-tool-textarea {
  min-height: 220px;
}
.seo-tool-result {
  margin-bottom: 16px;
}
.seo-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.seo-tool-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.seo-tool-card strong {
  display: block;
  font-size: 24px;
  margin-bottom: 6px;
}
.seo-tool-card span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}
.seo-tool-card-wide {
  grid-column: span 3;
}
.seo-tool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.seo-tool-actionbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.seo-tool-chip {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-dim);
  font-size: 11px;
}
.seo-tool-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12.5px;
}
.seo-recommendation-item,
.seo-check-item,
.seo-saved-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.seo-recommendation-item { display: grid; grid-template-columns: 88px 1fr; gap: 12px; margin-bottom: 10px; }
.seo-priority-badge,
.seo-status-pill,
.seo-grade-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 10px;
}
.seo-priority-badge.priority-critical,
.seo-priority-badge.priority-high,
.seo-status-pill.status-fail,
.seo-grade-pill.grade-F,
.seo-grade-pill.grade-D {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
}
.seo-priority-badge.priority-medium,
.seo-status-pill.status-warn,
.seo-grade-pill.grade-C {
  background: rgba(245,158,11,0.15);
  color: #fcd34d;
}
.seo-priority-badge.priority-low,
.seo-status-pill.status-pass,
.seo-grade-pill.grade-A,
.seo-grade-pill.grade-B {
  background: rgba(34,197,94,0.15);
  color: #86efac;
}
.seo-recommendation-title,
.seo-check-name { font-size: 13px; font-weight: 600; color: var(--text); }
.seo-recommendation-copy,
.seo-check-detail {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.55;
}
.seo-check-item { margin-bottom: 10px; }
.seo-check-top,
.seo-saved-top,
.seo-saved-meta,
.seo-saved-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.seo-saved-list { display: flex; flex-direction: column; gap: 12px; }
.seo-saved-item { cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.seo-saved-item:hover,
.seo-saved-item.active {
  border-color: rgba(59,130,246,0.55);
  transform: translateY(-1px);
}
.seo-saved-name { font-size: 14px; font-weight: 600; color: var(--text); }
.seo-saved-url {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 8px 0;
}
.seo-saved-meta { color: var(--text-dim); font-size: 12px; margin-bottom: 10px; }

/* ===== OUTREACH ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(34, 55, 84, 0.65);
  text-align: left;
  vertical-align: top;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(15, 27, 48, 0.96);
  backdrop-filter: blur(10px);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.table td {
  color: var(--text-dim);
  font-size: 13px;
}

.table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.outreach-table-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.outreach-table-toolbar,
.outreach-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.outreach-table-card {
  max-height: 68vh;
  overflow: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.outreach-page-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  color: var(--text-muted);
  font-size: 12px;
}

.page-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ===== MODAL ===== */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; min-width: 400px; max-width: 90vw; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-header button { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; }
.subject-idea { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 8px; font-size: 13.5px; transition: all 0.15s; }
.subject-idea:hover { background: var(--accent-glow); border-color: rgba(20,118,255,0.3); color: var(--accent); }

/* ===== SETTINGS ===== */
.settings-group { padding: 14px 0; border-bottom: 1px solid var(--border); }
.settings-label { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.settings-desc { font-size: 12.5px; color: var(--text-muted); }
.settings-status { margin-top: 20px; padding: 16px; background: var(--bg); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.settings-status h4 { margin-bottom: 8px; font-size: 13px; }

/* ===== MISC ===== */
.loading { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }
.empty-state { padding: 32px; text-align: center; color: var(--text-muted); font-size: 13.5px; }
.hidden { display: none !important; }

@media (max-width: 960px) {
  #authGate {
    padding: 20px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-hero,
  .auth-panel {
    padding: 24px;
  }

  .auth-hero h1 {
    font-size: 34px;
  }

  .users-admin-layout {
    grid-template-columns: 1fr;
  }

  .users-toolbar {
    grid-template-columns: 1fr;
  }

  .marketplace-hero-card,
  .marketplace-layout,
  .marketplace-toolbar {
    grid-template-columns: 1fr;
  }

  .marketplace-order-grid {
    grid-template-columns: 1fr;
  }

  .form-row-4,
  .marketplace-publisher-meta {
    grid-template-columns: 1fr;
  }
}
.flex { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.ml-auto { margin-left: auto; }
.mt-8 { margin-top: 8px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); font-size: 13px; line-height: 1.6; margin-bottom: 12px; }
.pagination { display: flex; gap: 6px; justify-content: flex-end; padding: 12px 0; }
.page-btn { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; font-size: 12px; }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== TOAST ===== */
#toastContainer { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13.5px; font-weight: 500;
  animation: slideUp 0.3s ease;
  min-width: 240px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast-success { background: #0f3620; border: 1px solid rgba(34,197,94,0.3); color: var(--green); }
.toast-error { background: #3b1212; border: 1px solid rgba(239,68,68,0.3); color: var(--red); }
.toast-info { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3e55; }

/* ===== NEW COLOR VARIANTS ===== */
.stat-card.purple { border-color: rgba(14,165,233,0.3); background: linear-gradient(180deg, rgba(14,165,233,0.12), rgba(12,22,40,0.98)); }
.stat-card.orange { border-color: rgba(247,127,55,0.3); background: linear-gradient(180deg, rgba(247,127,55,0.12), rgba(12,22,40,0.98)); }
.stat-card.purple .stat-icon { background: rgba(14,165,233,0.14); color: var(--purple); }
.stat-card.orange .stat-icon { background: rgba(247,127,55,0.14); color: var(--orange); }
.badge-paused { background: rgba(247,127,55,0.15); color: var(--orange); border: 1px solid rgba(247,127,55,0.2); }
.badge-completed { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.badge-sm { background: var(--surface3); color: var(--text-muted); font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 500; vertical-align: middle; }
.badge-sys { background: rgba(20,118,255,0.15); color: var(--accent); font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 600; }

/* ===== MULTI-LIST SELECTOR ===== */
.multi-list-selector {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.multi-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
}
.multi-list-item:hover { background: var(--surface2); }
.multi-list-item input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
.multi-list-item-count { margin-left: auto; color: var(--text-muted); font-size: 11px; }

/* ===== TEMPLATE GALLERY ===== */
.template-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.template-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.template-card:hover { border-color: var(--accent); box-shadow: 0 8px 24px rgba(20,118,255,0.2); transform: translateY(-2px); }
.template-preview {
  height: 180px;
  background: #fff;
  overflow: hidden;
  position: relative;
}
.template-preview iframe {
  width: 200%;
  height: 200%;
  border: none;
  transform: scale(0.5);
  transform-origin: top left;
  pointer-events: none;
}
.template-info { padding: 14px 16px; }
.template-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.template-meta { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.template-actions { display: flex; gap: 6px; margin-top: 10px; }
.template-sys-badge { position: absolute; top: 10px; right: 10px; }

/* ===== WORKFLOW BUILDER ===== */
.automation-builder { max-width: 740px; }
.automation-cards { display: flex; flex-direction: column; gap: 16px; }
.automation-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}
.automation-card:hover { border-color: rgba(20,118,255,0.3); }
.automation-card-icon {
  width: 48px;
  height: 48px;
  background: rgba(20, 118, 255, 0.12);
  border-radius: 12px;
  border: 1px solid rgba(20,118,255,0.22);
  color: var(--accent);
  flex-shrink: 0;
}
.automation-card-info { flex: 1; }
.automation-card-name { font-size: 15px; font-weight: 600; }
.automation-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.automation-card-stats { display: flex; gap: 16px; }
.automation-stat { text-align: center; }
.automation-stat-val { font-size: 18px; font-weight: 700; }
.automation-stat-lbl { font-size: 11px; color: var(--text-muted); }
.automation-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Workflow Steps */
.workflow-steps { display: flex; flex-direction: column; gap: 0; }
.workflow-trigger-node {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(20,118,255,0.1), rgba(56,189,248,0.1));
  border: 1px solid rgba(20,118,255,0.26);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.workflow-node-icon {
  width: 40px;
  height: 40px;
  background: rgba(20,118,255,0.16);
  border-radius: 10px;
  color: var(--accent);
}
.workflow-connector { display: flex; justify-content: center; height: 28px; position: relative; }
.connector-line { width: 2px; height: 100%; background: linear-gradient(to bottom, rgba(20,118,255,0.5), rgba(20,118,255,0.2)); }
.workflow-step-node {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface2);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.workflow-step-node:hover { border-color: var(--accent); background: var(--surface); }
.workflow-step-node.step-email { border-left: 3px solid var(--accent); }
.workflow-step-node.step-delay { border-left: 3px solid var(--yellow); }
.workflow-step-icon { font-size: 20px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0; }
.workflow-step-info { flex: 1; }
.workflow-step-title { font-size: 13.5px; font-weight: 600; }
.workflow-step-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.workflow-step-actions { display: flex; gap: 4px; }
.workflow-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
  width: 100%;
  margin-top: 8px;
}
.workflow-add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

/* ===== BILLING ===== */
.billing-plans {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.billing-plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
  transition: all 0.2s;
}
.billing-plan-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,0.4); }
.billing-plan-card.recommended { border-color: var(--accent); background: linear-gradient(135deg, rgba(20,118,255,0.08), rgba(59,130,246,0.05)); }
.plan-recommended-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 12px; border-radius: 20px; white-space: nowrap; }
.plan-name { font-size: 14px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.plan-price { font-size: 36px; font-weight: 800; color: var(--text); line-height: 1; }
.plan-price span { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.plan-specs { margin: 20px 0; display: flex; flex-direction: column; gap: 8px; }
.plan-spec { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }
.plan-spec-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(20, 118, 255, 0.1);
  color: var(--accent);
  font-size: 14px;
}
.plan-features { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px; }
.plan-feature { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); padding: 4px 0; }
.plan-feature::before { content: '✓'; color: var(--green); font-weight: 600; font-size: 12px; }
.plan-cta { margin-top: 20px; }

/* Usage Grid */
.billing-usage-card { background: linear-gradient(135deg, rgba(20,118,255,0.08), rgba(59,130,246,0.05)); border: 1px solid rgba(20,118,255,0.2); }
.usage-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.usage-badge { background: var(--accent-glow); color: var(--accent); font-size: 11px; padding: 4px 10px; border-radius: 20px; border: 1px solid rgba(20,118,255,0.24); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.usage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.usage-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.usage-val { font-size: 22px; font-weight: 700; color: var(--text); }
.usage-lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ===== ATTACHMENTS ===== */
.attachments-list { display: flex; flex-direction: column; gap: 8px; }
.attachment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.attachment-icon { font-size: 18px; }
.attachment-name { flex: 1; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-size { font-size: 11px; color: var(--text-muted); }

/* ===== MODAL VARIANTS ===== */
.modal-lg { min-width: 700px !important; }
.modal-body { max-height: 70vh; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ===== ENROLLMENT LIST ===== */
.enrollment-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(42,46,69,0.5);
  font-size: 13px;
}
.enrollment-item:last-child { border-bottom: none; }
.enrollment-step { background: var(--surface3); padding: 2px 8px; border-radius: 20px; font-size: 11px; color: var(--text-muted); }

/* ===== LOADING-SM ===== */
.loading-sm { font-size: 12px; color: var(--text-muted); padding: 8px; }

/* ===== SETTINGS ===== */
.settings-smtp-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ===== MCP INTEGRATIONS ===== */
.mcp-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.mcp-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mcp-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.mcp-card-head h3 {
  font-size: 22px;
  margin: 6px 0 8px;
}

.mcp-card-kicker {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mcp-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.mcp-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mcp-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mcp-meta-item {
  padding: 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.mcp-meta-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mcp-meta-item span,
.mcp-meta-item code {
  color: var(--text);
  line-height: 1.65;
  word-break: break-word;
}

.mcp-card-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mcp-step-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mcp-step-card {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
}

.mcp-list-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mcp-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mcp-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(20,118,255,0.1);
  border: 1px solid rgba(20,118,255,0.18);
  color: var(--text);
  font-size: 12px;
}

.mcp-bullet-list {
  display: grid;
  gap: 10px;
}

.mcp-bullet-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-dim);
  line-height: 1.6;
}

.mcp-auth-note,
.mcp-path {
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(20,118,255,0.08), rgba(59,130,246,0.06));
  border: 1px solid rgba(20,118,255,0.18);
  color: var(--text-dim);
  line-height: 1.7;
  word-break: break-word;
}

.mcp-notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

@media (max-width: 1100px) {
  .client-dashboard-hero,
  .client-dashboard-grid,
  .seo-report-layout,
  .seo-report-sections,
  .seo-hero-card {
    grid-template-columns: 1fr;
  }
  .seo-dashboard-toolbar,
  .seo-keyword-search-bottom,
  .seo-keyword-insight-grid {
    grid-template-columns: 1fr;
  }
  .seo-keyword-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .seo-tool-grid {
    grid-template-columns: 1fr;
  }
  .seo-tool-card-wide {
    grid-column: span 1;
  }
  .website-agent-focus-head {
    flex-direction: column;
  }
  .mcp-meta-grid,
  .mcp-card-columns,
  .mcp-step-grid {
    grid-template-columns: 1fr;
  }
  .outreach-table-card {
    max-height: 60vh;
  }
}

@media (max-width: 860px) {
  .sidebar { position: static; width: 100%; height: auto; }
  .main { margin-left: 0; }
  .topbar { position: static; }
  .topbar-right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .topbar-workspace-switcher {
    width: 100%;
    justify-content: space-between;
  }
  .topbar-workspace-select {
    min-width: 0;
    width: 100%;
  }
  .client-dashboard-area-grid,
  .ops-grid-2,
  .ops-grid-3,
  .ops-overview-grid {
    grid-template-columns: 1fr;
  }
  .website-workspace-bar {
    padding-left: 18px;
    padding-right: 18px;
  }
  .website-workspace-title {
    font-size: 18px;
  }
  .website-workspace-tab {
    min-width: 160px;
  }
  .contacts-layout,
  .form-row-2,
  .two-col {
    grid-template-columns: 1fr;
  }
  .seo-dashboard-grid,
  .seo-keyword-row {
    grid-template-columns: 1fr;
  }
  .seo-keyword-search-top,
  .seo-keyword-result-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .seo-keyword-title {
    font-size: 34px;
  }
  .outreach-table-toolbar,
  .outreach-table-footer {
    align-items: stretch;
  }
  body { display: block; }
}


