/* =====================================================================
   RocketAds Analytics — Global Styles
   ===================================================================== */

:root {
  --bg-base: #0f1117;
  --bg-card: #1a1d26;
  --bg-sidebar: #13151f;
  --bg-input: #0f1117;
  --bg-hover: #22263a;
  --bg-active: rgba(99, 102, 241, 0.12);

  --border: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent: #6366f1;
  --accent-hover: #818cf8;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius-card: 12px;
  --radius-btn: 8px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --transition: 0.2s ease;
}

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

html { font-size: 14px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

/* =====================================================================
   Scrollbars
   ===================================================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* =====================================================================
   Sidebar
   ===================================================================== */
#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-icon svg {
  width: 18px;
  height: 18px;
  color: white;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.sidebar-client {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.client-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.client-selector-wrap select,
.client-selector-wrap {
  width: 100%;
}

#client-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text-primary);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  padding-right: 32px;
  transition: border-color var(--transition);
}

#client-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

#client-select option { background: #1a1d26; }

.btn-add-client {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-btn);
  color: var(--accent);
  padding: 7px 10px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  transition: all var(--transition);
}

.btn-add-client:hover {
  background: var(--bg-active);
  border-color: var(--accent);
}

.btn-add-client svg { width: 14px; height: 14px; }

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

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(148,163,184,0.08);
  border: 1px solid rgba(148,163,184,0.12);
  color: var(--text-primary);
  font-weight: 600;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nav-group-toggle:hover {
  background: rgba(148,163,184,0.16);
  border-color: rgba(148,163,184,0.25);
}

.nav-group.has-active .nav-group-toggle {
  background: rgba(99,102,241,0.12);
  border-color: rgba(99,102,241,0.35);
}

.nav-group-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-group-title {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #cbd5f5;
}

.nav-group-toggle .nav-icon {
  width: 16px;
  height: 16px;
  color: #a5b4fc;
}

.nav-chevron {
  width: 16px;
  height: 16px;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.nav-group.collapsed .nav-chevron {
  transform: rotate(-90deg);
}

.nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 4px;
}

.nav-group.collapsed .nav-group-items {
  display: none;
}

.nav-sub-item {
  padding-left: 34px;
  font-size: 0.86rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-item.active {
  color: var(--accent-hover);
  background: var(--bg-active);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

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

.btn-edit-client {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text-secondary);
  padding: 7px 10px;
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  width: 100%;
  transition: all var(--transition);
}

.btn-edit-client:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.btn-edit-client svg { width: 14px; height: 14px; }

/* =====================================================================
   Main content
   ===================================================================== */
#main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* =====================================================================
   Topbar
   ===================================================================== */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

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

.client-badge {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

.topbar-data-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.5);
  min-height: 34px;
}

.topbar-data-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
}

.topbar-data-status-texts {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.topbar-data-status-label {
  font-size: 0.78rem;
  color: var(--text-primary);
  line-height: 1.1;
  white-space: nowrap;
}

.topbar-data-status-detail {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.1;
  white-space: nowrap;
}

.topbar-data-status.is-loading .topbar-data-status-dot,
.topbar-data-status.is-waiting .topbar-data-status-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.topbar-data-status.is-ready .topbar-data-status-dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.topbar-data-status.is-error .topbar-data-status-dot {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
}

.topbar-data-status.is-disconnected .topbar-data-status-dot {
  background: #64748b;
  box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.14);
}

.inline-data-status-host {
  margin: 10px 0 14px;
  min-height: 34px;
}

.last-refresh {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.last-refresh-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.last-refresh-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
  flex-shrink: 0;
}

.last-refresh-status.is-loading::before,
.last-refresh-status.is-waiting::before {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.last-refresh-status.is-ready::before {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.last-refresh-status.is-error::before {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.last-refresh-status.is-disconnected::before {
  background: #64748b;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.14);
}

.btn-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text-secondary);
  padding: 7px 12px;
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-refresh:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-refresh.loading svg { animation: spin 1s linear infinite; }
.btn-refresh svg { width: 14px; height: 14px; }
.btn-refresh:disabled,
.btn-refresh.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
  background: rgba(148,163,184,0.08);
  border-color: rgba(148,163,184,0.25);
}

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}
.btn-logout:hover { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.4); color: #ef4444; }

/* =====================================================================
   Content area
   ===================================================================== */
#content-area {
  padding: 24px;
  flex: 1;
}

/* =====================================================================
   Cards
   ===================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body { padding: 20px; }

/* =====================================================================
   Stat boxes
   ===================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stats-grid.stats-modern {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stats-grid.stats-modern .stat-box {
  flex: 1 1 0;
  min-width: 0;
}
.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform var(--transition);
}

.stat-box:hover { transform: translateY(-1px); }

.stats-modern .stat-box.stat-modern {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(30,41,59,0.65), rgba(15,23,42,0.85));
  border: 1px solid rgba(148,163,184,0.15);
  box-shadow: 0 10px 24px rgba(15,23,42,0.25);
  padding: 14px 16px 12px 16px;
  gap: 8px;
}

.stats-grid.stats-mini {
  gap: 10px;
  margin-top: 8px;
}

.stats-mini .stat-box.stat-modern {
  padding: 10px 12px 10px 12px;
  gap: 6px;
  background: linear-gradient(180deg, rgba(30,41,59,0.5), rgba(15,23,42,0.75));
  border: 1px solid rgba(148,163,184,0.1);
  box-shadow: 0 6px 16px rgba(15,23,42,0.2);
}

.stats-mini .stat-box.stat-modern::before {
  display: none;
}

.stat-box.no-accent::before {
  display: none;
}

.stats-mini .stat-title {
  font-size: 0.68rem;
}

.stats-mini .stat-icon svg {
  width: 13px;
  height: 13px;
}

.stats-mini .stat-pill {
  font-size: 0.56rem;
  padding: 1px 6px;
}

.stats-mini .stat-value {
  font-size: clamp(1.05rem, 2.1vw, 1.3rem);
}

.stats-mini .stat-trend {
  font-size: 0.68rem;
  padding: 2px 6px;
}

.stats-mini .stat-context {
  display: none;
}

.stats-modern .stat-box.stat-modern::before {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 3px;
  background: var(--accent, #6366f1);
  border-radius: 999px;
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent, #6366f1) 40%, transparent);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #e2e8f0;
  font-weight: 600;
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  color: var(--accent, #94a3b8);
  opacity: 0.9;
}

.stat-icon svg {
  width: 15px;
  height: 15px;
}

.stat-pill {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  color: #cbd5f5;
  background: rgba(99,102,241,0.18);
  border: 1px solid rgba(99,102,241,0.25);
}

.stat-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}

.stats-modern .stat-main {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.stats-modern .stat-value {
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.stat-trend {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(148,163,184,0.2);
  white-space: nowrap;
  flex: 0 0 auto;
}

.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }
.stat-trend.neutral { color: var(--text-muted); }

.stat-context {
  font-size: 0.78rem;
  color: #cbd5e1;
}

.stat-context-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 2px;
}

.stat-context-item {
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.14);
}

.stat-context-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.stat-context-item-muted {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.14);
}

.stat-context-label {
  font-size: 0.68rem;
  line-height: 1.1;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.stat-context-value {
  font-size: 0.88rem;
  line-height: 1.2;
  font-weight: 700;
  color: #e2e8f0;
}

.stat-context-trend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.35);
}

.stat-context-trend.up {
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.24);
  background: rgba(16, 185, 129, 0.08);
}

.stat-context-trend.down {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.08);
}

.stat-context-trend.neutral {
  color: var(--text-muted);
}

.stat-spark {
  margin-top: 4px;
  opacity: 0.85;
}

/* KPI filter pills */
.kpi-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kpi-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  max-width: 100%;
}

.donut-card .kpi-filters .period-pill {
  padding: 3px 8px;
  font-size: 0.7rem;
}

.kpi-filters .period-pill {
  white-space: nowrap;
  font-size: 0.7rem;
  padding: 4px 10px;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.stat-change {
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }
.stat-change.neutral { color: var(--text-muted); }

/* =====================================================================
   Charts grid
   ===================================================================== */
.charts-row {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.charts-row.cols-1 { grid-template-columns: 1fr; }
.charts-row.cols-2 { grid-template-columns: 1fr 1fr; }
.charts-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.charts-row.cols-4 { grid-template-columns: 1.05fr 1.05fr 1.1fr 0.8fr; }
.charts-row.cols-3 .chart-card.span-2 { grid-column: span 2; }
.charts-row.cols-3 .chart-card.span-1 { grid-column: span 1; }
.charts-row.cols-4 .chart-card.span-2 { grid-column: span 2; }
.charts-row.cols-4 .chart-card.span-1 { grid-column: span 1; }
.donut-card .chart-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 22px 8px 18px;
}
.donut-card .apexcharts-canvas {
  margin: 0 auto;
}

.placement-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 10px 8px;
}

.placement-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) minmax(140px, 2.2fr) auto;
  gap: 12px;
  align-items: center;
}

.placement-label {
  font-size: 0.78rem;
  color: #cbd5e1;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.placement-bar-wrap {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
}

.placement-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.35);
}

.placement-value {
  font-size: 0.78rem;
  color: #e2e8f0;
  text-align: right;
  min-width: 72px;
}


.funnel-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 16px;
  align-items: end;
  min-height: 220px;
  padding: 8px 6px 2px;
}

.funnel-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.funnel-bar-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
}

.funnel-bar-col {
  width: 64px;
  border-radius: 16px 16px 10px 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bar) 70%, #fff 5%), var(--bar));
  box-shadow: 0 12px 24px rgba(0,0,0,0.25), 0 0 14px color-mix(in srgb, var(--bar) 40%, transparent);
}

.funnel-bar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: #cbd5e1;
  margin-top: 8px;
}

.funnel-bar-icon svg {
  width: 20px;
  height: 20px;
}


.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.donut-card {
  min-height: 340px;
}

.chart-header {
  padding: 14px 20px 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.chart-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #e2e8f0;
  font-weight: 600;
}

.chart-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
}

.chart-title-icon svg {
  width: 14px;
  height: 14px;
}

.chart-body {
  padding: 8px 4px 8px;
}

/* =====================================================================
   Campaign sections
   ===================================================================== */
.campaign-section {
  margin-bottom: 40px;
}

.campaign-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(99,102,241,0.06);
  border-radius: 12px 12px 0 0;
  cursor: pointer;
  text-align: left;
  appearance: none;
  color: inherit;
  font: inherit;
}

.campaign-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.campaign-type-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(99,102,241,0.15);
  color: var(--accent);
  border: 1px solid rgba(99,102,241,0.3);
}

/* =====================================================================
   Period pills
   ===================================================================== */
.period-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}

.period-pill {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.period-pill:hover { border-color: var(--accent); color: var(--accent); }

.period-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* =====================================================================
   Tables
   ===================================================================== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

thead th {
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

thead th:hover { color: var(--text-primary); }
thead th.sort-asc::after { content: ' ↑'; color: var(--accent); }
thead th.sort-desc::after { content: ' ↓'; color: var(--accent); }

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition);
}

tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 9px 14px;
  color: var(--text-primary);
  vertical-align: middle;
}

.td-num { text-align: right; font-variant-numeric: tabular-nums; }

/* Row highlight classes */
.row-warning td:first-child { border-left: 3px solid var(--warning); }
.row-danger td:first-child { border-left: 3px solid var(--danger); }
.row-success td:first-child { border-left: 3px solid var(--success); }

/* =====================================================================
   Score badges
   ===================================================================== */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 24px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.score-badge.high { background: rgba(16,185,129,0.15); color: var(--success); }
.score-badge.medium { background: rgba(245,158,11,0.15); color: var(--warning); }
.score-badge.low { background: rgba(239,68,68,0.15); color: var(--danger); }

/* =====================================================================
   Tabs
   ===================================================================== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 10px 18px;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: -1px;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* =====================================================================
   A/B Test layout
   ===================================================================== */
.ab-test-card {
  background: linear-gradient(180deg, rgba(30,41,59,0.65), rgba(15,23,42,0.85));
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: var(--radius-card);
  margin-bottom: 24px;
  overflow: visible;
  box-shadow: 0 14px 28px rgba(15,23,42,0.25);
}

.ab-test-header {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(148,163,184,0.12);
  background: linear-gradient(90deg, rgba(15,23,42,0.4), rgba(99,102,241,0.08));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.ab-test-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ab-test-header-spacer {
  min-height: 1px;
}

.ab-variant-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ab-variant-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
}

.ab-variant-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.ab-variant-id {
  font-size: 0.7rem;
  color: var(--text-muted);
}

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

.ab-col-header .ab-variant-text {
  align-items: center;
  text-align: center;
}

.ab-test-campaign { font-size: 0.78rem; color: var(--text-muted); }
.ab-test-adgroup { font-size: 0.95rem; font-weight: 600; }

.ab-verdict {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  padding: 4px 0;
  flex-direction: column;
  align-self: start;
  margin-top: 8px;
}

.ab-verdict-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(160px, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 0;
}

.ab-verdict-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.2);
  background: rgba(15,23,42,0.4);
}

.ab-verdict-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ab-verdict-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: rgba(148,163,184,0.8);
}

.ab-verdict-icon svg {
  width: 14px;
  height: 14px;
}

.ab-verdict-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ab-verdict-change {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 800;
}

.ab-verdict-arrow {
  font-size: 0.85rem;
}

.ab-verdict-text {
  font-size: 0.78rem;
  font-weight: 700;
}

.ab-verdict-change.better { color: var(--success); }
.ab-verdict-change.worse { color: var(--danger); }
.ab-verdict-change.neutral { color: var(--text-muted); }
.ab-verdict-change.ab-winner-a { color: #c7d2fe; }
.ab-verdict-change.ab-winner-b { color: #bbf7d0; }
.ab-verdict-change.ab-winner-na { color: var(--text-muted); }

.ab-verdict-winner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  border: 1px solid rgba(148,163,184,0.25);
  background: rgba(15,23,42,0.6);
  color: var(--text-muted);
}

.ab-verdict-winner.ab-winner-a {
  color: #c7d2fe;
  border-color: rgba(99,102,241,0.6);
  background: rgba(99,102,241,0.18);
}

.ab-verdict-winner.ab-winner-b {
  color: #bbf7d0;
  border-color: rgba(16,185,129,0.6);
  background: rgba(16,185,129,0.18);
}

.ab-verdict-winner.ab-winner-na {
  color: var(--text-muted);
  border-color: rgba(148,163,184,0.2);
  background: rgba(15,23,42,0.5);
}

.ab-verdict-traffic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.ab-traffic-lights {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(148,163,184,0.2);
}

.ab-traffic-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0.25;
}

.ab-traffic-dot.red { background: rgba(239,68,68,0.9); }
.ab-traffic-dot.orange { background: rgba(245,158,11,0.9); }
.ab-traffic-dot.green { background: rgba(16,185,129,0.9); }

.ab-traffic-dot.active {
  opacity: 1;
  box-shadow: 0 0 10px rgba(255,255,255,0.25);
}

.ab-traffic-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ab-test-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-width: 0;
  overflow: hidden;
}

.ab-col {
  padding: 20px;
  border-right: 1px solid rgba(148,163,184,0.12);
  min-width: 0;
  overflow: hidden;
}

.ab-col:last-child { border-right: none; }

.ab-diff-toggle {
  display: flex;
  justify-content: center;
  margin: 10px 0 6px;
}

.ab-diff-toggle-btn {
  background: rgba(99,102,241,0.32);
  border: 1px solid rgba(99,102,241,0.7);
  color: #e0e7ff;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(2,6,23,0.45), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.ab-diff-toggle-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(129,140,248,0.85);
  background: rgba(129,140,248,0.45);
  color: #ffffff;
}

.ab-diff-panel {
  margin: 0 20px 20px;
  background: linear-gradient(180deg, rgba(15,23,42,0.78), rgba(15,23,42,0.92));
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: 14px;
  padding: 12px 16px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

.ab-diff-panel.open {
  max-height: 1200px;
  opacity: 1;
}

.ab-diff-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ab-diff-section {
  background: rgba(30,41,59,0.6);
  border: 1px solid rgba(148,163,184,0.14);
  border-radius: 12px;
  padding: 12px;
}

.ab-diff-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.ab-diff-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ab-diff-col-title {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ab-diff-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ab-diff-item {
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.78rem;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(148,163,184,0.2);
}

.ab-diff-item.a {
  border-color: rgba(99,102,241,0.45);
  color: #c7d2fe;
}

.ab-diff-item.b {
  border-color: rgba(16,185,129,0.45);
  color: #bbf7d0;
}

.ab-diff-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 6px 8px;
}

.ab-diff-empty-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 10px 4px;
}

.ab-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.ab-label-a { background: rgba(99,102,241,0.22); color: var(--accent); box-shadow: 0 0 12px rgba(99,102,241,0.2); }
.ab-label-b { background: rgba(16,185,129,0.22); color: var(--success); box-shadow: 0 0 12px rgba(16,185,129,0.2); }

.ab-ad-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.ab-meta { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 16px; }

.ab-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.ab-col { --ab-accent: rgba(99,102,241,0.6); }
.ab-col:last-child { --ab-accent: rgba(16,185,129,0.6); }

.ab-metric {
  position: relative;
  overflow: visible;
  background: linear-gradient(180deg, rgba(30,41,59,0.7), rgba(15,23,42,0.92));
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 12px;
  padding: 10px 12px 12px;
  box-shadow: 0 10px 18px rgba(2,6,23,0.35), inset 0 0 0 1px rgba(255,255,255,0.03);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 104px;
}

.ab-metric::before {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 3px;
  background: var(--ab-accent);
  border-radius: 999px;
  opacity: 0.8;
  box-shadow: 0 0 12px color-mix(in srgb, var(--ab-accent) 40%, transparent);
}

.ab-metric:hover {
  transform: translateY(-1px);
  border-color: rgba(148,163,184,0.35);
  box-shadow: 0 10px 18px rgba(2,6,23,0.45), inset 0 0 0 1px rgba(255,255,255,0.04);
}

.ab-metric .stat-title {
  font-size: 0.62rem;
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ab-metric .stat-value {
  font-size: 1.32rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
}

.ab-metric .stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ab-metric-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
}

.ab-metric-top .stat-title {
  justify-self: start;
}

.ab-metric-top .ab-metric-delta {
  justify-self: end;
}

.ab-metric-top .ab-metric-win {
  justify-self: center;
}

.ab-metric .stat-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
}

.ab-metric-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  color: rgba(148,163,184,0.8);
}

.ab-metric-icon svg {
  width: 14px;
  height: 14px;
}

.ab-metric-delta {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15,23,42,0.7);
  border: 1px solid rgba(148,163,184,0.2);
  white-space: nowrap;
}

.ab-metric-delta.better { color: var(--success); }
.ab-metric-delta.worse { color: var(--danger); }
.ab-metric-delta.neutral { color: var(--text-muted); }

.ab-metric-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ab-metric-win {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15,23,42,0.7);
  border: 1px solid rgba(148,163,184,0.2);
  white-space: nowrap;
}

.ab-metric-win.better { color: var(--success); }
.ab-metric-win.worse { color: var(--danger); }
.ab-metric-win.neutral { color: var(--text-muted); }

.ab-metric-bar {
  flex: 1;
  position: relative;
}

.ab-metric-bar-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(148,163,184,0.12);
  overflow: hidden;
}

.ab-metric-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ab-accent), rgba(255,255,255,0.25));
}

.ab-metric-delta-bar {
  position: relative;
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(148,163,184,0.12);
  border: 1px solid rgba(148,163,184,0.2);
  overflow: hidden;
}

.ab-metric-delta-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(148,163,184,0.35);
  transform: translateX(-1px);
}

.ab-metric-delta-fill {
  position: absolute;
  top: 0;
  bottom: 0;
}

.ab-metric-delta-fill.pos {
  left: 50%;
  background: rgba(99,102,241,0.95);
}

.ab-metric-delta-fill.neg {
  right: 50%;
  background: rgba(16,185,129,0.9);
}

.ab-metric--volume .ab-metric-delta {
  border-color: rgba(148,163,184,0.18);
}

.ab-metric-split {
  flex: 1;
  width: 100%;
  height: 10px;
  min-height: 10px;
  border-radius: 999px;
  background: rgba(148,163,184,0.12);
  overflow: hidden;
  border: 1px solid rgba(148,163,184,0.2);
  display: block;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
  z-index: 0;
}

.ab-metric-split-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  position: relative;
}

.ab-metric-split-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.62rem;
  color: var(--text-muted);
}

.ab-metric-split-kind {
  text-align: center;
  flex: 1;
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ab-split-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ab-split-tag::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.ab-split-a { color: rgba(99,102,241,0.95); }
.ab-split-a::before { background: rgba(99,102,241,0.95); }

.ab-split-b { color: rgba(16,185,129,0.9); }
.ab-split-b::before { background: rgba(16,185,129,0.9); }

.tip {
  position: relative;
  cursor: help;
}

.tip::after {
  content: '';
  display: none;
}

.tip::before {
  content: '';
  display: none;
}

.global-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -100%);
  background: rgba(15, 23, 42, 0.95);
  color: #e2e8f0;
  border: 1px solid rgba(148,163,184,0.35);
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100000;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.global-tooltip.visible {
  opacity: 1;
}

.ab-center { display: none; }

.ab-separator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  color: #cbd5f5;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: radial-gradient(circle at 30% 30%, rgba(99,102,241,0.25), rgba(15,23,42,0.8));
  border: 1px solid rgba(99,102,241,0.35);
  box-shadow: 0 8px 18px rgba(15,23,42,0.35);
}

.ab-diff {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(15,23,42,0.7), rgba(2,6,23,0.9));
  border: 1px solid rgba(148,163,184,0.2);
  box-shadow: 0 8px 16px rgba(2,6,23,0.35);
}

.ab-diff-label { font-size: 0.65rem; color: var(--text-muted); }
.ab-diff-value { font-size: 0.82rem; font-weight: 700; }
.ab-diff-value.better { color: var(--success); }
.ab-diff-value.worse { color: var(--danger); }
.ab-diff-value.neutral { color: var(--text-muted); }

/* =====================================================================
   Keyword analysis cards
   ===================================================================== */
.analysis-section { margin-bottom: 24px; }

.analysis-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.analysis-section-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-danger { background: var(--danger); }
.dot-warning { background: var(--warning); }
.dot-success { background: var(--success); }
.dot-info { background: var(--info); }

/* =====================================================================
   Top cards (headlines best/worst)
   ===================================================================== */
.top-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.top-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.top-card-rank {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.top-card-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.4;
}

.top-card-metrics { display: flex; flex-direction: column; gap: 4px; }

.top-card-metric {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.top-card-metric-label { color: var(--text-muted); }
.top-card-metric-value { color: var(--text-primary); font-weight: 500; }

/* =====================================================================
   Search input
   ===================================================================== */
.search-input-wrap {
  position: relative;
  max-width: 300px;
}

.search-input-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text-primary);
  padding: 8px 10px 8px 32px;
  font-family: inherit;
  font-size: 0.84rem;
  transition: border-color var(--transition);
}

.search-input:focus { outline: none; border-color: var(--border-focus); }
.search-input::placeholder { color: var(--text-muted); }

/* =====================================================================
   Flag button (keywords)
   ===================================================================== */
.btn-flag {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-flag:hover { border-color: var(--warning); color: var(--warning); }
.btn-flag.flagged { background: rgba(245,158,11,0.1); border-color: var(--warning); color: var(--warning); }

/* =====================================================================
   Modal
   ===================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 760px;
  max-width: 95vw;
  max-height: 90vh;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modal-in 0.2s ease;
  display: flex;
  flex-direction: column;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-header h2 { font-size: 1rem; font-weight: 600; }

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.modal-close:hover { color: var(--text-primary); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body {
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  flex-shrink: 0;
}

.modal-footer-right { display: flex; gap: 8px; }

/* =====================================================================
   Forms
   ===================================================================== */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-full { grid-column: 1 / -1; }

@media (min-width: 860px) {
  .modal-body { grid-template-columns: 1fr 1fr; }
}

.form-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.form-label .required {
  color: var(--accent);
  margin-left: 4px;
}

.form-section-title {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
}
.form-section-title:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text-primary);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color var(--transition);
  width: 100%;
}

.form-input:focus { outline: none; border-color: var(--border-focus); }
.form-input::placeholder { color: var(--text-muted); }

.form-hint { font-size: 0.75rem; color: var(--text-muted); }

.oauth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

@media (min-width: 520px) {
  .oauth-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

.oauth-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(148,163,184,0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.oauth-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.oauth-card-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.oauth-card-status.connected {
  color: var(--success);
}

.oauth-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
}

.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active { border-color: white; box-shadow: 0 0 0 3px rgba(255,255,255,0.2); }

/* =====================================================================
   Buttons
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover { background: rgba(239,68,68,0.1); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }

/* =====================================================================
   Toast notifications
   ===================================================================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: white;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  animation: toast-in 0.3s ease;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-info { background: #4f46e5; }
.toast-warning { background: #d97706; }

/* =====================================================================
   Skeleton loading
   ===================================================================== */
.skeleton {
  background: linear-gradient(90deg, #1e2232 25%, #262a3d 50%, #1e2232 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease infinite;
  border-radius: 6px;
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.full { width: 100%; }

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 16px;
}

/* =====================================================================
   Empty state
   ===================================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  gap: 12px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(99,102,241,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.empty-state-icon svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.empty-state-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
}

/* =====================================================================
   Overview
   ===================================================================== */
.overview-welcome {
  max-width: 700px;
  margin: 40px auto;
  text-align: center;
}

.overview-welcome h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.overview-welcome p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.overview-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.overview-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  text-align: left;
}

.overview-stat-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.overview-stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); }

/* =====================================================================
   Adgroup sub-sections
   ===================================================================== */
.adgroup-group {
  margin-bottom: 40px;
}

.adgroup-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: rgba(99,102,241,0.06);
  border-radius: 12px 12px 0 0;
  margin-bottom: 0;
  text-align: left;
  cursor: pointer;
  appearance: none;
  font-family: inherit;
}

.adgroup-section {
  margin-bottom: 30px;
  padding-left: 0;
  border-left: none;
}

.adgroup-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 12px 14px;
  margin-bottom: 0;
  border: 1px solid rgba(99,102,241,0.12);
  background: rgba(255,255,255,0.02);
  border-radius: 10px 10px 0 0;
  text-align: left;
  cursor: pointer;
  appearance: none;
  font-family: inherit;
}

.accordion-toolbar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.accordion-card {
  border-radius: 12px;
}

.accordion-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  margin-right: 8px;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
}

.accordion-summary strong {
  color: var(--text-primary);
  font-weight: 700;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
}

.summary-chip-cost {
  background: rgba(239, 68, 68, 0.08);
  color: #f3b2b2;
}

.summary-chip-cost strong {
  color: #f8caca;
}

.summary-chip-revenue {
  background: rgba(16, 185, 129, 0.08);
  color: #a9e5cf;
}

.summary-chip-revenue strong {
  color: #c8f2e1;
}

.accordion-chevron {
  color: var(--text-muted);
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.accordion-toggle[aria-expanded="true"] .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 16px 0 4px;
}

.campaign-section .accordion-body,
.adgroup-group > .accordion-body,
.adgroup-section .accordion-body {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 12px 12px;
  background: rgba(255,255,255,0.01);
  padding: 16px;
}

/* =====================================================================
   Misc
   ===================================================================== */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }

.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }

.section-divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* =====================================================================
   View Header Row
   ===================================================================== */
.view-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

/* Tab Pills */
.tab-pills {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}
.tab-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}
.tab-pill:hover { color: var(--text-primary); }
.tab-pill.active { background: var(--accent); color: #fff; }

/* Score Badge */
.score-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.score-badge.score-high   { background: rgba(16,185,129,0.15); color: #10b981; }
.score-badge.score-medium { background: rgba(245,158,11,0.15);  color: #f59e0b; }
.score-badge.score-low    { background: rgba(239,68,68,0.15);   color: #ef4444; }

/* Eval Layout */
.eval-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1000px) { .eval-grid { grid-template-columns: 1fr; } }

.eval-block {
  background: linear-gradient(180deg, rgba(30,41,59,0.6), rgba(15,23,42,0.85));
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 22px;
  box-shadow: 0 18px 40px rgba(2,6,23,0.35);
}

.eval-block.eval-block-conv {
  border-color: rgba(45,212,191,0.25);
  box-shadow: 0 18px 40px rgba(2,6,23,0.35);
}

.eval-block.eval-block-biz {
  border-color: rgba(139,92,246,0.3);
}

.eval-block.eval-block-cvr {
  border-color: rgba(16,185,129,0.28);
}

.eval-block.eval-block-cpa {
  border-color: rgba(249,115,22,0.3);
}

.eval-block-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  margin-bottom: 14px;
}

.eval-block-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.02em;
}

.eval-block-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.5;
}

.eval-block .eval-grid {
  margin-bottom: 0;
}

.desc-insight-panel {
  background: linear-gradient(180deg, rgba(30,41,59,0.7), rgba(15,23,42,0.92));
  border: 1px solid rgba(148,163,184,0.22);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 24px;
  box-shadow: 0 20px 50px rgba(2,6,23,0.45);
}

.desc-insight-head {
  text-align: center;
  margin-bottom: 16px;
}

.desc-insight-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.02em;
}

.desc-insight-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

.desc-insight-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.desc-insight-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.desc-insight-actions-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 2px;
}

.desc-insight-chart {
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: 14px;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.desc-health-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.desc-health-chart {
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  position: relative;
}

.desc-health-chart::before {
  content: '';
  position: absolute;
  inset: 12% 14%;
  background: radial-gradient(circle, rgba(56,189,248,0.25), rgba(15,23,42,0) 70%);
  filter: blur(12px);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}

.desc-health-chart .apexcharts-canvas {
  position: relative;
  z-index: 1;
}

.desc-health-chart .apexcharts-series path {
  filter: drop-shadow(0 10px 14px rgba(2,6,23,0.55));
}

.desc-health-chart .apexcharts-series path.apexcharts-pie-area.apexcharts-selected {
  stroke: var(--health-active-color, #38bdf8) !important;
  stroke-width: 3px !important;
  stroke-linejoin: round;
  filter:
    drop-shadow(0 0 6px var(--health-active-color, #38bdf8))
    drop-shadow(0 0 14px var(--health-active-color, #38bdf8))
    drop-shadow(0 10px 18px rgba(2,6,23,0.65)) !important;
}

.desc-health-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.desc-health-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  width: fit-content;
}

.desc-health-legend-item.active {
  background: rgba(148,163,184,0.14);
  color: #e2e8f0;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot-good { background: #10b981; }
.legend-dot-mid { background: #f59e0b; }
.legend-dot-weak { background: #ef4444; }
.legend-dot-low { background: #38bdf8; }

.desc-health-note {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 6px;
  max-width: 260px;
}

.desc-health-list {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(148,163,184,0.2);
}

.desc-health-list-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
}

.desc-health-list-body {
  max-height: 220px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.health-item {
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.health-item-text {
  font-size: 0.76rem;
  color: #e2e8f0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.health-item-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.health-item-kpis span {
  font-size: 0.66rem;
  color: var(--text-secondary);
  background: rgba(148,163,184,0.12);
  border: 1px solid rgba(148,163,184,0.18);
  padding: 2px 6px;
  border-radius: 999px;
}

.health-item-empty {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 4px 0;
  text-align: center;
}

.insight-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 12px;
  padding: 10px 12px;
}

.insight-item.muted { opacity: 0.65; }

.insight-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(15,23,42,0.6);
  color: #e2e8f0;
}

.insight-badge-top {
  background: linear-gradient(90deg, rgba(16,185,129,0.9), rgba(34,197,94,0.85));
  color: #0f172a;
  border-color: rgba(16,185,129,0.6);
}

.insight-badge-risk {
  background: linear-gradient(90deg, rgba(239,68,68,0.95), rgba(249,115,22,0.85));
  color: #fff;
  border-color: rgba(239,68,68,0.6);
}

.insight-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f8fafc;
}

.insight-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.insight-metric {
  text-align: right;
  min-width: 110px;
}

.insight-metric-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.insight-metric-value {
  font-size: 0.9rem;
  font-weight: 800;
  color: #f8fafc;
}

@media (max-width: 1100px) {
  .desc-insight-grid {
    grid-template-columns: 1fr;
  }
}

.title-badge-click {
  background: linear-gradient(90deg, rgba(56,189,248,0.95), rgba(59,130,246,0.85));
  color: #0f172a;
  border-color: rgba(56,189,248,0.6);
  text-shadow: none;
}

.title-badge-biz {
  background: linear-gradient(90deg, rgba(139,92,246,0.95), rgba(99,102,241,0.85));
  color: #0f172a;
  border-color: rgba(139,92,246,0.6);
  text-shadow: none;
}

.title-badge-biz-worst {
  background: linear-gradient(90deg, rgba(239,68,68,0.95), rgba(139,92,246,0.85));
  color: #fff;
  border-color: rgba(239,68,68,0.6);
  text-shadow: none;
}

.title-badge-cvr {
  background: linear-gradient(90deg, rgba(16,185,129,0.95), rgba(52,211,153,0.85));
  color: #0f172a;
  border-color: rgba(16,185,129,0.6);
  text-shadow: none;
}

.title-badge-cvr-worst {
  background: linear-gradient(90deg, rgba(239,68,68,0.95), rgba(16,185,129,0.85));
  color: #fff;
  border-color: rgba(239,68,68,0.6);
  text-shadow: none;
}

.title-badge-cpa {
  background: linear-gradient(90deg, rgba(245,158,11,0.95), rgba(249,115,22,0.85));
  color: #0f172a;
  border-color: rgba(245,158,11,0.6);
  text-shadow: none;
}

.title-badge-cpa-worst {
  background: linear-gradient(90deg, rgba(239,68,68,0.95), rgba(245,158,11,0.85));
  color: #fff;
  border-color: rgba(239,68,68,0.6);
  text-shadow: none;
}

.eval-cards-section { margin-bottom: 28px; }
.eval-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.eval-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.eval-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.eval-card-good { border-left: 3px solid var(--success); }
.eval-card-bad  { border-left: 3px solid var(--danger); }
.eval-card-rank {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.eval-card-name {
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.eval-card-metrics {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.eval-card-metrics b { color: var(--text-primary); }

.desc-toplist {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.desc-toprow {
  background: linear-gradient(180deg, rgba(30,41,59,0.75), rgba(15,23,42,0.9));
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(2,6,23,0.35);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.desc-toprow:hover {
  transform: translateY(-2px);
  border-color: rgba(148,163,184,0.28);
  box-shadow: 0 16px 40px rgba(2,6,23,0.45);
}

.desc-toprow-bad {
  border-color: rgba(239,68,68,0.25);
}

.desc-toprow-bad:hover {
  border-color: rgba(239,68,68,0.45);
}

.desc-score {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(148,163,184,0.14);
  border-radius: 12px;
  padding: 12px;
  align-items: center;
  text-align: center;
}

.desc-score-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.desc-score-value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.desc-score-value.score-high { color: #10b981; }
.desc-score-value.score-medium { color: #f59e0b; }
.desc-score-value.score-low { color: #ef4444; }
.desc-score-value.metric { color: #e2e8f0; }

.desc-score-bar {
  width: 100%;
  height: 8px;
  background: rgba(148,163,184,0.14);
  border-radius: 999px;
  overflow: hidden;
}

.desc-score-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #10b981);
  border-radius: 999px;
  transition: width var(--transition);
}

.desc-score-bar.bad span {
  background: linear-gradient(90deg, #f97316, #ef4444);
}

.desc-score-bar.biz span {
  background: linear-gradient(90deg, #8b5cf6, #6366f1);
}

.desc-score-bar.cvr span {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.desc-score-bar.cpa span {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.desc-score-bar.muted span {
  background: rgba(148,163,184,0.3);
}

.desc-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.desc-title-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.desc-toprank {
  font-size: 0.72rem;
  color: #e2e8f0;
  font-weight: 700;
  background: rgba(56,189,248,0.18);
  border: 1px solid rgba(56,189,248,0.35);
  padding: 2px 8px;
  border-radius: 999px;
}

.desc-toptext {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.desc-topmetrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.metric-item {
  background: rgba(148,163,184,0.08);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
}

.metric-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.metric-value {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-copy-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(148,163,184,0.1);
  border: 1px solid rgba(148,163,184,0.2);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-copy-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-copy-icon svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 900px) {
  .desc-toprow {
    grid-template-columns: 1fr;
  }
  .desc-topmetrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.chart-tooltip {
  background: rgba(15,23,42,0.95);
  color: #e2e8f0;
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.75rem;
  max-width: 260px;
}

.chart-tooltip b { color: #fff; }

.desc-top-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  margin: 14px 0 20px;
  padding: 6px 0 10px;
  color: #f8fafc;
  letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(56,189,248,0.35);
  text-shadow: 0 6px 20px rgba(56,189,248,0.25);
}

.title-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(15,23,42,0.6);
  color: #e2e8f0;
  box-shadow: 0 8px 20px rgba(2,6,23,0.35);
}

.title-badge svg {
  width: 12px;
  height: 12px;
}

.title-badge-top {
  background: linear-gradient(90deg, rgba(250,204,21,0.9), rgba(251,191,36,0.7));
  color: #1e293b;
  border-color: rgba(250,204,21,0.6);
  text-shadow: none;
}

.title-badge-worst {
  background: linear-gradient(90deg, rgba(239,68,68,0.95), rgba(249,115,22,0.85));
  color: #fff;
  border-color: rgba(239,68,68,0.6);
  text-shadow: none;
}

.title-badge-conv {
  background: linear-gradient(90deg, rgba(45,212,191,0.95), rgba(56,189,248,0.85));
  color: #0f172a;
  border-color: rgba(45,212,191,0.6);
  text-shadow: none;
}

.title-badge-conv-worst {
  background: linear-gradient(90deg, rgba(248,113,113,0.95), rgba(45,212,191,0.85));
  color: #0f172a;
  border-color: rgba(248,113,113,0.6);
  text-shadow: none;
}

/* Table Extensions */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.table-search {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 7px 12px;
  font-size: 0.85rem;
  width: 240px;
  outline: none;
  transition: border-color var(--transition);
}
.table-search:focus { border-color: var(--accent); }
.table-count { font-size: 0.8rem; color: var(--text-muted); }
.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.data-table thead { background: rgba(255,255,255,0.03); }
.data-table th {
  padding: 10px 12px;
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--text-primary); }
.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary);
  white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.025); }
.td-headline {
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary) !important;
}
.td-small {
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-good td    { background: rgba(16,185,129,0.04); }
.row-warning td { background: rgba(245,158,11,0.06); }
.row-danger td  { background: rgba(239,68,68,0.06); }
.row-flagged td { background: rgba(239,68,68,0.1); }
.overview-campaigns-table th.td-num,
.overview-campaigns-table td.td-num {
  text-align: center;
}
.overview-campaigns-table td:first-child,
.overview-campaigns-table th:first-child {
  text-align: left;
}
.overview-campaigns-table .row-good td:first-child { border-left: 3px solid var(--success); }

/* KW Legend */
.kw-legend {
  display: flex;
  gap: 12px;
  margin-left: auto;
  flex-wrap: wrap;
}
.legend-item {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
}
.legend-good    { background: rgba(16,185,129,0.1);  color: #10b981; }
.legend-warning { background: rgba(245,158,11,0.1);  color: #f59e0b; }
.legend-danger  { background: rgba(239,68,68,0.1);   color: #ef4444; }

/* Flag Button */
.btn-flag {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.4;
  transition: opacity var(--transition);
  padding: 2px 4px;
}
.btn-flag:hover, .btn-flag.flagged { opacity: 1; }

/* Analysis Sections */
.analysis-section { margin-bottom: 28px; }
.analysis-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px 10px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
}
.analysis-section-header.warning { background: rgba(245,158,11,0.07); border-color: rgba(245,158,11,0.2); }
.analysis-section-header.danger  { background: rgba(239,68,68,0.07);  border-color: rgba(239,68,68,0.2); }
.analysis-section-header.success { background: rgba(16,185,129,0.07); border-color: rgba(16,185,129,0.2); }
.asi-icon  { font-size: 1.4rem; }
.asi-title { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.asi-desc  { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.analysis-empty {
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0 0 10px 10px;
  background: var(--bg-card);
}
.analysis-section .table-wrap { border-radius: 0 0 10px 10px; border-top: none; }

/* Overview */
.overview-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 16px;
}
.welcome-icon    { color: var(--accent); opacity: 0.7; }
.welcome-title   { font-size: 1.8rem; font-weight: 700; }
.welcome-subtitle { color: var(--text-muted); max-width: 420px; line-height: 1.6; }
.btn-lg          { padding: 12px 24px; font-size: 0.95rem; }
.overview-header { margin-bottom: 24px; }
.overview-header h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.overview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.overview-nav-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}
.overview-nav-card:hover {
  border-color: rgba(99,102,241,0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.onc-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.onc-icon svg { width: 20px; height: 20px; }
.onc-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.onc-desc  { font-size: 0.78rem; color: var(--text-muted); }

/* Loading message */
.loading-msg {
  padding: 60px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Inline loading */
.form-label.has-loader {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.loading-inline {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.14);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-left: 6px;
}
.loading-inline svg {
  width: 12px;
  height: 12px;
  color: var(--accent);
}

/* Spin */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.spin { animation: spin 1s linear infinite; }

/* Summary & Actions */
.summary-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.summary-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
}

.summary-title {
  margin: 6px 0 4px;
  font-size: 1.4rem;
  color: var(--text-primary);
}

.summary-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.summary-range {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(148,163,184,0.08);
  border: 1px solid rgba(148,163,184,0.18);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.summary-column-title {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #cbd5f5;
  margin-bottom: 10px;
}

.summary-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-card {
  background: linear-gradient(180deg, rgba(30,41,59,0.65), rgba(15,23,42,0.95));
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 10px 16px rgba(2,6,23,0.35);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.summary-card:hover {
  transform: translateY(-1px);
  border-color: rgba(148,163,184,0.35);
}

.summary-card-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.summary-card-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.summary-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.summary-action {
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.3);
  color: #e0e7ff;
  font-size: 0.75rem;
  cursor: pointer;
}

.summary-card.is-done {
  border-color: rgba(16,185,129,0.6);
  box-shadow: 0 0 0 1px rgba(16,185,129,0.35);
}

.summary-card.is-ignored {
  border-color: rgba(148,163,184,0.45);
  opacity: 0.6;
}

.summary-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(148,163,184,0.25);
}

.summary-placeholder {
  border: 1px dashed rgba(148,163,184,0.25);
  border-radius: 14px;
  padding: 20px;
  color: var(--text-muted);
}

.summary-placeholder-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

/* Summary Overview */
.summary-overview-header {
  margin-bottom: 12px;
}

.summary-overview-pills {
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.summary-overview {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.summary-overview-note {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(148,163,184,0.35);
  color: var(--text-muted);
  font-size: 0.88rem;
}

.summary-overview-status-slot {
  margin-bottom: 2px;
}

.summary-overview-status-slot.inline {
  margin-bottom: 0;
  margin-left: auto;
  flex: 0 1 420px;
  min-width: 220px;
}

.summary-overview-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(56,189,248,0.18);
  background: rgba(15,23,42,0.78);
  color: #cbd5e1;
}

.summary-overview-status.is-ready {
  border-color: rgba(34,197,94,0.22);
}

.summary-overview-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #38bdf8;
  box-shadow: 0 0 0 6px rgba(56,189,248,0.12);
  flex: 0 0 auto;
}

.summary-overview-status.is-retrying .summary-overview-status-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 6px rgba(245,158,11,0.12);
}

.summary-overview-status.is-ready .summary-overview-status-dot {
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34,197,94,0.12);
}

.summary-overview-status-text {
  font-size: 12px;
  line-height: 1.35;
}

.summary-overview-charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.summary-overview-chart-card {
  background: linear-gradient(180deg, rgba(30,41,59,0.6), rgba(15,23,42,0.95));
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 8px 16px rgba(2,6,23,0.28);
}

.summary-overview-chart-title {
  font-size: 0.8rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.summary-overview-chart {
  min-height: 250px;
}

.summary-overview-chart-empty {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.apexcharts-tooltip {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(148,163,184,0.28) !important;
  box-shadow: 0 10px 24px rgba(2,6,23,0.45) !important;
}

.apexcharts-tooltip-title {
  background: rgba(30,41,59,0.9) !important;
  border-bottom: 1px solid rgba(148,163,184,0.22) !important;
  color: #e2e8f0 !important;
}

.apexcharts-tooltip-series-group {
  background: transparent !important;
  color: #e2e8f0 !important;
}

.apexcharts-tooltip-text,
.apexcharts-tooltip-text-y-label,
.apexcharts-tooltip-text-y-value,
.apexcharts-tooltip-text-z-label,
.apexcharts-tooltip-text-z-value,
.apexcharts-tooltip-text-x-label {
  color: #e2e8f0 !important;
}

.summary-overview-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.summary-kpi-row {
  display: grid;
  grid-template-columns: minmax(116px, 146px) repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.summary-kpi-row + .summary-kpi-row {
  margin-top: 14px;
}

.summary-logo-card {
  background: linear-gradient(180deg, rgba(30,41,59,0.62), rgba(15,23,42,0.96));
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 118px;
  align-items: center;
  text-align: center;
  box-shadow: 0 10px 18px rgba(2,6,23,0.35);
}

.summary-logo-badge {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: transparent;
  color: #e0e7ff;
}

.summary-logo-icon svg {
  width: 42px;
  height: 42px;
}

.summary-logo-svg {
  width: 42px;
  height: 42px;
  display: block;
}

.summary-logo-image {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}

.summary-logo-letter {
  font-size: 1.1rem;
}

.summary-logo-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.15;
  text-align: center;
}

.summary-logo-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.15;
  text-align: center;
}

.summary-logo-status {
  margin-top: auto;
  font-size: 0.76rem;
  color: #fbbf24;
  text-align: center;
}

.summary-kpi-card {
  background: linear-gradient(180deg, rgba(30,41,59,0.6), rgba(15,23,42,0.95));
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 14px;
  padding: 12px 14px;
  position: relative;
  box-shadow: 0 8px 16px rgba(2,6,23,0.3);
}

.summary-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: var(--kpi-accent, rgba(148,163,184,0.35));
  opacity: 0.7;
}

.summary-kpi-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-kpi-icon svg {
  width: 16px;
  height: 16px;
}

.summary-kpi-value {
  margin-top: 8px;
  font-size: 1.28rem;
  font-weight: 600;
  color: var(--text-primary);
}

.summary-kpi-sub {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.summary-kpi-card.is-empty .summary-kpi-value,
.summary-kpi-card.is-empty .summary-kpi-sub {
  color: #94a3b8;
}

.summary-kpi-card.is-na .summary-kpi-value {
  color: #e2e8f0;
}

@media (max-width: 1100px) {
  .summary-overview-status-slot.inline {
    margin-left: 0;
    flex-basis: 100%;
    min-width: 0;
  }

  .summary-overview-charts {
    grid-template-columns: 1fr;
  }

  .summary-kpi-row {
    grid-template-columns: minmax(160px, 1fr);
  }
}

/* UX/UI Audit */
.ux-header {
  margin-bottom: 12px;
}

.ux-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
}

.ux-title {
  margin: 6px 0 4px;
  font-size: 1.4rem;
  color: var(--text-primary);
}

.ux-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.ux-form {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.ux-url-chip {
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(148,163,184,0.12);
  border: 1px solid rgba(148,163,184,0.25);
  color: #e2e8f0;
  font-size: 0.85rem;
}

.ux-empty {
  background: rgba(148,163,184,0.08);
  border: 1px dashed rgba(148,163,184,0.28);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.ux-empty-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.ux-empty-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.ux-score-card {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.35);
  margin-bottom: 14px;
}

.ux-score-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #cbd5f5;
}

.ux-score-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #e0e7ff;
}

.ux-score-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ux-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ux-check {
  background: linear-gradient(180deg, rgba(30,41,59,0.65), rgba(15,23,42,0.95));
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 12px;
  padding: 12px;
}

.ux-check.ok { border-color: rgba(16,185,129,0.5); }
.ux-check.warn { border-color: rgba(245,158,11,0.5); }
.ux-check.fail { border-color: rgba(239,68,68,0.5); }

.ux-check-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.ux-check-title {
  font-weight: 600;
  color: var(--text-primary);
}

.ux-check-status {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.ux-check-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

/* Eshop / Shoptet */
.eshop-header {
  margin-bottom: 16px;
}

.eshop-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
}

.eshop-title {
  margin: 6px 0 4px;
  font-size: 1.4rem;
  color: var(--text-primary);
}

.eshop-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.eshop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.eshop-card {
  background: linear-gradient(180deg, rgba(30,41,59,0.65), rgba(15,23,42,0.95));
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 14px;
  padding: 16px;
}

.eshop-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.eshop-card-title {
  font-weight: 600;
  color: var(--text-primary);
}

.eshop-card-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.eshop-card-actions {
  display: flex;
  gap: 8px;
}

.eshop-upload {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.eshop-upload input[type="file"] {
  color: var(--text-muted);
}

.eshop-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.eshop-stat {
  background: rgba(148,163,184,0.08);
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 160px;
}

.eshop-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 4px;
}

.eshop-stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.eshop-empty {
  background: rgba(148,163,184,0.08);
  border: 1px dashed rgba(148,163,184,0.28);
  border-radius: 12px;
  padding: 12px;
}

.eshop-empty-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.eshop-empty-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.eshop-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.eshop-tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.2);
  background: rgba(148,163,184,0.08);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
}

.eshop-tab.active {
  background: rgba(99,102,241,0.18);
  border-color: rgba(99,102,241,0.6);
  color: #e0e7ff;
}

.eshop-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 1100px) {
  .eshop-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.eshop-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}

@media (max-width: 1100px) {
  .eshop-chart-grid {
    grid-template-columns: 1fr;
  }
}

.eshop-footnote {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.eshop-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eshop-status-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.eshop-status-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.16);
  background: rgba(15, 23, 42, 0.42);
}

.eshop-status-card.tone-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.18);
}

.eshop-status-card.tone-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.18);
}

.eshop-status-card.tone-danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
}

.eshop-status-card-label {
  font-size: 0.74rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.eshop-status-card-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.eshop-status-card-meta {
  margin-top: 4px;
  font-size: 0.84rem;
  color: #cbd5e1;
}

.eshop-status-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eshop-status-section {
  margin-bottom: 14px;
}

.eshop-status-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.eshop-status-section-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.18);
  font-size: 1rem;
}

.eshop-status-section-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.eshop-status-row {
  position: relative;
  overflow: hidden;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(148,163,184,0.08);
  border: 1px solid rgba(148,163,184,0.16);
}

.eshop-status-row.tone-success {
  border-color: rgba(16, 185, 129, 0.18);
}

.eshop-status-row.tone-warning {
  border-color: rgba(245, 158, 11, 0.18);
}

.eshop-status-row.tone-danger {
  border-color: rgba(239, 68, 68, 0.18);
}

.eshop-status-main,
.eshop-status-metrics {
  position: relative;
  z-index: 1;
}

.eshop-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.9fr);
  gap: 14px;
  align-items: center;
}

.eshop-status-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

.eshop-status-sub {
  margin-top: 4px;
  font-size: 0.82rem;
  color: #94a3b8;
}

.eshop-status-metrics {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
}

.eshop-status-metric {
  text-align: right;
}

.eshop-status-metric-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 4px;
}

.eshop-status-metric strong {
  color: var(--text-primary);
}

.eshop-status-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255,255,255,0.03);
}

.eshop-status-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(99,102,241,0.95), rgba(56,189,248,0.95));
}

.eshop-empty {
  padding: 14px;
  border-radius: 12px;
  background: rgba(148,163,184,0.06);
  border: 1px dashed rgba(148,163,184,0.18);
  color: #94a3b8;
}

.eshop-row {
  display: grid;
  grid-template-columns: 1.6fr 0.7fr 0.9fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(148,163,184,0.08);
  border: 1px solid rgba(148,163,184,0.2);
}

.eshop-row.eshop-head {
  background: rgba(148,163,184,0.12);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  font-weight: 600;
}

.weekday-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.weekday-kpi {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.14);
}

.weekday-kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 6px;
}

.weekday-kpi-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.weekday-kpi-sub {
  margin-top: 4px;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.weekday-table {
  margin-top: 10px;
}

@media (max-width: 1100px) {
  .eshop-status-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eshop-status-row {
    grid-template-columns: 1fr;
  }

  .eshop-status-metrics {
    justify-content: flex-start;
  }

  .weekday-kpis {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .eshop-status-summary {
    grid-template-columns: 1fr;
  }
}

.eshop-products-grid,
.eshop-products-grid-modern {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.eshop-product-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.eshop-product-kpi {
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.eshop-product-kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 8px;
}

.eshop-product-kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #f8fafc;
}

.eshop-product-kpi-sub {
  margin-top: 4px;
  font-size: 0.78rem;
  color: #cbd5e1;
}

.eshop-products-table {
  display: grid;
  gap: 10px;
}

.eshop-products-head,
.eshop-product-row {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) 150px 130px 140px 170px;
  gap: 14px;
  align-items: center;
}

.eshop-products-head {
  padding: 0 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.eshop-products-head > div:first-child {
  text-align: left;
}

.eshop-products-head > div:not(:first-child) {
  text-align: center;
}

.eshop-product-row {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.eshop-product-main {
  min-width: 0;
}

.eshop-product-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
}

.eshop-product-meta {
  margin-top: 4px;
  font-size: 0.78rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eshop-product-cell {
  color: #e2e8f0;
  text-align: center;
}

.eshop-product-cell.is-number {
  font-weight: 700;
  color: #f8fafc;
}

.eshop-product-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.16);
  border: 1px solid rgba(99, 102, 241, 0.24);
  font-weight: 700;
  color: #dbe4ff;
}

.eshop-share-cell {
  display: grid;
  gap: 6px;
}

.eshop-share-value {
  text-align: center;
  font-size: 0.83rem;
  font-weight: 700;
  color: #e2e8f0;
}

.eshop-share-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.eshop-share-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c6cff, #22d3ee);
}

.eshop-strongest-grid,
.eshop-strong-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.eshop-strong-card {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.94));
  border: 1px solid rgba(99, 102, 241, 0.18);
}

.eshop-strong-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.eshop-strong-rank {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a5b4fc;
  margin-bottom: 6px;
}

.eshop-strong-name {
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
}

.eshop-strong-meta {
  margin-top: 4px;
  font-size: 0.78rem;
  color: #94a3b8;
}

.eshop-strong-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #86efac;
  font-size: 0.72rem;
  font-weight: 700;
}

.eshop-strong-metrics {
  display: grid;
  gap: 8px;
}

.eshop-strong-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
  color: #cbd5e1;
}

.eshop-strong-metric strong {
  font-size: 0.92rem;
  color: #f8fafc;
}

@media (max-width: 1100px) {
  .eshop-products-grid,
  .eshop-products-grid-modern,
  .eshop-strongest-grid,
  .eshop-strong-grid {
    grid-template-columns: 1fr;
  }

  .eshop-product-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eshop-products-head,
  .eshop-product-row {
    grid-template-columns: minmax(0, 1.5fr) 110px 100px 110px 130px;
  }
}

@media (max-width: 760px) {
  .eshop-product-kpis {
    grid-template-columns: 1fr;
  }

  .eshop-products-head {
    display: none;
  }

  .eshop-product-row {
    grid-template-columns: 1fr;
  }

  .eshop-product-cell.is-number,
  .eshop-share-value {
    text-align: left;
  }
}

.eshop-section-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* GSC Overview Dashboard */
.gsc-header {
  margin-bottom: 10px;
}

.gsc-periods {
  margin-bottom: 14px;
}

.gsc-kpi-sticky {
  position: relative;
  top: 0;
  z-index: 1;
  margin-bottom: 14px;
}

.gsc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.gsc-kpi-card {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.88));
  padding: 10px 12px;
}

.gsc-kpi-card.is-breakdown .gsc-kpi-head {
  margin-bottom: 4px;
}

.gsc-kpi-card.is-breakdown .gsc-kpi-label {
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  color: #c6d4ea;
}

.gsc-kpi-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.gsc-kpi-label {
  color: #a7b3c9;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gsc-kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
  margin-top: 2px;
}

.gsc-kpi-sub {
  margin-top: 2px;
  font-size: 0.67rem;
  color: #94a3b8;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gsc-kpi-bars {
  margin-top: 10px;
  display: grid;
  gap: 4px;
}

.gsc-kpi-bar-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: center;
}

.gsc-kpi-bar-label {
  font-size: 0.62rem;
  color: #a7b3c9;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.gsc-kpi-bar-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.gsc-kpi-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.gsc-kpi-bar-value {
  text-align: right;
  font-size: 0.63rem;
  color: #cbd5e1;
  font-weight: 700;
}

.gsc-kpi-delta {
  font-size: 0.78rem;
  font-weight: 700;
}

.gsc-kpi-delta.is-up {
  color: #22c55e;
}

.gsc-kpi-delta.is-down {
  color: #ef4444;
}

.gsc-kpi-delta.is-neutral {
  color: #94a3b8;
}

.gsc-kpi-spark {
  height: 44px;
  margin-top: 4px;
  overflow: hidden;
}

.gsc-spark-svg {
  display: block;
  width: 100%;
  height: 42px;
  shape-rendering: geometricPrecision;
}

.gsc-main-chart-card {
  margin-bottom: 0;
}

.gsc-main-chart-header {
  gap: 12px;
  flex-wrap: wrap;
}

.gsc-main-chart {
  min-height: 360px;
}

.gsc-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 14px;
  margin-bottom: 14px;
}

.gsc-chart-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gsc-toggle {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.22);
  padding: 3px;
}

.gsc-toggle button {
  border: 0;
  background: transparent;
  color: #a7b3c9;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.gsc-toggle button.active {
  background: rgba(99, 102, 241, 0.24);
  color: #dbeafe;
}

.gsc-segment-select {
  min-width: 180px;
  max-width: 230px;
}

.gsc-insight-panel {
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: linear-gradient(145deg, rgba(8, 47, 73, 0.4), rgba(15, 23, 42, 0.85));
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 0;
}

.gsc-insight-title {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7dd3fc;
  margin-bottom: 8px;
  font-weight: 700;
}

.gsc-insight-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  color: #dbeafe;
  display: grid;
  gap: 8px;
}

.gsc-insight-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.42);
}

.gsc-insight-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 800;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.65);
}

.gsc-insight-body {
  min-width: 0;
}

.gsc-insight-kicker {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 2px;
}

.gsc-insight-text {
  font-size: 0.82rem;
  line-height: 1.35;
  color: #dbeafe;
}

.gsc-insight-item.is-positive {
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(20, 83, 45, 0.24);
}

.gsc-insight-item.is-positive .gsc-insight-icon {
  border-color: rgba(34, 197, 94, 0.55);
  color: #86efac;
  background: rgba(22, 101, 52, 0.35);
}

.gsc-insight-item.is-positive .gsc-insight-kicker {
  color: #86efac;
}

.gsc-insight-item.is-risk {
  border-color: rgba(239, 68, 68, 0.38);
  background: rgba(127, 29, 29, 0.24);
}

.gsc-insight-item.is-risk .gsc-insight-icon {
  border-color: rgba(239, 68, 68, 0.58);
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.35);
}

.gsc-insight-item.is-risk .gsc-insight-kicker {
  color: #fca5a5;
}

.gsc-insight-item.is-info {
  border-color: rgba(59, 130, 246, 0.38);
  background: rgba(30, 64, 175, 0.2);
}

.gsc-insight-item.is-info .gsc-insight-icon {
  border-color: rgba(59, 130, 246, 0.58);
  color: #93c5fd;
  background: rgba(30, 64, 175, 0.3);
}

.gsc-insight-item.is-info .gsc-insight-kicker {
  color: #93c5fd;
}

.gsc-quick-row {
  margin-bottom: 14px;
}

.gsc-quick-row .card {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.gsc-quick-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 0 10px 0;
  border: 0;
  background: transparent;
}

.gsc-quick-row .card-body {
  padding: 0;
}

.gsc-card-title-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gsc-title-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}

.gsc-title-icon svg {
  width: 13px;
  height: 13px;
}

.gsc-title-icon.is-up {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.08);
}

.gsc-title-icon.is-down {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

.gsc-pos-delta {
  color: #94a3b8;
  font-size: 0.75rem;
}

.gsc-quick-row-item {
  transition: background-color 0.16s ease;
}

.gsc-quick-row-item.is-up td:first-child {
  box-shadow: inset 2px 0 0 rgba(34, 197, 94, 0.35);
}

.gsc-quick-row-item.is-down td:first-child {
  box-shadow: inset 2px 0 0 rgba(239, 68, 68, 0.35);
}

.gsc-delta-cell {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gsc-delta-chip,
.gsc-pos-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  line-height: 1.3;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
}

.gsc-num-main {
  display: inline-block;
  margin-right: 0;
}

.gsc-num-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.15;
}

.gsc-mini-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  vertical-align: middle;
  opacity: 0.95;
}

.gsc-mini-delta.is-up {
  color: #22c55e;
}

.gsc-mini-delta.is-down {
  color: #ef4444;
}

.gsc-mini-delta.is-neutral {
  color: #94a3b8;
}

.gsc-chip-icon {
  font-size: 0.6rem;
  opacity: 0.95;
}

.gsc-delta-chip.is-up,
.gsc-pos-chip.is-up {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.08);
  color: #86efac;
}

.gsc-delta-chip.is-down,
.gsc-pos-chip.is-down {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}

.gsc-delta-chip.is-neutral,
.gsc-pos-chip.is-neutral {
  border-color: var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
}

.gsc-quick-row .data-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.gsc-quick-row .data-table thead {
  background: rgba(255,255,255,0.03);
}

.gsc-quick-row .data-table .gsc-col-impr {
  width: 90px;
}

.gsc-quick-row .data-table .gsc-col-clicks {
  width: 88px;
}

.gsc-quick-row .data-table .gsc-col-pos {
  width: 78px;
}

.gsc-quick-row .data-table .gsc-col-delta {
  width: 180px;
}

.gsc-quick-row .data-table th,
.gsc-quick-row .data-table td {
  text-align: center;
  vertical-align: middle;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary);
  white-space: nowrap;
}

.gsc-quick-row .data-table th {
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.gsc-quick-row .data-table tr:last-child td {
  border-bottom: none;
}

.gsc-quick-row .data-table tr:hover td {
  background: rgba(255,255,255,0.025);
}

.gsc-quick-row .data-table th:first-child,
.gsc-quick-row .data-table td:first-child {
  text-align: left;
}

.gsc-quick-row .data-table .td-num {
  text-align: center;
}

.gsc-cell-label {
  max-width: 0;
}

.gsc-label-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gsc-ellipsis-label {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gsc-copy-btn {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: #cbd5e1;
  cursor: pointer;
  opacity: 0.72;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.gsc-copy-btn svg {
  width: 13px;
  height: 13px;
}

.gsc-quick-row .data-table tr:hover .gsc-copy-btn,
.gsc-copy-btn:focus-visible {
  opacity: 1;
  border-color: rgba(96, 165, 250, 0.62);
  color: #f8fafc;
  outline: none;
}

.gsc-copy-btn:hover {
  background: rgba(59, 130, 246, 0.2);
}

/* GSC Queries Dashboard */
.gscq-period-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.gscq-open-winners-btn {
  border-color: rgba(99, 102, 241, 0.36);
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.1);
}

.gscq-open-winners-btn:hover {
  border-color: rgba(129, 140, 248, 0.6);
  background: rgba(99, 102, 241, 0.18);
  color: #e0e7ff;
}

.gscq-mode-pills {
  margin-left: auto;
}

.gscq-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.gscq-segments-wrap,
.gscq-quality-wrap {
  min-width: 0;
}

.gscq-segments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  height: 100%;
}

.gscq-segment-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.82));
  border-radius: 12px;
  padding: 10px 11px;
  text-align: left;
  color: #dbeafe;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
}

.gscq-segment-card:hover {
  transform: translateY(-1px);
  border-color: rgba(129, 140, 248, 0.58);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.34);
}

.gscq-segment-card:focus-visible {
  outline: none;
  border-color: rgba(99, 102, 241, 0.75);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.gscq-segment-card:active {
  transform: translateY(0);
}

.gscq-segment-card.active {
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.55), 0 10px 24px rgba(15, 23, 42, 0.35);
  border-color: rgba(99, 102, 241, 0.48);
}

.gscq-segment-card.is-quick_wins.active {
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.55), 0 10px 24px rgba(15, 23, 42, 0.35);
  border-color: rgba(34, 197, 94, 0.48);
}

.gscq-segment-card.is-low_ctr.active {
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.55), 0 10px 24px rgba(15, 23, 42, 0.35);
  border-color: rgba(239, 68, 68, 0.48);
}

.gscq-segment-card.is-trending.active {
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.55), 0 10px 24px rgba(15, 23, 42, 0.35);
  border-color: rgba(59, 130, 246, 0.48);
}

.gscq-segment-card.is-losing.active {
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.55), 0 10px 24px rgba(15, 23, 42, 0.35);
  border-color: rgba(245, 158, 11, 0.48);
}

.gscq-segment-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.gscq-segment-icon {
  font-size: 0.92rem;
  line-height: 1;
}

.gscq-segment-card.is-quick_wins .gscq-segment-icon {
  color: #22c55e;
}

.gscq-segment-card.is-low_ctr .gscq-segment-icon {
  color: #ef4444;
}

.gscq-segment-card.is-trending .gscq-segment-icon {
  color: #60a5fa;
}

.gscq-segment-card.is-losing .gscq-segment-icon {
  color: #f59e0b;
}

.gscq-segment-count {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
}

.gscq-segment-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 2px;
}

.gscq-segment-desc {
  font-size: 0.68rem;
  color: #94a3b8;
  line-height: 1.3;
}

.gscq-segment-action {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.66rem;
  font-weight: 700;
  color: #a5b4fc;
  border: 1px solid rgba(129, 140, 248, 0.3);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(99, 102, 241, 0.1);
}

.gscq-segment-action::before {
  content: '↗';
  font-size: 0.62rem;
  opacity: 0.95;
}

.gscq-segment-card:hover .gscq-segment-action {
  border-color: rgba(129, 140, 248, 0.52);
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.16);
}

.gscq-segment-action.is-active {
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
}

.gscq-segment-action.is-active::before {
  content: '✓';
}

.gscq-quality-card {
  border: 1px solid rgba(99, 102, 241, 0.26);
  background:
    radial-gradient(130% 150% at 100% 0%, rgba(59, 130, 246, 0.16) 0%, rgba(59, 130, 246, 0) 52%),
    linear-gradient(155deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.78));
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.28);
  padding: 12px;
}

.gscq-quality-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.gscq-quality-head .card-title {
  font-size: 0.92rem;
}

.gscq-quality-note {
  font-size: 0.7rem;
  color: #9fb0cb;
  white-space: nowrap;
}

.gscq-quality-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.gscq-quality-kpi {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.46);
  padding: 8px 9px;
}

.gscq-quality-kpi.is-up {
  border-color: rgba(34, 197, 94, 0.3);
}

.gscq-quality-kpi.is-down {
  border-color: rgba(239, 68, 68, 0.3);
}

.gscq-quality-kpi-label {
  font-size: 0.66rem;
  color: #8ea0bd;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.gscq-quality-kpi-value {
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1;
}

.gscq-quality-kpi-value.is-positive {
  color: #22c55e;
}

.gscq-quality-kpi-value.is-negative {
  color: #ef4444;
}

.gscq-quality-kpi-value.is-neutral {
  color: #cbd5e1;
}

.gscq-quality-bar {
  display: flex;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.52);
}

.gscq-quality-bar > span {
  display: block;
  height: 100%;
}

.gscq-quality-bar > span.is-up {
  background: linear-gradient(90deg, rgba(22, 163, 74, 0.95), rgba(34, 197, 94, 0.95));
}

.gscq-quality-bar > span.is-down {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.95), rgba(239, 68, 68, 0.95));
}

.gscq-quality-bar > span.is-neutral {
  background: rgba(148, 163, 184, 0.5);
}

.gscq-quality-legend {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.68rem;
  color: #9fb0cb;
}

.gscq-quality-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.gscq-quality-legend i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.gscq-quality-legend i.is-up {
  background: #22c55e;
}

.gscq-quality-legend i.is-down {
  background: #ef4444;
}

.gscq-quality-legend i.is-neutral {
  background: #94a3b8;
}

.gscq-quality-legend i.is-total {
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: transparent;
}

/* GSC Winners */
.gscw-top-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.gscw-threshold-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.gscw-threshold-item {
  border: 1px solid rgba(99, 102, 241, 0.28);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.88), rgba(30, 41, 59, 0.72));
  border-radius: 12px;
  padding: 9px 10px;
  display: grid;
  gap: 2px;
}

.gscw-threshold-item span {
  color: #9fb0cb;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gscw-threshold-item strong {
  color: #dbeafe;
  font-size: 0.8rem;
  font-weight: 700;
}

.gscw-section {
  margin-bottom: 14px;
}

.gscw-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.gscw-section-head h3 {
  margin: 0;
  font-size: 0.96rem;
  color: #e2e8f0;
}

.gscw-section-head span {
  color: #8ea0bd;
  font-size: 0.74rem;
}

.gscw-grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.gscw-grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gscw-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 13px;
  background: linear-gradient(155deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.75));
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.26);
  overflow: hidden;
}

.gscw-card.is-top {
  border-color: rgba(34, 197, 94, 0.35);
}

.gscw-card.is-mid {
  border-color: rgba(59, 130, 246, 0.35);
}

.gscw-card.is-near {
  border-color: rgba(245, 158, 11, 0.38);
}

.gscw-card.is-up {
  border-color: rgba(22, 163, 74, 0.34);
}

.gscw-card.is-down {
  border-color: rgba(239, 68, 68, 0.34);
}

.gscw-card-head {
  padding: 10px 11px 8px 11px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.gscw-card-title {
  color: #e2e8f0;
  font-weight: 700;
  font-size: 0.83rem;
}

.gscw-card-subtitle {
  margin-top: 2px;
  color: #8ea0bd;
  font-size: 0.71rem;
}

.gscw-list {
  padding: 6px 7px 8px 7px;
  display: grid;
  gap: 6px;
  max-height: 370px;
  overflow: auto;
}

.gscw-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: flex-start;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.42);
  padding: 7px;
}

.gscw-rank {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(30, 41, 59, 0.75);
}

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

.gscw-query {
  color: #dbeafe;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gscw-chips {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.gscw-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.66rem;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.62);
}

.gscw-chip.strong {
  border-color: rgba(129, 140, 248, 0.44);
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.16);
}

.gscw-chip.is-up {
  border-color: rgba(34, 197, 94, 0.42);
  color: #86efac;
  background: rgba(22, 101, 52, 0.24);
}

.gscw-chip.is-down {
  border-color: rgba(239, 68, 68, 0.42);
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.24);
}

.gscw-empty {
  padding: 10px 8px;
  color: #8ea0bd;
  font-size: 0.74rem;
}

.gscw-dist-card {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.46);
  padding: 10px;
}

.gscw-dist-title {
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.gscw-dist-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.gscw-dist-item {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.6);
  padding: 7px;
  text-align: center;
}

.gscw-dist-band {
  color: #94a3b8;
  font-size: 0.64rem;
  margin-bottom: 3px;
}

.gscw-dist-value {
  color: #e2e8f0;
  font-size: 0.94rem;
  font-weight: 800;
}

.gscw-dist-delta {
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 700;
}

.gscw-dist-delta.is-up {
  color: #22c55e;
}

.gscw-dist-delta.is-down {
  color: #ef4444;
}

.gscw-dist-delta.is-neutral {
  color: #94a3b8;
}

.gscq-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 0 10px 0;
  border: 0;
  background: transparent;
}

.gscq-table-card {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.gscq-table-body {
  padding: 0;
}

.gscq-table-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  color: #94a3b8;
  flex-wrap: wrap;
}

.gscq-active-segment {
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
}

.gscq-toggle-all-btn {
  border-color: var(--border);
  color: var(--text-secondary);
  background: rgba(255,255,255,0.02);
}

.gscq-toggle-all-btn.is-active {
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.08);
}

.gscq-size-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
}

.gscq-size-select {
  min-width: 90px;
  max-width: 102px;
  height: 30px;
  padding: 4px 8px;
  font-size: 0.75rem;
}

.gscq-total-note {
  color: #7f8da3;
  font-size: 0.73rem;
}

.gscq-table .gscq-col-query {
  width: 34%;
}

.gscq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.gscq-table thead {
  background: rgba(255,255,255,0.03);
}

.gscq-table th {
  padding: 10px 12px;
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.gscq-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.gscq-table th.sortable:hover {
  color: var(--text-primary);
}

.gscq-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary);
  white-space: nowrap;
  background: transparent;
}

.gscq-table tr:last-child td {
  border-bottom: none;
}

.gscq-table tr:hover td {
  background: rgba(255,255,255,0.025);
}

.gscq-table th,
.gscq-table td {
  vertical-align: middle;
}

.gscq-table th.td-num,
.gscq-table td.td-num {
  text-align: center;
}

.gscq-table th:first-child,
.gscq-table td:first-child {
  text-align: left;
}

.gscq-query-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.gscq-expand-cta {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  width: 18px;
  height: 18px;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.gscq-expand-symbol {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-secondary);
  line-height: 1;
}

.gscq-row:hover .gscq-expand-cta {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  box-shadow: none;
}

.gscq-expand-cta.is-open {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.16);
  box-shadow: none;
}

.gscq-query-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
  color: var(--text-primary);
}

.gscq-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.gscq-row.is-up td:first-child {
  box-shadow: inset 2px 0 0 rgba(34, 197, 94, 0.35);
}

.gscq-row.is-down td:first-child {
  box-shadow: inset 2px 0 0 rgba(239, 68, 68, 0.35);
}

.gscq-row.is-expanded td {
  background: rgba(255,255,255,0.04);
}

.gscq-num-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.15;
}

.gscq-num-main {
  display: inline-block;
  color: var(--text-primary);
  font-weight: 600;
}

.gscq-mini-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.63rem;
  font-weight: 700;
}

.gscq-mini-delta.is-up {
  color: #22c55e;
}

.gscq-mini-delta.is-down {
  color: #ef4444;
}

.gscq-mini-delta.is-neutral {
  color: #94a3b8;
}

.gscq-spark-wrap {
  display: flex;
  justify-content: center;
}

.gscq-spark {
  width: 140px;
  height: 34px;
}

.gscq-detail-row td {
  background: rgba(15, 23, 42, 0.35);
}

.gscq-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding: 8px 2px;
}

.gscq-detail-grid > * {
  min-width: 0;
}

.gscq-detail-card {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.5);
  padding: 10px;
  min-width: 0;
}

.gscq-detail-title {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: 8px;
  font-weight: 700;
}

.gscq-detail-chart {
  min-height: 220px;
}

.gscq-pages-list {
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.gscq-page-row {
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(30, 41, 59, 0.45);
  padding: 8px;
}

.gscq-page-url {
  color: #dbeafe;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  margin-bottom: 4px;
}

.gscq-page-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #94a3b8;
  font-size: 0.67rem;
  align-items: center;
}

.gscq-open-url-btn {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.16s ease;
}

.gscq-open-url-btn svg {
  width: 11px;
  height: 11px;
}

.gscq-open-url-btn:hover,
.gscq-open-url-btn:focus-visible {
  border-color: rgba(96, 165, 250, 0.62);
  color: #f8fafc;
  background: rgba(59, 130, 246, 0.18);
  outline: none;
}

.gscq-reco-list {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.gscq-reco-item {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(30, 41, 59, 0.5);
  padding: 8px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.gscq-reco-item.is-high {
  border-color: rgba(239, 68, 68, 0.48);
  background: rgba(127, 29, 29, 0.24);
}

.gscq-reco-item.is-medium {
  border-color: rgba(245, 158, 11, 0.48);
  background: rgba(120, 53, 15, 0.24);
}

.gscq-reco-item.is-low {
  border-color: rgba(59, 130, 246, 0.44);
  background: rgba(30, 64, 175, 0.22);
}

.gscq-reco-priority {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #cbd5e1;
  font-weight: 700;
}

.gscq-reco-title {
  display: block;
  margin-top: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #e2e8f0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  max-width: 100%;
}

.gscq-reco-desc {
  display: block;
  margin-top: 3px;
  font-size: 0.69rem;
  line-height: 1.35;
  color: #cbd5e1;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  max-width: 100%;
}

.gscq-detail-loading,
.gscq-detail-error,
.gscq-muted {
  color: #94a3b8;
  font-size: 0.75rem;
  padding: 4px 2px;
}

@media (max-width: 1500px) {
  .gsc-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .gscw-threshold-strip {
    grid-template-columns: 1fr;
  }
  .gscw-grid3 {
    grid-template-columns: 1fr;
  }
  .gscw-dist-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .gscq-top-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .gscq-quality-card {
    padding: 11px;
  }
  .gscq-segments {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .gsc-main-grid {
    grid-template-columns: 1fr;
  }
  .gsc-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gsc-segment-select {
    min-width: 150px;
  }
  .gscq-period-row,
  .gscw-top-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .gscw-grid2 {
    grid-template-columns: 1fr;
  }
  .gscw-dist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gscq-quality-metrics {
    grid-template-columns: 1fr;
  }
  .gscq-quality-head {
    flex-wrap: wrap;
    gap: 6px;
  }
  .gscq-quality-note {
    white-space: normal;
  }
  .gscq-segments {
    grid-template-columns: 1fr;
  }
  .gscq-detail-grid {
    grid-template-columns: 1fr;
  }
  .gscq-spark {
    width: 120px;
  }
}

.brand-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

.brand-filter-pills {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.brand-filter-note,
.brand-filter-badge {
  font-size: 0.78rem;
  color: #94a3b8;
}

.brand-filter-badge {
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
}

.brand-terms-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2000;
}

.brand-terms-modal {
  width: min(560px, 100%);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background: #111827;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  padding: 18px;
}

.brand-terms-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
}

.brand-terms-modal-desc {
  margin-top: 8px;
  color: #94a3b8;
  font-size: 0.85rem;
  line-height: 1.45;
}

.brand-terms-textarea {
  width: 100%;
  min-height: 180px;
  margin-top: 14px;
  resize: vertical;
}

.brand-terms-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.form-label-with-help {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-help {
  position: relative;
  display: inline-flex;
}

.inline-help summary {
  list-style: none;
}

.inline-help summary::-webkit-details-marker {
  display: none;
}

.inline-help-trigger {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(99,102,241,0.35);
  background: rgba(99,102,241,0.12);
  color: #c7d2fe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition);
}

.inline-help-trigger:hover {
  border-color: rgba(99,102,241,0.6);
  background: rgba(99,102,241,0.18);
  color: #e0e7ff;
}

.inline-help-trigger span {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.inline-help-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  bottom: auto;
  left: auto;
  z-index: 1200;
  width: min(440px, calc(100vw - 80px));
  max-height: min(52vh, 460px);
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(99,102,241,0.18);
  background: linear-gradient(180deg, rgba(15,23,42,0.98), rgba(17,24,39,0.98));
  box-shadow: 0 18px 48px rgba(2,6,23,0.45);
  overflow: auto;
}

.inline-help-popover::-webkit-scrollbar {
  width: 8px;
}

.inline-help-popover::-webkit-scrollbar-track {
  background: rgba(148,163,184,0.08);
  border-radius: 999px;
}

.inline-help-popover::-webkit-scrollbar-thumb {
  background: rgba(99,102,241,0.38);
  border-radius: 999px;
}

.inline-help-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.inline-help-text {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 10px;
}

.inline-help-subtitle {
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 10px 0 8px;
}

.inline-help-map {
  display: grid;
  gap: 8px;
}

.inline-help-map-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.12);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.inline-help-map-item strong {
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
}

.inline-help-map-item span {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.inline-help-map-item code {
  color: #c7d2fe;
  font-family: inherit;
  font-weight: 600;
}

.inline-help-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.5;
}

.inline-help-list li + li {
  margin-top: 4px;
}

/* =====================================================================
   Google Ads Shopping
   ===================================================================== */
.shopping-shell {
  display: grid;
  gap: 18px;
}

.shopping-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  padding: 20px 22px;
  border-radius: var(--radius-card);
  border: 1px solid rgba(99,102,241,0.18);
  background:
    radial-gradient(circle at top right, rgba(99,102,241,0.18), transparent 36%),
    radial-gradient(circle at left center, rgba(16,185,129,0.12), transparent 28%),
    linear-gradient(180deg, rgba(15,23,42,0.92), rgba(17,24,39,0.98));
  box-shadow: 0 18px 48px rgba(15,23,42,0.24);
}

.shopping-overline {
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  margin-bottom: 8px;
}

.shopping-title {
  margin: 0 0 8px;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1.05;
}

.shopping-lead {
  margin: 0;
  max-width: 760px;
  color: var(--text-secondary);
}

.shopping-hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.shopping-hero-badge {
  min-width: 120px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.16);
  background: rgba(15,23,42,0.55);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shopping-hero-badge span,
.shopping-card-sub,
.shopping-focus-desc,
.shopping-product-sub,
.shopping-table-meta,
.shopping-empty-mini {
  color: var(--text-secondary);
}

.shopping-hero-badge strong {
  font-size: 1rem;
  color: var(--text-primary);
}

.shopping-kpi-grid .shopping-kpi-card {
  min-width: 170px;
}

.shopping-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, 0.95fr);
  gap: 18px;
}

.shopping-card {
  background: linear-gradient(180deg, rgba(17,24,39,0.98), rgba(15,23,42,0.95));
  border: 1px solid rgba(148,163,184,0.12);
  box-shadow: 0 14px 34px rgba(15,23,42,0.22);
}

.shopping-focus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.shopping-focus-item {
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(148,163,184,0.12);
  background: rgba(15,23,42,0.48);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shopping-focus-item.tone-good { box-shadow: inset 0 0 0 1px rgba(16,185,129,0.16); }
.shopping-focus-item.tone-danger { box-shadow: inset 0 0 0 1px rgba(239,68,68,0.16); }
.shopping-focus-item.tone-warning { box-shadow: inset 0 0 0 1px rgba(245,158,11,0.16); }
.shopping-focus-item.tone-info { box-shadow: inset 0 0 0 1px rgba(56,189,248,0.16); }

.shopping-focus-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.shopping-focus-value {
  font-size: 1.5rem;
}

.shopping-insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.shopping-insight-card.winner { border-top: 2px solid rgba(16,185,129,0.9); }
.shopping-insight-card.spender { border-top: 2px solid rgba(239,68,68,0.9); }
.shopping-insight-card.risk { border-top: 2px solid rgba(245,158,11,0.9); }
.shopping-insight-card.opportunity { border-top: 2px solid rgba(56,189,248,0.9); }

.shopping-insight-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shopping-insight-row {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.10);
  background: rgba(15,23,42,0.48);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shopping-insight-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shopping-insight-sub {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.shopping-insight-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.shopping-metric-pills,
.shopping-filter-pills,
.shopping-table-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.shopping-table-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.shopping-search {
  min-width: 280px;
}

.shopping-table-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.82rem;
}

.shopping-product-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shopping-product-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.shopping-product-sub {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
}

.shopping-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shopping-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.18);
  color: #c7d2fe;
  font-size: 0.7rem;
}

.shopping-muted {
  color: var(--text-muted);
}

.shopping-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.shopping-status-badge.winner {
  color: #86efac;
  background: rgba(16,185,129,0.12);
  border-color: rgba(16,185,129,0.18);
}

.shopping-status-badge.spender {
  color: #fca5a5;
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.18);
}

.shopping-status-badge.risk {
  color: #fcd34d;
  background: rgba(245,158,11,0.12);
  border-color: rgba(245,158,11,0.18);
}

.shopping-status-badge.opportunity {
  color: #7dd3fc;
  background: rgba(56,189,248,0.12);
  border-color: rgba(56,189,248,0.18);
}

.shopping-status-badge.neutral {
  color: #cbd5e1;
  background: rgba(148,163,184,0.10);
  border-color: rgba(148,163,184,0.14);
}

.shopping-table .shopping-row-winner td:first-child { border-left: 3px solid rgba(16,185,129,0.9); }
.shopping-table .shopping-row-spender td:first-child { border-left: 3px solid rgba(239,68,68,0.85); }
.shopping-table .shopping-row-risk td:first-child { border-left: 3px solid rgba(245,158,11,0.85); }
.shopping-table .shopping-row-opportunity td:first-child { border-left: 3px solid rgba(56,189,248,0.85); }

.shopping-cell-sub {
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

@media (max-width: 1280px) {
  .shopping-insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

@media (max-width: 860px) {
  .shopping-hero,
  .shopping-table-head {
    flex-direction: column;
    align-items: stretch;
  }

  .shopping-focus-grid,
  .shopping-insights {
    grid-template-columns: 1fr;
  }

  .shopping-search {
    min-width: 0;
    width: 100%;
  }
}

/* =====================================================================
   Případovka (Google Ads Case Study)
   ===================================================================== */

.case-study-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.case-study-range-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.case-study-range-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.case-study-copy-year-btn {
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
}

.case-study-copy-year-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.24);
}

.case-study-export-group {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-self: flex-end;
}

.case-study-export-ai-btn {
  white-space: nowrap;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #c4b5fd;
}

.case-study-export-ai-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  color: #ede9fe;
}

.case-study-tables-row {
  align-items: start;
}

.case-study-range-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.case-study-range-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px 10px;
}

.case-study-range-chip strong {
  color: var(--text-primary);
  font-weight: 600;
  margin-right: 4px;
}

.case-study-range-arrow {
  color: var(--text-muted);
}

.cs-chart-tooltip {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.cs-chart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.cs-chart-tooltip-row + .cs-chart-tooltip-row {
  margin-top: 4px;
}

.cs-chart-tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stat-compare {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.stat-compare-note {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.case-study-note-card {
  margin-top: 16px;
}

.case-study-note {
  width: 100%;
  resize: vertical;
  font-family: inherit;
}

.case-study-print-header {
  display: none;
}

.print-only {
  display: none;
}

@media print {
  #sidebar,
  .topbar,
  .case-study-toolbar,
  #toast-container {
    display: none !important;
  }

  #main-content {
    margin: 0 !important;
    padding: 0 !important;
  }

  #content-area {
    padding: 0 !important;
  }

  body,
  #main-content {
    background: #fff !important;
    color: #111 !important;
  }

  .print-only {
    display: block !important;
    margin-bottom: 16px;
  }

  .case-study-print-header h2 {
    margin: 0 0 4px;
    font-size: 18px;
  }

  .case-study-print-ranges {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #444;
  }

  .stat-box,
  .chart-card,
  .card {
    break-inside: avoid;
  }
}
