/* ==========================================================================
   Veriloom Reporting Dashboard - Clean Light Theme (Apple / Stripe Aesthetic)
   ========================================================================== */

:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Surfaces - Pure White & Subtle Light Slates */
  --bg-canvas: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;

  /* Borders */
  --border-light: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-focus: #1e255e;

  /* Text & Typography */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Brand Accents (from veriloom-logo-yatay.png) */
  --brand-navy: #1e255e;
  --brand-navy-light: #2d3780;
  --brand-teal: #22b09a;
  --brand-teal-light: #e6f7f5;

  /* Metrics Palette */
  --color-spend: #2563eb;
  --color-spend-bg: #eff6ff;
  --color-revenue: #10b981;
  --color-revenue-bg: #ecfdf5;
  --color-roas: #0d9488;
  --color-roas-bg: #f0fdfa;
  --color-orders: #8b5cf6;
  --color-orders-bg: #f5f3ff;
  --color-warning: #f59e0b;
  --color-warning-bg: #fef3c7;
  --color-danger: #ef4444;
  --color-danger-bg: #fef2f2;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-card: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.04);
  --shadow-hover: 0 4px 8px -2px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.04);
  --shadow-popover: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
}

/* Reset & Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Container */
.app-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px 60px 24px;
}

/* Header */
.top-header {
  position: sticky;
  top: 0;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
  z-index: 50;
  padding: 14px 0;
  margin-bottom: 24px;
}

.header-content {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.badge-mode {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background-color: var(--brand-teal-light);
  color: var(--brand-teal);
  border: 1px solid rgba(34, 176, 154, 0.2);
}

.badge-client {
  background-color: #f1f5f9;
  color: var(--brand-navy);
  border-color: var(--border-light);
}

.control-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.select-control {
  appearance: none;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 34px 8px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.select-control:hover, .select-control:focus {
  border-color: var(--border-focus);
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

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

.btn-primary {
  background-color: var(--brand-navy);
  color: #ffffff;
  border-color: var(--brand-navy);
}

.btn-primary:hover {
  background-color: var(--brand-navy-light);
  color: #ffffff;
}

/* Client Hero */
.client-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.client-title-group h1 {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--brand-navy);
  letter-spacing: -0.02em;
}

.client-title-group p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Pacing Card (Budget Progress Bar) */
.pacing-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.pacing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.pacing-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pacing-label {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.pacing-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-on-track {
  background-color: var(--color-revenue-bg);
  color: var(--color-revenue);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-under-pacing {
  background-color: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-over-pacing {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.pacing-numbers {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pacing-numbers strong {
  font-family: var(--font-heading);
  color: var(--text-primary);
}

.pacing-pct-label strong {
  color: var(--brand-teal);
}

.divider {
  color: var(--text-light);
}

.progress-track {
  position: relative;
  height: 10px;
  background-color: #f1f5f9;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-teal), #10b981);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.pacing-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* Takeaways Card */
.takeaways-card {
  background-color: #f0fdfa;
  border: 1px solid rgba(34, 176, 154, 0.25);
  border-left: 4px solid var(--brand-teal);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.takeaways-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.takeaways-icon {
  font-size: 20px;
}

.takeaways-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-navy);
}

.takeaways-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.takeaways-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 32px;
}

.takeaways-list li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--brand-navy);
}

.tab-btn.active {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-navy);
}

/* Tab Panes */
.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* KPI Scorecards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

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

.kpi-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

.card-spend .kpi-icon { background-color: var(--color-spend-bg); color: var(--color-spend); }
.card-revenue .kpi-icon { background-color: var(--color-revenue-bg); color: var(--color-revenue); }
.card-roas .kpi-icon { background-color: var(--color-roas-bg); color: var(--color-roas); }
.card-orders .kpi-icon { background-color: var(--color-orders-bg); color: var(--color-orders); }

.kpi-value {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.kpi-footer {
  font-size: 12px;
  color: var(--text-muted);
}

.kpi-footer strong {
  color: var(--text-primary);
}

/* Secondary Metrics Grid */
.secondary-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.sec-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
}

.sec-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sec-value {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-navy);
}

/* Charts Row */
.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

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

.chart-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.dot-spend { background-color: var(--color-spend); }
.dot-revenue { background-color: var(--color-revenue); }

.chart-wrapper {
  position: relative;
  height: 320px;
  width: 100%;
}

/* Card Section (Reusable wrapper for tables & funnels) */
.card-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px;
  margin-bottom: 24px;
}

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

.section-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-navy);
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.badge-tag {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.badge-tag-teal {
  background-color: var(--brand-teal-light);
  color: var(--brand-teal);
}

/* Funnel Steps Visualizer */
.funnel-steps-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.funnel-step-item {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  transition: all 0.2s ease;
}

.funnel-step-item:hover {
  background-color: #ffffff;
  box-shadow: var(--shadow-sm);
  border-color: #cbd5e1;
}

.funnel-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.funnel-step-name {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.funnel-step-stat {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-navy);
}

.funnel-step-bar-track {
  height: 12px;
  background-color: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.funnel-step-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #1e255e, #22b09a);
  transition: width 0.6s ease;
}

.funnel-step-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.funnel-cvr {
  color: var(--brand-teal);
  font-weight: 600;
}

.funnel-drop {
  color: var(--color-danger);
  font-weight: 500;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-light);
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.data-table tbody tr:hover {
  background-color: var(--bg-subtle);
}

.text-right { text-align: right; }
.text-center { text-align: center; }

/* Campaign Status Badges */
.badge-winner, .badge-scale, .badge-bleeder, .badge-legend {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.badge-winner {
  background-color: var(--color-revenue-bg);
  color: var(--color-revenue);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-scale {
  background-color: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-bleeder {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.campaign-filters {
  display: flex;
  gap: 8px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background-color: var(--brand-navy);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-light);
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

.footer-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-light);
}

/* Responsive */
@media (max-width: 1024px) {
  .kpi-grid, .secondary-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .charts-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .header-content, .client-hero, .pacing-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .control-bar {
    width: 100%;
    flex-wrap: wrap;
  }
  .kpi-grid, .secondary-metrics-grid {
    grid-template-columns: 1fr;
  }
  .chart-wrapper {
    height: 240px;
  }
}

/* ==========================================================================
   Store & MER (Arbitrator) & GA4 Traffic Styles
   ========================================================================== */

.store-hero-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.store-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.badge-store-provider {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--brand-teal-light);
  color: var(--brand-teal);
  border: 1px solid rgba(34, 176, 154, 0.2);
}

.badge-store-active {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  color: var(--text-secondary);
}

/* Reconciliation Card */
.recon-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.recon-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.recon-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recon-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.recon-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.recon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.recon-item {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.recon-item-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.recon-item-value {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.recon-item-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.text-brand {
  color: var(--brand-navy) !important;
}

.text-success {
  color: #10b981 !important;
}

.text-danger {
  color: #ef4444 !important;
}

@media (max-width: 1024px) {
  .recon-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ==========================================================================
   Advanced Analytics Styling (Deltas, Creatives, SEO & Merchant, Growth)
   ========================================================================== */

/* MoM Delta Badges on KPI Cards */
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-top: 4px;
}

.kpi-delta.delta-up {
  background-color: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.kpi-delta.delta-down {
  background-color: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

.kpi-delta.delta-neutral {
  background-color: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* Secondary Button (PDF Print) */
.btn-secondary {
  background: #ffffff;
  color: #0284c7;
  border: 1.5px solid #0284c7;
}

.btn-secondary:hover {
  background: #f0f9ff;
  border-color: #0369a1;
  color: #0369a1;
}

/* Creative Status Badges */
.badge-fatigued {
  background-color: #fffbeb;
  color: #d97706;
  border: 1px solid #fcd34d;
}

.badge-learning {
  background-color: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

/* Merchant Feed Health Summary */
.merchant-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.merchant-kpi {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.merchant-kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.merchant-kpi-val {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.merchant-issues-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.merchant-issue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fee2e2;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: #991b1b;
}

.merchant-issue-item.warning {
  background: #fffbeb;
  border-color: #fef3c7;
  color: #92400e;
}

/* SEO Ranking Tier Badges */
.badge-top3 {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-weight: 700;
}

.badge-firstpage {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-opportunity {
  background-color: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* ==================== Creative Thumbnails & Preview Modal ==================== */
.creative-thumb-cell {
  width: 64px;
  text-align: center;
  padding: 8px !important;
}

.creative-thumb-box {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.creative-thumb-box:hover {
  transform: scale(1.15);
  border-color: #3b82f6;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.25);
  z-index: 5;
}

.creative-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.creative-thumb-placeholder {
  font-size: 20px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #f1f5f9;
}

.btn-preview-ad {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-preview-ad:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

/* Modal Backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: #fafafa;
}

.modal-title-group {
  flex: 1;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
}

.modal-subtitle {
  font-size: 12px;
  color: #64748b;
  margin: 3px 0 0 0;
}

.modal-close-btn {
  background: #e2e8f0;
  border: none;
  font-size: 22px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
}

.modal-close-btn:hover {
  background: #cbd5e1;
  color: #0f172a;
  transform: scale(1.05);
}

.modal-body {
  padding: 22px;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 22px;
  overflow-y: auto;
  max-height: calc(90vh - 75px);
}

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

.modal-preview-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-image-wrapper {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-ad-img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
}

.modal-iframe-container {
  width: 100%;
  height: 380px;
  overflow: hidden;
}

.modal-iframe-container iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
}

.modal-toggle-row {
  display: flex;
  gap: 8px;
}

.btn-modal-toggle {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-modal-toggle.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.modal-details-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.modal-kpi-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.m-kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.m-kpi-val {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.modal-copy-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
}

.modal-copy-heading {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin: 0 0 8px 0;
}

.modal-copy-text {
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
  max-height: 140px;
  overflow-y: auto;
  white-space: pre-line;
  word-break: break-word;
}

/* Custom Date Selector & Inputs */
.custom-date-container {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 3px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.date-input {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 4px 7px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-primary);
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s ease;
}

.date-input:focus {
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 2px rgba(34, 176, 154, 0.15);
}

.date-sep {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* Comparison Toggle Switch */
.compare-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.compare-toggle-label:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.compare-toggle-label input[type="checkbox"] {
  display: none;
}

.compare-toggle-switch {
  width: 32px;
  height: 18px;
  background: #cbd5e1;
  border-radius: 20px;
  position: relative;
  transition: background 0.2s ease;
  display: inline-block;
  vertical-align: middle;
}

.compare-toggle-switch::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  top: 2px;
  left: 2px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.compare-toggle-label input[type="checkbox"]:checked + .compare-toggle-switch {
  background: var(--brand-teal);
}

.compare-toggle-label input[type="checkbox"]:checked + .compare-toggle-switch::after {
  transform: translateX(14px);
}

.compare-toggle-text {
  font-size: 12px;
  white-space: nowrap;
}

/* KPI Delta Badges */
.kpi-delta-wrapper {
  margin: 4px 0 8px 0;
  min-height: 22px;
  display: flex;
  align-items: center;
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: -0.01em;
}

.delta-up {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.delta-down {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}




/* ==========================================================================
   Hesap Yöneticisi Notu & Veri Notları
   ========================================================================== */
.manager-note-card { border-left: 4px solid var(--brand-teal); }
.manager-note-text { white-space: pre-wrap; font-size: 14px; line-height: 1.6; color: var(--text-primary); }
.manager-note-editor textarea {
  width: 100%; box-sizing: border-box; margin-top: 12px; padding: 10px 12px;
  border: 1px solid var(--border-light); border-radius: 8px; font-family: var(--font-body); font-size: 14px; resize: vertical;
}
.manager-note-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.manager-note-hint { font-size: 12px; color: var(--text-muted); }
.kpi-data-note {
  margin: -8px 0 20px; padding: 10px 14px; font-size: 12.5px; line-height: 1.5;
  color: var(--text-secondary); background: var(--bg-subtle); border: 1px solid var(--border-light); border-radius: 8px;
}
