:root {
  /* Light Theme */
  --bg-color: #f8fafc;
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --accent-blue: #2563eb;
  --accent-light: #eff6ff;
  --border-color: #e2e8f0;
  --success-color: #22c55e;
  --font-main: 'Outfit', sans-serif;
  --font-serif: 'Georgia', serif;
  --danger-color: #ef4444;
  --danger-bg: #fef2f2;
  --hover-bg: #e8eaed;


  /* Specific Element Colors */
  --tag-year-bg: #f1f5f9;
  --tag-year-text: #475569;

  --ans-bg: #f0fdf4;
  --ans-border: #bbf7d0;
  --ans-header: #166534;
  --ans-text: #14532d;

  --mains-bg: #fffbeb;
  --mains-border: #fde68a;
  --mains-text: #92400e;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-card: 0 10px 20px -10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  /* Dark Theme */
  --bg-color: #000000;
  --sidebar-bg: #18181b;
  --card-bg: #18181b;
  --text-primary: #f1f5f9;
  --text-secondary: #9ca3af;
  --accent-blue: #60a5fa;
  --accent-light: rgba(59, 130, 246, 0.15);
  --border-color: #27272a;
  --success-color: #34d399;
  --danger-color: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --hover-bg: #3f3f46;

  --tag-year-bg: #27272a;
  --tag-year-text: #e4e4e7;

  /* Darker, transparent variants */
  --ans-bg: rgba(6, 78, 59, 0.4);
  --ans-border: #065f46;
  --ans-header: #86efac;
  --ans-text: #d1fae5;

  --mains-bg: rgba(69, 26, 3, 0.4);
  --mains-border: #78350f;
  --mains-text: #fcd34d;

  --shadow-sm: 0 1px 2px 0 rgba(255, 255, 255, 0.05);
  --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.8);
}

* {
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background: var(--bg-color);
  color: var(--text-primary);
  height: 100vh;
  height: 100dvh;
  display: flex;
  overflow: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: var(--text-secondary); border-radius: 4px; opacity: 0.5; }

.side-brand {
  text-decoration: none;
  display: none;
  margin: auto;
  padding-top: 20px;
  font-family: var(--font-main);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

@media (max-width: 600px) {
  .side-brand { display: block; }
}

/* Sidebar */
#sidebar {
  width: 300px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: width 0.3s ease, transform 0.3s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

body.sidebar-collapsed #sidebar { width: 0; border-right: none; overflow: hidden; }

.filters-container {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 30px;
  /* width: 300px; */
}

/* PDF Button Styles */
.pdf-archive-btn {
  width: 100%;
  padding: 14px;
  margin-bottom: 20px;
  background: #1e293b;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s, transform 0.1s;
  box-shadow: var(--shadow-sm);
  min-height: 48px;
}

[data-theme="dark"] .pdf-archive-btn { background: var(--accent-blue); color: #0f172a; }
.pdf-archive-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* Search Box Styles */
.search-wrapper { position: relative; margin-bottom: 16px; }

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 12px 12px 36px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-color);
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-input::placeholder { color: var(--text-secondary); opacity: 0.7; }

/* Clear Filter Button */
.clear-btn {
  width: 100%;
  padding: 12px;
  margin-bottom: 24px;
  background: var(--danger-bg);
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
  opacity: 0.9;
  min-height: 44px;
}

.clear-btn:hover { opacity: 1; }

.filter-group { margin-bottom: 24px; }

.filter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.filter-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 12px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 14px;
  transition: all 0.2s;
  text-align: left;
}

.filter-btn:hover { background: var(--accent-light); }
.filter-btn.active { background: var(--accent-light); color: var(--accent-blue); font-weight: 600; border-color: var(--accent-blue); }

.count-badge { font-size: 11px; background: var(--border-color); padding: 2px 6px; border-radius: 4px; color: var(--text-secondary); }
.filter-btn.active .count-badge { background: var(--accent-blue); color: white; }

/* Mobile Overlay */
#mobile-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 40; display: none; }

@media (max-width: 1024px) {
  #sidebar { position: fixed; height: 100%; left: -280px; width: 280px; box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1); }
  body.sidebar-open #sidebar { transform: translateX(280px); }
  body.sidebar-open #mobile-overlay { display: block; }
}

/* Main Content */
main { flex: 1; display: flex; flex-direction: column; width: 100%; position: relative; min-width: 0; }

header {
  height: 64px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-left { display: flex; align-items: center; gap: 16px; }
.header-logo { font-size: 20px; font-weight: 700; color: var(--text-primary); text-decoration: none; }
.logo-accent { color: var(--accent-blue); }

/* Score Badge */
.score-badge {
  background: var(--bg-color);
  border: 1px solid #fcd34d;
  color: #b45309;
  padding: 6px 12px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  margin-right: 16px;
}

[data-theme="dark"] .score-badge { border-color: #d97706; color: #fbbf24; }

/* Master Badge */
.master-badge {
  display: none;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: white;
  padding: 6px 16px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-right: 12px;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { box-shadow: 0 0 5px #60a5fa, 0 0 10px #2563eb; transform: scale(1); }
  to { box-shadow: 0 0 15px #93c5fd, 0 0 25px #3b82f6; transform: scale(1.05); }
}

.theme-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  /* width: 40px;
  height: 40px; */
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-right: 12px;
  padding: 8px;
}

.theme-toggle:hover {
  background: var(--bg-color);
  color: var(--text-primary);
  border-radius: 8px;
}

.mobile-toggle {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 10px;
  border-radius: 50%;
  transition: background 0.2s;
}

.mobile-toggle:hover { background: var(--bg-color); }

.page-title { font-size: 18px; font-weight: 600; color: var(--text-primary); }

/* Question Grid */
#content-scroll { flex: 1; overflow-y: auto; padding: 30px; }

.pyq-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 1200px) { .pyq-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .pyq-grid { grid-template-columns: 1fr; gap: 16px; } }

@media (max-width: 600px) {
  header { padding: 0 16px; }
  .header-logo { display: none; }
  .page-title { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
  .score-badge { margin-right: 8px; padding: 4px 10px; font-size: 12px; }
  .theme-toggle { margin-right: 8px; width: 36px; height: 36px; }
  #content-scroll { padding: 16px; }
}

/* Card Styles */
.q-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.q-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); border-color: var(--accent-blue); }

/* Solved State */
.q-card.solved { opacity: 0.6; background: var(--bg-color); border-color: var(--border-color); }
.q-card.solved .q-text { color: var(--text-secondary); text-decoration: line-through; }

.q-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.q-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.tag-year { background: var(--tag-year-bg); color: var(--tag-year-text); }
.tag-subject { background: var(--accent-light); color: var(--accent-blue); }

.solved-check { cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; }
.solved-check input { cursor: pointer; accent-color: var(--success-color); width: 16px; height: 16px; }

/* Bookmark Button */
.bookmark-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

.bookmark-btn:hover { color: var(--accent-blue); transform: scale(1.1); }
.bookmark-btn.active { color: var(--accent-blue); }
.bookmark-btn.active svg { fill: var(--accent-blue); }

.q-card.bookmarked {
  border-color: var(--accent-blue);
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .q-card.bookmarked {
  box-shadow: 0 0 15px rgba(96, 165, 250, 0.25);
}

.q-text {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 16px;
  color: var(--text-primary);
  flex: 1;
}

.options-list { list-style: none; padding: 0; margin: 0 0 16px 0; }

.options-list li {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

.answer-section {
  background: var(--ans-bg);
  border: 1px solid var(--ans-border);
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
  display: none;
  animation: fadeIn 0.3s;
}

.answer-section.visible { display: block; }
.ans-header { font-size: 13px; font-weight: 700; color: var(--ans-header); margin-bottom: 4px; }
.ans-text { font-size: 14px; color: var(--ans-text); line-height: 1.5; }

.mains-structure {
  background: var(--mains-bg);
  border: 1px solid var(--mains-border);
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
  display: none;
}

.mains-structure.visible { display: block; }
.structure-list { padding-left: 16px; margin: 0; font-size: 14px; color: var(--mains-text); }
.structure-list li { margin-bottom: 6px; }

.action-btn {
  background: transparent;
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue);
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
  margin-top: auto;
}

.action-btn:hover { background: var(--accent-light); }

/* Affiliate Image Ad Styles */
.affiliate-ad {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0; /* Remove padding so image goes edge-to-edge */
  overflow: hidden; /* Keeps the rounded corners over the image */
  position: relative;
  display: flex;
  height: 100%;
  min-height: 200px; /* Gives the image a good presence */
}

/* Floating label over the image */
.ad-label-floating {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 2;
  backdrop-filter: blur(4px);
  pointer-events: none; /* Let clicks pass through to the image */
}

.ad-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  overflow: hidden;
}

.ad-image {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures the image fills the box without squishing */
  display: block;
  transition: transform 0.3s ease;
}

/* Slight zoom effect on hover for better click-through rate */
.ad-link:hover .ad-image {
  transform: scale(1.05);
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-color);
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  font-weight: 500;
  width: max-content;
}

.toast.show { opacity: 1; bottom: 30px; }

/* Interactive Options */
.interactive-option {
  cursor: pointer;
  transition: all 0.2s ease;
}

.interactive-option:hover {
  background-color: var(--accent-light);
  border-color: var(--accent-blue);
}

/* State: Wrong Answer */
.interactive-option.option-wrong {
  background-color: var(--danger-color);
  color: white;
  border-color: var(--danger-color);
}

/* State: Correct Answer */
.interactive-option.option-correct {
  background-color: var(--success-color);
  color: white;
  border-color: var(--success-color);
}

/* Animation: Green Blink on the Card */
@keyframes green-blink {
  0% { 
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); 
    border-color: var(--success-color); 
  }
  50% { 
    box-shadow: 0 0 20px 5px rgba(34, 197, 94, 0); 
    border-color: var(--success-color); 
    background-color: var(--ans-bg); /* Slight green tint from your existing vars */
  }
  100% { 
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); 
    border-color: var(--border-color); 
    background-color: var(--card-bg);
  }
}

.card-correct-blink {
  animation: green-blink 1s ease-out;
}

/* Locked state after an answer is chosen */
.options-list.locked .interactive-option {
  pointer-events: none;
  opacity: 0.7;
}

/* Keep the selected answer fully visible */
.options-list.locked .interactive-option.option-correct,
.options-list.locked .interactive-option.option-wrong {
  opacity: 1;
}

/* Retry Icon Styles */
.retry-btn {
  display: none; /* Hidden by default */
  background: none;
  border: none;
  color: var(--danger-color);
  cursor: pointer;
  padding: 4px;
  margin-left: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
  align-items: center;
  justify-content: center;
}

.retry-btn:hover {
  background: var(--danger-bg);
  transform: rotate(-30deg);
}

/* Animation for when it appears */
@keyframes popIn {
  0% { transform: scale(0) rotate(90deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.retry-btn.show-retry {
  display: inline-flex;
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Sidebar Footer & Reset Button */
.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  background: var(--sidebar-bg);
  flex-shrink: 0; /* Prevents it from squishing */
}

.reset-progress-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.reset-progress-btn:hover {
  background: var(--danger-color);
  color: white;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--sidebar-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.show .modal-content {
  transform: translateY(0) scale(1);
}

.modal-icon {
  color: var(--danger-color);
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.modal-content h3 {
  margin: 0 0 12px 0;
  color: var(--text-primary);
  font-size: 20px;
}

.modal-content p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 24px 0;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-btn {
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  flex: 1;
}

.cancel-btn {
  background: var(--bg-color);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

.confirm-btn {
  background: var(--danger-color);
  color: white;
}

.confirm-btn:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
}

/* Header Action Button (Clear Bookmarks) */
.header-action-btn {
  background: var(--danger-bg);
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  transition: all 0.2s ease;
}

.header-action-btn:hover {
  background: var(--danger-color);
  color: white;
}

@media (max-width: 600px) {
  .header-action-btn .hide-mobile {
    display: none;
  }
  .header-action-btn {
    padding: 6px;
    margin-right: 8px;
  }
}

/* Progress Dashboard */
.dashboard-content {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 30px;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.show .dashboard-content {
  transform: translateY(0) scale(1);
}

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

.dashboard-header h2 {
  margin: 0;
  color: var(--text-primary);
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Dashboard Grid Layout */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Two equal columns for the bottom row */
  gap: 24px;
}

/* New class to make the bar chart span the entire top row */
.chart-card.full-width {
  grid-column: 1 / -1; 
}

.chart-card {
  background: var(--sidebar-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
}

.chart-card h3 {
  margin: 0 0 16px 0;
  font-size: 14px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

/* Export Section */
.export-section {
  margin-top: auto; /* Pushes the export section to the bottom of the card */
  padding-top: 20px;
  border-top: 1px dashed var(--border-color);
}

.export-section h3 {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.export-controls {
  display: flex;
  flex-direction: column; /* Stack elements vertically in the narrow card */
  gap: 12px;
}

.month-dropdown {
  width: 100%; /* Take full width of the container */
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

.month-dropdown:focus {
  border-color: var(--accent-blue);
}

.export-controls .action-btn {
  width: 100%; /* Make button full width */
  margin: 0;
  max-width: none; /* Override previous max-width */
}

@media (max-width: 600px) {
  .export-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .action-btn { max-width: 100% !important; }
}

/* --- EXCEL-STYLE TAB BAR --- */
.tab-bar-wrapper {
    position: sticky;
    top: 64px; /* Matches your 64px header */
    z-index: 19; /* Just below header's z-index 20 */
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
}
.tab-bar-wrapper::before, .tab-bar-wrapper::after {
    content: ''; position: absolute; top: 0; bottom: 0; width: 40px;
    pointer-events: none; z-index: 10; opacity: 0; transition: opacity 0.3s ease;
}
.tab-bar-wrapper::before { left: 0; background: linear-gradient(to right, var(--sidebar-bg) 0%, transparent 100%); }
.tab-bar-wrapper::after { right: 0; background: linear-gradient(to left, var(--sidebar-bg) 0%, transparent 100%); }
.tab-bar-wrapper.can-scroll-left::before { opacity: 1; }
.tab-bar-wrapper.can-scroll-right::after { opacity: 1; }

.excel-tab-bar { display: flex; overflow-x: auto; scrollbar-width: none; }
.excel-tab-bar::-webkit-scrollbar { display: none; }

.tab-link {
    padding: 14px 20px; white-space: nowrap; color: var(--text-secondary);
    font-size: 14px; font-weight: 600; border-bottom: 3px solid transparent;
    cursor: pointer; transition: all 0.2s ease; display: flex;
    align-items: center; gap: 6px; background: transparent; border-top: none;
    border-left: none; border-right: none; font-family: var(--font-main); text-decoration: none;
}
.tab-link:hover { background: var(--hover-bg); color: var(--text-primary); }
.tab-link.active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); background: rgba(37, 99, 235, 0.05); }

/* --- QUICK READS DROPDOWN --- */
.tab-dropdown { position: relative; display: inline-block; }
.tab-dropdown-menu {
    display: none; position: fixed; transform: translateX(-50%);
    background: var(--card-bg); min-width: 250px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color); border-radius: 12px; z-index: 1000;
    flex-direction: column; overflow: hidden;
}
.tab-dropdown-menu.show { display: flex; animation: fadeIn 0.2s ease-in-out; }
.tab-dropdown-menu a { padding: 12px 16px; color: var(--text-secondary); font-size: 13px; font-weight: 500; border-bottom: 1px solid var(--border-color); transition: 0.2s; text-decoration: none; }
.tab-dropdown-menu a:hover { background: var(--accent-light); color: var(--accent-blue); }
.tab-dropdown-menu a:last-child { border-bottom: none; }
.dropdown-toggle.open svg { transform: rotate(180deg); }
.dropdown-toggle svg { transition: transform 0.3s ease; }
