/* ==========================================================================
   Clean Cooking Transition Database (CCT-DB) - CSS Stylesheet
   Design Paradigm: Premium Energy Informatics Terminal & Sleek Spreadsheet
   ========================================================================== */

/* --- 1. Variables & Reset --- */
:root {
  /* Colors */
  --bg-primary: #070a13;
  --bg-secondary: #0f1524;
  --bg-tertiary: #172033;
  --bg-hover: #1e2942;
  
  --border-color: #1e293b;
  --border-color-focus: #3b82f6;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Semantic Highlights */
  --color-emerald: #10b981;
  --color-emerald-glow: rgba(16, 185, 129, 0.15);
  --color-danger: #ef4444;
  --color-danger-glow: rgba(239, 68, 68, 0.15);
  --color-warning: #f59e0b;
  --color-warning-glow: rgba(245, 158, 11, 0.15);
  --color-blue: #3b82f6;
  --color-blue-glow: rgba(59, 130, 246, 0.15);
  
  /* Layout Dimensions */
  --header-height: 56px;
  --tabs-height: 38px;
  
  /* Font Families */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* --- 2. Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- 3. Top System Header --- */
#dashboard-header {
  height: var(--header-height);
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  flex-shrink: 0;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.icon-logo {
  color: var(--color-emerald);
  fill: rgba(16, 185, 129, 0.1);
  animation: pulse-flame 3s infinite alternate;
}

@keyframes pulse-flame {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(16, 185, 129, 0.4)); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.8)); }
}

.logo-dot {
  color: var(--color-emerald);
}

.divider {
  width: 1px;
  height: 24px;
  background-color: var(--border-color);
}

.header-title-block h1 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.header-subtitle {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-primary);
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  position: relative;
}

.status-indicator.live {
  background-color: var(--color-emerald);
  box-shadow: 0 0 8px var(--color-emerald);
}

.status-text {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.data-version {
  font-size: 0.75rem;
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--color-blue);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
}

.version-label {
  opacity: 0.7;
  margin-right: 4px;
}

/* --- 4. Main Viewport & Sheets Switcher --- */
#sheet-viewport {
  flex-grow: 1;
  position: relative;
  height: calc(100vh - var(--header-height) - var(--tabs-height));
  width: 100%;
  overflow: hidden;
}

.sheet-content {
  display: none;
  width: 100%;
  height: 100%;
  padding: 16px;
  overflow: hidden;
  animation: fadeIn 0.2s ease-out;
}

.sheet-content.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 5. Dashboard Cards & Panels --- */
.dashboard-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-panel:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

.panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(255, 255, 255, 0.01);
  flex-shrink: 0;
}

.panel-header h3 {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.panel-header h3 i {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.panel-info {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.panel-body {
  padding: 16px;
  flex-grow: 1;
  position: relative;
  overflow: hidden;
}

.scrollable-body {
  overflow-y: auto;
}

/* --- 6. KPI Grid (Executive Summary) --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  flex-shrink: 0;
}

.kpi-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.08);
}

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

.kpi-icon-wrapper i {
  width: 20px;
  height: 20px;
}

/* Iconic KPI themes */
.kpi-icon-wrapper.access { background-color: var(--color-emerald-glow); color: var(--color-emerald); }
.kpi-icon-wrapper.deficit { background-color: var(--color-blue-glow); color: var(--color-blue); }
.kpi-icon-wrapper.health { background-color: var(--color-danger-glow); color: var(--color-danger); }
.kpi-icon-wrapper.finance { background-color: var(--color-warning-glow); color: var(--color-warning); }

.kpi-data {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.kpi-subtext {
  font-size: 0.7rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-subtext i {
  width: 12px;
  height: 12px;
}

.kpi-subtext.positive { color: var(--color-emerald); }
.kpi-subtext.negative { color: var(--color-danger); }

/* --- 7. Overview Page Layout --- */
.overview-layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 16px;
  flex-grow: 1;
  overflow: hidden;
}

.chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.bulletin-item {
  padding: 12px 14px;
  background-color: var(--bg-tertiary);
  border-radius: 6px;
  border-left: 3px solid transparent;
  margin-bottom: 12px;
}

.bulletin-item:last-child {
  margin-bottom: 0;
}

.bulletin-item h4 {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bulletin-item p {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.highlight-border-green { border-left-color: var(--color-emerald); }
.highlight-border-red { border-left-color: var(--color-danger); }
.highlight-border-warning { border-left-color: var(--color-warning); }

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--color-emerald); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--color-danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--color-warning); border: 1px solid rgba(245, 158, 11, 0.2); }

/* --- 8. Global Trends Layout --- */
.trends-layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 16px;
  flex-grow: 1;
  overflow: hidden;
}

.trend-chart-panel {
  display: flex;
  flex-direction: column;
}

.chart-legend-custom {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.72rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.legend-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-item .dot.historical { background-color: var(--color-emerald); }
.legend-item .dot.target { background-color: var(--color-blue); }
.legend-item .dot.projection { background-color: var(--color-warning); }

.interactive-slider-wrapper {
  background-color: var(--bg-tertiary);
  border-top: 1px solid var(--border-color);
  padding: 12px 16px;
  flex-shrink: 0;
}

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

.slider-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.slider-active-year {
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-emerald);
  background-color: var(--bg-primary);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.custom-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-hover);
  outline: none;
  border-radius: 3px;
  cursor: pointer;
}

.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-emerald);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
  transition: transform 0.1s ease;
}

.custom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.metric-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background-color: var(--bg-tertiary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.metric-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

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

.text-emerald { color: var(--color-emerald); }
.text-danger { color: var(--color-danger); }
.text-orange { color: #f97316; }
.text-blue { color: var(--color-blue); }

.timeline-insights-card {
  padding: 12px 14px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.timeline-insights-card h4 {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.timeline-insights-card h4 i {
  width: 14px;
  height: 14px;
}

.timeline-insights-card p {
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

/* --- 9. Regional Layout --- */
.regional-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
  flex-grow: 1;
  overflow: hidden;
}

/* --- 10. Health & Environment Layout --- */
.health-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  flex-grow: 1;
  overflow: hidden;
}

.health-pie-container {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 16px;
  align-items: center;
  height: 100%;
}

.health-chart-wrapper {
  position: relative;
  height: 90%;
  width: 100%;
}

.scrollable-legend {
  overflow-y: auto;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 8px;
}

.legend-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
}

.legend-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 700;
}

.legend-card-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 6px;
}

.legend-card-pct {
  font-family: var(--font-mono);
  font-weight: 700;
}

.legend-card-desc {
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.climate-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.climate-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 14px;
}

.climate-icon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.climate-icon-row i {
  width: 20px;
  height: 20px;
}

.climate-metric-headline {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.climate-card h4 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.climate-card p {
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-muted);
}

/* --- 11. Simulator Sheet Layout --- */
.simulator-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  flex-grow: 1;
  overflow: hidden;
}

.simulator-inputs-scroll {
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sim-input-group {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px 14px;
}

.sim-input-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.sim-input-label-row label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sim-input-value {
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-emerald);
  background: var(--bg-primary);
  padding: 2px 8px;
  border-radius: 4px;
}

.sim-slider::-webkit-slider-thumb {
  background: var(--color-blue);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}

.sim-input-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.3;
}

.sim-actions {
  margin-top: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--color-emerald);
  color: #000000;
}

.btn-primary:hover {
  background-color: #34d399;
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

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

.sim-output-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sim-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  flex-shrink: 0;
}

.sim-kpi-box {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sim-kpi-lbl {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.sim-kpi-val {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.sim-kpi-status {
  font-size: 0.6rem;
  font-weight: 700;
  align-self: flex-start;
  padding: 1px 6px;
  border-radius: 3px;
}

.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--color-blue); border: 1px solid rgba(59, 130, 246, 0.2); }

.sim-chart-container {
  flex-grow: 1;
  position: relative;
  height: 200px;
}

/* --- 12. Data Explorer Grid --- */
.explorer-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.explorer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px 6px 0 0;
  gap: 16px;
  flex-shrink: 0;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-grow: 1;
}

.search-input-wrapper {
  position: relative;
  width: 220px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

#explorer-search {
  width: 100%;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 10px 6px 32px;
  border-radius: 4px;
  font-size: 0.75rem;
  outline: none;
}

#explorer-search:focus {
  border-color: var(--border-color-focus);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.custom-select {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  outline: none;
}

.custom-select:focus {
  border-color: var(--border-color-focus);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.explorer-records-count {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.excel-grid-container {
  flex-grow: 1;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-top: none;
  background-color: var(--bg-secondary);
  border-radius: 0 0 6px 6px;
}

.excel-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-align: left;
}

/* Header style sticky */
.excel-table th {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 600;
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  user-select: none;
}

.excel-table th.sortable {
  cursor: pointer;
}

.excel-table th.sortable:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.sort-icon {
  width: 12px;
  height: 12px;
  vertical-align: middle;
  margin-left: 4px;
  opacity: 0.7;
}

.excel-table td {
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.excel-table tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.015);
}

.excel-table tbody tr:hover {
  background-color: var(--bg-hover);
}

/* Number cell alignment & monospacing */
.excel-table td.text-right, .excel-table th.text-right {
  text-align: right;
}
.excel-table td.text-right {
  font-family: var(--font-mono);
}

.excel-table td.text-center, .excel-table th.text-center {
  text-align: center;
}

.cell-index {
  width: 40px;
  text-align: center;
  font-family: var(--font-mono);
  background-color: var(--bg-tertiary);
  color: var(--text-muted);
  border-right: 1px solid var(--border-color);
  position: sticky;
  left: 0;
  z-index: 2;
}

tbody .cell-index {
  background-color: rgba(23, 32, 51, 0.5);
  font-weight: 500;
}

.policy-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 700;
}

.policy-5 { background-color: rgba(16, 185, 129, 0.15); color: #34d399; }
.policy-4 { background-color: rgba(16, 185, 129, 0.1); color: #a7f3d0; }
.policy-3 { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.policy-2 { background-color: rgba(239, 68, 68, 0.1); color: #fca5a5; }
.policy-1 { background-color: rgba(239, 68, 68, 0.2); color: #f87171; }

/* --- 13. Bottom Excel Workbook Tab Bar --- */
#workbook-tabs {
  height: var(--tabs-height);
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0;
  overflow: hidden;
  z-index: 100;
  flex-shrink: 0;
}

.sheet-navigation {
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border-color);
  padding: 0 4px;
  background-color: var(--bg-tertiary);
  height: 100%;
}

.sheet-nav-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: background 0.1s, color 0.1s;
}

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

.sheet-nav-btn i {
  width: 14px;
  height: 14px;
}

.sheets-tabs-container {
  display: flex;
  align-items: flex-end;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none; /* Hide scrollbar Firefox */
}

.sheets-tabs-container::-webkit-scrollbar {
  display: none; /* Hide scrollbar Chrome/Safari */
}

.sheet-tab {
  background-color: var(--bg-tertiary);
  border: none;
  border-right: 1px solid var(--border-color);
  border-top: 2px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 16px;
  height: calc(100% - 2px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 500;
  user-select: none;
  transition: background-color 0.1s, color 0.1s, border-top-color 0.1s;
}

.sheet-tab:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.sheet-tab.active {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  border-top: 3px solid var(--color-emerald);
  height: 100%;
}

.sheet-tab i {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

.sheet-add-btn-wrapper {
  display: flex;
  align-items: center;
  padding: 0 8px;
  height: 100%;
  border-right: 1px solid var(--border-color);
}

.sheet-add-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.1s, color 0.1s;
}

.sheet-add-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.sheet-add-btn i {
  width: 14px;
  height: 14px;
}

.status-bar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  height: 100%;
  background-color: var(--bg-tertiary);
  border-left: 1px solid var(--border-color);
}

.status-cell {
  padding: 0 12px;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 0.68rem;
  color: var(--text-muted);
  border-right: 1px solid var(--border-color);
}

.status-cell.cell-sum {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* Responsiveness adjustments for smaller screens */
@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .overview-layout, .trends-layout, .regional-layout, .health-layout, .simulator-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .sheet-content {
    overflow-y: auto !important;
  }
}
