/* 
   BUDGET & ROI MANAGER - Stylesheet
   Trade Fair Investment Analytics & Decision Support
    */

/* 
   BASE SETUP
    */

:root,
.page-budget-roi {
  --br-accent: #0b3c5d;
  --br-blue: #2563eb;
  --br-green: #16a34a;
  --br-red: #dc2626;
  --br-amber: #d97706;
  --br-purple: #7c3aed;
  --br-slate: #64748b;
  --br-muted: #94a3b8;
  --br-light: #f1f5f9;
  --br-line: #cbd5e1;
  /* Darkened from #e2e8f0 for better visibility */
  --br-card: #ffffff;
  --br-ink: #0f172a;
}



/* 
   HERO / PAGE HEADER
    */

.br-hero {
  margin-bottom: 0;
}

.br-hero .panel-head {
  flex-wrap: wrap;
  gap: 16px;
}

.br-hero h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--br-ink);
  margin: 0;
}

.br-hero .panel-sub {
  font-size: 14px;
  color: var(--br-slate);
  margin-top: 4px;
}

.br-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.br-year-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.br-year-filter label {
  font-size: 12px;
  font-weight: 600;
  color: var(--br-slate);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.br-year-filter select {
  padding: 8px 12px;
  border: 1px solid var(--br-line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--br-ink);
  background: var(--br-card);
  cursor: pointer;
  min-width: 110px;
}

.br-year-filter select:focus {
  outline: none;
  border-color: var(--br-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--br-line);
  border-radius: 10px;
  background: var(--br-card);
  color: var(--br-slate);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: var(--br-light);
  color: var(--br-ink);
}

/* 
   TOP KPI CARDS
    */

/* 
   TOP KPI CARDS (Standardized Style)
    */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 20px;
}

@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

.kpi-card {
  background: var(--br-card);
  border: 1px solid var(--br-line);
  border-radius: 12px;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 2, 4, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

.kpi-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--br-slate);
  /* Using br-slate instead of -muted to match file vars */
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--br-ink);
  line-height: 1;
}

.kpi-card.highlight .kpi-value {
  color: var(--br-blue);
}

/* Legacy overrides removal */


/* Cash Flow Area Chart */
.cash-flow-chart-container {
  margin-top: 20px;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
}

.area-chart-placeholder {
  width: 100%;
  position: relative;
}

.smooth-area-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-months-labels {
  display: flex;
  justify-content: space-between;
  padding: 12px 10px 0;
  border-top: 1px solid var(--br-line);
  margin-top: 10px;
}

.chart-months-labels span {
  font-size: 11px;
  font-weight: 700;
  color: var(--br-slate);
  text-transform: uppercase;
}

/* Modern Toggle Switch */
.switch-modern {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch-modern input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-modern {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e2e8f0;
  transition: .4s;
  border-radius: 20px;
}

.slider-modern:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input:checked+.slider-modern {
  background-color: var(--br-blue);
}

input:checked+.slider-modern:before {
  transform: translateX(16px);
}

/* Table Enhancements */
.badge-status {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.br-table th {
  background: #f8fafc;
  font-size: 11px;
  color: var(--br-slate);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 
   TABS NAVIGATION
    */

.br-analytics {
  margin-top: 20px;
}

.br-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--br-light);
  border-radius: 12px;
  margin-bottom: 24px;
}

.br-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--br-slate);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.br-tab:hover {
  color: var(--br-ink);
  background: rgba(255, 255, 255, 0.5);
}

.br-tab.is-active {
  background: var(--br-card);
  color: var(--br-ink);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.br-tab svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.br-tab.is-active svg {
  opacity: 1;
  color: var(--br-ink);
}

/* 
   TAB CONTENT
    */

.br-tab-content {
  display: none;
}

.br-tab-content.is-active {
  display: block;
  animation: brFadeIn 0.25s ease;
}

@keyframes brFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

.br-tab-header {
  margin-bottom: 20px;
}

.br-tab-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--br-ink);
  margin: 0 0 4px;
}

.br-tab-desc {
  font-size: 14px;
  color: var(--br-slate);
  margin: 0;
}

/* 
   MINI KPIs (Per Tab)
    */

.br-mini-kpis {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.br-mini-kpi {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 20px;
  background: var(--br-light);
  border-radius: 10px;
  min-width: 120px;
  flex: 1;
}

.br-mini-kpi--forecast {
  border: 1px solid var(--br-line);
  background: var(--br-light);
}

.br-mini-kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--br-slate);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 4px;
  text-align: center;
}

/* 
   NEW KPI GRID & CARDS
    */

.br-mini-kpis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

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

@media (max-width: 600px) {
  .br-mini-kpis-grid {
    grid-template-columns: 1fr;
  }
}

.br-kpi-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--br-card);
  border: 1px solid var(--br-line);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.br-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.br-kpi-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--br-light);
  color: var(--br-blue);
  border-radius: 12px;
  flex-shrink: 0;
}

.br-kpi-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.br-kpi-card-info .br-mini-kpi-label {
  text-align: left;
  margin-top: 0;
  color: var(--br-slate);
  font-size: 11px;
}

.br-kpi-card-info .br-mini-kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--br-ink);
}

/* 
   CHARTS GRID
    */

.br-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.br-chart-block {
  background: var(--br-light);
  border-radius: 12px;
  padding: 18px;
}

.br-chart-block--wide {
  grid-column: 1 / -1;
}

.br-chart-block h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--br-ink);
  margin: 0 0 14px;
}

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

.br-chart-header h3 {
  margin: 0;
}

.br-chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.br-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--br-slate);
}

.br-chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.br-chart {
  min-height: 180px;
  position: relative;
}

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

.br-chart--map {
  min-height: 220px;
}

.br-chart--bars {
  min-height: 200px;
}

.br-chart-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 160px;
  color: var(--br-muted);
  font-size: 13px;
  text-align: center;
  gap: 4px;
}

.br-chart-placeholder-hint {
  font-size: 12px;
  color: var(--br-muted);
  opacity: 0.8;
}

/* 
   BAR CHART STYLES
    */

.br-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 8px;
}

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

.br-bar-label {
  width: 90px;
  font-size: 12px;
  font-weight: 600;
  color: var(--br-slate);
  text-align: right;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.br-bar-track {
  flex: 1;
  height: 24px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.br-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  padding-left: 10px;
}

.br-bar-fill--blue {
  background: var(--br-blue);
}

.br-bar-fill--green {
  background: var(--br-green);
}

.br-bar-fill--amber {
  background: var(--br-amber);
}

.br-bar-fill--red {
  background: var(--br-red);
}

.br-bar-fill--purple {
  background: var(--br-purple);
}

.br-bar-fill--slate {
  background: var(--br-slate);
}

.br-bar-value {
  min-width: 70px;
  font-size: 13px;
  font-weight: 700;
  color: var(--br-ink);
  text-align: right;
  flex-shrink: 0;
  margin-left: 8px;
}

/* 
   DONUT CHART STYLES
    */

.br-donut-chart {
  display: flex;
  align-items: center;
  gap: 30px;
}

.br-donut-svg {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.br-donut-segment {
  transition: opacity 0.2s ease;
  cursor: pointer;
}

.br-donut-segment:hover {
  opacity: 0.8;
}

.br-donut-center {
  font-size: 18px;
  font-weight: 800;
  fill: var(--br-ink);
}

.br-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.br-donut-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--br-ink);
}

.br-donut-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
}

.br-donut-legend-value {
  font-weight: 700;
  margin-left: auto;
  color: var(--br-slate);
}

/* 
   HORIZONTAL BAR CHART (ROI Comparison)
    */

.br-hbar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
}

.br-hbar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.br-hbar-label {
  width: 140px;
  font-size: 13px;
  font-weight: 600;
  color: var(--br-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.br-hbar-track {
  flex: 1;
  height: 28px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.br-hbar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
  position: relative;
}

.br-hbar-fill--positive {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.br-hbar-fill--negative {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

.br-hbar-fill--neutral {
  background: var(--br-slate);
}

.br-hbar-value {
  width: 70px;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  flex-shrink: 0;
}

.br-hbar-value--positive {
  color: #16a34a;
}

.br-hbar-value--negative {
  color: #dc2626;
}

.br-hbar-value--neutral {
  color: var(--br-slate);
}

/* 
   CONTENT SPLIT LAYOUT
    */

.br-content-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  margin-top: 24px;
}

.br-content-split--reverse {
  grid-template-columns: 320px minmax(0, 1fr);
}

.br-content-split--reverse .br-content-sidebar {
  order: -1;
}

.br-content-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.br-content-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* 
   FORM CARD
    */

.br-form-card {
  background: var(--br-card);
  border: 1px solid var(--br-line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  position: relative;
}

.br-form-card h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--br-ink);
  margin: 0 0 4px;
}

.br-form-subtitle {
  font-size: 13px;
  color: var(--br-slate);
  margin: 0 0 16px;
}

.br-form-divider {
  height: 1px;
  background: var(--br-line);
  margin: 16px 0;
}

.br-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.br-form-field:last-child {
  margin-bottom: 0;
}

.br-form-field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--br-slate);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.br-form-field input,
.br-form-field select,
.br-form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--br-line);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--br-ink);
  background: var(--br-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.br-form-field input:focus,
.br-form-field select:focus,
.br-form-field textarea:focus {
  outline: none;
  border-color: var(--br-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.br-form-field input::placeholder {
  color: var(--br-muted);
}

.br-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.br-form-row .br-form-field {
  margin-bottom: 0;
}

.br-input-currency {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--br-line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--br-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Custom Select Styles */
.br-select-custom {
  position: relative;
  width: 100%;
}

.br-select-trigger {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--br-line);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--br-ink);
  background: var(--br-card);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.br-select-trigger:focus,
.br-select-custom.is-open .br-select-trigger {
  outline: none;
  border-color: var(--br-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.br-select-trigger::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--br-slate);
  margin-left: 8px;
  transition: transform 0.2s ease;
}

.br-select-custom.is-open .br-select-trigger::after {
  transform: rotate(180deg);
}

.br-select-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--br-card);
  border: 1px solid var(--br-line);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  padding: 4px;
}

.br-select-custom.is-open .br-select-options {
  display: block;
  animation: brFadeIn 0.15s ease;
}

.br-select-option {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--br-ink);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.1s ease;
}

.br-select-option:hover {
  background: var(--br-light);
}

.br-select-option.is-selected {
  background: #eff6ff;
  color: var(--br-blue);
  font-weight: 600;
}

.br-select-option-date {
  font-size: 12px;
  color: var(--br-slate);
  font-weight: 400;
}

.br-input-currency:focus-within {
  border-color: var(--br-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.br-input-currency span {
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: var(--br-light);
  color: var(--br-slate);
  font-weight: 600;
  font-size: 14px;
  border-right: 1px solid var(--br-line);
}

.br-input-currency input {
  flex: 1;
  padding: 10px 12px;
  border: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--br-ink);
  background: transparent;
  min-width: 0;
}

.br-input-currency input:focus {
  outline: none;
  box-shadow: none;
}

.br-form-group {
  margin-bottom: 16px;
}

.br-form-group-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--br-ink);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--br-line);
}

.br-form-actions {
  margin-top: 20px;
}

.btn.wide {
  width: 100%;
  padding: 14px 16px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 
   TABLE SECTION
    */

.br-table-section {
  margin-top: 24px;
}

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

.br-table-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--br-ink);
  margin: 0;
}

.br-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  height: 400px;
  background: var(--br-card);
  border: 1px solid var(--br-line);
  border-radius: 12px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.br-table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.br-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.br-table-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.br-table-wrap::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Standardized Table Internal styles removed - now using MasterTable */

.br-table-btn--delete:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* 
   EMPTY STATE
    */

.br-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--br-muted);
  font-size: 14px;
  background: #f8fafc;
  gap: 8px;
}

.br-empty-state svg {
  opacity: 0.5;
  margin-bottom: 4px;
}

.br-empty-hint {
  font-size: 12px;
  opacity: 0.8;
}

/* 
   RANKINGS
    */

.br-rankings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.br-ranking-block {
  background: var(--br-light);
  border-radius: 12px;
  padding: 16px;
}

.br-ranking-block--top {
  border-left: 4px solid var(--br-green);
}

.br-ranking-block--bottom {
  border-left: 4px solid var(--br-red);
}

.br-ranking-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.br-ranking-header svg {
  color: inherit;
}

.br-ranking-block--top .br-ranking-header svg {
  color: var(--br-green);
}

.br-ranking-block--bottom .br-ranking-header svg {
  color: var(--br-red);
}

.br-ranking-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--br-ink);
  margin: 0;
}

.br-ranking-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.br-ranking-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--br-card);
  border-radius: 8px;
  font-size: 13px;
}

.br-ranking-item-name {
  font-weight: 600;
  color: var(--br-ink);
}

.br-ranking-item-value {
  font-weight: 700;
}

.br-ranking-block--top .br-ranking-item-value {
  color: var(--br-green);
}

.br-ranking-block--bottom .br-ranking-item-value {
  color: var(--br-red);
}

.br-ranking-empty {
  font-size: 13px;
  color: var(--br-muted);
  text-align: center;
  padding: 16px;
}

/* 
   STRATEGIC INSIGHTS
    */

.br-insights {
  margin-top: 20px;
}

.br-insights-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.br-insights-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--br-ink);
  margin: 0 0 4px;
}

.br-insights-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #6d28d9;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.br-insights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.br-insight-card {
  display: flex;
  gap: 14px;
  padding: 18px;
  background: var(--br-card);
  border-radius: 12px;
  border-left: 4px solid var(--br-line);
}

.br-insight-card--positive {
  border-left-color: var(--br-green);
  background: #f0fdf4;
}

.br-insight-card--negative {
  border-left-color: var(--br-red);
  background: #fef2f2;
}

.br-insight-card--warning {
  border-left-color: var(--br-amber);
  background: #fffbeb;
}

.br-insight-card--neutral {
  border-left-color: var(--br-slate);
  background: #f8fafc;
}

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

.br-insight-card--positive .br-insight-icon {
  background: #dcfce7;
  color: var(--br-green);
}

.br-insight-card--negative .br-insight-icon {
  background: #fee2e2;
  color: var(--br-red);
}

.br-insight-card--warning .br-insight-icon {
  background: #fef3c7;
  color: var(--br-amber);
}

.br-insight-card--neutral .br-insight-icon {
  background: var(--br-light);
  color: var(--br-slate);
}

.br-insight-content h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--br-ink);
  margin: 0 0 4px;
}

.br-insight-content p {
  font-size: 13px;
  color: var(--br-slate);
  margin: 0;
  line-height: 1.5;
}

/* 
   ACTIONS SECTION
    */

.br-actions {
  margin-top: 20px;
}

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

.br-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 18px;
  background: var(--br-light);
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.br-action-card:hover {
  background: var(--br-card);
  border-color: var(--br-line);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.br-action-card.is-disabled,
.br-action-card:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
  transform: none;
}

.br-action-card.is-disabled:hover,
.br-action-card:disabled:hover {
  background: var(--br-light);
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.br-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--br-card);
  border-radius: 14px;
  color: var(--br-blue);
  margin-bottom: 14px;
}

.br-action-card:hover .br-action-icon {
  background: #dbeafe;
}

.br-action-content h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--br-ink);
  margin: 0 0 4px;
}

.br-action-content p {
  font-size: 12px;
  color: var(--br-slate);
  margin: 0;
}

/* 
   MODAL
    */

.br-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.br-modal.is-open {
  display: flex;
}

.br-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  animation: brFadeIn 0.2s ease;
}

.br-modal-content {
  position: relative;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  background: var(--br-card);
  border-radius: 18px;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  animation: brModalIn 0.25s ease;
}

@keyframes brModalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

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

.br-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--br-line);
}

.br-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--br-ink);
  margin: 0;
}

.br-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--br-slate);
  cursor: pointer;
  transition: all 0.15s ease;
}

.br-modal-close:hover {
  background: var(--br-light);
  color: var(--br-ink);
}

.br-modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 80px);
}

.br-compare-selectors {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
}

.br-compare-selectors .br-form-field {
  flex: 1;
  margin-bottom: 0;
}

.br-compare-vs {
  font-size: 14px;
  font-weight: 700;
  color: var(--br-muted);
  padding-bottom: 12px;
}

.br-compare-results {
  background: var(--br-light);
  border-radius: 12px;
  padding: 20px;
  min-height: 200px;
}

.br-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 160px;
  color: var(--br-slate);
  font-size: 14px;
  font-weight: 500;
}

.br-compare-actions {
  display: flex;
  justify-content: flex-end;
  margin: -10px 0 16px;
}

.br-compare-toggle {
  border-radius: 999px;
}

.br-compare-results.is-collapsed [data-compare-extra="true"] {
  display: none;
}

/* .br-compare-table styles removed - now using MasterTable */

/* 
   GEOGRAPHIC MAP (SIMPLIFIED)
    */

.br-geo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.br-geo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
}

.br-geo-flag {
  font-size: 18px;
}

.br-geo-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--br-ink);
}

.br-geo-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--br-blue);
}

/* 
   RESPONSIVE
    */

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

  .br-tabs {
    flex-wrap: wrap;
  }

  .br-tab {
    flex: 1;
    justify-content: center;
    min-width: calc(50% - 4px);
  }

  .br-tab span {
    display: none;
  }

  .br-charts-grid {
    grid-template-columns: 1fr;
  }

  .br-content-split,
  .br-content-split--reverse {
    grid-template-columns: 1fr;
  }

  .br-content-split--reverse .br-content-sidebar {
    order: 0;
  }

  .br-rankings-grid {
    grid-template-columns: 1fr;
  }

  .br-insights-grid {
    grid-template-columns: 1fr;
  }

  .br-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .br-compare-selectors {
    flex-direction: column;
    align-items: stretch;
  }

  .br-compare-vs {
    text-align: center;
    padding: 0;
  }
}

/* Fixed Table Layout for Comparison */
.br-table-fixed {
  table-layout: fixed;
  width: 100%;
}

.br-col-metric {
  width: 140px;
  white-space: nowrap;
}

.br-col-val {
  width: calc(50% - 70px);
}

@media (max-width: 767px) {
  .br-hero .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .br-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .br-kpis {
    grid-template-columns: 1fr;
  }

  .br-kpi-card {
    padding: 14px 16px;
  }

  .br-mini-kpis {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .br-mini-kpi {
    min-width: 0;
  }

  .br-tab {
    min-width: calc(50% - 4px);
    padding: 10px 14px;
  }

  .br-form-row {
    grid-template-columns: 1fr;
  }

  .br-actions-grid {
    grid-template-columns: 1fr;
  }

  .br-action-card {
    flex-direction: row;
    text-align: left;
    padding: 16px;
  }

  .br-action-icon {
    margin-bottom: 0;
    margin-right: 14px;
    width: 44px;
    height: 44px;
  }

  .br-table-wrap {
    max-height: 300px;
  }

  .br-donut-chart {
    flex-direction: column;
    gap: 16px;
  }

  .br-donut-legend {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;

    /* Budget & ROI Single Sheet Overrides */
    .dashboard-main-panel .br-kpi-card,
    .dashboard-main-panel .br-form-card,
    .dashboard-main-panel .br-insight-card,
    .dashboard-main-panel .br-action-card,
    .dashboard-main-panel .br-table-wrap {
      box-shadow: none !important;
      border-color: #e2e8f0;
    }

    .dashboard-main-panel .br-kpi-card:hover,
    .dashboard-main-panel .br-action-card:hover {
      box-shadow: none !important;
      background-color: #f8fafc;
      border-color: var(--br-blue);
      transform: translateY(-2px);
    }

    /* Ensure hero text aligns */
    .dashboard-main-panel .br-hero {
      padding-left: 0;
      padding-right: 0;
      margin-bottom: 24px;
    }

    /* Tab container adjustment to look integrated */
    .dashboard-main-panel .br-tabs {
      background-color: #f8fafc;
      border: 1px solid #e2e8f0;
    }

    .dashboard-main-panel .br-tab.is-active {
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    /* Fix ranking blocks inside single sheet */
    .dashboard-main-panel .br-ranking-block {
      box-shadow: none;
      background: #f8fafc;
    }


    /* 
   UTILITY CLASSES
    */

    .br-text-green {
      color: var(--br-green);
    }

    .br-text-red {
      color: var(--br-red);
    }

    .br-text-amber {
      color: var(--br-amber);
    }

    .br-text-blue {
      color: var(--br-blue);
    }

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

    .br-bg-green {
      background: #dcfce7;
    }

    .br-bg-red {
      background: #fee2e2;
    }

    .br-bg-amber {
      background: #fef3c7;
    }

    .br-bg-blue {
      background: #dbeafe;
    }

    .br-hidden {
      display: none !important;
    }

    .br-visible {
      display: block !important;
    }

    /* Chart Colors */
    .br-bar-fill--purple {
      background-color: #8b5cf6;
    }

    .br-bar-fill--orange {
      background-color: #f59e0b;
    }

    .br-bar-fill--teal {
      background-color: #14b8a6;
    }

    /* new chart styles */
    .br-chart-container-bar {
      display: flex;
      align-items: flex-end;
      justify-content: space-around;
      height: 100%;
      padding-top: 20px;
    }

    .br-chart-col {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-end;
      height: 100%;
      width: 40px;
      position: relative;
    }

    .br-chart-bar {
      width: 100%;
      border-radius: 4px 4px 0 0;
      transition: height 0.5s ease;
      min-height: 4px;
    }

    .br-chart-label {
      font-size: 11px;
      color: var(--br-slate);
      margin-top: 6px;
    }

    .br-donut-wrapper {
      position: relative;
      width: 140px;
      height: 140px;
      margin: 0 auto;
    }

    .br-donut-center {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      display: flex;
      flex-direction: column;
      align-items: center;
    }