/* ============================================================
   Social Optimize Machine - Command Center
   Color Palette: Black/White/Gold base | Red/Green/Blue highlights
   ============================================================ */

:root {
  --bg-primary:    #0a0a0a;
  --bg-card:       #141414;
  --bg-card2:      #1c1c1c;
  --bg-elevated:   #242424;
  --border:        #2a2a2a;
  --border-bright: #3d3d3d;

  /* Base colors — Gold is now primary */
  --red:           #d4a017;
  --red-dim:       #8a6910;
  --red-glow:      rgba(212,160,23,0.20);
  --white:         #f5f5f5;
  --white-dim:     #cccccc;
  --black:         #0a0a0a;

  /* Highlight accents — Red moved here */
  --green:         #22c55e;
  --green-dim:     rgba(34,197,94,0.15);
  --yellow:        #e62020;
  --yellow-dim:    rgba(230,32,32,0.18);
  --blue:          #3b82f6;
  --blue-dim:      rgba(59,130,246,0.15);

  /* Typography */
  --font:          'Inter', system-ui, -apple-system, sans-serif;
  --mono:          'JetBrains Mono', 'Fira Code', monospace;

  /* Effects */
  --radius:        10px;
  --radius-lg:     16px;
  --shadow:        0 4px 24px rgba(0,0,0,0.5);
  --transition:    all 0.2s ease;

  /* Landing page aliases */
  --bg:            #0a0a0a;
  --text:          #f5f5f5;
  --muted:         #cccccc;
  --card:          #141414;
  --accent:        #d4a017;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar (thicker, easier to grab) ─────────────────── */
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--red-dim); border-radius: 8px;
  border: 3px solid var(--bg-primary); background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent, var(--red-dim)); background-clip: content-box; }
* { scrollbar-width: auto; scrollbar-color: var(--red-dim) var(--bg-primary); }

/* ── Live production progress pinned to the bottom ───────────
   While a job runs, generated content flows DOWN the page — keep the progress
   bar + timer (which spells SOCIAL OPTIMIZE) stuck to the bottom of the viewport
   so you don't have to scroll back to the top to see if it's still working.
   These containers are display:none until production starts, so this is inert
   the rest of the time. */
#progress-area,
#progressSection,
.hw-progress-wrap,
.progress-bar-wrap,
#studioProgress {
  position: sticky;
  bottom: 8px;
  z-index: 50;
  background: var(--card, var(--bg-primary));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 -6px 16px rgba(0,0,0,.28);
}

/* ── Layout ──────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.sidebar-logo .logo-text span.red { color: var(--red); }
.sidebar-logo .logo-text span.dim { color: var(--white-dim); font-size: 11px; font-weight: 400; display: block; margin-top: 3px; }

.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--red);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 10px;
  box-shadow: 0 0 16px var(--red-glow);
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--white-dim);
  padding: 12px 8px 6px;
  opacity: 0.6;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--white-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--white);
}

.nav-item.active {
  background: var(--red-glow);
  color: var(--white);
  border-left: 3px solid var(--red);
  padding-left: 9px;
}

.nav-item .icon { font-size: 17px; width: 22px; text-align: center; }

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.api-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--white-dim);
  padding: 8px;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--white-dim);
  flex-shrink: 0;
}
.status-dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.red   { background: var(--red);   box-shadow: 0 0 6px var(--red); }
.status-dot.yellow { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }

/* ── Main Content ────────────────────────────────────────── */
.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
}

.topbar-sub {
  font-size: 12px;
  color: var(--white-dim);
  margin-top: 1px;
}

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

.content { padding: 28px; flex: 1; }

/* ── Embedded mode (page shown inside a Studio hub iframe) ──────────────────
   No sidebar/topbar: collapse the grid to a single full-width column so the
   page uses the whole hub area instead of being crammed into the 240px track.
   The hub already provides the title bar and tabs, and its iframe scrolls,
   so drop the redundant chrome, min-heights, and outer scrollbar. */
.layout.embed { grid-template-columns: 1fr; min-height: auto; }
.layout.embed .main { min-height: auto; }
.layout.embed .content { padding: 24px; }
body.embedded { background: transparent; }

/* Iframe-context safety net: any page rendered inside an iframe (studio hubs,
   Whop app) must hide the app chrome even if the ?embed flag was lost on a
   redirect/nav — otherwise a second sidebar renders ("double left tabs"). */
html.embedded-frame .sidebar,
html.embedded-frame .topbar { display: none !important; }
html.embedded-frame .layout { grid-template-columns: 1fr !important; min-height: auto; }
html.embedded-frame body { background: transparent; }
html.embedded-frame #hermesBubble,
html.embedded-frame #hermesPanel { display: none !important; }

/* The hub page already shows the assistant bubble — hide the duplicate that
   each embedded iframe would otherwise stack on top of it. */
body.embedded #hermesBubble,
body.embedded #hermesPanel { display: none !important; }
/* Full-height pages subtract a topbar (80/116px) that no longer exists in
   embed mode — inside the iframe the whole area is theirs. Reclaim it, and
   zero the surrounding content padding so their edge-to-edge grids don't sit
   inside a second scroll box. Normal card pages keep the 24px padding above. */
.layout.embed .content:has(.clipper-layout),
.layout.embed .content:has(.pod-layout),
.layout.embed .content:has(.ms-wrap) { padding: 0; }
.layout.embed .clipper-layout { min-height: 100vh; }
.layout.embed .panel-left,
.layout.embed .panel-center,
.layout.embed .panel-right { max-height: 100vh; }
.layout.embed .pod-layout,
.layout.embed .ms-wrap { height: 100vh; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  display: flex; align-items: center; gap: 8px;
}

.card-title .accent { color: var(--red); }

/* ── Stats Grid ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.stat-card.red-accent::before   { background: var(--red); }
.stat-card.green-accent::before { background: var(--green); }
.stat-card.yellow-accent::before{ background: var(--yellow); }
.stat-card.blue-accent::before  { background: var(--blue); }

.stat-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--white-dim);
  margin-bottom: 10px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-value.red    { color: var(--red); }
.stat-value.green  { color: var(--green); }
.stat-value.yellow { color: var(--yellow); }
.stat-value.blue   { color: var(--blue); }

.stat-sub {
  font-size: 12px;
  color: var(--white-dim);
}

.stat-icon {
  position: absolute;
  top: 18px; right: 18px;
  font-size: 28px;
  opacity: 0.15;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--red);
  color: white;
  box-shadow: 0 0 20px var(--red-glow);
}

.btn-primary:hover {
  background: #ff2a2a;
  box-shadow: 0 0 28px rgba(230,32,32,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--white);
  border: 1px solid var(--border-bright);
}

.btn-secondary:hover {
  background: var(--bg-card2);
  border-color: var(--white-dim);
}

.btn-green {
  background: var(--green);
  color: #000;
}

.btn-green:hover { background: #16a34a; }

.btn-yellow {
  background: var(--yellow);
  color: #000;
}

.btn-yellow:hover { background: #eab308; }

.btn-blue {
  background: var(--blue);
  color: white;
}

.btn-blue:hover { background: #2563eb; }

.btn-ghost {
  background: transparent;
  color: var(--white-dim);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--white);
  border-color: var(--border-bright);
  background: var(--bg-elevated);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red-dim);
}

.btn-danger:hover {
  background: var(--red-glow);
}

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 13px 26px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--white-dim);
  margin-bottom: 7px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  color: var(--white);
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font);
  transition: var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

textarea { resize: vertical; min-height: 80px; }
select option { background: var(--bg-card); }

.form-hint {
  font-size: 11px;
  color: var(--white-dim);
  margin-top: 5px;
  opacity: 0.7;
}

/* ── Platform Selector ───────────────────────────────────── */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.platform-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-elevated);
  user-select: none;
}

.platform-card:hover {
  border-color: var(--border-bright);
}

.platform-card.selected.youtube { border-color: var(--red); background: var(--red-glow); }
.platform-card.selected.tiktok  { border-color: var(--white); background: rgba(255,255,255,0.05); }
.platform-card.selected.instagram { border-color: var(--yellow); background: var(--yellow-dim); }

.platform-card .platform-icon { font-size: 26px; margin-bottom: 6px; }
.platform-card .platform-name { font-size: 12px; font-weight: 600; color: var(--white-dim); }
.platform-card.selected .platform-name { color: var(--white); }

/* ── Format Selector ─────────────────────────────────────── */
.format-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.format-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-elevated);
  user-select: none;
}

.format-card:hover { border-color: var(--border-bright); }

.format-card.selected {
  border-color: var(--red);
  background: var(--red-glow);
}

.format-card .format-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 3px;
}

.format-card .format-desc {
  font-size: 11px;
  color: var(--white-dim);
}

.format-card .format-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  margin-top: 6px;
}

.badge-green  { background: var(--green-dim); color: var(--green); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); }
.badge-blue   { background: var(--blue-dim); color: var(--blue); }
.badge-red    { background: var(--red-glow); color: var(--red); }

/* ── Progress Bar ────────────────────────────────────────── */
.progress-track {
  background: var(--bg-elevated);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--red), #ff6b6b);
  transition: width 0.5s ease;
  box-shadow: 0 0 8px var(--red-glow);
}

.progress-bar.green  { background: linear-gradient(90deg, var(--green), #86efac); box-shadow: 0 0 8px var(--green-dim); }
.progress-bar.yellow { background: linear-gradient(90deg, var(--yellow), #fef08a); box-shadow: 0 0 8px var(--yellow-dim); }
.progress-bar.blue   { background: linear-gradient(90deg, var(--blue), #93c5fd); box-shadow: 0 0 8px var(--blue-dim); }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--white-dim);
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

tbody tr:hover { background: var(--bg-elevated); }

tbody td {
  padding: 12px 14px;
  color: var(--white);
}

/* ── Status Pills ────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.pill-done    { background: var(--green-dim); color: var(--green); }
.pill-running { background: var(--yellow-dim); color: var(--yellow); }
.pill-error   { background: var(--red-glow); color: var(--red); }
.pill-pending { background: var(--bg-elevated); color: var(--white-dim); }

/* ── Account Cards ───────────────────────────────────────── */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.account-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.account-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.account-card.youtube::before  { background: var(--red); }
.account-card.tiktok::before   { background: var(--white); }
.account-card.instagram::before { background: linear-gradient(90deg, var(--yellow), var(--red), var(--blue)); }

.account-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.account-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
  border: 2px solid var(--border);
  overflow: hidden;
}

.account-avatar img { width: 100%; height: 100%; object-fit: cover; }

.account-name { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.account-handle { font-size: 12px; color: var(--white-dim); margin-bottom: 12px; }

.account-stats {
  display: flex; gap: 16px; margin-bottom: 14px;
  font-size: 12px;
}

.account-stat-val { font-weight: 700; font-size: 15px; color: var(--green); }
.account-stat-label { color: var(--white-dim); }

.connect-platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.connect-card {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.connect-card:hover {
  border-color: var(--red);
  background: var(--red-glow);
}

.connect-card .connect-icon { font-size: 32px; margin-bottom: 10px; }
.connect-card .connect-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.connect-card .connect-desc { font-size: 11px; color: var(--white-dim); }

/* ── Contacts ────────────────────────────────────────────── */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.contact-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: var(--transition);
}

.contact-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-1px);
}

.contact-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
  color: var(--white);
  margin-bottom: 10px;
  flex-shrink: 0;
}

.contact-name { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.contact-handle { font-size: 11px; color: var(--white-dim); }
.contact-platform {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--white-dim);
  margin-top: 8px;
}

.platform-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; text-transform: uppercase;
}

.platform-tag.youtube   { background: var(--red-glow); color: var(--red); }
.platform-tag.tiktok    { background: rgba(255,255,255,0.08); color: var(--white); }
.platform-tag.instagram { background: var(--yellow-dim); color: var(--yellow); }
.platform-tag.phone     { background: var(--green-dim); color: var(--green); }
.platform-tag.other     { background: var(--blue-dim); color: var(--blue); }

/* ── Drop Zone ───────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-elevated);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--blue);
  background: var(--blue-dim);
}

.drop-zone .drop-icon { font-size: 36px; margin-bottom: 10px; }
.drop-zone .drop-text { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.drop-zone .drop-sub  { font-size: 12px; color: var(--white-dim); }

/* ── Toast Notifications ─────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 280px;
  max-width: 360px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.toast.toast-success { border-color: var(--green); }
.toast.toast-error   { border-color: var(--red); }
.toast.toast-warning { border-color: var(--yellow); }
.toast.toast-info    { border-color: var(--blue); }

.toast-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.toast-msg   { font-size: 12px; color: var(--white-dim); }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 520px;
  position: relative;
  animation: modalIn 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalIn {
  from { transform: scale(0.94); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--white-dim);
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px;
  transition: var(--transition);
}

.modal-close:hover { color: var(--white); background: var(--bg-card2); }
.modal-title { font-size: 18px; font-weight: 800; margin-bottom: 20px; }

/* ── Job Progress Panel ──────────────────────────────────── */
.job-progress-panel {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 24px;
  display: none;
}

.job-log {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--white-dim);
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.8;
}

.job-log .log-line { display: block; }
.job-log .log-success { color: var(--green); }
.job-log .log-warn    { color: var(--yellow); }
.job-log .log-error   { color: var(--red); }

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ── Grid Helpers ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ── Flex Helpers ────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ── Text Helpers ────────────────────────────────────────── */
.text-dim    { color: var(--white-dim); }
.text-sm     { font-size: 12px; }
.text-xs     { font-size: 11px; }
.text-red    { color: var(--red); }
.text-green  { color: var(--green); }
.text-yellow { color: var(--yellow); }
.text-blue   { color: var(--blue); }
.text-bold   { font-weight: 700; }
.text-center { text-align: center; }

/* ── Section Header ──────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
}

.section-title .accent { color: var(--red); }

/* ── Filter Bar ──────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--white-dim);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.filter-chip:hover { border-color: var(--border-bright); color: var(--white); }
.filter-chip.active { background: var(--red-glow); border-color: var(--red); color: var(--white); }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--white-dim);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state .empty-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-state .empty-sub { font-size: 13px; margin-bottom: 20px; }

/* ── Glow Headline ───────────────────────────────────────── */
.glow-red    { text-shadow: 0 0 20px var(--red); }
.glow-green  { text-shadow: 0 0 20px var(--green); }
.glow-blue   { text-shadow: 0 0 20px var(--blue); }
.glow-yellow { text-shadow: 0 0 20px var(--yellow); }

/* ── Brand Progress Counter (spells "SOCIAL OPTIMIZE" as a job runs) ─────── */
.so-brand-counter   { font-size: 13px; font-weight: 700; letter-spacing: 1.5px; font-family: 'Courier New', monospace; white-space: nowrap; }
.so-brand-letter    { color: #3a3a3a; transition: color .25s ease; }
.so-brand-letter.revealed { color: var(--accent); text-shadow: 0 0 6px rgba(212,160,23,.4); }
.so-brand-pct       { color: #777; font-weight: 600; margin-left: 8px; letter-spacing: 0; font-family: inherit; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px; }
  .platform-grid, .connect-platform-grid { grid-template-columns: 1fr; }
}
