/* ═══════════════════════════════════════════════════════════════════════════
   QE Analytics — Design System v4
   Modern Enterprise SaaS Light Theme
═══════════════════════════════════════════════════════════════════════════ */

/* ─── Variables ──────────────────────────────────────────────────────────── */
:root {
  --sidebar-w: 260px;

  /* Primary Colors */
  --color-primary: #F57C00;
  --color-primary-hover: #E66A00;
  --color-primary-light: #FFF4E8;
  --primary: var(--color-primary);
  --primary-hover: var(--color-primary-hover);
  --color-primary-08: rgba(245, 124, 0, 0.08);
  --color-primary-16: rgba(245, 124, 0, 0.16);
  --color-primary-32: rgba(245, 124, 0, 0.32);

  /* Secondary Colors */
  --color-secondary: #0EA5E9;
  --color-secondary-light: #F0F9FF;
  --color-light-blue: #0EA5E9;
  --color-violet: #0EA5E9;

  /* Neutral Colors */
  --bg: #FAFBFC;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --border-2: #E2E8F0;
  --bg-hover: #F1F5F9;

  /* Text Colors */
  --text-primary: #1E293B;
  --text-secondary: #475569;
  --text-tertiary: #64748B;
  --text-disabled: #9CA3AF;

  /* Status Colors */
  --color-success: #16A34A;
  --color-warning: #F59E0B;
  --color-error: #DC2626;
  --color-info: #0284C7;
  --color-emerald: var(--color-success);
  --color-green: var(--color-success);
  --color-rose: var(--color-error);

  /* Gradients */
  --gradient-primary: #F57C00;
  --gradient-secondary: #0EA5E9;
  --gradient-hero: #F57C00;

  /* Typography — Font Family */
  --font-sans: 'Plus Jakarta Sans', Inter, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

  /* Typography Scale */
  --text-display-size: 4rem;
  --text-display-weight: 700;
  --text-display-lh: 4.5rem;
  --text-h1-size: 3rem;
  --text-h1-weight: 700;
  --text-h1-lh: 3.5rem;
  --text-h2-size: 2.25rem;
  --text-h2-weight: 700;
  --text-h2-lh: 2.75rem;
  --text-h3-size: 1.875rem;
  --text-h3-weight: 600;
  --text-h3-lh: 2.375rem;
  --text-h4-size: 1.5rem;
  --text-h4-weight: 600;
  --text-h4-lh: 2rem;
  --text-h5-size: 1.25rem;
  --text-h5-weight: 600;
  --text-h5-lh: 1.75rem;
  --text-h6-size: 1.125rem;
  --text-h6-weight: 600;
  --text-h6-lh: 1.625rem;
  --text-body-lg-size: 1.125rem;
  --text-body-lg-weight: 400;
  --text-body-lg-lh: 1.875rem;
  --text-body-size: 1rem;
  --text-body-weight: 400;
  --text-body-lh: 1.75rem;
  --text-small-size: 0.875rem;
  --text-small-weight: 400;
  --text-small-lh: 1.375rem;
  --text-caption-size: 0.75rem;
  --text-caption-weight: 400;
  --text-caption-lh: 1.125rem;
  --text-button-size: 0.875rem;
  --text-button-weight: 600;
  --text-button-ls: 0.2px;
  --text-nav-size: 0.9375rem;
  --text-nav-weight: 500;
  --text-card-title-size: 1.25rem;
  --text-card-title-weight: 600;
  --text-metric-size: 2rem;
  --text-metric-weight: 700;
  --text-label-size: 0.875rem;
  --text-label-weight: 500;
  --text-input-size: 1rem;
  --text-input-weight: 400;
  --text-helper-size: 0.75rem;
  --text-helper-weight: 400;
  --text-error-size: 0.75rem;
  --text-error-weight: 500;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 14px 30px rgba(15, 23, 42, 0.12);
  --bg-soft: #F8FAFC;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body-size);
  font-weight: var(--text-body-weight);
  line-height: var(--text-body-lh);
  background: var(--bg);
  color: var(--text-secondary);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
}

h1 {
  font-size: var(--text-h1-size);
  font-weight: var(--text-h1-weight);
  line-height: var(--text-h1-lh);
}

h2 {
  font-size: var(--text-h2-size);
  font-weight: var(--text-h2-weight);
  line-height: var(--text-h2-lh);
}

h3 {
  font-size: var(--text-h3-size);
  font-weight: var(--text-h3-weight);
  line-height: var(--text-h3-lh);
}

h4 {
  font-size: var(--text-h4-size);
  font-weight: var(--text-h4-weight);
  line-height: var(--text-h4-lh);
}

h5 {
  font-size: var(--text-h5-size);
  font-weight: var(--text-h5-weight);
  line-height: var(--text-h5-lh);
}

h6 {
  font-size: var(--text-h6-size);
  font-weight: var(--text-h6-weight);
  line-height: var(--text-h6-lh);
}

.text-display {
  font-size: var(--text-display-size);
  font-weight: var(--text-display-weight);
  line-height: var(--text-display-lh);
  color: var(--text-primary);
}

.text-body-lg {
  font-size: var(--text-body-lg-size);
  font-weight: var(--text-body-lg-weight);
  line-height: var(--text-body-lg-lh);
}

.text-small {
  font-size: var(--text-small-size);
  font-weight: var(--text-small-weight);
  line-height: var(--text-small-lh);
}

.text-caption {
  font-size: var(--text-caption-size);
  font-weight: var(--text-caption-weight);
  line-height: var(--text-caption-lh);
  color: var(--text-tertiary);
}

.text-muted {
  color: var(--text-tertiary);
}

.text-disabled {
  color: var(--text-disabled);
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  font-family: inherit;
  background: none;
}

canvas {
  display: block;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--r-md);
  font-size: var(--text-button-size);
  font-weight: var(--text-button-weight);
  letter-spacing: var(--text-button-ls);
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 124, 0, 0.25);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 124, 0, 0.35);
}

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

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

.btn-ghost.active {
  background: var(--color-primary-08);
  color: var(--color-primary);
  border-color: var(--color-primary-16);
}

.btn-lg {
  padding: 13px 24px;
  font-size: 0.95rem;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.75rem;
}

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.icon-btn:hover {
  background: var(--bg);
}

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  pointer-events: none;
}

.toast.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.toast.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.toast.info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.text-danger { color: var(--color-rose); }
.text-success { color: var(--color-green); }

.btn-danger {
  background: var(--color-rose);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: #DC2626;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

.modal-actions.full-width {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.confirm-card {
  text-align: center;
  max-width: 400px;
}

.confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff1f2;
  color: var(--color-rose);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
}

.confirm-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 8px;
}

/* ─── Overlays/Modals ────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(30, 41, 59, 0.24);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(3px);
  pointer-events: all;
  cursor: wait;
}

.loading-overlay--fetch {
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(2px);
}

.loading-overlay--export {
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(1px);
}

/* Fetch: loader only — no card */
.loading-overlay__fetch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.qe-loader {
  position: relative;
  width: 56px;
  height: 56px;
}

.qe-loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: var(--color-primary);
  border-right-color: rgba(245, 124, 0, 0.18);
  animation: qe-loader-spin 0.95s cubic-bezier(0.45, 0.05, 0.35, 0.95) infinite;
}

.qe-loader__ring--delay {
  inset: 7px;
  border-width: 2px;
  border-top-color: var(--color-secondary);
  border-right-color: rgba(14, 165, 233, 0.14);
  animation-duration: 1.35s;
  animation-direction: reverse;
}

.qe-loader__core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 12px rgba(245, 124, 0, 0.35);
  animation: qe-loader-pulse 1.8s ease-in-out infinite;
}

.loading-overlay__message--fetch {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.65;
}

/* Export: compact card with progress bar */
.loading-overlay__card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  min-width: 300px;
  padding: 22px 28px;
  border-radius: var(--r-xl, 12px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.loading-overlay__message--export {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  text-align: center;
}

.loading-overlay__progress-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.loading-overlay__progress-track {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 10px;
  overflow: hidden;
}

.loading-overlay__progress-bar {
  width: 0%;
  height: 100%;
  background: var(--color-primary);
  border-radius: 10px;
  transition: width 0.35s ease;
}

.loading-overlay__percent {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
}

@keyframes qe-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes qe-loader-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.82);
    opacity: 0.75;
  }
}

body.ui-locked {
  overflow: hidden;
  pointer-events: none;
}

body.ui-locked #loading-overlay {
  pointer-events: all;
}

.setup-card,
.modal-card {
  background: var(--surface);
  width: 100%;
  max-width: 440px;
  padding: 40px;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.setup-logo {
  margin-bottom: 24px;
}

.setup-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.4px;
}

.setup-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

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

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.btn-close {
  font-size: 1.2rem;
  color: var(--text-tertiary);
  line-height: 1;
  padding: 4px;
}

.btn-close:hover {
  color: var(--text-primary);
}

.modal-sub {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Guide Modal Specifics */
#guide-modal .modal-body::-webkit-scrollbar {
  width: 6px;
}
#guide-modal .modal-body::-webkit-scrollbar-track {
  background: transparent;
}
#guide-modal .modal-body::-webkit-scrollbar-thumb {
  background: var(--color-primary-16);
  border-radius: 10px;
}
#guide-modal .modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-32);
}

/* Report options modal */
#report-name-modal {
  align-items: center;
  overflow-y: auto;
}

.report-options-modal {
  max-width: 520px;
  max-height: min(560px, calc(100vh - 48px));
  padding: 22px 24px 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
}

.report-options-modal .modal-sub {
  margin-bottom: 16px;
}

.report-options-modal__filename {
  margin-bottom: 14px;
}

.report-options-modal__sections {
  margin-bottom: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.report-options-modal__sections-label {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px !important;
}

.report-options-modal__sections-label .btn-xs {
  padding: 2px 8px;
  font-size: 11px;
  text-transform: none;
  letter-spacing: normal;
}

.report-options-modal .sections-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: min(260px, calc(100vh - 340px));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
}

.report-options-modal .sections-grid__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-primary);
  cursor: pointer;
  text-transform: none !important;
  font-weight: 500;
  letter-spacing: normal;
  margin-bottom: 0;
  background: var(--surface);
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.report-options-modal .sections-grid__item input {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

.report-options-modal .sections-grid::-webkit-scrollbar {
  width: 6px;
}

.report-options-modal .sections-grid::-webkit-scrollbar-track {
  background: transparent;
}

.report-options-modal .sections-grid::-webkit-scrollbar-thumb {
  background: var(--color-primary-16);
  border-radius: 10px;
}

.report-options-modal .sections-grid::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-32);
}

.report-options-modal__actions {
  flex-shrink: 0;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

@media (max-width: 560px) {
  .report-options-modal {
    max-width: 100%;
    padding: 18px 16px 16px;
  }

  .report-options-modal .sections-grid {
    grid-template-columns: 1fr;
    max-height: min(220px, calc(100vh - 320px));
  }
}

/* Generation progress modal */
#gen-progress-modal {
  align-items: center;
  overflow-y: auto;
}

.gen-progress-modal {
  max-width: 400px;
  max-height: min(500px, calc(100vh - 48px));
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
}

.gen-progress-modal .modal-header {
  margin-bottom: 14px !important;
}

.gen-progress-modal .modal-header h3 {
  font-size: 1.05rem !important;
  font-weight: 800;
}

.gen-progress-modal .modal-sub {
  font-size: 0.8rem !important;
  margin-bottom: 0 !important;
  line-height: 1.45;
}

.gen-progress-modal .gen-progress-modal__bar {
  margin-bottom: 14px;
  flex-shrink: 0;
}

.gen-progress-modal .gen-progress-modal__bar-meta {
  margin-bottom: 6px !important;
}

.gen-progress-modal .progress-steps-list {
  gap: 10px !important;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}

.gen-progress-modal .progress-step-item {
  gap: 12px !important;
}

.gen-progress-modal .step-icon-wrap {
  width: 28px !important;
  height: 28px !important;
}

.gen-progress-modal .step-label {
  font-size: 0.82rem !important;
  line-height: 1.3;
}

.gen-progress-modal .step-desc {
  font-size: 0.7rem !important;
  line-height: 1.35;
}

.gen-progress-modal .progress-steps-list::-webkit-scrollbar {
  width: 5px;
}

.gen-progress-modal .progress-steps-list::-webkit-scrollbar-track {
  background: transparent;
}

.gen-progress-modal .progress-steps-list::-webkit-scrollbar-thumb {
  background: var(--color-primary-16);
  border-radius: 10px;
}

#gen-progress-modal #gen-progress-footer {
  margin-top: 16px !important;
  padding-top: 14px !important;
  flex-shrink: 0;
}

#gen-progress-modal #gen-progress-footer p {
  font-size: 0.85rem !important;
  margin-bottom: 12px !important;
}

@media (max-width: 440px) {
  .gen-progress-modal {
    max-width: 100%;
    padding: 16px 16px 14px;
  }
}

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

.form-field label {
  display: block;
  font-size: var(--text-label-size);
  font-weight: var(--text-label-weight);
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-field input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: inherit;
  font-size: var(--text-input-size);
  font-weight: var(--text-input-weight);
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-field .helper-text {
  font-size: var(--text-helper-size);
  font-weight: var(--text-helper-weight);
  color: var(--text-tertiary);
  margin-top: 6px;
}

.form-field .error-text {
  font-size: var(--text-error-size);
  font-weight: var(--text-error-weight);
  color: var(--color-error);
  margin-top: 6px;
}

.form-field input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-16);
}


/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT — Mobile First
═══════════════════════════════════════════════════════════════════════════ */

/* ─── Mobile Sticky Header ───────────────────────────────────────────────── */
.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 900;
}

.mobile-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-header .brand-name {
  font-size: 1rem;
  font-weight: 800;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 24px;
}

.hamburger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text-primary);
  transition: all 0.3s;
}

/* ─── Backdrop (mobile) ──────────────────────────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(30, 41, 59, 0.2);
  backdrop-filter: blur(2px);
}

body.mobile-nav-open .sidebar-backdrop {
  display: block;
}

/* ─── App Shell ──────────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: calc(100vh - 56px);
  /* subtract mobile header */
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0;
  top: 56px;
  width: var(--sidebar-w);
  height: calc(100vh - 56px);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px;
  z-index: 1001;
  overflow: hidden;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.mobile-nav-open .sidebar {
  transform: translateX(0);
  box-shadow: var(--shadow-lg);
}

.sidebar-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.nav-link.active {
  background: var(--color-primary-08);
  color: var(--color-primary);
  font-weight: 600;
}

.nav-link svg {
  flex-shrink: 0;
}

.sidebar-bottom {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-copyright {
  margin-top: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-align: center;
  line-height: 1.4;
}

.sidebar-copyright p {
  margin: 0;
}

/* Property badge */
.property-badge {
  background: var(--bg);
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.property-badge:hover {
  border-color: var(--color-primary-16);
  background: var(--surface);
}

.property-badge-icon {
  background: var(--color-primary);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 900;
}

.mobile-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-header .brand-name {
  font-size: 1rem;
  font-weight: 800;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 24px;
}

.hamburger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text-primary);
  transition: all 0.3s;
}

/* ─── Backdrop (mobile) ──────────────────────────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(30, 41, 59, 0.2);
  backdrop-filter: blur(2px);
}

body.mobile-nav-open .sidebar-backdrop {
  display: block;
}

/* ─── App Shell ──────────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: calc(100vh - 56px);
  /* subtract mobile header */
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0;
  top: 56px;
  width: var(--sidebar-w);
  height: calc(100vh - 56px);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px;
  z-index: 1001;
  overflow: hidden;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.mobile-nav-open .sidebar {
  transform: translateX(0);
  box-shadow: var(--shadow-lg);
}

.sidebar-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.sidebar-top::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding: 4px;
}

.app-brand-logo {
  display: block;
  height: 36px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.app-brand-logo--sidebar {
  height: 40px;
}

.mobile-header .app-brand-logo {
  height: 32px;
  max-width: 160px;
}

.sidebar-brand .brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-tertiary);
  margin: 20px 0 8px 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 0.82rem;
  font-weight: var(--text-nav-weight);
  color: var(--text-secondary);
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

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

.nav-link.active {
  background: var(--color-primary-08);
  color: var(--color-primary);
  font-weight: 600;
}

.nav-link svg {
  flex-shrink: 0;
}

.sidebar-bottom {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-copyright {
  margin-top: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-align: center;
  line-height: 1.4;
}

.sidebar-copyright p {
  margin: 0;
}

/* Property badge */
.property-badge {
  background: var(--bg);
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.property-badge:hover {
  border-color: var(--color-primary-16);
  background: var(--surface);
}

.property-badge-icon {
  background: var(--color-primary);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  flex-shrink: 0;
}

.property-badge-text {
  flex: 1;
  min-width: 0;
}

.property-badge-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.property-badge-id {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.property-badge-chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ─── Commentary Section ─────────────────────────────────────────────────── */
.bottom-row {
  margin-top: 24px;
}

.commentary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

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

.commentary-header h3 {
  font-size: var(--text-card-title-size);
  font-weight: var(--text-card-title-weight);
}

#quill-editor {
  min-height: 200px;
  border: 1px solid var(--border);
  /* border-radius: var(--r-md); */
  font-family: inherit;
}

.ql-toolbar.ql-snow {
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--r-md) var(--r-md) 0 0;
  background: var(--bg);
}

.ql-container.ql-snow {
  border: 1px solid var(--border);
  border-radius: 0 0 var(--r-md) var(--r-md);
  font-size: 0.95rem;
}

.commentary-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-tertiary);
}

.commentary-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  flex-shrink: 0;
}

.commentary-status--locked {
  color: #16a34a;
}

.commentary-status--locked .commentary-status__dot {
  background: #16a34a;
}

.commentary-status--editing {
  color: var(--color-primary);
}

.commentary-status--editing .commentary-status__dot {
  background: var(--color-primary);
}

.commentary-status--empty .commentary-status__dot {
  background: #94a3b8;
}

/* Auth state */
.auth-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--r-md);
}

.auth-state.connected {
  background: rgba(22, 163, 74, 0.08);
  color: var(--color-success);
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.auth-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-green);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.btn-disconnect {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.2s;
}

.btn-disconnect:hover {
  background: #fef2f2;
  border-color: #fee2e2;
  color: var(--color-rose);
}


.btn-connect {
  width: 100%;
  justify-content: center;
  padding: 11px;
  font-weight: 700;
}

/* ─── Main Content ───────────────────────────────────────────────────────── */
.main {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 24px 20px;
  background: var(--bg);
}

/* ─── Topbar ─────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 1024px) {
  .topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 20px;
  }
}

.topbar-left {
  flex: 1;
  min-width: 0;
}

.topbar-left .page-title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-page-header {
  padding: 48px 0 24px;
  text-align: center;
}

.report-page-header h2 {
  font-size: var(--text-h2-size);
  font-weight: var(--text-h2-weight);
  line-height: var(--text-h2-lh);
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.025em;
  margin: 0;
}


/* duplicate removed */






.date-context {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

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

.date-range-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 5px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.custom-date-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.date-sep {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.date-input {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  background: var(--bg);
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
}

.date-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 2px;
}

/* ─── Connect Banner ─────────────────────────────────────────────────────── */
.connect-banner {
  background: var(--color-primary-light);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  margin-bottom: 28px;
}

.connect-banner-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.connect-banner h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.connect-banner p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ─── KPI Row ────────────────────────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .kpi-row {
    grid-template-columns: repeat(6, 1fr);
  }
}


.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

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

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon svg { width: 18px; height: 18px; }
.kpi-symbol-icon {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-change {
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 99px;
}

.kpi-change.up {
  color: var(--color-success);
  background: rgba(34, 197, 94, 0.1);
}

.kpi-change.down {
  color: var(--color-error);
  background: rgba(239, 68, 68, 0.1);
}

.vs-value {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-top: -2px;
  margin-bottom: 4px;
}

.change-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-left: 4px;
  white-space: nowrap;
}

.kpi-change.neutral {
  color: var(--text-tertiary);
  background: var(--bg);
}

.kpi-body {
  margin-top: auto;
}

.kpi-value {
  font-size: var(--text-metric-size);
  font-weight: var(--text-metric-weight);
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: normal;
}


/* ─── Skeleton ───────────────────────────────────────────────────────────── */
.skeleton-card {
  background: #f0f2f7;
  background-size: 400% 100%;
  animation: shimmer 1.5s infinite;
  min-height: 90px;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

/* ─── Full-width Trend Chart ─────────────────────────────────────────────── */
.trend-chart-section { margin-bottom: 20px; }
.chart-subtitle { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 2px; font-weight: 400; }

/* ─── Channel + Country 2-Column Layout ─────────────────────────────────── */
.channel-country-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.section-divider {
  display: none; /* vertical line — only shown on desktop */
  width: 1px; background: var(--border);
}
.country-card { overflow: auto; }

/* Country table rows */
.country-table th { background: #f8fafc; font-size: 0.75rem; }
.country-name { font-size: 0.85rem; color: var(--text-primary); padding: 9px 12px; }
.country-val {
  padding: 9px 12px; white-space: nowrap;
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
}
.country-num { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.country-bar-bg {
  display: inline-block; height: 10px; background: rgba(124, 203, 236, 0.35);
  border-radius: 2px; overflow: hidden; flex-shrink: 0;
}
.country-bar-fill { height: 100%; background: var(--color-primary); border-radius: 2px; }

/* Desktop 2-column */
@media (min-width: 900px) {
  .channel-country-row {
    grid-template-columns: 1fr 1px 1fr;
    gap: 32px;
    align-items: stretch;
  }
  .section-divider { 
    display: block; 
    height: 100%;
    align-self: center;
  }
}



/* ─── Charts Row ─────────────────────────────────────────────────────────── */

.charts-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.chart-card h3 {
  font-size: var(--text-card-title-size);
  font-weight: var(--text-card-title-weight);
}

.chart-badge {
  font-size: 0.7rem;
  font-weight: 600;
}

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

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

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon svg { width: 18px; height: 18px; }
.kpi-symbol-icon {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-change {
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 99px;
}

.kpi-change.up {
  color: var(--color-success);
  background: rgba(34, 197, 94, 0.1);
}

.kpi-change.down {
  color: var(--color-error);
  background: rgba(239, 68, 68, 0.1);
}

.vs-value {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-top: -2px;
  margin-bottom: 4px;
}

.change-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-left: 4px;
  white-space: nowrap;
}

.kpi-change.neutral {
  color: var(--text-tertiary);
  background: var(--bg);
}

.kpi-body {
  margin-top: auto;
}

.kpi-value {
  font-size: var(--text-metric-size);
  font-weight: var(--text-metric-weight);
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: normal;
}


/* ─── Skeleton ───────────────────────────────────────────────────────────── */
.skeleton-card {
  background: #f0f2f7;
  background-size: 400% 100%;
  animation: shimmer 1.5s infinite;
  min-height: 90px;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

/* ─── Full-width Trend Chart ─────────────────────────────────────────────── */
.trend-chart-section { margin-bottom: 20px; }
.chart-subtitle { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 2px; font-weight: 400; }

/* ─── Channel + Country 2-Column Layout ─────────────────────────────────── */
.channel-country-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.section-divider {
  display: none; /* vertical line — only shown on desktop */
  width: 1px; background: var(--border);
}
.country-card { overflow: auto; }

/* Country table rows */
.country-table th { background: #f8fafc; font-size: 0.75rem; }
.country-name { font-size: 0.85rem; color: var(--text-primary); padding: 9px 12px; }
.country-val {
  padding: 9px 12px; white-space: nowrap;
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
}
.country-num { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.country-bar-bg {
  display: inline-block; height: 10px; background: rgba(124, 203, 236, 0.35);
  border-radius: 2px; overflow: hidden; flex-shrink: 0;
}
.country-bar-fill { height: 100%; background: var(--color-primary); border-radius: 2px; }

/* Desktop 2-column */
@media (min-width: 900px) {
  .channel-country-row {
    grid-template-columns: 1fr 1px 1fr;
    gap: 32px;
    align-items: stretch;
  }
  .section-divider { 
    display: block; 
    height: 100%;
    align-self: center;
  }
}



/* ─── Charts Row ─────────────────────────────────────────────────────────── */

.charts-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.chart-card h3 {
  font-size: var(--text-card-title-size);
  font-weight: var(--text-card-title-weight);
}

.chart-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--color-primary-08);
  color: var(--color-primary);
  padding: 3px 8px;
  border-radius: 99px;
}
.chart-wrap {
  position: relative;
}

/* ─── Bottom Row ─────────────────────────────────────────────────────────── */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.table-card,
.commentary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

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

.table-card-header h3,
.commentary-header h3 {
  font-size: var(--text-card-title-size);
  font-weight: var(--text-card-title-weight);
}

.table-badge {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ─── Skeleton ───────────────────────────────────────────────────────────── */
.skeleton-card {
  background: #f0f2f7;
  background-size: 400% 100%;
  animation: shimmer 1.5s infinite;
  min-height: 90px;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

/* ─── Full-width Trend Chart ─────────────────────────────────────────────── */
.trend-chart-section { margin-bottom: 20px; }
.chart-subtitle { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 2px; font-weight: 400; }

/* ─── Channel + Country 2-Column Layout ─────────────────────────────────── */
.channel-country-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.section-divider {
  display: none; /* vertical line — only shown on desktop */
  width: 1px; background: var(--border);
}
.country-card { overflow: auto; }

/* Country table rows */
.country-table th { background: #f8fafc; font-size: 0.75rem; }
.country-name { font-size: 0.85rem; color: var(--text-primary); padding: 9px 12px; }
.country-val {
  padding: 9px 12px; white-space: nowrap;
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
}
.country-num { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.country-bar-bg {
  display: inline-block; height: 10px; background: rgba(124, 203, 236, 0.35);
  border-radius: 2px; overflow: hidden; flex-shrink: 0;
}
.country-bar-fill { height: 100%; background: var(--color-primary); border-radius: 2px; }

/* Desktop 2-column */
@media (min-width: 900px) {
  .channel-country-row {
    grid-template-columns: 1fr 1px 1fr;
    gap: 32px;
    align-items: stretch;
  }
  .section-divider { 
    display: block; 
    height: 100%;
    align-self: center;
  }
}



/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
═══════════════════════════════════════════════════════════════════════════ */

/* Tablet and up (768px+) */
@media (min-width: 768px) {
  .main {
    padding: 28px 32px;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
  }

  .topbar-left .page-title {
    font-size: 1.5rem;
  }

  .connect-banner-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .kpi-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .charts-row {
    grid-template-columns: 1fr 320px;
    gap: 20px;
  }

  .bottom-row {
    grid-template-columns: 1fr 320px;
    gap: 20px;
  }

  .chart-card {
    padding: 24px;
  }

  .table-card,
  .commentary-card {
    padding: 24px;
  }
}

/* Desktop (1024px+) — sidebar is visible */
@media (min-width: 1024px) {

  /* Hide mobile-only header */
  .mobile-header {
    display: none;
  }

  /* Sidebar becomes part of normal flow */
  .sidebar {
    position: sticky;
    top: 0;
    transform: translateX(0) !important;
    height: 100vh;
    flex-shrink: 0;
    box-shadow: none;
  }

  /* App shell fills full viewport */
  .app-shell {
    min-height: 100vh;
  }

  .main {
    padding: 28px 32px;
  }

  .kpi-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

/* Large Desktop (1280px+) */
@media (min-width: 1280px) {
  .kpi-row {
    grid-template-columns: repeat(6, 1fr);
  }
  .kpi-row.kpi-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .charts-row {
    grid-template-columns: 1fr 360px;
  }

  .bottom-row {
    grid-template-columns: 1fr 360px;
  }
}
/* --- Pagination (v2) --- */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pagination-page {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 80px;
  text-align: center;
}

.pagination-controls .btn-xs {
  min-width: 90px;
  height: 32px;
  border-radius: 8px;
}

.pagination-controls svg {
  margin: 0 4px;
}

@media (max-width: 640px) {
  .pagination-wrap {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }
}

.editable-title {
  position: relative;
  cursor: text;
  transition: all 0.2s;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
}

.editable-title:hover {
  border-color: var(--border);
}

.editable-title:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.section-content-container {
  position: relative;
  min-height: 100px;
}

.image-area {
  position: relative;
  width: 100%;
  text-align: center;
}

.section-preview {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  margin-top: 12px;
}

.upload-placeholder-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: #f8fafc;
  padding: 40px 20px;
  transition: all 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
}

.upload-placeholder-area:hover {
  border-color: var(--primary);
  background: #f1f5f9;
}

.placeholder-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.placeholder-icon {
  color: var(--text-disabled);
  margin-bottom: 16px;
}

.placeholder-content p {
  color: var(--text-tertiary);
  font-weight: 600;
  margin-bottom: 20px;
}

.image-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
  opacity: 0;
  transition: opacity 0.2s;
}

.image-area:hover .image-actions {
  opacity: 1;
}

.upload-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.site-dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  margin-top: 4px;
}

.site-dropdown-list .site-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.2s;
  border-bottom: 1px solid var(--border);
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.4;
}

.site-dropdown-list .site-item:last-child { border-bottom: none; }
.site-dropdown-list .site-item:hover { background: var(--bg-hover); color: var(--primary); }

.site-dropdown-list .site-item.selected { 
  background: var(--color-primary-08);
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

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

.header-date-badge {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.9rem;
  color: var(--text-tertiary);
  font-weight: 500;
  transition: all 0.2s;
}

.header-date-badge:hover {
  border-color: var(--primary);
  background: #f8fafc;
  color: var(--primary);
}

/* --- Website Health Overhaul Styles --------------------------------------- */
.health-top-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.crawled-pages-card .crawled-stats-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.crawled-total {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.crawled-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.breakdown-item:last-child { border-bottom: none; }
.breakdown-item .label { color: var(--text-secondary); }
.breakdown-item .val { font-weight: 700; }
.breakdown-item.healthy .val { color: var(--color-success); }
.breakdown-item.broken .val { color: var(--color-error); }

.ai-gauge-wrap {
  position: relative;
  height: 140px;
  margin-top: 10px;
}

.ai-gauge-val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  padding-top: 40px;
}

.ai-health-note {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 12px;
}

.blocked-ai-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.blocked-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--r-md);
}

.status-good { color: var(--color-success); font-weight: 600; font-size: 0.75rem; }

.trend-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.trend-tab {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 99px;
  background: var(--bg);
  color: var(--text-secondary);
  transition: all 0.2s;
  cursor: pointer;
}

.trend-tab.active { background: var(--color-primary); color: #fff; }

.issue-item-v2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.issue-item-v2:last-child { border-bottom: none; }

.issue-main { display: flex; align-items: center; gap: 12px; }

.issue-severity {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.issue-severity.error { background: #fee2e2; color: #ef4444; }
.issue-severity.warning { background: #fef3c7; color: #d97706; }
.issue-severity.notice { background: #e0f2fe; color: #0ea5e9; }

.issue-desc { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }

.thematic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.thematic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thematic-label { font-size: 0.75rem; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; }
.thematic-val { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); }
.thematic-bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.thematic-bar .fill { height: 100%; background: var(--color-primary); border-radius: 3px; }

/* --- Backlinks Overhaul Styles ------------------------------------------ */
.kpi-row-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.kpi-card-v2 {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-card-v2 .kpi-label { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.kpi-card-v2 .kpi-value { font-size: var(--text-metric-size); font-weight: var(--text-metric-weight); color: var(--text-primary); }
.kpi-card-v2 .kpi-value.toxicity.high { color: var(--color-error); }
.kpi-card-v2 .kpi-value.toxicity.medium { color: var(--color-warning); }
.kpi-card-v2 .kpi-value.toxicity.low { color: var(--color-success); }

.kpi-change { font-size: 0.75rem; font-weight: 700; color: var(--color-success); }

.backlinks-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.authority-flex {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 10px;
}

.authority-gauge-wrap {
  position: relative;
  width: 120px;
  height: 100px;
}

.authority-val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  padding-top: 30px;
}

.authority-info .auth-rating {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.authority-info p {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-tertiary);
  letter-spacing: 1px;
}

.network-placeholder {
  height: 180px;
  background: var(--bg);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
}

.network-status {
  padding: 8px 16px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.8rem;
}

.network-status.safe { background: rgba(34, 197, 94, 0.1); color: var(--color-success); }
.network-status.dangerous { background: rgba(239, 68, 68, 0.1); color: var(--color-error); }

/* --- Summary Section ------------------------------------------------------ */
.summary-card {
  background: var(--gradient-secondary);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 32px;
}

.summary-header h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: 24px; }

.summary-block { margin-bottom: 24px; }
.summary-block h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }
.summary-block ul { padding-left: 20px; }
.summary-block li { margin-bottom: 8px; font-size: 0.95rem; }

.form-section {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.form-section:last-child { border-bottom: none; }

.form-section-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}


/* ─── Channel Breakdown Table Enhancements ──────────────────────────────── */
.channel-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.channel-name {
  font-weight: 700;
  color: var(--text-primary);
}

.session-volume-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-bar-bg {
  width: 100%;
  height: 4px;
  background: var(--bg-soft);
  border-radius: 99px;
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.key-event-badge {
  display: inline-flex;
  padding: 4px 10px;
  background: #f0fdf4;
  color: #166534;
  font-weight: 800;
  border-radius: 8px;
  font-size: 0.85rem;
  border: 1px solid #dcfce7;
  font-family: var(--font-mono);
}

.rate-cell {
  font-weight: 600;
  color: var(--text-secondary);
}

.align-right { text-align: right; }
.align-center { text-align: center; }
.font-mono { font-family: var(--font-mono); }

/* ─── Standard Report Table Professional Styling ──────────────────────────── */
.report-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.report-table thead th {
  background: #f8fafc;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: left;
}

.report-table thead th:last-child {
  border-right: none;
}

.report-table td {
  padding: 12px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.report-table td:last-child {
  border-right: none;
}

.report-table tr:hover td {
  background-color: #f8fafc !important;
}

/* Professional Cell Colors with better contrast */
.cell-blue { background: #eff6ff !important; color: #1e40af; font-weight: 600; border-right-color: #dbeafe !important; }
.cell-mint { background: #f0fdf4 !important; color: #166534; font-weight: 600; border-right-color: #dcfce7 !important; }
.cell-rose { background: #fff1f2 !important; color: #9d174d; font-weight: 600; border-right-color: #ffe4e6 !important; }
.cell-amber { background: #fffbeb !important; color: #92400e; font-weight: 600; border-right-color: #fef3c7 !important; }

.report-table .font-bold {
  color: var(--text-primary);
  font-weight: 700;
}

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

/* ─── Sessions 2.0 Extra Grid Layout ────────────────────────────────────── */
@media (min-width: 1280px) {
  .sessions-extra-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important; /* Equal width */
    gap: 24px !important;
  }
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}

/* Ensure table stays within card and doesn't bleed out */
.table-card {
  overflow: hidden;
}

.report-table {
  min-width: 500px; /* Minimum width before scrolling starts */
}

/* ─── Sessions Page Fix ──────────────────────────────────────────────────── */
.bottom-row.sessions-extra-grid {
  background: transparent !important;
  backdrop-filter: none !important;
}

/* ─── Dashboard Report Layout ─────────────────────────────────────────────── */
.dashboard-report .kpi-row {
  margin-bottom: 24px;
}

@media (min-width: 1280px) {
  .dashboard-report .kpi-row.kpi-row-5 {
    grid-template-columns: repeat(5, 1fr);
  }
}

.dashboard-report-summary {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: var(--text-body-size);
  line-height: 1.9;
}

.dashboard-report-summary li {
  margin-bottom: 4px;
}

.dashboard-report-summary .trend-up {
  color: var(--color-success);
  font-weight: 600;
}

.dashboard-report-summary .trend-down {
  color: var(--color-error);
  font-weight: 600;
}

.dashboard-report-summary .kpi-summary-item,
.dashboard-report-summary .insights-editor-item,
.dashboard-report-insights .insights-editor-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  list-style: inherit;
  border-radius: var(--r-sm, 4px);
  padding: 2px 6px 2px 0;
  margin-left: -6px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-report-summary .kpi-summary-item__text,
.dashboard-report-summary .insights-editor-item__text,
.dashboard-report-insights .insights-editor-item__text {
  flex: 1;
  min-width: 0;
  cursor: text;
  outline: none;
}

.dashboard-report-summary .kpi-summary-item:hover,
.dashboard-report-summary .insights-editor-item:hover,
.dashboard-report-insights .insights-editor-item:hover {
  background: var(--color-secondary-08, rgba(14, 165, 233, 0.08));
}

.dashboard-report-summary .kpi-summary-item__text:focus,
.dashboard-report-summary .insights-editor-item__text:focus,
.dashboard-report-insights .insights-editor-item__text:focus {
  background: #fff;
  box-shadow: 0 0 0 2px var(--color-secondary-16, rgba(14, 165, 233, 0.25));
  border-radius: var(--r-sm, 4px);
}

.kpi-summary-editor,
.insights-editor {
  margin-bottom: 8px;
}

.kpi-summary-editor__toolbar,
.insights-editor__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.kpi-summary-editor__label,
.insights-editor__label {
  font-size: var(--text-small-size);
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.kpi-summary-editor__actions,
.insights-editor__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.kpi-summary-item__remove,
.insights-editor-item__remove {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: var(--r-sm, 4px);
  background: transparent;
  color: var(--text-tertiary);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.kpi-summary-item:hover .kpi-summary-item__remove,
.kpi-summary-item__remove:focus,
.insights-editor-item:hover .insights-editor-item__remove,
.insights-editor-item__remove:focus {
  opacity: 1;
}

.kpi-summary-item__remove:hover,
.insights-editor-item__remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
}

.kpi-summary-empty,
.insights-editor-empty {
  color: var(--text-tertiary);
  font-style: italic;
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}

.dashboard-report-insights .insights-editor {
  margin-top: 0;
}

.insights-quill-card {
  width: 100%;
  margin-top: 0;
  padding: 16px 20px 20px;
}

.insights-quill-card__header {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.insights-quill-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.insights-quill-card .insights-quill-editor {
  min-height: 140px;
}

.insights-quill-card .ql-toolbar.ql-snow {
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--r-md) var(--r-md) 0 0;
  background: var(--bg);
}

.insights-quill-card .ql-container.ql-snow {
  border: 1px solid var(--border);
  border-radius: 0 0 var(--r-md) var(--r-md);
}

.insights-quill-card .ql-container {
  min-height: 120px;
  font-size: var(--text-body-size);
  line-height: 1.75;
  color: var(--text-secondary);
}

.insights-quill-card .ql-editor ul,
.insights-quill-card .ql-editor ol {
  padding-left: 1.25rem;
}

.insights-quill-card .ql-editor li {
  margin-bottom: 4px;
}

.dashboard-report-divider {
  border: none;
  border-top: 2px dotted var(--border);
  margin: 28px 0;
  position: relative;
  height: 0;
}

.dashboard-report-divider__diamond {
  position: absolute;
  top: -4px;
  width: 8px;
  height: 8px;
  background: var(--color-secondary);
  transform: rotate(45deg);
}

.dashboard-report-divider__diamond--start { left: 0; }
.dashboard-report-divider__diamond--end { right: 0; }

.dashboard-report-section {
  margin-bottom: 8px;
}

@media (min-width: 1280px) {
  .kpi-row.kpi-row-5 {
    grid-template-columns: repeat(5, 1fr);
  }
}

.dashboard-report-title {
  display: block;
  width: 100%;
  max-width: 100%;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 20px;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.dashboard-report-title--editable {
  cursor: text;
  border-radius: var(--r-md);
  padding: 8px 16px;
  box-sizing: border-box;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-report-title--editable:hover {
  background: var(--color-secondary-08, rgba(14, 165, 233, 0.08));
}

.dashboard-report-title--editable:focus {
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 2px var(--color-secondary-16, rgba(14, 165, 233, 0.25));
  color: var(--text-primary);
}

.dashboard-report-title--italic {
  font-style: italic;
}

.conversions-report-table thead th {
  background: #f1f5f9;
  color: var(--text-primary);
  border-color: #e2e8f0;
  font-size: 0.8rem;
}

.conversions-report-table tbody td {
  font-size: 0.85rem;
  vertical-align: top;
}

.conversion-meta-cell {
  min-width: 90px;
  color: var(--text-secondary);
  line-height: 1.5;
  cursor: text;
}

.conversion-meta-cell:focus {
  outline: none;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--color-secondary-16, rgba(14, 165, 233, 0.25));
}

.conversion-meta-cell--wide {
  min-width: 220px;
  max-width: 360px;
}

.dashboard-report-banner {
  background: var(--color-secondary);
  color: #fff;
  font-weight: 700;
  text-align: center;
  padding: 12px 20px;
  margin: 0 0 20px;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.semrush-editor-card {
  margin-bottom: 8px;
}

.semrush-editor-card .ql-container {
  min-height: 220px;
}

.dashboard-report-insights {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 20px 0 0;
  color: var(--text-secondary);
  font-size: var(--text-small-size);
  line-height: 1.75;
}

.dashboard-report-insights li {
  margin-bottom: 8px;
}

.dashboard-report-insights strong,
.dashboard-report-insights .trend-up,
.dashboard-report-insights .trend-down {
  font-weight: 600;
}

.dashboard-report-insights .trend-up { color: var(--color-success); }
.dashboard-report-insights .trend-down { color: var(--color-error); }

.dashboard-report-table thead th {
  background: #1e293b;
  color: #fff;
  border-color: #334155;
}

.dashboard-report-table .total-row td {
  background: #f8fafc;
  border-top: 2px solid var(--border);
  font-weight: 700;
}

.dashboard-report-table .cell-users { background: #eff6ff !important; }
.dashboard-report-table .cell-sessions { background: #ecfeff !important; }
.dashboard-report-table .cell-keyevents { background: #fdf2f8 !important; }
.dashboard-report-table .cell-events { background: #f0fdf4 !important; }

.dashboard-report-lead {
  color: var(--text-secondary);
  font-size: var(--text-body-size);
  line-height: 1.75;
  margin: 0 0 16px;
}

.dashboard-report-lead--bold {
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 20px;
}

.dashboard-report-note {
  color: var(--text-secondary);
  font-size: var(--text-small-size);
  line-height: 1.75;
  margin: 16px 0 0;
}

.dashboard-report-buckets {
  list-style: none;
  padding: 0;
  margin: 12px 0 16px;
  color: var(--text-secondary);
  font-size: var(--text-small-size);
  line-height: 1.9;
}

.dashboard-report-buckets li {
  margin-bottom: 4px;
}

.dashboard-report-insights .trend-neutral {
  color: var(--color-secondary);
  font-weight: 600;
}

.report-table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.report-table-pagination-label {
  font-size: var(--text-small-size);
  color: var(--text-tertiary);
}

.report-table-pagination-actions {
  display: flex;
  gap: 4px;
}

.report-table-pagination-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
}

.report-table-pagination-actions button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.report-table-pagination-actions button:not(:disabled):hover {
  background: var(--color-primary-08);
  border-color: var(--color-primary-16);
  color: var(--color-primary);
}

.dashboard-report-table .page-path {
  font-size: 0.85rem;
  color: var(--text-primary);
  word-break: break-all;
}
