/* ================================================================
   Savit — Unified Design System
   Source of truth: PPC Engine design language
   Shared by: Content Engine, Audit Engine
   (PPC Engine carries its own inline CSS as the original source)
   ================================================================ */

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

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #64748b;
  --bg-color: #f0f2f5;
  --text-main: #1e293b;
  --border-color: #e2e8f0;
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  --focus-ring: rgba(37, 99, 235, 0.25);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  background: var(--bg-color);
  color: var(--text-main);
  background-image: radial-gradient(circle at top right, rgba(37,99,235,0.04) 0%, transparent 40%),
                    radial-gradient(circle at bottom left, rgba(124,58,237,0.03) 0%, transparent 40%);
  background-attachment: fixed;
}
input, select, textarea, button { font-family: inherit; }

/* ── LAYOUT SHELL ─────────────────────────────────────────── */
#app-wrapper { min-height: 100vh; display: flex; }
#main-content { flex-grow: 1; display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .25s ease;
}
.sidebar.collapsed { width: 0; overflow: hidden; }

/* Brand */
.sidebar-brand {
  padding: 16px 14px 14px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  flex-shrink: 0;
}
.sb-logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px; color: #fff; flex-shrink: 0;
  font-style: italic; letter-spacing: -1px;
}
.logo-text  { font-size: 15px; font-weight: 800; color: #fff; letter-spacing: -.4px; line-height: 1.1; }
.logo-sub   { font-size: 9px; color: #475569; letter-spacing: .7px; text-transform: uppercase; margin-top: 2px; }

/* Section labels */
.sidebar-section {
  padding: 14px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .8px;
  flex-shrink: 0;
}

/* Nav links */
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  margin: 1px 6px;
  border-radius: 6px;
  color: #94a3b8;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 500;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.sidebar-nav a:hover  { background: #1e293b; color: #e2e8f0; }
.sidebar-nav a.active { background: #2563eb; color: #fff; }
.sidebar-nav a .bi    { font-size: 13px; width: 15px; text-align: center; flex-shrink: 0; }
.sidebar-nav a .soon  {
  font-size: 9px; padding: 1px 5px; background: #1e293b;
  color: #475569; border-radius: 8px; margin-left: auto;
}

/* Engine-switcher links — slightly elevated so they read as "mode" tabs */
.sb-engine-link        { font-weight: 600 !important; }
.sb-engine-link.active { background: #1d4ed8 !important; color: #fff !important; }
.sb-active-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #93c5fd; flex-shrink: 0; margin-left: auto;
}

/* Divider inside sidebar */
.sidebar-divider { border: none; border-top: 1px solid #1e293b; margin: 8px 12px; }

/* Footer */
.sidebar-footer {
  margin-top: auto;
  padding: 10px 14px;
  border-top: 1px solid #1e293b;
  flex-shrink: 0;
}
.sidebar-footer small { color: #475569; font-size: 10px; }

/* Scrollbar */
.sidebar::-webkit-scrollbar       { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

/* Collapse text */
.sidebar.collapsed .logo-text,
.sidebar.collapsed .logo-sub,
.sidebar.collapsed .sidebar-section,
.sidebar.collapsed .sidebar-nav span,
.sidebar.collapsed .sb-active-dot,
.sidebar.collapsed .sidebar-footer { opacity: 0; pointer-events: none; }

/* ── TOPBAR ───────────────────────────────────────────────── */
.savit-topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 20px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
}
.savit-topbar .topbar-left  { display: flex; align-items: center; gap: 10px; }
.savit-topbar .topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-title { font-weight: 800; font-size: 14px; color: #0f172a; }
.topbar-engine-badge {
  font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
  background: rgba(37,99,235,.1); color: #2563eb; letter-spacing: .2px;
}
.topbar-toggle {
  background: transparent; border: none; color: #64748b;
  padding: 4px 6px; border-radius: 6px; cursor: pointer; line-height: 1;
  transition: background .15s, color .15s;
}
.topbar-toggle:hover { background: #f1f5f9; color: #1e293b; }

/* ── BOOTSTRAP CARD OVERRIDES ─────────────────────────────── */
.card {
  border-radius: 12px !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  box-shadow: var(--card-shadow) !important;
  animation: savitFade .25s ease-out;
  background: var(--card-bg) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
}
.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--border-color) !important;
  border-radius: 12px 12px 0 0 !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  color: #0f172a !important;
  padding: 14px 20px !important;
}
.card-body    { padding: 14px 16px !important; }
.card-footer  { background: #f8fafc !important; border-top: 1px solid #f1f5f9 !important; }

/* ── PPC-STYLE SECTION CARDS (pcard) ─────────────────────── */
.pcard { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 14px; }
.pcard-head {
  padding: 11px 16px; border-bottom: 1px solid #f1f5f9;
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 13px; color: #0f172a;
}
.pcard-head .ph-icon {
  width: 24px; height: 24px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; flex-shrink: 0;
}
.ph-icon.blue   { background: #2563eb; }
.ph-icon.purple { background: #7c3aed; }
.ph-icon.teal   { background: #0891b2; }
.ph-icon.green  { background: #16a34a; }
.ph-icon.amber  { background: #d97706; }
.ph-icon.red    { background: #dc2626; }
.ph-icon.slate  { background: #475569; }
.pcard-body { padding: 14px 16px; }

/* ── KPI STAT CARDS ───────────────────────────────────────── */
.stat-icon { flex-shrink: 0; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 10px; }

/* ── TABLES ───────────────────────────────────────────────── */
.table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.table thead th {
  background: rgba(248, 250, 252, 0.7) !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #475569 !important;
  white-space: nowrap;
  padding: 12px 16px !important;
  border-bottom: 2px solid var(--border-color) !important;
  border-top: none !important;
}
.table tbody td { 
  font-size: 13px; 
  vertical-align: middle; 
  padding: 12px 16px !important;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.15s ease;
}
.table-hover tbody tr:hover td { 
  background: rgba(248, 250, 252, 0.9) !important; 
}
.table-responsive {
  border-radius: 8px;
  overflow-x: auto;   /* was: hidden — that blocked horizontal scroll */
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

/* Scrollable table: fade hint on right edge when content overflows */
.table-scroll-wrap {
  position: relative;
}
.table-scroll-wrap::after {
  content: '';
  pointer-events: none;
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 32px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,.85));
  border-radius: 0 8px 8px 0;
  opacity: 0;
  transition: opacity .2s;
}
.table-scroll-wrap.has-overflow::after { opacity: 1; }

/* Sticky first column for wide tables */
.table-sticky-col thead th:first-child,
.table-sticky-col tbody td:first-child {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
  box-shadow: 2px 0 4px rgba(0,0,0,.04);
}
.table-sticky-col thead th:first-child {
  background: #f8fafc;
  z-index: 3;
}

/* ── DATATABLES OVERRIDES ─────────────────────────────────── */
.dataTables_wrapper .row { align-items: center; margin-bottom: 12px; }
.dataTables_filter input {
  border-radius: 20px !important;
  padding: 6px 16px !important;
  border: 1px solid var(--border-color) !important;
  transition: all 0.2s;
  font-size: 12px;
}
.dataTables_filter input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--focus-ring) !important;
  outline: none;
}
.dataTables_length select {
  border-radius: 8px !important;
  border: 1px solid var(--border-color) !important;
  padding: 4px 30px 4px 10px !important;
}
div.dataTables_info, div.dataTables_paginate {
  font-size: 12px;
  color: var(--secondary);
  margin-top: 12px;
}
.page-item.active .page-link {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.page-link {
  border-radius: 6px;
  margin: 0 3px;
  color: var(--text-main);
  border: 1px solid transparent;
}
.page-link:hover {
  background-color: #f1f5f9;
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn { font-family: inherit; font-weight: 600; border-radius: 8px !important; font-size: 12px !important; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary    { background: var(--primary) !important; border-color: var(--primary) !important; box-shadow: 0 2px 8px rgba(37,99,235,0.25); }
.btn-primary:hover { background: var(--primary-hover) !important; border-color: var(--primary-hover) !important; box-shadow: 0 4px 12px rgba(37,99,235,0.35); }

/* Topbar-style micro buttons (PPC-derived) */
.btn-tb {
  height: 30px; padding: 0 11px; font-size: 11px; font-weight: 600;
  border-radius: 6px; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; transition: all .15s;
}
.btn-tb-outline { background: #fff; border: 1px solid #e2e8f0 !important; color: #475569; }
.btn-tb-outline:hover { background: #f8fafc; border-color: #cbd5e1 !important; }
.btn-tb-primary { background: #2563eb; color: #fff; }
.btn-tb-primary:hover { background: #1d4ed8; }
.btn-tb-green   { background: #16a34a; color: #fff; }
.btn-tb-green:hover { background: #15803d; }

/* ── FORMS ────────────────────────────────────────────────── */
.form-control, .form-select {
  font-family: inherit;
  font-size: 13px !important;
  border-color: #e2e8f0;
  border-radius: 6px !important;
}
.form-control:focus, .form-select:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37,99,235,.1) !important;
}
.form-label { font-size: 12px; font-weight: 600; color: #374151; }
.form-label-sm {
  display: block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: #64748b; margin-bottom: 4px;
}
.form-ctrl {
  width: 100%; border: 1px solid #e2e8f0; border-radius: 6px;
  padding: 7px 10px; font-size: 13px; outline: none;
  transition: border .15s; background: #fff; font-family: inherit;
}
.form-ctrl:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.1); }

/* ── BADGE UTILITIES ──────────────────────────────────────── */
.badge { font-weight: 600; letter-spacing: .01em; }
.bg-primary-subtle   { background-color: rgba(37,99,235,.1)  !important; }
.bg-success-subtle   { background-color: rgba(22,163,74,.1)  !important; }
.bg-danger-subtle    { background-color: rgba(220,38,38,.1)  !important; }
.bg-warning-subtle   { background-color: rgba(217,119,6,.12) !important; }
.bg-info-subtle      { background-color: rgba(8,145,178,.1)  !important; }
.bg-secondary-subtle { background-color: rgba(71,85,105,.08) !important; }
.text-primary { color: #2563eb !important; }

/* ── CONTENT ENGINE — SPECIFIC ────────────────────────────── */
.content-preview {
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.8; color: #1e293b; font-size: 15px;
}
.content-preview h1 { font-size: 2em; margin-bottom: .3em; margin-top: 0; }
.content-preview h2 { font-size: 1.35em; margin-top: 1.8em; color: #0f172a; border-bottom: 2px solid #f0f2f5; padding-bottom: 4px; }
.content-preview h3 { font-size: 1.1em; margin-top: 1.3em; color: #334155; }
.content-preview p  { margin: .85em 0; }
.content-preview ul, .content-preview ol { margin: .85em 0 .85em 1.4em; }
.content-preview li { margin-bottom: .4em; }
.content-preview strong { font-weight: 700; }
.content-preview blockquote {
  border-left: 4px solid #2563eb; padding: .5em 1em;
  margin: 1em 0; color: #555; background: #f0f7ff; border-radius: 0 6px 6px 0;
}

.font-mono { font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace; font-size: 13px; line-height: 1.5; }

.var-tag {
  cursor: pointer; padding: 2px 6px; border-radius: 4px;
  transition: background .15s; display: inline-block !important; margin-bottom: 3px;
}
.var-tag:hover { background: #dbeafe; color: #1d4ed8 !important; }

.upload-zone { cursor: pointer; transition: border-color .2s, background .2s; }
.upload-zone:hover { background: #f0f7ff; border-color: #2563eb !important; }

.flow-step { flex-shrink: 0; }

/* ── MISC UTILITIES ───────────────────────────────────────── */
.border-dashed    { border-style: dashed !important; }
.hover-primary:hover { color: #2563eb !important; }
.card-body .bi    { line-height: 1; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; z-index: 1000;
    transform: translateX(-100%);
    transition: transform .25s ease;
    height: 100vh; overflow-y: auto;
  }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.4); }
  #main-content { margin-left: 0 !important; }
  /* Stack topbar items on small screens */
  .savit-topbar { flex-wrap: wrap; gap: 4px; }
}

/* ── ANIMATIONS ───────────────────────────────────────────── */
@keyframes savitFade {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   AI PROMPT RESEARCH MODULE — Full CSS Port
   Ported from ai-tool/theme/css/* and research-specific page styles
   Scoped to .research-* classes and #research-container.
   ================================================================ */

/* ── RESEARCH MODULE: CSS VARIABLES ─────────────────────────── */
:root {
  --research-primary:   #FF6B35;
  --research-primary-h: #f05a24;
  --research-dark:      #1A1A2E;
  --research-cyan:      #00D9FF;
  --research-border:    rgba(0, 0, 0, 0.07);
}

/* ── STEP NAVIGATION ─────────────────────────────────────────── */
#research-container .research-step {
  transition: opacity 0.25s ease;
}

/* ── OPTION CARDS (Step 1) ───────────────────────────────────── */
.research-option-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  cursor: pointer;
  border: 1.5px solid #e2e8f0 !important;
}
.research-option-card:hover {
  border-color: var(--research-primary) !important;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.1);
}
.research-option-card.active {
  border-color: var(--research-primary) !important;
  background-color: #fff8f5 !important;
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.12);
}
.research-option-card .clickable-label { cursor: pointer; }

/* Custom Radio */
#research-container .custom-radio {
  width: 18px;
  height: 18px;
  border: 2px solid #ddd;
  box-shadow: none !important;
  cursor: pointer;
  accent-color: var(--research-primary);
}

/* Model Dropdown */
.model-dropdown-wrapper .dropdown-toggle::after { display: none; }
.model-dropdown-wrapper .btn {
  background: #fff !important;
  border-color: #e2e8f0 !important;
  color: #1e293b !important;
}
.model-dropdown-wrapper .btn:hover {
  border-color: var(--research-primary) !important;
  box-shadow: 0 0 0 2px rgba(255,107,53,.12);
}

/* Textarea / Inputs in Research forms */
#research-container .form-control:focus {
  border-color: var(--research-primary) !important;
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12) !important;
}
#research-container .resize-none { resize: none; }
#research-container .extra-small  { font-size: 11px; }
#research-container .cursor-help  { cursor: help; }

/* Next Step / Finish Buttons */
#research-container .btn-primary,
#btn-finish,
#btn-next-step {
  background: var(--research-primary) !important;
  border-color: var(--research-primary) !important;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
}
#research-container .btn-primary:hover,
#btn-finish:hover,
#btn-next-step:hover {
  background: var(--research-primary-h) !important;
  border-color: var(--research-primary-h) !important;
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

/* ── PROMPT RESULTS TABLE (Step 2) ───────────────────────────── */
.prompt-results-container {
  max-height: 520px;
  overflow-y: auto;
}
.prompt-results-container::-webkit-scrollbar { width: 5px; }
.prompt-results-container::-webkit-scrollbar-thumb {
  background: #e2e8f0; border-radius: 4px;
}

#results-table thead th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0 !important;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 12px !important;
  white-space: nowrap;
}
#results-table tbody td {
  padding: 13px 14px !important;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
#results-table tbody tr:hover td { background: #fff8f5 !important; }

/* Intent Score Pills */
.score-pill {
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.72rem;
  min-width: 26px;
  display: inline-block;
  text-align: center;
}
.score-1  { background: #fee2e2; color: #ef4444; }
.score-2  { background: #fecaca; color: #dc2626; }
.score-3  { background: #fca5a5; color: #b91c1c; }
.score-4  { background: #fff7ed; color: #ea580c; }
.score-5  { background: #ffedd5; color: #f59e0b; }
.score-6  { background: #fef3c7; color: #d97706; }
.score-7  { background: #ecfdf5; color: #10b981; }
.score-8  { background: #d1fae5; color: #059669; }
.score-9  { background: #a7f3d0; color: #047857; }
.score-10 { background: #6ee7b7; color: #065f46; }

/* Visibility badge overrides */
.score-pill.score-high { background: #d1fae5; color: #047857; }
.score-pill.score-mid  { background: #fef3c7; color: #d97706; }
.score-pill.score-low  { background: #fee2e2; color: #ef4444; }

/* Intent column cells */
.intent-col { padding: 10px 8px !important; }

/* Sortable column headers */
.sortable-header {
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  border-radius: 4px;
  padding: 4px 6px;
}
.sortable-header:hover { background: rgba(0,0,0,0.04); }
.sortable-header .sort-up,
.sortable-header .sort-down { font-size: 0.55rem; transition: color 0.15s; }
.sortable-header.sorting-asc  .sort-up   { color: var(--research-primary); opacity: 1 !important; }
.sortable-header.sorting-desc .sort-down { color: var(--research-primary); opacity: 1 !important; }

/* Prompt text clamp */
.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--research-primary) !important;
}

/* ── PROJECTS TABLE (Step 3 + Prompts Management) ────────────── */
#projects-table thead th,
.custom-prompts-table thead th {
  background: #f8fafc;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #64748b !important;
  border-bottom: 2px solid #e2e8f0 !important;
  padding: 10px 14px !important;
}
#projects-table tbody td,
.custom-prompts-table tbody td {
  padding: 14px 14px !important;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
#projects-table tbody tr:hover td,
.custom-prompts-table tbody tr:hover td { background: #fff8f5 !important; }

/* Status icon cell */
.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
}

/* ── AI RESPONSE CONTENT (Details View) ──────────────────────── */
.ai-response-content {
  line-height: 1.75;
  font-size: 13.5px;
  color: #1e293b;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem !important;
  max-height: 480px;
  overflow-y: auto;
}
.ai-response-content::-webkit-scrollbar { width: 5px; }
.ai-response-content::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

/* ── RESEARCH PAGINATION ─────────────────────────────────────── */
#pagination-list { gap: 3px; }
#pagination-list .page-link {
  border-radius: 7px !important;
  border-color: #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 500;
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  transition: all 0.2s;
}
#pagination-list .page-link:hover {
  background: #fff4f0;
  border-color: var(--research-primary);
  color: var(--research-primary);
}
#pagination-list .page-item.active .page-link {
  background: linear-gradient(135deg, #FF6B35, #FF8C42);
  border-color: #FF6B35;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(255,107,53,0.3);
}

/* ── ADD PROMPT MODAL ────────────────────────────────────────── */
#addPromptModal .modal-content { border-radius: 16px; border: none; }
#addPromptModal textarea.form-control:focus {
  border-color: var(--research-primary) !important;
  box-shadow: 0 0 0 3px rgba(255,107,53,.12) !important;
}
#addPromptModal .btn-primary {
  background: var(--research-primary) !important;
  border-color: var(--research-primary) !important;
}

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.research-empty { text-align: center; padding: 3rem 1rem; color: #94a3b8; }
.research-empty .bi { font-size: 2.5rem; opacity: .25; }
.research-empty p { margin-top: .75rem; font-size: 13px; }

/* ── SIDEBAR: RESEARCH LINK (orange accent active state) ──────── */
.sidebar-nav a[href*="/research"].active {
  background: var(--research-primary) !important;
  color: #fff !important;
}

/* ── UTILITY: btn-white (used in research filter bars) ──────── */
.btn-white {
  background: #fff;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.btn-white:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  #research-container h2.h3 { font-size: 1.35rem; }
  .research-option-card { padding: 1rem !important; }
  #research-container .d-flex.gap-4.align-items-center {
    flex-direction: column-reverse;
    gap: .75rem !important;
    align-items: stretch !important;
  }
  #btn-next-step, #btn-finish {
    width: 100%;
    justify-content: center;
    padding: .75rem !important;
  }
  .prompt-results-container { max-height: 380px; }
  .search-actions-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch !important;
    gap: .6rem !important;
  }
  .search-input-group { width: 100% !important; max-width: none !important; }
  .action-btns { width: 100%; display: flex; gap: .5rem; }
  .action-btns > button { flex: 1; justify-content: center; }
  .filters-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem !important;
  }
  .filters-group > div  { width: 100%; }
  .filters-group button { width: 100%; justify-content: space-between; }
  .filters-group .dropdown-menu { width: 100%; }
}
.border-bottom-dashed { border-bottom: 1px dashed var(--border-color) !important; }
.border-bottom-dashed:last-child { border-bottom: none !important; }
