/* ============================================
   POLYMARKET CREATOR DASHBOARD — STYLES
   Visual style guide: Polymarket blue, Inter font
   ============================================ */

/* ── LOCAL FONT: Inter Polymarket ──────────── */
@font-face {
  font-family: 'Inter';
  src: url('./assets/fonts/Inter-Polymarket-VariableFont_opsz,wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('./assets/fonts/Inter-Polymarket-Italic-VariableFont_opsz,wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Backgrounds */
  --bg:       #f5f6fa;
  --surface:  rgba(255, 255, 255, .92);
  --surface2: rgba(245, 246, 250, .95);

  /* Borders */
  --border:  rgba(0, 0, 0, .06);
  --border2: rgba(0, 0, 0, .10);

  /* Accent */
  --accent:      #2E5CFF;
  --accent-glow: rgba(46, 92, 255, .25);

  /* Semantic */
  --green: #34d399;
  --red:   #f87171;
  --amber: #fbbf24;
  --blue:  #60a5fa;
  --pink:  #f472b6;

  /* Text */
  --text:   #1a1d2e;
  --muted:  #6b7280;
  --muted2: #9ca3af;

  /* Platform colors (distinct for each platform) */
  --platform-ig: #E1306C;
  --platform-tt: #00F2EA;
  --platform-yt: #FF0000;
  --platform-x:  #A8B3CF;
  --platform-th: #E0E0E0;
  --platform-fb: #1877F2;
  --platform-bs: #00AAFF;
  --platform-ss: #FF6719;
  --platform-li: #0A66C2;

  /* Shape */
  --r:   14px;
  --gap: 16px;

  /* Legacy aliases used by JS-generated class names */
  --text-muted: var(--muted);
}

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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
}

/* ── GLOBAL DISABLED STATE ──────────────── */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  background: rgba(0, 0, 0, .04) !important;
  color: var(--muted2) !important;
  cursor: not-allowed !important;
  opacity: 0.45;
}

/* ── BACKGROUND OVERLAYS ──────────────────── */
/* Radial gradient glow */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(46,92,255,.12), transparent),
    radial-gradient(ellipse 50% 30% at 90% 80%, rgba(52,211,153,.05), transparent);
}

/* Subtle grid pattern */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(0,0,0,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.03) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ── SCROLLBAR ────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.08); border-radius: 2px; }

/* ── ANIMATIONS ───────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* ── HEADER ───────────────────────────────── */
#header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px;
  background: linear-gradient(135deg, rgba(255,255,255,.97), rgba(245,246,250,.97));
  border-bottom: 1px solid var(--border2);
  backdrop-filter: blur(16px);
  box-shadow: 0 0 0 1px rgba(46,92,255,.08), 0 12px 40px rgba(0,0,0,.08);
}

.header-left { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; align-items: center; gap: 14px; }

.brand {
  display: flex;
  align-items: center;
  gap: 4px;
}
.brand-logo {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.2px;
  color: var(--accent);
}
.header-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  padding-left: 16px;
  border-left: 1px solid var(--border2);
  white-space: nowrap;
}

.last-updated {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
}

/* Toggle switch */
.auto-refresh-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.auto-refresh-toggle input { display: none; }
.toggle-slider {
  width: 30px; height: 15px;
  background: rgba(0,0,0,.08);
  border-radius: 8px;
  position: relative;
  transition: background 0.2s;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--muted);
  transition: all 0.2s;
}
.auto-refresh-toggle input:checked + .toggle-slider {
  background: rgba(52,211,153,.2);
}
.auto-refresh-toggle input:checked + .toggle-slider::after {
  left: 17px;
  background: var(--green);
  box-shadow: 0 0 6px rgba(52,211,153,.4);
}
.toggle-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted2);
}

/* Buttons */
.btn-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(46,92,255,.3);
  color: var(--accent);
  padding: 5px 13px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-refresh:hover {
  background: rgba(46,92,255,.08);
  border-color: rgba(46,92,255,.5);
  color: var(--accent);
}
.btn-refresh.spinning svg {
  animation: spin 0.6s linear infinite;
}

/* ── ERROR BANNER ─────────────────────────── */
.error-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 26px;
  background: rgba(248,113,113,.08);
  border-bottom: 1px solid rgba(248,113,113,.15);
  color: var(--red);
  font-size: 12px;
  font-weight: 500;
}

/* ── FILTER BAR ───────────────────────────── */
.filter-bar {
  position: sticky;
  top: 53px;
  z-index: 99;
  display: flex;
  align-items: flex-end;
  gap: 20px;
  padding: 12px 26px;
  background: rgba(245,246,250,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}

.date-inputs { display: flex; align-items: center; gap: 6px; }
.date-sep { color: var(--muted); font-size: 12px; }

.input-date, .input-select, .input-text {
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color .15s;
  backdrop-filter: blur(8px);
}
.input-date:focus, .input-select:focus, .input-text:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(46,92,255,.15);
}
.input-date { width: 130px; }
.input-select { min-width: 120px; }
.input-text { width: 180px; }
.input-date::-webkit-calendar-picker-indicator { filter: none; }

/* Platform icons (used in breakdown cards & creator table) */
.plat-icon {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  flex-shrink: 0;
}
.plat-icon svg {
  width: 16px;
  height: 16px;
}
.plat-icon-sm {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  cursor: help;
}
a.plat-icon-link {
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  border-radius: 4px;
  padding: 2px;
  transition: all .15s;
}
a.plat-icon-link:hover {
  background: rgba(46,92,255,.1);
  color: var(--accent);
}
.plat-icon-sm svg {
  width: 14px;
  height: 14px;
}

/* Creator autocomplete dropdown */
.filter-creator-group,
.filter-blitz-group {
  position: relative;
}
.creator-autocomplete,
.blitz-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255,255,255,.98);
  border: 1px solid var(--border2);
  border-radius: 8px;
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.autocomplete-item {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover {
  background: rgba(46,92,255,.1);
  color: var(--text);
}

.btn-clear-filters {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 0;
  align-self: flex-end;
  transition: color .15s;
}
.btn-clear-filters:hover { color: var(--red); }

/* ── MAIN ─────────────────────────────────── */
main {
  position: relative;
  z-index: 1;
  padding: 24px 16px 60px;
  max-width: 1480px;
  margin: 0 auto;
}

.section {
  margin-bottom: 32px;
  animation: fadeUp .5s ease both;
  animation-delay: .15s;
}
.section-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.section-badge {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.section-header .section-title {
  flex: 1;
  margin-bottom: 0;
}

/* ── KPI CARDS ────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px 24px 22px;
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  animation: fadeUp .4s ease both;
}
.kpi-card:nth-child(1) { animation-delay: .04s; }
.kpi-card:nth-child(2) { animation-delay: .08s; }
.kpi-card:nth-child(3) { animation-delay: .12s; }
.kpi-card:nth-child(4) { animation-delay: .16s; }
.kpi-card:nth-child(5) { animation-delay: .20s; }
.kpi-card:nth-child(6) { animation-delay: .24s; }

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
}

/* KPI glow effect — removed for light theme */

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 8px;
}
.kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -1px;
}
/* .kpi-value.green removed — all KPI values are white */

.kpi-bar {
  display: flex;
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 12px;
  background: rgba(0,0,0,.06);
}
.kpi-bar-seg {
  height: 100%;
  transition: width 0.4s ease;
}

/* Shimmer placeholder */
.shimmer {
  background: linear-gradient(90deg, rgba(230,232,240,.85) 25%, rgba(240,241,248,.9) 50%, rgba(230,232,240,.85) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}
.shimmer-line {
  height: 14px;
  margin-bottom: 8px;
}
.shimmer-line.lg { height: 28px; width: 60%; }

/* ── PLATFORM CARDS ───────────────────────── */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

.platform-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  animation: fadeUp .5s ease both;
  animation-delay: .15s;
}
.platform-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
}
.platform-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.platform-card.ig::before       { background: var(--platform-ig); }
.platform-card.tt::before       { background: var(--platform-tt); }
.platform-card.yt::before       { background: var(--platform-yt); }
.platform-card.x-plat::before   { background: var(--platform-x); }
.platform-card.th::before       { background: var(--platform-th); }
.platform-card.fb::before       { background: var(--platform-fb); }
.platform-card.bs::before       { background: var(--platform-bs); }
.platform-card.ss::before       { background: var(--platform-ss); }
.platform-card.li::before       { background: var(--platform-li); }

/* Inactive platform cards (0 posts in filtered view) */
.platform-card.inactive {
  opacity: 0.25 !important;
}

.platform-card-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.1px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.platform-card-name .plat-icon { color: var(--text); }

.platform-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
}
.platform-stat-label {
  font-size: 11px;
  color: var(--muted);
}
.platform-stat-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ── DATA TABLES ──────────────────────────── */
/* Scrollable tables with sticky headers */
#sectionPosts .table-wrap {
  max-height: 600px;
  overflow-y: auto;
}
#sectionCreators .table-wrap {
  max-height: 600px;
  overflow-y: auto;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  backdrop-filter: blur(8px);
  animation: fadeUp .5s ease both;
  animation-delay: .15s;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f0f1f5;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
  user-select: none;
  transition: color .12s;
}
.data-table thead th.num { text-align: right; }
.data-table thead th.sortable { cursor: pointer; }
.data-table thead th.sortable:hover { color: var(--text); }
.data-table thead th.sort-active { color: var(--accent); }
.sort-arrow { font-size: 9px; opacity: 0.3; margin-left: 2px; }
.sort-active .sort-arrow { opacity: 1; }

.data-table tbody tr {
  transition: background .1s;
}
.data-table tbody tr:hover { background: rgba(46,92,255,.05); }
.data-table tbody td {
  padding: 9px 14px;
  color: var(--text);
  white-space: nowrap;
  border-bottom: 1px solid rgba(0,0,0,.04);
  vertical-align: middle;
  font-size: 12.5px;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}

/* Category badges (tag style) */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.badge-sports  { background: rgba(52,211,153,.12);  color: var(--green); }
.badge-crypto  { background: rgba(96,165,250,.12);  color: var(--blue); }
.badge-finance { background: rgba(251,191,36,.12);   color: var(--amber); }
.badge-politics { background: rgba(248,113,113,.12); color: var(--red); }
.badge-culture { background: rgba(244,114,182,.12);  color: var(--pink); }
.badge-other   { background: rgba(0,0,0,.06);  color: var(--muted2); }

/* Platform badge */
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .3px;
}
.platform-badge.ig { background: rgba(225,48,108,.12); color: var(--platform-ig); }
.platform-badge.tt { background: rgba(0,242,234,.12); color: var(--platform-tt); }
.platform-badge.yt { background: rgba(255,0,0,.12); color: var(--platform-yt); }
.platform-badge.x-plat { background: rgba(0,0,0,.06); color: var(--platform-x); }

/* CPM coloring — use style guide semantic colors */
.cpm-good { color: var(--green); }
.cpm-mid  { color: var(--amber); }
.cpm-high { color: var(--red); }

/* Platform dots in creator table */
.platform-dots { display: flex; gap: 4px; }
.platform-dots .plat-dot { width: 8px; height: 8px; border-radius: 50%; }

/* View link */
.view-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  transition: color .15s;
}
.view-link:hover { color: #6B8AFF; text-decoration: underline; }

/* Health view link (inside expanded rows) */
.health-view-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: color .15s;
}
.health-view-link:hover { color: #6B8AFF; text-decoration: underline; }

/* Table controls — chips */
.table-controls { display: flex; gap: 4px; }
.btn-toggle {
  background: rgba(46,92,255,.04);
  border: 1px solid rgba(46,92,255,.3);
  color: var(--muted);
  padding: 5px 13px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.btn-toggle:hover { background: rgba(46,92,255,.08); color: var(--text); border-color: rgba(46,92,255,.5); }
.btn-toggle.active {
  background: rgba(46,92,255,.15);
  border-color: rgba(46,92,255,.4);
  color: var(--text);
}

/* ── CONTRACTS ────────────────────────────── */
.contracts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--gap);
}

.contract-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  backdrop-filter: blur(8px);
  transition: transform .15s, box-shadow .15s;
  animation: fadeUp .5s ease both;
  animation-delay: .15s;
}
.contract-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
}

.contract-creator {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.1px;
}
.contract-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-left: 8px;
}
.contract-status.active { background: rgba(52,211,153,.12); color: var(--green); }
.contract-status.trial  { background: rgba(251,191,36,.12); color: var(--amber); }

.progress-wrap { margin-bottom: 12px; }
.progress-bar-bg {
  height: 4px;
  background: rgba(0,0,0,.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #6B8AFF);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.progress-text {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted2);
}

.contract-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.contract-meta-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}
.contract-meta-val {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}

/* ── DATA HEALTH ──────────────────────────── */
.section-health { margin-top: 16px; }
.health-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.health-items-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.health-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.health-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
}
.health-dot.red    { background: var(--red); }
.health-dot.yellow { background: var(--amber); }
.health-dot.green  { background: var(--green); }
.health-ok {
  color: var(--text);
  font-weight: 600;
}
.health-count {
  font-weight: 700;
  color: var(--muted2);
}

/* Clickable health items */
.health-item.clickable {
  cursor: pointer;
  transition: all .15s;
  padding: 4px 8px;
  border-radius: 6px;
  margin: -4px -8px;
  border: 1px solid rgba(46,92,255,.25);
}
.health-item.clickable:hover {
  background: rgba(46,92,255,.06);
  border-color: rgba(46,92,255,.45);
}
.health-item.clickable .health-chevron {
  font-size: 10px;
  color: var(--muted);
  margin-left: 6px;
  transition: transform .2s;
}
.health-item.expanded {
  border: 1px solid var(--border2);
  background: rgba(0,0,0,.04);
}
.health-item.expanded .health-chevron {
  transform: rotate(90deg);
}

/* Expanded post list below all health categories */
.health-expand-area {
  display: none;
  margin-top: 12px;
  padding: 10px 16px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  background: rgba(0,0,0,.02);
}
.health-expand-area.open {
  display: block;
}
.health-expanded-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.health-expanded-row:last-child {
  border-bottom: none;
}
.health-expanded-row .row-info {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted2);
}
.health-expanded-row .row-actions {
  flex-shrink: 0;
  margin-left: 12px;
  display: flex;
  gap: 8px;
}
.health-expanded-more {
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0;
  font-style: italic;
}

/* Health action buttons */
.health-btn {
  padding: 2px 10px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all .15s;
  border: 1px solid rgba(46,92,255,.4);
  background: transparent;
  color: var(--accent);
}
.health-btn:hover {
  background: rgba(46,92,255,.12);
}
.health-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(0, 0, 0, .04);
  color: var(--muted2);
}
.health-btn.muted {
  border-color: var(--border2);
  color: var(--muted);
}
.health-btn.muted:hover {
  background: rgba(0,0,0,.06);
}
.health-btn.accent-fill {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  padding: 4px 14px;
  font-size: 12px;
}
.health-btn.accent-fill:hover {
  background: #4B72FF;
}
.health-btn .btn-spinner {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(0,0,0,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-right: 4px;
  vertical-align: middle;
}
.health-retry-all-wrap {
  display: flex;
  justify-content: flex-end;
  padding: 6px 0 2px;
}

/* ── HEALTH FIX MODAL ────────────────────── */
.health-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.health-modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  width: 440px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,.15);
}
.health-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 0;
}
.health-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.health-modal-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all .15s;
}
.health-modal-close:hover {
  color: var(--text);
  background: rgba(0,0,0,.06);
}
.health-modal-error {
  margin: 12px 24px 0;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--red);
  background: rgba(248,113,113,.08);
  border: 1px solid rgba(248,113,113,.2);
  border-radius: 8px;
}
.health-modal-body {
  padding: 16px 24px;
}
.health-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 0 24px 20px;
}
.hm-field {
  margin-bottom: 14px;
}
.hm-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 5px;
}
.hm-value {
  font-size: 13px;
  color: var(--text);
  padding: 8px 12px;
  background: rgba(0,0,0,.03);
  border: 1px solid var(--border2);
  border-radius: 8px;
}
.hm-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 8px;
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
}
.hm-input:focus {
  border-color: var(--accent);
}
.hm-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 8px;
  outline: none;
  cursor: pointer;
}
.hm-select:focus {
  border-color: var(--accent);
}
.hm-row {
  display: flex;
  gap: 12px;
}
.hm-row .hm-field {
  flex: 1;
}
.hm-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 16px 0 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border2);
}
.hm-validation {
  font-size: 11px;
  color: var(--red);
  margin-top: 3px;
}

/* ── EMPTY STATE ──────────────────────────── */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  border: 1px dashed var(--border2);
  border-radius: var(--r);
  background: var(--surface);
  backdrop-filter: blur(8px);
}
.empty-state p {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted2);
  margin-bottom: 6px;
}
.empty-sub {
  font-size: 12px;
  color: var(--muted);
}

/* ── LOADING OVERLAY ──────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245,246,250,0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 200;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted2);
  transition: opacity 0.3s;
}
.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── PASTE POSTS BUTTON ──────────────────── */
.btn-paste {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(46,92,255,.1);
  border: 1px solid rgba(46,92,255,.4);
  color: var(--accent);
  padding: 5px 13px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-paste:hover {
  background: rgba(46,92,255,.2);
  box-shadow: 0 0 12px rgba(46,92,255,.2);
}

/* ── PASTE PANEL ─────────────────────────── */
.paste-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  background: rgba(0,0,0,.2);
  backdrop-filter: blur(4px);
}
.paste-overlay.open {
  display: flex;
  justify-content: flex-end;
}
.paste-panel {
  width: 520px;
  max-width: 100vw;
  height: 100vh;
  background: rgba(255,255,255,.98);
  border-left: 1px solid var(--border2);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.25s ease;
}
.paste-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.paste-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text);
}
.paste-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  transition: color .15s;
}
.paste-close:hover { color: var(--red); }
.paste-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.paste-field { display: flex; flex-direction: column; gap: 4px; }
.paste-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}
.paste-input {
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  backdrop-filter: blur(8px);
}
.paste-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(46,92,255,.15);
}
.paste-textarea {
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
  min-height: 220px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  backdrop-filter: blur(8px);
}
.paste-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(46,92,255,.15);
}
.paste-textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

/* Preview */
.paste-preview {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.paste-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.paste-preview-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}
.paste-preview-count {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}
.paste-preview-list {
  max-height: 260px;
  overflow-y: auto;
}
.paste-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(0,0,0,.04);
  font-size: 12px;
}
.paste-preview-row:last-child { border-bottom: none; }
.paste-preview-handle {
  color: var(--accent);
  font-weight: 600;
  min-width: 140px;
  flex-shrink: 0;
  font-size: 12px;
}
.paste-preview-url {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.paste-preview-row.error {
  background: rgba(248,113,113,.05);
}
.paste-preview-row.error .paste-preview-handle {
  color: var(--red);
}

/* Actions */
.paste-actions {
  display: flex;
  gap: 10px;
}
.paste-btn-preview, .paste-btn-submit {
  flex: 1;
  padding: 10px 16px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  border: 1px solid;
}
.paste-btn-preview {
  background: rgba(0,0,0,.04);
  border-color: var(--border2);
  color: var(--muted2);
}
.paste-btn-preview:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(46,92,255,.06);
}
.paste-btn-submit {
  background: rgba(46,92,255,.12);
  border-color: rgba(46,92,255,.4);
  color: var(--accent);
}
.paste-btn-submit:hover:not(:disabled) {
  background: rgba(46,92,255,.22);
  box-shadow: 0 0 12px rgba(46,92,255,.2);
}
.paste-btn-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(0, 0, 0, .04);
  color: var(--muted2);
}

/* Result */
.paste-result {
  padding: 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}
.paste-result.success {
  background: rgba(52,211,153,.08);
  border: 1px solid rgba(52,211,153,.2);
  color: var(--green);
}
.paste-result.error {
  background: rgba(248,113,113,.08);
  border: 1px solid rgba(248,113,113,.2);
  color: var(--red);
}
.paste-result.partial {
  background: rgba(251,191,36,.08);
  border: 1px solid rgba(251,191,36,.2);
  color: var(--amber);
}

/* ── RESPONSIVE ───────────────────────────── */
@media (max-width: 1400px) {
}
@media (max-width: 1200px) {
  .platform-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .platform-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .platform-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { gap: 12px; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(1, 1fr); }
  .platform-grid { grid-template-columns: repeat(1, 1fr); }
  #header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  main { padding: 16px 12px 48px; }
  .filter-bar { padding: 10px 12px; }
}

/* ── PASSWORD GATE ────────────────────────── */
.password-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.password-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(46,92,255,.10), transparent),
    radial-gradient(ellipse 50% 30% at 90% 80%, rgba(52,211,153,.06), transparent);
  pointer-events: none;
}
.password-overlay::after {
  display: none;
}
.password-overlay.hidden {
  display: none;
}

/* Decorative background icons */
.pw-bg-icons {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.pw-bg-icon {
  position: absolute;
  opacity: 0.10;
}
/* Top-left corner — large, cut off */
.pw-bg-1 { width: 320px; top: -8%;  left: -6%;  transform: rotate(-22deg); }
/* Top-right corner — medium, cut off */
.pw-bg-2 { width: 200px; top: -4%;  right: -5%; transform: rotate(15deg); }
/* Bottom-left corner — large, cut off */
.pw-bg-3 { width: 350px; bottom: -10%; left: -8%; transform: rotate(10deg); }
/* Bottom-right corner — medium, cut off */
.pw-bg-4 { width: 180px; bottom: -5%; right: -4%; transform: rotate(-30deg); }
/* Peeking right of card — larger */
.pw-bg-5 { width: 200px; top: 50%;  left: 50%;  transform: translate(100px, -60%) rotate(-15deg); }
/* Peeking bottom-right of card — medium */
.pw-bg-6 { width: 120px; top: 50%;  left: 50%;  transform: translate(80px, 80px) rotate(18deg); }
/* Peeking top-left of card — small */
.pw-bg-7 { width: 90px;  top: 50%;  left: 50%;  transform: translate(-260px, -220px) rotate(25deg); }
/* Right edge, upper */
.pw-bg-8 { width: 80px;  top: 20%;  right: 5%;  transform: rotate(-12deg); }
/* Top center-right — small */
.pw-bg-9 { width: 65px;  top: 5%;   left: 58%;  transform: rotate(35deg); }

.password-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 40px 36px 36px;
  width: 380px;
  max-width: 92vw;
  backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgba(46,92,255,.08),
    0 24px 80px rgba(0,0,0,.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  animation: fadeUp .5s ease both;
}

.password-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
}
.password-logo {
  width: 36px;
  height: 36px;
}
.password-brand-name {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.4px;
  color: var(--accent);
}
.password-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-top: -8px;
  letter-spacing: -0.1px;
}
.password-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.password-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}
.password-input {
  width: 100%;
  background: rgba(240,241,248,.8);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.password-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46,92,255,.15);
}
.password-btn {
  width: 100%;
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--accent);
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  box-shadow: 0 4px 12px rgba(46,92,255,.2);
}
.password-btn:hover {
  background: #4B72FF;
  box-shadow: 0 4px 16px rgba(46,92,255,.3);
}
.password-error {
  font-size: 12px;
  font-weight: 500;
  color: var(--red);
  padding: 8px 12px;
  background: rgba(248,113,113,.08);
  border: 1px solid rgba(248,113,113,.2);
  border-radius: 8px;
  width: 100%;
}

/* ── HEADER ACTION BUTTONS ───────────────── */
.btn-header-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(46,92,255,.3);
  color: var(--accent);
  padding: 5px 13px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-header-action:hover {
  background: rgba(46,92,255,.08);
  border-color: rgba(46,92,255,.5);
  color: var(--accent);
}

/* ── SHARED SLIDE-OUT PANEL ──────────────── */
.panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  background: rgba(0,0,0,.2);
  backdrop-filter: blur(4px);
}
.panel-overlay.open {
  display: flex;
  justify-content: flex-end;
}
.slide-panel {
  width: 560px;
  max-width: 100vw;
  height: 100vh;
  background: rgba(255,255,255,.98);
  border-left: 1px solid var(--border2);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.25s ease;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.panel-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text);
}
.panel-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  transition: color .15s;
}
.panel-close:hover { color: var(--red); }
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
/* Field groups inside panels — controls spacing between label+input blocks */
#acSingleMode,
.ur-selected {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.panel-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.panel-field-row {
  display: flex;
  gap: 12px;
}
.panel-field-row .panel-field {
  flex: 1;
}
.panel-actions {
  margin-top: 8px;
}
.panel-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}
.panel-input {
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  backdrop-filter: blur(8px);
}
.panel-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(46,92,255,.15);
}
.panel-actions {
  display: flex;
  gap: 10px;
}
.panel-btn-submit {
  flex: 1;
  padding: 10px 16px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  border: 1px solid rgba(46,92,255,.4);
  background: rgba(46,92,255,.12);
  color: var(--accent);
}
.panel-btn-submit:hover:not(:disabled) {
  background: rgba(46,92,255,.22);
  box-shadow: 0 0 12px rgba(46,92,255,.2);
}
.panel-btn-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(0, 0, 0, .04);
  color: var(--muted2);
}

.panel-result {
  padding: 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}
.panel-result.success {
  background: rgba(52,211,153,.08);
  border: 1px solid rgba(52,211,153,.2);
  color: var(--green);
}
.panel-result.error {
  background: rgba(248,113,113,.08);
  border: 1px solid rgba(248,113,113,.2);
  color: var(--red);
}
.panel-result.partial {
  background: rgba(251,191,36,.08);
  border: 1px solid rgba(251,191,36,.2);
  color: var(--amber);
}

/* ── ADD CREATOR — MODE TOGGLE ───────────── */
.panel-mode-toggle {
  display: flex;
  gap: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
}
.panel-mode-btn {
  flex: 1;
  padding: 10px 16px;
  background: rgba(0, 0, 0, .04);
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.panel-mode-btn:hover { background: rgba(0,0,0,.06); color: var(--muted); }
.panel-mode-btn.active {
  background: transparent;
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── BULK UPLOAD STYLES ──────────────────── */
.bulk-instructions {
  padding: 16px;
  background: rgba(46,92,255,.04);
  border: 1px solid rgba(46,92,255,.12);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bulk-instructions-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.bulk-instructions-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.bulk-template {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  color: var(--accent);
  background: rgba(0,0,0,.05);
  padding: 8px 12px;
  border-radius: 6px;
  display: block;
  letter-spacing: .3px;
}
.bulk-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,.04);
  border: 1px solid var(--border2);
  color: var(--muted2);
  padding: 6px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  align-self: flex-start;
  margin-top: 4px;
}
.bulk-download-btn:hover {
  background: rgba(46,92,255,.1);
  border-color: rgba(46,92,255,.4);
  color: var(--accent);
}

.bulk-preview {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
}
.bulk-preview-table-wrap {
  max-height: 280px;
  overflow-y: auto;
}
.bulk-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.bulk-preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f0f1f5;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  padding: 7px 10px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.bulk-preview-table tbody td {
  padding: 6px 10px;
  color: var(--text);
  border-bottom: 1px solid rgba(0,0,0,.04);
  white-space: nowrap;
  font-size: 11.5px;
}
.bulk-preview-table tbody tr:last-child td { border-bottom: none; }
.bulk-preview-table tbody tr:hover { background: rgba(46,92,255,.04); }
.bulk-preview-table tbody tr.row-error { background: rgba(248,113,113,.06); }
.bulk-preview-table tbody tr.row-error td { color: var(--red); }
.bulk-preview-table .row-status {
  font-size: 10px;
  font-weight: 600;
}
.bulk-preview-table .row-status.ok { color: var(--green); }
.bulk-preview-table .row-status.err { color: var(--red); }
.bulk-preview-table .row-status.dup { color: var(--amber); }

.bulk-progress {
  padding: 4px 0;
}
.bulk-progress-text {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted2);
  margin-top: 6px;
  text-align: center;
}

/* ── UPDATE RATE — SEARCH RESULTS ────────── */
.ur-results {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
}
.ur-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid rgba(0,0,0,.04);
  font-size: 12.5px;
}
.ur-result-row:last-child { border-bottom: none; }
.ur-result-row:hover { background: rgba(46,92,255,.06); }
.ur-result-name {
  font-weight: 600;
  color: var(--text);
}
.ur-result-meta {
  font-size: 11px;
  color: var(--muted);
}
.ur-no-results {
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ── UPDATE RATE — SELECTED CREATOR ──────── */
.ur-selected {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  padding: 16px;
  backdrop-filter: blur(8px);
}
.ur-selected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.ur-selected-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.ur-clear-btn {
  background: rgba(0,0,0,.04);
  border: 1px solid var(--border2);
  color: var(--muted2);
  padding: 3px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.ur-clear-btn:hover {
  background: rgba(0,0,0,.06);
  color: var(--text);
}
.ur-selected-category {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 14px;
}
.ur-current-rates {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ur-rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0,0,0,.02);
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.04);
}
.ur-rate-platform {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.ur-rate-handle {
  font-size: 11px;
  color: var(--muted);
  margin-left: 4px;
  font-weight: 400;
}
.ur-rate-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ── KPI CHART MODAL ────────────────────── */
.kpi-chart-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.kpi-chart-modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  width: 720px;
  max-width: 94vw;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,.15);
}
.kpi-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.kpi-chart-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.kpi-chart-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all .15s;
}
.kpi-chart-close:hover {
  color: var(--text);
  background: rgba(0,0,0,.06);
}
.kpi-chart-body {
  padding: 24px;
  position: relative;
  height: 400px;
}
.kpi-chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* ── EDIT PANEL ─────────────────────────────── */

/* Global focus style for all inputs/selects in edit panel */
#editPanel input:focus,
#editPanel select:focus,
#editPanel textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(46,92,255,.15);
}

/* Selected creator header */
.ed-selected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(46,92,255,.06);
  border-radius: 10px;
  margin-bottom: 16px;
}
.ed-selected-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.ed-clear-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.ed-clear-btn:hover {
  color: var(--red);
  background: rgba(248,113,113,.08);
}

/* Sub-tabs (Details | Handles | Merge | Delete) */
.ed-subtabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.ed-subtab {
  flex: 1;
  padding: 8px 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.ed-subtab:hover { color: var(--text); }
.ed-subtab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Handle rows */
.ed-handles-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.ed-handle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: 8px;
  font-size: 13px;
}
.ed-handle-row .ed-handle-text {
  flex: 1;
  font-weight: 600;
  color: var(--text);
}
.ed-handle-row .ed-handle-platform {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,.06);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.ed-handle-actions {
  display: flex;
  gap: 4px;
}
.ed-handle-actions button {
  background: none;
  border: none;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
  transition: all .15s;
}
.ed-handle-actions button:hover { background: rgba(0,0,0,.06); color: var(--text); }
.ed-handle-actions .ed-handle-delete:hover { color: var(--red); background: rgba(248,113,113,.08); }

/* Handle edit mode (inline) */
.ed-handle-edit-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(46,92,255,.04);
  border: 1px solid rgba(46,92,255,.15);
  border-radius: 8px;
}
.ed-handle-edit-row input,
.ed-handle-edit-row select {
  padding: 6px 8px;
  border: 1px solid var(--border2);
  border-radius: 6px;
  font-size: 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.ed-handle-edit-row input:focus,
.ed-handle-edit-row select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(46,92,255,.15);
}
.ed-handle-edit-row input { flex: 1; }
.ed-handle-edit-row select { width: 120px; }
.ed-handle-edit-row button {
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.ed-handle-edit-save {
  background: rgba(46,92,255,.12);
  color: var(--accent);
}
.ed-handle-edit-save:hover { background: rgba(46,92,255,.2); }
.ed-handle-edit-cancel {
  background: rgba(0,0,0,.06);
  color: var(--muted);
}
.ed-handle-edit-cancel:hover { background: rgba(0,0,0,.1); }

/* Add handle section */
.ed-add-handle {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.ed-add-handle-btn {
  padding: 8px 14px;
  background: rgba(46,92,255,.12);
  color: var(--accent);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  margin-bottom: 0;
  height: 38px;
}
.ed-add-handle-btn:hover { background: rgba(46,92,255,.2); }

/* Merge section */
.ed-merge-info {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(96,165,250,.06);
  border: 1px solid rgba(96,165,250,.15);
  border-radius: 8px;
}
.ed-merge-target {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(46,92,255,.06);
  border-radius: 8px;
  margin-top: 8px;
}
.ed-merge-target-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  flex: 1;
}
.ed-merge-preview {
  padding: 14px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.6;
  background: rgba(0,0,0,.03);
  border: 1px solid var(--border);
  margin-top: 12px;
  color: var(--text);
}
.ed-merge-preview strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}
.ed-merge-preview ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ed-merge-preview li {
  padding: 3px 0;
}
.ed-merge-preview li::before {
  content: '\2022 ';
  color: var(--accent);
  font-weight: bold;
}

/* Delete section */
.ed-delete-warning {
  font-size: 12px;
  color: var(--red);
  line-height: 1.5;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(248,113,113,.06);
  border: 1px solid rgba(248,113,113,.2);
  border-radius: 8px;
  font-weight: 500;
}
.ed-delete-preview {
  font-size: 12px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(0,0,0,.03);
  border-radius: 8px;
}

/* Danger button */
.ed-btn-danger {
  width: 100%;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  background: rgba(248,113,113,.1);
  color: var(--red);
}
.ed-btn-danger:hover:not(:disabled) {
  background: rgba(248,113,113,.18);
  box-shadow: 0 0 12px rgba(248,113,113,.15);
}
.ed-btn-danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ed-btn-danger.confirming {
  background: var(--red);
  color: white;
}
.ed-btn-danger.confirming:hover {
  background: #ef4444;
}

/* Post info card */
.ed-post-info {
  padding: 14px;
  border-radius: 10px;
  background: rgba(0,0,0,.03);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
}
.ed-post-info-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}
.ed-post-info-label {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: .5px;
}
.ed-post-info-value {
  font-weight: 500;
}

/* Post delete section */
.ed-post-delete-section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Handle delete modal overlay */
.ed-handle-delete-modal {
  padding: 12px;
  background: rgba(248,113,113,.04);
  border: 1px solid rgba(248,113,113,.15);
  border-radius: 8px;
  margin-top: 8px;
  font-size: 12px;
}
.ed-handle-delete-modal p {
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1.5;
}
.ed-handle-delete-actions {
  display: flex;
  gap: 8px;
}
.ed-handle-delete-actions button {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.ed-handle-move-btn {
  background: rgba(46,92,255,.12);
  color: var(--accent);
}
.ed-handle-move-btn:hover { background: rgba(46,92,255,.2); }
.ed-handle-just-delete-btn {
  background: rgba(248,113,113,.1);
  color: var(--red);
}
.ed-handle-just-delete-btn:hover { background: rgba(248,113,113,.18); }

/* Spinner for async buttons */
.btn-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

/* ── Data Health: Submitted By tag ── */
.health-submitted-by {
  color: var(--muted2);
  font-weight: 400;
  font-size: 11px;
}

/* ── Data Health: Danger (delete) button for unavailable posts ── */
.health-btn.danger-sm {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}
.health-btn.danger-sm:hover {
  background: rgba(248,113,113,.1);
}
