
/* /src/index.css */
:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color-scheme: light;
}

html, body, #root {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}


/* /src/App.css */
* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  background: #0b1020;
  color: #e2e8f0;
  font-size: 14px;
}

button { font-family: inherit; }
a { color: #fbbf24; text-decoration: none; }
a:hover { text-decoration: underline; }

.loading-screen, .login-screen {
  display: flex; align-items: center; justify-content: center;
  height: 100vh; background: #0b1020;
}
.login-card {
  background: #11182b; border: 1px solid #1f2942;
  padding: 32px 40px; border-radius: 12px; max-width: 420px; width: 90%;
  display: flex; flex-direction: column; gap: 20px;
}
.login-card h1 { font-size: 20px; margin: 0; color: #fff; }

.logo, .brand { display: flex; align-items: center; gap: 10px; }
.logo-icon, .brand-icon {
  width: 36px; height: 36px; background: #1e40af;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.logo-title, .brand-title { font-weight: 700; color: #fff; font-size: 14px; line-height: 1.1; }
.logo-sub, .brand-sub { font-size: 12px; color: #94a3b8; }

.btn-primary {
  background: #1877f2; color: white; border: none;
  padding: 9px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.btn-primary:hover { background: #166fe5; }
.btn-ghost {
  background: transparent; color: #cbd5e1; border: 1px solid #1f2942;
  padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: 12px;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-ghost:hover { background: #11182b; }
.link {
  background: transparent; border: none; color: #94a3b8;
  cursor: pointer; font-size: 13px; padding: 0;
}
.link:hover { color: #fbbf24; }

.error {
  background: rgba(180, 35, 24, 0.15); color: #fca5a5;
  border: 1px solid rgba(180, 35, 24, 0.4);
  padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13px;
}

/* Layout */
.layout { display: grid; grid-template-columns: 220px 1fr; height: 100vh; transition: grid-template-columns 0.18s; }
.layout.nav-collapsed { grid-template-columns: 60px 1fr; }

/* Sidebar */
.nav {
  background: #0b1020; border-right: 1px solid #1f2942;
  padding: 18px 12px; display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
.brand { padding: 0 8px 18px; position: relative; }
.nav-toggle {
  position: absolute; right: -22px; top: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #11182b; border: 1px solid #1f2942;
  color: #94a3b8; cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
}
.nav-toggle:hover { background: #1a2238; color: #fff; }

.nav-collapsed .brand-title,
.nav-collapsed .brand-sub,
.nav-collapsed .nav-section,
.nav-collapsed .nav-label,
.nav-collapsed .nav-count { display: none; }
.nav-collapsed .nav-item { justify-content: center; padding: 8px; }
.nav-collapsed .nav-item.indent { padding-left: 8px; }
.nav-collapsed .nav-bottom { text-align: center; }
.nav-collapsed .brand { padding: 0 0 14px; justify-content: center; }
.nav-collapsed .nav-icon { font-size: 16px; }
.nav-section {
  font-size: 10px; color: #64748b; letter-spacing: 0.8px;
  padding: 14px 10px 6px; font-weight: 600;
}
.nav-item {
  background: transparent; border: none; color: #cbd5e1;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; gap: 10px; font-size: 13px;
  width: 100%; text-align: left;
}
.nav-item:hover { background: #11182b; color: #fff; }
.nav-item.active { background: #1e3a8a33; color: #60a5fa; }
.nav-item.indent { padding-left: 28px; }
.nav-icon { width: 16px; opacity: 0.8; }
.nav-label { flex: 1; }
.nav-count {
  font-size: 11px; color: #64748b;
  background: #1f2942; padding: 1px 6px; border-radius: 10px;
}
.nav-item.active .nav-count { background: #1e3a8a; color: #93c5fd; }
.nav-bottom { margin-top: auto; padding: 8px; }

/* Content */
.content { display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; border-bottom: 1px solid #1f2942;
  background: #0b1020;
}
.account-picker { position: relative; }
.account-pill {
  background: #11182b; border: 1px solid #1f2942;
  color: #e2e8f0; padding: 7px 14px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.account-pill:hover { background: #1a2238; }
.account-pill .meta { color: #64748b; font-size: 11px; }
.acct-id {
  font-family: ui-monospace, Consolas, monospace; font-size: 11px;
  color: #64748b; user-select: all;
}
.account-menu-main { display: flex; flex-direction: column; gap: 2px; }
.account-pill .caret { color: #64748b; font-size: 10px; }
.account-menu {
  position: absolute; top: calc(100% + 4px); left: 0;
  background: #11182b; border: 1px solid #1f2942; border-radius: 8px;
  min-width: 260px; max-height: 360px; overflow-y: auto;
  z-index: 10; box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.account-menu-item {
  padding: 8px 14px; cursor: pointer; display: flex; justify-content: space-between;
  font-size: 13px; color: #cbd5e1;
}
.account-menu-item:hover { background: #1a2238; }
.account-menu-item.active { background: #1e3a8a33; color: #60a5fa; }
.account-menu-item .meta { color: #64748b; font-size: 11px; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.upgrade-pill, .search-pill {
  background: #11182b; border: 1px solid #1f2942;
  padding: 6px 12px; border-radius: 8px; font-size: 12px;
  display: flex; align-items: center; gap: 6px; color: #cbd5e1;
}
.upgrade-pill .bolt { color: #fbbf24; }
.dot { color: #475569; }
kbd {
  background: #1f2942; padding: 1px 6px; border-radius: 4px;
  font-family: inherit; font-size: 11px; color: #cbd5e1;
}

/* Main */
.main { flex: 1; overflow-y: auto; padding: 20px 24px; }
.main-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.head-left { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; }
.head-right { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex: 1 1 auto; min-width: 0; }
.title-row {
  display: flex; align-items: center; gap: 12px;
}
.title-row h1 { margin: 0; font-size: 28px; color: #fff; font-weight: 700; }
.sync-pill {
  background: #1f1a08; border: 1px solid #3f2f08;
  color: #fbbf24; padding: 4px 10px; border-radius: 14px; font-size: 12px;
  display: inline-flex; align-items: center; gap: 6px;
}
.dot-green {
  width: 6px; height: 6px; border-radius: 50%; background: #fbbf24;
}
.count { color: #64748b; font-size: 13px; }

.filters {
  display: flex; align-items: end; gap: 12px; margin: 0 0 16px;
  flex-wrap: wrap; justify-content: flex-end;
}
.field { display: flex; flex-direction: column; gap: 4px; width: 160px; flex: 0 0 auto; }
.field label { font-size: 9px; }
.field select, .multi-trigger { padding: 7px 10px; font-size: 12px; }
.field label { font-size: 10px; color: #64748b; letter-spacing: 0.8px; font-weight: 600; }
.field select {
  background: #11182b; border: 1px solid #1f2942;
  color: #e2e8f0; padding: 9px 12px; border-radius: 8px;
  font-size: 13px; font-family: inherit; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px;
  padding-right: 32px;
}
.new-ad { align-self: end; }
.field select { width: 100%; }

/* Table */
.table-wrap {
  background: #11182b; border: 1px solid #1f2942; border-radius: 12px;
  overflow-x: auto; overflow-y: hidden;
}
.ads-table { width: 100%; border-collapse: collapse; min-width: max-content; }
.ads-table { line-height: 1.3; }
.ads-table thead th {
  text-align: left; padding: 6px 12px; font-size: 10px;
  color: #64748b; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
  border-bottom: 1px solid #1f2942;
}
.ads-table tbody td {
  padding: 4px 12px; border-bottom: 1px solid #1f2942;
  font-size: 12px; color: #cbd5e1; vertical-align: middle;
  line-height: 1.3; white-space: nowrap;
}
.ads-table thead th { white-space: nowrap; user-select: none; }
.ads-table thead th.sortable { cursor: pointer; }
.ads-table thead th.sortable:hover { color: #f1f5f9; }
.sort-arrow { margin-left: 4px; font-size: 9px; color: #475569; opacity: 0.5; }
.sort-arrow.active { color: #60a5fa; opacity: 1; }
.hint-icon {
  display: inline-block; margin-left: 4px;
  color: #475569; font-size: 11px; cursor: help;
  font-style: normal;
}
.hint-icon:hover { color: #60a5fa; }

/* Multi-select filter */
.multi-field { position: relative; }
.multi-trigger {
  background: #11182b; border: 1px solid #1f2942; color: #e2e8f0;
  padding: 9px 12px; border-radius: 8px; font-size: 13px;
  font-family: inherit; cursor: pointer; width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  text-align: left;
}
.multi-trigger:hover { background: #1a2238; }
.multi-summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-trigger .caret { color: #64748b; font-size: 10px; margin-left: 8px; }
.multi-menu {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: #11182b; border: 1px solid #1f2942; border-radius: 8px;
  width: 280px; max-height: 360px; display: flex; flex-direction: column;
  z-index: 20; box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.multi-menu-head { padding: 8px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid #1f2942; }
.multi-search {
  background: #0b1020; border: 1px solid #1f2942; color: #e2e8f0;
  padding: 6px 10px; border-radius: 6px; font-size: 12px;
  font-family: inherit;
}
.multi-search:focus { outline: none; border-color: #1877f2; }
.multi-actions { display: flex; gap: 8px; justify-content: flex-end; }
.multi-actions .link { font-size: 11px; }
.multi-options { overflow-y: auto; padding: 4px; flex: 1; }
.multi-option {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
  font-size: 13px; color: #cbd5e1;
}
.multi-option:hover { background: #1a2238; }
.multi-option.active { background: #1e3a8a33; color: #60a5fa; }
.multi-option input { accent-color: #1877f2; }

.search-field { width: 200px; }
.search-input {
  background: #11182b; border: 1px solid #1f2942; color: #e2e8f0;
  padding: 7px 10px 7px 28px; border-radius: 8px; font-size: 12px;
  font-family: inherit; width: 100%;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3e%3ccircle cx='11' cy='11' r='8'/%3e%3cpath d='m21 21-4.35-4.35'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: 8px center; background-size: 14px;
}
.search-input:focus { outline: none; border-color: #1877f2; }

.creatives-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.creatives-sort { display: flex; align-items: center; gap: 6px; }
.creatives-sort label { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; }
.creatives-count { margin-left: auto; font-size: 13px; color: #64748b; }
.ads-table thead th:first-child,
.ads-table tbody td:first-child { padding-left: 16px; }
.ads-table thead th:last-child,
.ads-table tbody td:last-child { padding-right: 16px; }
.ads-table tbody tr:last-child td { border-bottom: none; }
.ads-table tbody tr:hover { background: #1a2238; }
.check { width: 28px; }
.check input { accent-color: #1877f2; }
.preview-col { width: 76px; }
.thumb {
  width: 60px; height: 60px; border-radius: 8px; overflow: hidden;
  background: #1f2942; display: flex; align-items: center; justify-content: center;
}
.ad-id {
  font-family: ui-monospace, Consolas, monospace; font-size: 11px;
  color: #64748b; cursor: pointer; user-select: all;
}
.ad-id:hover { color: #60a5fa; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-clickable { cursor: pointer; transition: transform 0.1s; }
.thumb-clickable:hover { transform: scale(1.05); }
.thumb-clickable:hover .thumb { outline: 2px solid #1877f2; outline-offset: 2px; }
.thumb-empty { color: #64748b; font-size: 18px; }
.name {
  display: inline-block; max-width: 360px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #f1f5f9; font-weight: 500; vertical-align: middle;
}
.score-bar {
  width: 90px; height: 16px; border-radius: 8px; background: #1f2942;
  position: relative; overflow: hidden; cursor: help;
}
.score-fill {
  height: 100%; border-radius: 8px;
  background: linear-gradient(90deg, #f87171 0%, #fbbf24 40%, #34d399 80%);
  transition: width 0.3s;
}
.score-num {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
  text-shadow: 0 0 4px rgba(0,0,0,0.6);
  font-variant-numeric: tabular-nums;
}
.num { font-variant-numeric: tabular-nums; }
.custom-range { display: flex; align-items: center; gap: 6px; }
.date-input {
  background: #11182b; border: 1px solid #1f2942; color: #cbd5e1;
  padding: 6px 8px; border-radius: 6px; font-size: 12px;
  font-family: inherit;
  color-scheme: dark;
}
.date-input:focus { outline: none; border-color: #1877f2; }
.dash-sep { color: #64748b; font-size: 12px; }

.date-select {
  background: #11182b; border: 1px solid #1f2942; color: #cbd5e1;
  padding: 6px 26px 6px 10px; border-radius: 8px; font-size: 12px;
  cursor: pointer; font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 6px center; background-size: 14px;
}
.actions-col { width: 130px; text-align: right; }
.actions { text-align: right; }
.actions button {
  background: transparent; border: 1px solid #1f2942;
  color: #94a3b8; width: 26px; height: 26px;
  border-radius: 6px; cursor: pointer; margin-left: 4px;
  font-size: 11px;
}
.actions button:hover { background: #1a2238; color: #fff; }

.status-pill {
  display: inline-block; padding: 4px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
  background: #1f2942; color: #cbd5e1;
}
.status-pill.active { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.status-pill.paused { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.status-pill.deleted { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.status-pill.neutral { background: #1f2942; color: #cbd5e1; }

.loading-cell {
  text-align: center; padding: 40px; color: #64748b; font-size: 13px;
}

/* Dashboard */
.dashboard { display: flex; flex-direction: column; gap: 16px; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi {
  background: #11182b; border: 1px solid #1f2942; border-radius: 12px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
}
.kpi.accent { border-color: #1e40af; background: linear-gradient(135deg, #11182b, #1a2c52); }
.kpi-label { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.kpi-value { font-size: 22px; color: #f1f5f9; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi.accent .kpi-value { color: #60a5fa; }
.section-title { font-size: 15px; color: #cbd5e1; margin: 12px 0 0; font-weight: 600; }

.dash-grid {
  display: grid; gap: 16px;
  grid-template-columns: 2fr 1fr;
}
.dash-grid:has(.chart-panel + .chart-panel) { grid-template-columns: 1fr 1fr; }
.dash-grid:has(> .panel:nth-child(2):last-child:not(.chart-panel)) { grid-template-columns: 1fr 1fr; }

.panel {
  background: #11182b; border: 1px solid #1f2942; border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; }
.panel-title { font-size: 13px; color: #cbd5e1; margin: 0; font-weight: 600; }
.panel-sub { font-size: 11px; color: #64748b; }

.chart-panel { min-height: 220px; }
.trend { display: flex; flex-direction: column; gap: 8px; }
.trend-summary { display: flex; align-items: baseline; gap: 10px; }
.trend-current { font-size: 22px; color: #f1f5f9; font-weight: 700; font-variant-numeric: tabular-nums; }
.trend-delta { font-size: 12px; font-weight: 600; }
.trend-delta.up { color: #34d399; }
.trend-delta.down { color: #f87171; }
.trend-svg { width: 100%; height: 140px; display: block; }
.trend-chart-wrap { position: relative; cursor: crosshair; }
.trend-tooltip {
  position: absolute; top: 0; transform: translateX(-50%);
  background: #0b1020; border: 1px solid #1f2942; border-radius: 8px;
  padding: 10px 12px; font-size: 11px; min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5); pointer-events: none; z-index: 5;
}
.trend-tooltip .tt-date { font-weight: 600; color: #f1f5f9; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.tt-rows { display: flex; flex-direction: column; gap: 4px; }
.tt-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; color: #cbd5e1; }
.tt-row.prev { color: #94a3b8; }
.tt-dot { width: 8px; height: 8px; border-radius: 50%; }
.tt-dot.dash { background: transparent; border: 1.5px dashed #94a3b8; border-radius: 0; height: 0; align-self: center; }
.tt-val { font-variant-numeric: tabular-nums; color: #f1f5f9; font-weight: 600; }
.tt-sep { height: 1px; background: #1f2942; margin: 6px 0; }
.tt-section-label { font-size: 10px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; margin-bottom: 6px; }
.tt-top-ads { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
.tt-top-ad { display: flex; gap: 8px; align-items: center; }
.tt-top-ad .thumb { width: 32px; height: 32px; border-radius: 4px; flex: 0 0 auto; }
.tt-top-ad-meta { flex: 1; min-width: 0; }
.tt-top-ad-name {
  font-size: 11px; color: #f1f5f9; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tt-top-ad-stats { font-size: 10px; color: #94a3b8; display: flex; gap: 3px; align-items: center; }
.tt-top-ad-stats .dot { color: #475569; }
.trend-tooltip { min-width: 260px; }
.trend-axis { display: flex; justify-content: space-between; font-size: 10px; color: #64748b; font-variant-numeric: tabular-nums; }

.stat-list { display: flex; flex-direction: column; gap: 4px; }
.stat-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.stat-label { color: #94a3b8; }
.stat-value { color: #f1f5f9; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-value.active { color: #34d399; }
.stat-value.paused { color: #fbbf24; }
.stat-value.danger { color: #f87171; }
.divider { height: 1px; background: #1f2942; margin: 4px 0; }

.top-ads { display: flex; flex-direction: column; gap: 8px; }
.top-ad-row {
  display: flex; gap: 12px; align-items: center;
  padding: 6px; border-radius: 8px;
}
.top-ad-row:hover { background: #1a2238; }
.top-ad-meta { flex: 1; min-width: 0; }
.top-ad-name {
  font-size: 13px; color: #f1f5f9; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.top-ad-stats { font-size: 11px; color: #94a3b8; margin-top: 2px; font-variant-numeric: tabular-nums; }
.top-ad-stats .dot { color: #475569; margin: 0 4px; }
.empty-state-inline { color: #64748b; font-size: 12px; padding: 16px; text-align: center; }

/* Alert banner */
.alert-banner {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 12px;
}
.alert-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.1), rgba(248, 113, 113, 0.03));
  border: 1px solid rgba(248, 113, 113, 0.3); border-radius: 8px;
  font-size: 13px; color: #f1f5f9;
}
.alert-icon { font-size: 16px; }
.alert-text { flex: 1; }
.alert-action {
  background: rgba(248, 113, 113, 0.2); border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fca5a5; padding: 4px 12px; border-radius: 6px;
  cursor: pointer; font-size: 12px; font-weight: 600;
}
.alert-action:hover { background: rgba(248, 113, 113, 0.3); }

/* Dashboard sub-nav */
.dash-subnav {
  position: sticky; top: 0; z-index: 8;
  display: flex; gap: 4px; padding: 8px 0;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #0b1020 80%, transparent);
}
.dash-subnav-link {
  padding: 5px 12px; border-radius: 14px;
  font-size: 12px; color: #94a3b8;
  background: #11182b; border: 1px solid #1f2942;
  text-decoration: none;
}
.dash-subnav-link:hover { color: #60a5fa; background: #1a2238; text-decoration: none; }
.dash-anchor { scroll-margin-top: 56px; }

/* Clickable KPIs */
.kpi-clickable { cursor: pointer; transition: transform 0.1s, border-color 0.15s; }
.kpi-clickable:hover { transform: translateY(-2px); border-color: #1e40af; }

/* Quick Wins action */
.qw-actions { margin-left: auto; }
.qw-btn { padding: 4px 12px; font-size: 11px; }

/* Goals */
.goals-empty {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #11182b; border: 1px dashed #1f2942;
  border-radius: 8px; font-size: 13px; color: #94a3b8;
}
.goals-list { display: flex; flex-direction: column; gap: 10px; }
.goal-row { display: grid; grid-template-columns: 80px 1fr 200px; gap: 12px; align-items: center; font-size: 12px; }
.goal-label { color: #94a3b8; font-weight: 500; }
.goal-track { height: 10px; background: #1f2942; border-radius: 5px; overflow: hidden; }
.goal-fill { height: 100%; border-radius: 5px; transition: width 0.3s; }
.goal-val { color: #f1f5f9; text-align: right; font-variant-numeric: tabular-nums; }
.goal-val .muted { color: #64748b; }
.goal-form { display: flex; flex-direction: column; gap: 10px; max-width: 320px; }
.goal-form label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; }

/* Best / worst */
.best-worst { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bw-card {
  display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px;
  background: #11182b; border: 1px solid #1f2942;
}
.bw-card.best { border-left: 3px solid #34d399; }
.bw-card.worst { border-left: 3px solid #f87171; }
.bw-icon { font-size: 24px; }
.bw-body { display: flex; flex-direction: column; gap: 2px; }
.bw-label { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.bw-week { font-size: 13px; color: #f1f5f9; font-weight: 600; font-variant-numeric: tabular-nums; }
.bw-stats { font-size: 12px; color: #94a3b8; }

/* Saturation curve */
.sat-summary { margin-top: 10px; font-size: 12px; color: #cbd5e1; padding: 8px 10px; background: #0b1020; border-radius: 6px; }

/* A/B sig test */
.ab-sig { margin-top: 14px; padding-top: 14px; border-top: 1px solid #1f2942; display: flex; flex-direction: column; gap: 6px; }
.ab-row { display: flex; justify-content: space-between; font-size: 12px; color: #cbd5e1; }
.ab-result { font-size: 13px; font-weight: 600; padding: 8px 10px; border-radius: 6px; margin-top: 4px; }
.ab-result.sig { background: rgba(52, 211, 153, 0.1); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.ab-result.nosig { background: rgba(251, 191, 36, 0.1); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }

/* What-if simulator */
.whatif { display: flex; flex-direction: column; gap: 14px; }
.whatif-slider { display: flex; flex-direction: column; gap: 6px; }
.whatif-slider input { accent-color: #1877f2; width: 100%; }
.whatif-label { font-size: 14px; color: #f1f5f9; font-weight: 600; text-align: center; }
.whatif-grid { display: flex; flex-direction: column; gap: 6px; }
.whatif-row { display: grid; grid-template-columns: 110px 1fr 20px 1fr; gap: 10px; align-items: center; font-size: 13px; }
.whatif-row-label { color: #94a3b8; font-weight: 500; }
.whatif-row-cur { font-variant-numeric: tabular-nums; }
.whatif-row-proj { color: #60a5fa; font-weight: 600; font-variant-numeric: tabular-nums; }
.whatif-arrow { color: #475569; text-align: center; }
.whatif-hint { font-size: 11px; text-align: center; font-style: italic; }

/* Focus banner */
.focus-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; margin-bottom: 8px;
  background: rgba(96, 165, 250, 0.1); border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 8px; font-size: 13px; color: #cbd5e1;
}
.focus-banner .alert-action { background: rgba(96, 165, 250, 0.2); border-color: rgba(96, 165, 250, 0.4); color: #93c5fd; }

.bar-clickable { cursor: pointer; padding: 4px; border-radius: 4px; }
.bar-clickable:hover { background: #1a2238; }

/* Funnel by segment */
.seg-toggle { display: flex; gap: 4px; margin-bottom: 12px; }
.seg-funnels { display: flex; gap: 12px; height: 200px; align-items: flex-end; padding: 8px; }
.seg-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; justify-content: flex-end; min-width: 0; }
.seg-label { font-size: 11px; color: #94a3b8; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.seg-bar { width: 80%; border-radius: 2px 2px 0 0; min-height: 2px; transition: height 0.3s; opacity: 0.85; }
.seg-bar:hover { opacity: 1; }
.seg-stats { font-size: 10px; color: #cbd5e1; text-align: center; margin-top: 4px; font-variant-numeric: tabular-nums; }
.seg-stats .muted { color: #64748b; font-size: 9px; }

/* Pivot */
.pivot-controls { display: flex; gap: 12px; margin-bottom: 10px; font-size: 12px; color: #94a3b8; align-items: center; }
.pivot-controls label { display: flex; align-items: center; gap: 6px; }

/* Video metrics */
.video-stages { display: flex; flex-direction: column; gap: 6px; }
.video-stage { display: grid; grid-template-columns: 70px 1fr 80px; gap: 10px; align-items: center; font-size: 12px; }
.video-stage-label { color: #94a3b8; font-weight: 500; }
.video-stage-bar { height: 16px; background: #1f2942; border-radius: 4px; overflow: hidden; }
.video-stage-fill { height: 100%; background: linear-gradient(90deg, #60a5fa, #a855f7); border-radius: 4px; transition: width 0.3s; }
.video-stage-val { color: #f1f5f9; text-align: right; font-variant-numeric: tabular-nums; }

/* Geo heatmap */
.geo-heatmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 4px; margin-bottom: 12px; }
.geo-tile {
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
  transition: transform 0.1s;
}
.geo-tile:hover { transform: scale(1.05); outline: 1px solid #60a5fa; }
.geo-code { font-size: 13px; font-weight: 700; color: #fff; }
.geo-val { font-size: 10px; color: rgba(255,255,255,0.85); font-variant-numeric: tabular-nums; }

/* Sparkline grid */
.sparkline { width: 100px; height: 28px; display: block; }
.spark-grid { display: flex; flex-direction: column; gap: 6px; }
.spark-row {
  display: grid; grid-template-columns: 110px 1fr 120px 80px;
  gap: 12px; align-items: center; font-size: 12px;
  padding: 6px 8px; border-radius: 6px;
}
.spark-row:hover { background: #1a2238; }
.spark-label { color: #94a3b8; font-weight: 500; }
.spark-total { color: #f1f5f9; font-variant-numeric: tabular-nums; font-weight: 600; }
.spark-delta { font-size: 11px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.spark-delta.up { color: #34d399; }
.spark-delta.down { color: #f87171; }

/* Print */
@media print {
  body { background: white !important; color: black !important; }
  .nav, .topbar, .dash-subnav, .alert-action, .density-toggle, .main-head, .panel-head .btn-ghost, .field, .filters, .new-ad, .focus-banner { display: none !important; }
  .layout { grid-template-columns: 1fr !important; height: auto !important; }
  .main { overflow: visible !important; padding: 0 !important; }
  .content { overflow: visible !important; }
  .panel { background: white !important; border: 1px solid #ccc !important; color: black !important; page-break-inside: avoid; }
  .panel-title, .kpi-value, .kpi-label, .name { color: black !important; }
  .kpi { background: white !important; border: 1px solid #ccc !important; }
  .ads-table { color: black !important; }
  .ads-table tbody td, .ads-table thead th { color: black !important; border-color: #ccc !important; }
  .dash-grid { display: block !important; }
  .dash-grid > * { margin-bottom: 12px; page-break-inside: avoid; }
}

/* Density toggle */
.density-toggle {
  background: #11182b; border: 1px solid #1f2942; color: #94a3b8;
  width: 32px; height: 30px; border-radius: 8px;
  cursor: pointer; font-size: 14px;
}
.density-toggle:hover { background: #1a2238; color: #fff; }
.density-toggle.demo-on { background: rgba(168, 85, 247, 0.2); border-color: rgba(168, 85, 247, 0.5); color: #c084fc; }

/* Demo mode: blur images + hide preview iframes */
.layout[data-demo="true"] .thumb img,
.layout[data-demo="true"] .creative-img img,
.layout[data-demo="true"] .top-ad-row .thumb img,
.layout[data-demo="true"] .ad-preview-frame,
.layout[data-demo="true"] .card-preview iframe {
  filter: blur(14px) saturate(0.4) brightness(0.6);
  transition: filter 0.2s;
}
.layout[data-demo="true"] .thumb-clickable:hover .thumb img {
  filter: blur(4px) saturate(0.6) brightness(0.8);
}

[data-density="compact"] .panel { padding: 10px 12px; gap: 8px; }
[data-density="compact"] .kpi { padding: 10px 12px; }
[data-density="compact"] .kpi-value { font-size: 18px; }
[data-density="compact"] .panel-title { font-size: 12px; }
[data-density="compact"] .dashboard { gap: 10px; }
[data-density="compact"] .dash-grid { gap: 10px; }
[data-density="compact"] .main { padding: 14px 18px; }
[data-density="compact"] .kpi-row { gap: 8px; }

/* Skeleton */
.skeleton-panel {
  background: #11182b; border: 1px solid #1f2942; border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
  min-height: 200px;
}
.skeleton-row {
  height: 12px; background: linear-gradient(90deg, #1f2942 0%, #2a3656 50%, #1f2942 100%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.kpi-delta { font-size: 11px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi-delta.up { color: #34d399; }
.kpi-delta.down { color: #f87171; }

.bar-list { display: flex; flex-direction: column; gap: 6px; }
.bar-row {
  display: grid; grid-template-columns: 90px 1fr 90px;
  gap: 10px; align-items: center; font-size: 12px;
}
.bar-label { color: #cbd5e1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track {
  height: 8px; background: #1f2942; border-radius: 4px; overflow: hidden;
  display: flex; gap: 1px;
}
.bar-track.stacked { background: #1f2942; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.bar-value { color: #cbd5e1; text-align: right; }

.legend { display: flex; gap: 16px; margin-top: 8px; font-size: 11px; color: #94a3b8; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.dot-blue { background: #60a5fa; }
.dot-pink { background: #f472b6; }

.top-ad-stats .up { color: #34d399; font-weight: 600; }
.top-ad-stats .down { color: #f87171; font-weight: 600; }

.heatmap-wrap { position: relative; }
.heatmap-tooltip {
  position: absolute; transform: translate(-50%, calc(-100% - 8px));
  background: #0b1020; border: 1px solid #1f2942; border-radius: 8px;
  padding: 10px 12px; font-size: 11px; min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5); pointer-events: none; z-index: 10;
}
.heatmap { display: flex; flex-direction: column; gap: 2px; }
.heatmap-hours, .heatmap-row {
  display: grid; grid-template-columns: 64px repeat(24, minmax(20px, 1fr)) 50px;
  gap: 2px;
}
.heatmap-hour-label { font-size: 9px; color: #64748b; text-align: center; }
.heatmap-day-label { font-size: 11px; color: #94a3b8; display: flex; align-items: center; justify-content: flex-end; padding-right: 4px; }
.heatmap-cell {
  height: 22px; border-radius: 3px; cursor: pointer; transition: transform 0.1s;
  position: relative; overflow: hidden;
}
.heatmap-cell:hover { transform: scale(1.15); outline: 1px solid #60a5fa; z-index: 2; }
.heatmap-cell.best { outline: 1.5px solid #34d399; }
.heatmap-cell.worst { outline: 1.5px solid #f87171; }
.hm-full { width: 100%; height: 100%; border-radius: 3px; }
.hm-half { position: absolute; left: 0; right: 0; height: 50%; }
.hm-half.top { top: 0; }
.hm-half.bottom { bottom: 0; }

.heatmap-controls { display: flex; gap: 16px; align-items: center; margin-bottom: 10px; }
.heatmap-metric-toggle {
  display: inline-flex; background: #0b1020; border: 1px solid #1f2942; border-radius: 8px; padding: 2px;
}
.hm-btn {
  background: transparent; border: none; color: #94a3b8;
  padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 12px;
  font-family: inherit;
}
.hm-btn.active { background: #1e3a8a33; color: #60a5fa; }
.hm-btn:hover:not(.active) { color: #cbd5e1; }
.hm-compare { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #94a3b8; cursor: pointer; }
.hm-compare input { accent-color: #1877f2; }

.heatmap-callouts { display: flex; gap: 16px; font-size: 12px; color: #94a3b8; margin-bottom: 10px; flex-wrap: wrap; }
.heatmap-callouts b { color: #f1f5f9; }

.heatmap-day-label { gap: 4px; }
.hm-trend { font-size: 9px; font-weight: 600; margin-left: 4px; font-variant-numeric: tabular-nums; }
.hm-trend.up { color: #34d399; }
.hm-trend.down { color: #f87171; }

.heatmap-row-total {
  display: flex; align-items: center; height: 22px; padding-left: 4px;
}
.heatmap-row-total .hm-total-bar {
  height: 8px; background: linear-gradient(90deg, #1877f2, #34d399);
  border-radius: 2px; min-width: 1px;
}
.heatmap-row-total-label, .col-totals .heatmap-day-label {
  font-size: 10px; color: #64748b; font-weight: 600;
}
.heatmap-row.col-totals { margin-top: 4px; align-items: end; }
.heatmap-col-total {
  height: 22px; display: flex; align-items: end; justify-content: center;
}
.heatmap-col-total .hm-total-bar {
  width: 8px; background: linear-gradient(180deg, #34d399, #1877f2);
  border-radius: 2px; min-height: 1px;
}

.conv-cell { color: #34d399; }

.pacing-list { display: flex; flex-direction: column; gap: 10px; }
.pacing-row {
  display: grid; grid-template-columns: 1fr 220px 200px;
  gap: 12px; align-items: center;
}
.pacing-name {
  font-size: 13px; color: #f1f5f9; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pacing-track {
  position: relative; height: 8px; background: #1f2942;
  border-radius: 4px; overflow: hidden;
}
.pacing-fill {
  height: 100%; border-radius: 4px; transition: width 0.3s;
  background: #34d399;
}
.pacing-fill.over { background: #f87171; }
.pacing-fill.under { background: #fbbf24; }
.pacing-expected {
  position: absolute; top: -2px; bottom: -2px;
  width: 2px; background: #94a3b8; z-index: 2;
}
.pacing-stats { font-size: 11px; color: #cbd5e1; text-align: right; }
.pacing-stats .muted { color: #64748b; }
.pacing-ratio { margin-left: 8px; font-weight: 600; }
.pacing-ratio.over { color: #f87171; }
.pacing-ratio.under { color: #fbbf24; }
.pacing-ratio.ok { color: #34d399; }

/* Funnel */
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel-row { display: flex; flex-direction: column; gap: 4px; }
.funnel-label {
  display: flex; justify-content: space-between; font-size: 11px;
  color: #94a3b8; font-weight: 500;
}
.funnel-drop { color: #f87171; font-variant-numeric: tabular-nums; }
.funnel-bar-wrap { background: #1f2942; border-radius: 4px; height: 28px; }
.funnel-bar {
  height: 100%; border-radius: 4px; transition: width 0.3s;
  display: flex; align-items: center; padding: 0 10px;
  color: #0b1020; font-weight: 600; font-size: 12px;
}
.funnel-value { color: rgba(0,0,0,0.75); }

/* Forecast */
.forecast-list { display: flex; flex-direction: column; gap: 8px; }
.forecast-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; padding: 4px 0; }
.forecast-label { color: #94a3b8; }
.forecast-value { color: #f1f5f9; font-weight: 600; font-variant-numeric: tabular-nums; }
.forecast-progress { height: 6px; background: #1f2942; border-radius: 3px; margin-top: 4px; overflow: hidden; }
.forecast-progress-fill { height: 100%; background: linear-gradient(90deg, #1877f2, #34d399); transition: width 0.3s; }

/* Time of day */
.time-insight { display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 8px; }
.time-best { font-size: 28px; color: #fbbf24; font-weight: 700; font-variant-numeric: tabular-nums; }
.time-sub { font-size: 12px; color: #94a3b8; }
.time-bars { display: flex; gap: 2px; align-items: end; width: 100%; height: 60px; margin-top: 8px; }
.time-bar { flex: 1; background: #1f2942; border-radius: 2px 2px 0 0; min-height: 2px; transition: height 0.3s; }
.time-bar.peak { background: #fbbf24; }

/* Activity */
.activity-list { display: flex; flex-direction: column; gap: 6px; }
.activity-row {
  display: flex; gap: 10px; font-size: 12px;
  padding: 6px 0; border-bottom: 1px solid #1f2942;
}
.activity-row:last-child { border-bottom: none; }
.activity-time { color: #64748b; font-variant-numeric: tabular-nums; min-width: 80px; }
.activity-body { color: #cbd5e1; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-type { font-weight: 600; color: #60a5fa; text-transform: capitalize; }
.activity-target { color: #f1f5f9; }
.activity-actor { color: #64748b; }

/* Audience overlap */
.overlap-list { display: flex; flex-direction: column; gap: 12px; }
.overlap-group { display: flex; flex-direction: column; gap: 6px; }
.overlap-key { font-size: 12px; color: #fbbf24; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.overlap-key .muted { color: #64748b; font-weight: 500; }
.overlap-items { display: flex; flex-wrap: wrap; gap: 6px; }
.overlap-pill {
  background: #1f2942; color: #cbd5e1;
  padding: 4px 10px; border-radius: 12px; font-size: 12px;
}
.overlap-pill.muted { color: #64748b; }
.overlap-size { color: #94a3b8; }

/* Saved views */
.saved-views { position: relative; }
.saved-menu {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: #11182b; border: 1px solid #1f2942; border-radius: 8px;
  min-width: 220px; z-index: 10; box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  padding: 4px;
}
.saved-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px; border-radius: 6px; font-size: 13px; color: #cbd5e1;
}
.saved-row:hover { background: #1a2238; }
.saved-name { flex: 1; cursor: pointer; }
.saved-del {
  background: transparent; border: none; color: #64748b;
  cursor: pointer; font-size: 16px; padding: 0 4px;
}
.saved-del:hover { color: #f87171; }
.saved-empty { color: #64748b; font-size: 12px; padding: 8px; text-align: center; }
.saved-add {
  width: 100%; background: transparent; border: 1px dashed #1f2942;
  color: #60a5fa; padding: 8px; border-radius: 6px; cursor: pointer;
  margin-top: 4px; font-size: 12px;
}
.saved-add:hover { background: #1a2238; }

.trend-legend { font-size: 11px; color: #94a3b8; display: inline-flex; align-items: center; gap: 4px; }
.trend-legend .dash { width: 14px; height: 2px; border-top: 2px dashed; border-color: inherit; }

/* Day of week bars */
.dow-chart { display: flex; align-items: end; gap: 6px; height: 180px; padding: 8px 4px; }
.dow-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: end; }
.dow-bar { width: 100%; background: #1f2942; border-radius: 4px 4px 0 0; min-height: 2px; transition: height 0.3s; }
.dow-bar.peak { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.dow-label { font-size: 11px; color: #94a3b8; }

/* Scatter */
.scatter-svg { width: 100%; height: 280px; }
.scatter-wrap { position: relative; }
.scatter-bubble { cursor: pointer; transition: filter 0.1s; }
.scatter-bubble:hover { filter: brightness(1.3); }
.scatter-tooltip {
  position: absolute; transform: translate(-50%, calc(-100% - 10px));
  background: #0b1020; border: 1px solid #1f2942; border-radius: 8px;
  padding: 10px 12px; font-size: 11px; min-width: 240px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5); pointer-events: none; z-index: 10;
}
.scatter-warn { font-size: 11px; color: #f87171; margin-top: 6px; font-weight: 600; }
.scatter-good { font-size: 11px; color: #34d399; margin-top: 6px; font-weight: 600; }
.scatter-watch { font-size: 11px; color: #fbbf24; margin-top: 6px; font-weight: 600; }
.scatter-tag { font-size: 11px; color: #a855f7; margin-top: 6px; font-weight: 600; }

/* Fatigue info popover */
.fatigue-info { position: relative; display: inline-block; margin-left: 6px; }
.fatigue-info-btn {
  background: transparent; border: none; color: #64748b;
  cursor: pointer; font-size: 12px; padding: 0; font-style: normal;
}
.fatigue-info-btn:hover { color: #60a5fa; }
.fatigue-popover {
  position: absolute; left: 0; top: calc(100% + 6px);
  background: #0b1020; border: 1px solid #1f2942; border-radius: 10px;
  padding: 14px 16px; width: 360px; z-index: 100;
  box-shadow: 0 12px 36px rgba(0,0,0,0.6);
  font-size: 12px; color: #cbd5e1; font-weight: 400;
}
.fp-title { font-size: 13px; color: #f1f5f9; font-weight: 700; margin-bottom: 10px; }
.fp-section { margin-bottom: 12px; }
.fp-section:last-child { margin-bottom: 0; }
.fp-section-head { font-size: 11px; color: #94a3b8; font-weight: 600; margin-bottom: 6px; }
.fp-list { margin: 0; padding-left: 18px; }
.fp-list li { margin-bottom: 3px; line-height: 1.4; }
.fp-list b { color: #f1f5f9; }
.fp-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.fp-table th, .fp-table td { padding: 6px; text-align: left; border-bottom: 1px solid #1f2942; }
.fp-table th { color: #64748b; font-weight: 600; }
.fp-table td.watch { color: #fbbf24; font-weight: 600; }
.fp-table td.warn { color: #f87171; font-weight: 600; }
.fp-note { font-size: 11px; color: #94a3b8; font-style: italic; margin-top: 6px; }
.fp-tip { font-size: 12px; color: #cbd5e1; line-height: 1.5; padding: 8px; background: #11182b; border-radius: 6px; border-left: 3px solid #34d399; }

/* Opportunities */
.opp-list { display: flex; flex-direction: column; gap: 8px; }
.opp-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #cbd5e1; padding: 8px; border-radius: 6px; background: #0b1020; }
.opp-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; }

/* Period compare bars */
.compare-bars { display: flex; flex-direction: column; gap: 12px; }
.compare-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; }
.compare-label { font-size: 12px; color: #94a3b8; }
.compare-bar-group { display: flex; flex-direction: column; gap: 4px; }
.compare-bar-line { display: flex; align-items: center; gap: 8px; }
.compare-bar { height: 12px; border-radius: 3px; transition: width 0.3s; }
.compare-bar.current { background: #60a5fa; }
.compare-bar.prev { background: #475569; }
.compare-val { font-size: 11px; color: #cbd5e1; white-space: nowrap; }
.compare-val.muted { color: #64748b; }
.dot-gray { background: #475569; }

/* Campaign compare picker */
.campaign-compare { display: flex; flex-direction: column; gap: 12px; }
.cc-picker { display: flex; flex-wrap: wrap; gap: 6px; max-height: 140px; overflow-y: auto; padding: 4px; }
.cc-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border: 1px solid #1f2942; border-radius: 16px;
  font-size: 12px; cursor: pointer; color: #cbd5e1;
}
.cc-pill:hover { background: #1a2238; }
.cc-pill.active { background: #1e3a8a33; border-color: #1e40af; color: #60a5fa; }
.cc-pill input { accent-color: #1877f2; }

/* Creatives grid */
.creatives-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.creative-card {
  background: #11182b; border: 1px solid #1f2942; border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column;
}
.creative-img {
  aspect-ratio: 1 / 1; background: #1f2942; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.creative-img img { width: 100%; height: 100%; object-fit: cover; }
.creative-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: 16px 10px 8px; display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 600;
}
.creative-overlay-spend { color: #fff; }
.creative-overlay-ctr { color: #34d399; }
.creative-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.creative-body .name {
  font-size: 13px; color: #f1f5f9; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.creative-stats { font-size: 11px; color: #94a3b8; display: flex; gap: 4px; align-items: center; }
.creative-stats .muted { color: #64748b; }
.creative-stats .num { color: #cbd5e1; font-variant-numeric: tabular-nums; }
.creative-stats .dot { color: #475569; }

.empty-state {
  background: #11182b; border: 1px dashed #1f2942; border-radius: 12px;
  padding: 40px; text-align: center; color: #64748b; font-size: 13px;
}

/* Explorer */
.explorer { display: flex; flex-direction: column; gap: 12px; }
.explorer-form { display: flex; gap: 8px; }
.text-input {
  background: #11182b; border: 1px solid #1f2942;
  color: #e2e8f0; padding: 10px 14px; border-radius: 8px;
  font-size: 13px; font-family: inherit; flex: 1;
}
.text-input.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.text-input:focus { outline: none; border-color: #1877f2; }
.explorer-result {
  background: #11182b; border: 1px solid #1f2942; border-radius: 12px;
  padding: 16px; color: #cbd5e1; font-family: ui-monospace, Consolas, monospace;
  font-size: 12px; line-height: 1.6; overflow: auto; max-height: 70vh; margin: 0;
  white-space: pre-wrap; word-break: break-word;
}

/* Ad Library */
.library { display: flex; flex-direction: column; gap: 16px; }
.library-form { display: flex; gap: 8px; }
.library-form .text-input { max-width: 360px; }
.library-form { align-items: center; flex-wrap: wrap; }
.lib-exact { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #94a3b8; cursor: pointer; white-space: nowrap; }
.lib-exact input { accent-color: #1877f2; }
.lib-note { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #94a3b8; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 24px;
}
.modal {
  background: #11182b; border: 1px solid #1f2942; border-radius: 12px;
  max-width: 560px; width: 100%; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #1f2942;
}
.modal-title { font-size: 14px; color: #f1f5f9; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.modal-title .ad-id { font-size: 11px; color: #64748b; font-family: ui-monospace, Consolas, monospace; }
.modal-controls { display: flex; align-items: center; gap: 8px; }
.modal-controls .btn-ghost { padding: 4px 10px; }
.modal-body { padding: 16px; overflow: auto; display: flex; justify-content: center; background: #0b1020; }
.ad-preview-frame { width: 100%; }
.ad-preview-frame iframe { width: 100% !important; min-height: 540px; border: none; display: block; margin: 0 auto; }

.modal-wide { max-width: 720px; }
.library-actions { display: flex; gap: 6px; margin-top: 4px; }
.library-link { background: transparent; cursor: pointer; }

.lib-detail { display: flex; flex-direction: column; gap: 14px; color: #cbd5e1; }
.lib-detail-section { display: flex; flex-direction: column; gap: 4px; }
.lib-detail-label { font-size: 10px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.lib-detail-title { font-size: 15px; color: #f1f5f9; font-weight: 600; }
.lib-detail-body-text { font-size: 13px; color: #e2e8f0; line-height: 1.5; white-space: pre-wrap; }
.lib-detail-desc, .lib-detail-caption { font-size: 12px; color: #94a3b8; }
.lib-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lib-platforms { display: flex; flex-wrap: wrap; gap: 4px; }
.lib-platform-pill { font-size: 11px; background: #1f2942; padding: 2px 8px; border-radius: 8px; color: #cbd5e1; }
.lib-demo-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.lib-demo-table th, .lib-demo-table td { padding: 4px 8px; text-align: left; border-bottom: 1px solid #1f2942; color: #cbd5e1; }
.lib-demo-table th { color: #64748b; font-weight: 600; font-size: 10px; text-transform: uppercase; }
.lib-detail-note {
  font-size: 11px; color: #94a3b8; padding: 8px 10px;
  background: #11182b; border-left: 3px solid #fbbf24; border-radius: 4px; font-style: italic;
}
.library-form select { max-width: 180px; flex: 0 0 auto; }
.library-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.library-card {
  background: #11182b; border: 1px solid #1f2942; border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.library-page { font-weight: 600; color: #f1f5f9; font-size: 14px; }
.library-body {
  font-size: 13px; color: #cbd5e1;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.library-meta { font-size: 11px; color: #64748b; }
.library-link {
  align-self: flex-start; font-size: 12px; color: #60a5fa;
  border: 1px solid #1f2942; padding: 4px 10px; border-radius: 6px;
}
.library-link:hover { background: #1a2238; text-decoration: none; }
