/* ==========================================================================
   CARBONÔMETRO - STYLES & DESIGN SYSTEM
   Modern, Eco-Friendly, Glassmorphic & Responsive Theme (GHG Protocol Compliant)
   ========================================================================== */

:root {
  /* Color Tokens - Dark Mode (Default) */
  --bg-primary: #0a110e;
  --bg-secondary: #121f1a;
  --bg-card: rgba(22, 38, 31, 0.7);
  --bg-card-hover: rgba(28, 48, 39, 0.85);
  --bg-glass: rgba(18, 35, 28, 0.6);
  --border-color: rgba(46, 90, 68, 0.35);
  --border-highlight: rgba(16, 185, 129, 0.4);
  
  --text-primary: #f0fdf4;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Primary Eco Palette */
  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --emerald-600: #059669;
  --cyan-500: #06b6d4;
  --cyan-400: #22d3ee;
  --teal-500: #14b8a6;
  --accent-orange: #f97316;
  --accent-blue: #3b82f6;

  /* Status Colors */
  --success-bg: rgba(16, 185, 129, 0.15);
  --success-text: #34d399;
  --info-bg: rgba(6, 182, 212, 0.15);
  --info-text: #22d3ee;
  --warning-bg: rgba(249, 115, 22, 0.15);
  --warning-text: #fb923c;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  
  /* Layout & Shadows */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.15);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Override */
[data-theme="light"] {
  --bg-primary: #f2f7f4;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.75);
  --border-color: rgba(209, 231, 221, 0.8);
  --border-highlight: rgba(16, 185, 129, 0.5);
  
  --text-primary: #0f291e;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --shadow-card: 0 10px 25px -5px rgba(0, 50, 20, 0.08);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Container */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.25rem 1.75rem;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--emerald-500), var(--cyan-500));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.brand-title h1 {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary), var(--emerald-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  font-size: 0.8rem;
  color: var(--emerald-400);
  font-weight: 500;
  display: block;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* Select Inputs */
.custom-select, .custom-input {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  font-family: var(--font-sans);
  outline: none;
  transition: var(--transition-smooth);
}

.custom-select option, select option {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.5rem;
}

[data-theme="dark"] .custom-select option,
[data-theme="dark"] select option {
  background-color: #121f1a;
  color: #f0fdf4;
}

[data-theme="light"] .custom-select option,
[data-theme="light"] select option {
  background-color: #ffffff;
  color: #0f291e;
}

.custom-select:focus, .custom-input:focus {
  border-color: var(--emerald-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.custom-select.alt {
  background-color: rgba(6, 182, 212, 0.08);
  border-color: rgba(6, 182, 212, 0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-600));
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-pulse {
  animation: pulse-glow 2.5s infinite;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn-secondary {
  background: var(--cyan-500);
  color: #ffffff;
}

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

.btn-outline:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--emerald-500);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-full {
  width: 100%;
}

.icon-btn {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.icon-btn:hover {
  border-color: var(--emerald-500);
  color: var(--emerald-400);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* Navigation Tabs */
.app-nav {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--emerald-600), var(--emerald-500));
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* Tab Contents */
.tab-content {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.35s ease;
}

.tab-content.active {
  display: flex;
}

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

/* Metric Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: var(--transition-smooth);
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-glow);
}

.metric-card.primary-gradient {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.15));
  border-color: var(--emerald-500);
}

.card-icon-bg {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon-bg.icon-blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.card-icon-bg.icon-orange { background: rgba(249, 115, 22, 0.15); color: var(--accent-orange); }
.card-icon-bg.icon-emerald { background: rgba(16, 185, 129, 0.2); color: var(--emerald-400); }

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value-container {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
}

.metric-unit {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--emerald-400);
}

.metric-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.metric-subtext.highlight-green {
  color: var(--emerald-400);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
}

/* Equivalencies Banner */
.equivalencies-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.banner-header h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
}

.banner-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.equivalency-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.eq-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.eq-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.12);
  color: var(--cyan-400);
  display: flex;
  align-items: center;
  justify-content: center;
}

.eq-content {
  display: flex;
  flex-direction: column;
}

.eq-value {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.eq-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chart-card.full-width {
  grid-column: span 2;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.card-header h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 300px;
}

/* Section Cards & Tables */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.custom-table th, .custom-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.custom-table th {
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.15);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.custom-table tbody tr {
  transition: var(--transition-smooth);
}

.custom-table tbody tr:hover {
  background: rgba(16, 185, 129, 0.05);
}

.table-summary-row {
  font-weight: 700;
  background: rgba(16, 185, 129, 0.1);
  color: var(--text-primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-info { background: var(--info-bg); color: var(--info-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

.status-dot.online {
  background-color: var(--emerald-400);
  box-shadow: 0 0 8px var(--emerald-400);
  animation: pulse-dot 2s infinite;
}

.status-dot.offline {
  background-color: var(--accent-orange);
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* TAB 2: SIMULATOR */
.simulator-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 1.5rem;
}

.simulator-controls {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sim-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.input-with-action {
  display: flex;
  gap: 0.4rem;
}

.input-with-action input {
  flex: 1;
}

.btn-icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
}

.sim-results-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sim-results-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--emerald-400);
}

.sim-stat {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}

.sim-stat.highlight {
  color: var(--cyan-400);
  font-size: 0.88rem;
}

.sim-stat.highlight-green {
  color: var(--emerald-400);
  font-size: 0.95rem;
  border-top: 1px dashed var(--border-color);
  padding-top: 0.4rem;
}

.simulator-map-container {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  min-height: 550px;
}

.map-view {
  width: 100%;
  height: 100%;
  min-height: 550px;
  z-index: 1;
}

.map-overlay-instructions {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  pointer-events: none;
}

/* TAB 3: RANKING */
.ranking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.user-level-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-highlight);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
}

.level-badge {
  background: linear-gradient(135deg, var(--emerald-500), var(--cyan-500));
  color: #fff;
  font-weight: 800;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.level-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 180px;
}

.level-title {
  font-size: 0.85rem;
  font-weight: 700;
}

.progress-bar-container {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--emerald-400);
}

.level-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.ranking-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
}

.lb-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.lb-rank.gold { background: #eab308; color: #000; }
.lb-rank.silver { background: #94a3b8; color: #000; }
.lb-rank.bronze { background: #b45309; color: #fff; }

.lb-info {
  flex: 1;
  margin: 0 1rem;
}

.lb-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.lb-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.lb-score {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--emerald-400);
  font-size: 1.05rem;
}

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

.badge-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 1.25rem 0.85rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.badge-item.unlocked {
  border-color: var(--emerald-500);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.badge-icon {
  font-size: 2.2rem;
}

.badge-name {
  font-weight: 700;
  font-size: 0.82rem;
}

.badge-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* TAB 4: METHODOLOGY */
.methodology-hero {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 2rem auto;
}

.hero-tag {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.methodology-hero h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

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

.method-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.method-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan-400);
  display: flex;
  align-items: center;
  justify-content: center;
}

.formula-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
  color: var(--emerald-400);
  font-size: 0.88rem;
}

.formula-box.highlight {
  border-color: var(--emerald-500);
  background: rgba(16, 185, 129, 0.1);
}

.factors-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
}

/* TAB 5: REPORTS */
.reports-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
}

.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.report-print-header {
  display: none;
}

/* MODAL DIALOG */
.custom-dialog {
  border: none;
  background: transparent;
  padding: 1rem;
  max-width: 620px;
  width: 100%;
  margin: auto;
}

.custom-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.dialog-content {
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: var(--text-primary);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.dialog-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.dialog-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.dialog-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-preview-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.footer-badge {
  background: rgba(16, 185, 129, 0.1);
  color: var(--emerald-400);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ==========================================================================
   PRINT STYLES FOR OFFICIAL ESG PDF GENERATION
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .app-header, .app-nav, .reports-header-actions, .filter-card, .app-footer, .custom-dialog {
    display: none !important;
  }

  .tab-content {
    display: none !important;
  }

  #tab-reports {
    display: block !important;
  }

  .section-card.printable-area {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
  }

  .report-print-header {
    display: block !important;
    margin-bottom: 1.5rem;
  }

  .report-print-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
  }

  .report-print-header p {
    font-size: 0.85rem;
    color: #444;
  }

  .custom-table th {
    background: #e2e8f0 !important;
    color: #000000 !important;
  }

  .custom-table td, .custom-table th {
    border-bottom: 1px solid #cbd5e1 !important;
  }
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .simulator-layout {
    grid-template-columns: 1fr;
  }

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

  .chart-card.full-width {
    grid-column: span 1;
  }

  .ranking-grid {
    grid-template-columns: 1fr;
  }

  .methodology-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

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