/* Design System & Base Variables */
:root {
  /* Colors */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: #1e293b;
  --bg-card-hover: #243146;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-primary: #0d9488; /* Teal 600 */
  --accent-primary-hover: #14b8a6; /* Teal 500 */
  --accent-secondary: #0ea5e9; /* Sky 500 */
  --accent-secondary-hover: #38bdf8; /* Sky 400 */
  
  --success: #10b981; /* Emerald 500 */
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b; /* Amber 500 */
  --warning-bg: rgba(245, 158, 11, 0.1);
  --error: #ef4444; /* Red 500 */
  
  --border-color: #334155; /* Slate 700 */
  --border-light: rgba(51, 65, 85, 0.5);
  
  /* Fonts */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Container Width */
  --container-max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 70px; /* Offset for sticky header */
}

a {
  color: var(--accent-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-secondary-hover);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

h1 { font-size: 2.25rem; margin-bottom: 1.5rem; letter-spacing: -0.025em; }
h2 { font-size: 1.75rem; margin-bottom: 1.25rem; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-mono { font-family: var(--font-mono); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-secondary { color: var(--text-secondary); }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.font-bold { font-weight: 700; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

/* Clean layout and wrappers */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section-padding {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

/* Floating Glassmorphism Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background-color: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
}

.logo span {
  color: var(--accent-primary-hover);
}

/* Header Search Bar */
.header-search-container {
  position: relative;
  width: 320px;
  margin: 0 1.5rem;
}

.header-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.header-search-box input {
  width: 100%;
  padding: 0.5rem 2.5rem 0.5rem 0.85rem;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.header-search-box input:focus {
  outline: none;
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.1);
}

.header-search-box .search-icon {
  position: absolute;
  right: 0.85rem;
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.header-search-box input:focus + .search-icon {
  color: var(--accent-primary-hover);
}

/* Search Dropdown */
.header-search-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 2000;
  display: flex;
  flex-direction: column;
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  transition: background-color var(--transition-fast);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item.active-item {
  background-color: rgba(255, 255, 255, 0.03);
}

.search-result-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
}

.search-result-title {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.search-result-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-no-results {
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 768px) {
  .header-search-container {
    width: 200px;
    margin: 0 1rem;
  }
}

@media (max-width: 640px) {
  .header-search-container {
    width: auto;
    flex-grow: 1;
    max-width: 200px;
    margin: 0 0.75rem;
  }
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background-color: var(--border-light);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4.5rem 1.5rem;
  background: radial-gradient(circle at 50% -20%, rgba(13, 148, 136, 0.15) 0%, rgba(11, 15, 25, 0) 60%);
  border-bottom: 1px solid var(--border-light);
}

.hero h1 {
  font-size: 3rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  font-size: 1.25rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
}

/* Grids and Cards */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card-hover:hover {
  transform: translateY(-4px);
  border-color: var(--text-muted);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  background-color: var(--bg-card-hover);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  width: fit-content;
}

.badge-teal {
  background-color: rgba(13, 148, 136, 0.15);
  color: var(--accent-primary-hover);
  border: 1px solid rgba(13, 148, 136, 0.3);
}

.badge-sky {
  background-color: rgba(14, 165, 233, 0.15);
  color: var(--accent-secondary-hover);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

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

.badge-extranjera {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-local {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-purple {
  background-color: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-rose {
  background-color: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
  gap: 0.5rem;
}

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

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

.btn-outline {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  background-color: var(--border-color);
  border-color: var(--text-muted);
}

.btn-full {
  width: 100%;
}

.btn-xs {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Flex utils */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* Interactive Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

th {
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  white-space: nowrap;
}

.td-description {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .td-description {
    max-width: 140px;
  }
}

.td-truncated {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .td-truncated {
    max-width: 140px;
  }
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: var(--bg-card);
  color: var(--text-primary);
}

.ticker-link {
  font-weight: 700;
  color: var(--accent-secondary-hover);
  background-color: rgba(14, 165, 233, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.ticker-link:hover {
  background-color: rgba(14, 165, 233, 0.2);
  border-color: rgba(14, 165, 233, 0.4);
}

/* Form Controls */
.search-controls {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input, .form-select {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  outline: none;
  width: 100%;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-primary-hover);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  overflow: hidden;
}

.faq-question {
  padding: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background-color var(--transition-fast);
}

.faq-question:hover {
  background-color: var(--bg-card-hover);
}

.faq-answer {
  padding: 0 1.25rem 1.25rem 1.25rem;
  color: var(--text-secondary);
  display: none;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-item.active .faq-answer {
  display: block;
}

.faq-toggle-icon {
  transition: transform var(--transition-fast);
  color: var(--accent-secondary-hover);
}

.faq-item.active .faq-toggle-icon {
  transform: rotate(180deg);
}

/* Calculator & Portfolio visualizer */
.calculator-container {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .calculator-container {
    grid-template-columns: 1fr;
  }
}

.portfolio-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.bond-selector-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1.25rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.bond-selector-card:hover {
  border-color: var(--text-muted);
}

.bond-selector-card.selected {
  border-color: var(--accent-primary-hover);
  background-color: rgba(13, 148, 136, 0.05);
}

.checkbox-custom {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  width: 100%;
}

.checkbox-custom input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  height: 20px;
  width: 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-right: 12px;
  position: relative;
  flex-shrink: 0;
}

.checkbox-custom:hover input ~ .checkmark {
  border-color: var(--text-muted);
}

.checkbox-custom input:checked ~ .checkmark {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary-hover);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-custom input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-info {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
  padding-right: 0.5rem;
}

/* Chart Styles */
.chart-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chart-wrapper {
  margin-top: 1.5rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  flex-grow: 1;
  min-height: 300px;
  position: relative;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 220px;
  padding-top: 20px;
  border-bottom: 2px solid var(--border-color);
  position: relative;
}

.chart-bar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-grow: 1;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  group: hover;
}

.chart-bar {
  width: 60%;
  max-width: 35px;
  background-color: var(--accent-primary);
  border-radius: 4px 4px 0 0;
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color var(--transition-fast);
  position: relative;
}

.chart-bar:hover {
  background-color: var(--accent-primary-hover);
}

.chart-bar-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.chart-bar-container:hover .chart-bar-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

.chart-label {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 8px;
}

.chart-grid-y {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--border-light);
  pointer-events: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.metric-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* Exenciones Tax Page custom styles */
.tax-exempt-card {
  border-left: 4px solid var(--success);
}

.tax-taxable-card {
  border-left: 4px solid var(--text-muted);
}

.tax-badge-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* Footer styling */
.footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 3rem 1.5rem;
  margin-top: 5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-about h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.footer-links h4 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-light);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Responsiveness adjustments */
@media (max-width: 960px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .search-controls {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  body {
    padding-top: 60px;
  }
  .header {
    height: 60px;
  }
  .hero {
    padding: 3rem 1rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .search-controls {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  /* nav-links displays toggle via active class */
  .metric-grid {
    grid-template-columns: 1fr;
  }
}

/* Line clamps helper */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Nav Dropdown Navigation styles */
.nav-item-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s;
  z-index: 1000;
  min-width: 220px;
  margin-top: 0.5rem;
  list-style: none;
  margin: 0;
}

/* Add a subtle invisible hover bridge to prevent closing on gap gap transition */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -15px;
  left: 0;
  right: 0;
  height: 15px;
}

.nav-item-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-item {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all var(--transition-fast);
  display: block;
  text-decoration: none;
}

.dropdown-item:hover {
  color: var(--text-primary);
  background-color: var(--border-light);
}

.nav-item-dropdown .nav-link {
  user-select: none;
}

/* Portfolio Builder - Layout Grid Updates */
.portfolio-grid-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .calc-dashboard-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Assistant grid style with 3 columns (3x2 grid) on desktop and responsive behavior */
.assistant-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem 1.5rem; /* vertical gap 20px, horizontal gap 24px */
  align-items: flex-end;
}

/* Override select and input height/padding inside the assistant grid to prevent vertical clipping */
.assistant-grid select,
.assistant-grid input {
  height: 42px !important;
  padding: 0.5rem 0.75rem !important;
  line-height: 1.4 !important;
  border-radius: var(--radius-md) !important;
  width: 100% !important;
}

.assistant-grid select {
  padding-right: 2rem !important; /* Extra space on the right for select native arrow icon */
}

@media (max-width: 900px) {
  .assistant-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 1.25rem;
  }
}

@media (max-width: 600px) {
  .assistant-grid {
    grid-template-columns: 1fr;
    gap: 1rem 0;
  }
}

/* Mobile responsive menu overlay styles */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex !important;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px; /* matched to desktop header height */
    left: 0;
    right: 0;
    background-color: rgb(11, 15, 25);
    border-bottom: 1px solid var(--border-light);
    padding: 1.25rem 1.5rem;
    gap: 0.75rem;
    z-index: 999;
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.8);
    list-style: none;
    margin: 0;
  }
  .nav-links.active {
    display: flex !important;
  }
  .nav-item-dropdown .dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    background-color: rgba(255, 255, 255, 0.02);
    border: none;
    box-shadow: none;
    padding-left: 1.25rem;
    margin-top: 0.25rem;
    display: flex;
    margin-bottom: 0.5rem;
    list-style: none;
  }
  .dropdown-item {
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .nav-links {
    top: 60px; /* matched to mobile header height */
  }
}

