/* =========================================================
   HUELLA DE CARBONO — VACA MUERTA
   Design System · main.css
   Ref: Resolución MA 258/25 · Disposición 1/26
   ========================================================= */

/* Tipografía RAWE: DM Sans (Key Visual Chacal × Nevo) */
@font-face { font-family: "DM Sans"; src: url("fonts/DMSans_18pt-Medium.ttf") format("truetype"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/DMSans_18pt-ExtraBold.ttf") format("truetype"); font-weight: 700 900; font-display: swap; }

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  /* Paleta RAWE, misma que el Observatorio de Emisiones */
  --primary:        #285843;   /* verde bosque */
  --primary-dim:    #1F4636;
  --primary-glow:   rgba(40,88,67,.10);
  --accent:         #8C6D16;   /* amarillo en versión legible sobre claro */
  --accent-dim:     #6F5611;
  --danger:         #A9472F;
  --danger-dim:     #8A3A26;
  --warning:        #9A5B2A;
  --info:           #5C5C50;   /* tierra */
  --amarillo:       #E1E58F;
  --hoja:           #559D48;

  /* Neutros (sesgo arcilla) */
  --bg-0:           #ECEBE5;
  --bg-1:           #E4E2D8;
  --bg-2:           #F3F2EC;
  --bg-3:           #E1E0E0;
  --bg-4:           #C0BDA6;
  --surface:        #F6F5F0;
  --surface-hi:     #E1E0E0;
  --border:         #D6D4C6;
  --border-hi:      #C0BDA6;

  /* Texto */
  --text-1:         #282826;
  --text-2:         #5C5C50;
  --text-3:         #7A7868;

  /* Estados */
  --status-green:   #3E7B4F;
  --status-yellow:  #8C6D16;
  --status-red:     #A9472F;
  --status-grey:    #7A7868;

  /* Tamaños */
  --radius-sm:      4px;
  --radius-md:      6px;
  --radius-lg:      8px;
  --radius-xl:      10px;
  --sidebar-w:      260px;
  --header-h:       64px;

  /* Sombras discretas */
  --shadow-sm:  0 1px 3px rgba(40,40,38,.06);
  --shadow-md:  0 4px 14px rgba(40,40,38,.08);
  --shadow-lg:  0 10px 30px rgba(40,40,38,.12);
  --glow-primary: none;
}

/* ── RESET ───────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg-0);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}
input:focus, select:focus, textarea:focus, button:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dim); }

/* ── LAYOUT ──────────────────────────────────────────────── */
#app { display: flex; height: 100vh; overflow: hidden; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  transition: transform .3s ease;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dim));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: var(--glow-primary);
}
.logo-text { font-size: 13px; font-weight: 700; color: var(--text-1); line-height: 1.2; }
.logo-sub  { font-size: 10px; font-weight: 400; color: var(--text-3); }
.sidebar-tagline {
  font-size: 10px; color: var(--text-3); 
  padding: 4px 8px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--primary);
}

.sidebar-nav { padding: 12px 8px; flex: 1; }
.nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  color: var(--text-3); padding: 12px 12px 4px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-md);
  cursor: pointer; transition: all .2s ease;
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  margin-bottom: 2px; position: relative;
}
.nav-item:hover { background: var(--bg-3); color: var(--text-1); }
.nav-item.active {
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid var(--border-hi);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: var(--primary);
  border-radius: 0 2px 2px 0;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 999px;
  background: var(--primary); color: #E1E0E0;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  font-size: 10px; color: var(--text-3);
}
.sidebar-footer strong { color: var(--primary); }

/* MAIN AREA */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* HEADER */
.topbar {
  height: var(--header-h);
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  flex-shrink: 0;
}
.topbar-title { font-size: 16px; font-weight: 700; color: var(--text-1); }
.topbar-subtitle { font-size: 11px; color: var(--text-3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.last-updated { font-size: 11px; color: var(--text-3); }
.hamburger-btn {
  display: none; background: none; border: none;
  color: var(--text-2); cursor: pointer; font-size: 20px;
}

/* CONTENT */
.content-area {
  flex: 1; overflow-y: auto; padding: 24px;
}

/* PAGE */
.page { display: none; animation: fadeIn .25s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 800; color: var(--text-1); }
.page-header p  { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.page-header .norm-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 600; padding: 3px 8px;
  background: rgba(140,109,22,.1); color: var(--accent);
  border: 1px solid rgba(140,109,22,.3); border-radius: 999px;
  margin-top: 8px; margin-right: 4px;
}

/* ── COMPONENTS ──────────────────────────────────────────── */

/* GLASS CARD */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  
  transition: border-color .2s, box-shadow .2s;
}
.card:hover { border-color: var(--border-hi); box-shadow: var(--shadow-sm); }
.card-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-3); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}

/* KPI CARD */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative; overflow: hidden;
  transition: all .3s ease;
}
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--kpi-color, var(--primary));
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-hi); }
.kpi-label  { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; }
.kpi-value  { font-size: 28px; font-weight: 800; color: var(--text-1); margin: 6px 0 4px; line-height: 1; }
.kpi-unit   { font-size: 12px; color: var(--text-3); font-weight: 400; }
.kpi-delta  { font-size: 11px; font-weight: 600; margin-top: 6px; }
.kpi-delta.up   { color: var(--danger); }
.kpi-delta.down { color: var(--status-green); }
.kpi-icon { position: absolute; top: 16px; right: 16px; font-size: 26px; opacity: .15; }

/* CHART CONTAINERS */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px,1fr)); gap: 20px; margin-bottom: 24px; }
.chart-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.chart-box canvas { max-height: 300px; }

/* TABLE */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--bg-2); padding: 12px 14px;
  text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-2); }
tbody td { padding: 12px 14px; color: var(--text-2); vertical-align: middle; }
tbody td strong { color: var(--text-1); font-weight: 600; }

/* STATUS BADGE */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
}
.badge-green  { background: rgba(62,123,79,.15); color: var(--status-green); border: 1px solid rgba(62,123,79,.3); }
.badge-yellow { background: rgba(140,109,22,.15);  color: var(--status-yellow); border: 1px solid rgba(140,109,22,.3); }
.badge-red    { background: rgba(169,71,47,.15);   color: var(--status-red);    border: 1px solid rgba(169,71,47,.3); }
.badge-grey   { background: rgba(122,120,104,.15); color: var(--status-grey);  border: 1px solid rgba(122,120,104,.3); }
.badge-blue   { background: rgba(92,92,80,.15);  color: var(--info);          border: 1px solid rgba(92,92,80,.3); }

/* PROGRESS BAR */
.progress-bar-wrap { background: var(--bg-3); border-radius: 999px; height: 6px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 999px; transition: width 1s ease; }

/* BUTTON */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; transition: all .2s ease;
}
.btn-primary { background: var(--primary); color: #E1E0E0; }
.btn-primary:hover { background: var(--primary-dim); box-shadow: var(--glow-primary); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 1px solid var(--border-hi);
}
.btn-outline:hover { background: var(--primary-glow); }
.btn-danger { background: rgba(169,71,47,.15); color: var(--danger); border: 1px solid rgba(169,71,47,.3); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* FORM */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-label .req { color: var(--danger); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-1); padding: 9px 12px;
  transition: border .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-select option { background: var(--bg-2); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; }
.form-section-title {
  font-size: 13px; font-weight: 700; color: var(--primary);
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  margin-bottom: 16px; margin-top: 8px;
}

/* TABS */
.tab-bar {
  display: flex; gap: 2px;
  background: var(--bg-2); border-radius: var(--radius-md);
  padding: 4px; margin-bottom: 20px; width: fit-content;
}
.tab-btn {
  padding: 7px 16px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; cursor: pointer;
  background: none; border: none; color: var(--text-3);
  transition: all .2s;
}
.tab-btn.active { background: var(--surface-hi); color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(40,40,38,.45); backdrop-filter: blur(4px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 28px;
  width: min(680px, 95vw); max-height: 90vh; overflow-y: auto;
  transform: scale(.96); transition: transform .2s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 17px; font-weight: 800; }
.modal-close { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 26px; line-height: 1; width: 36px; height: 36px; border-radius: 8px; }
.modal-close:focus-visible { outline: 2px solid var(--primary); }
.modal-close:hover { color: var(--text-1); }

/* ALERT BOX */
.alert {
  display: flex; gap: 12px; padding: 14px 16px;
  border-radius: var(--radius-md); margin-bottom: 16px;
  font-size: 13px;
}
.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-info    { background: rgba(92,92,80,.08); border: 1px solid rgba(92,92,80,.2); color: var(--info); }
.alert-warning { background: rgba(140,109,22,.08); border: 1px solid rgba(140,109,22,.2); color: var(--accent); }
.alert-danger  { background: rgba(169,71,47,.08);  border: 1px solid rgba(169,71,47,.2);  color: var(--danger); }
.alert-success { background: rgba(62,123,79,.08);  border: 1px solid rgba(62,123,79,.2);  color: var(--status-green); }

/* MAP */
#main-map { height: 380px; border-radius: var(--radius-lg); overflow: hidden; }

/* NORMATIVE CARD */
.norm-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden; margin-bottom: 16px;
}
.norm-card-header {
  background: var(--bg-3); padding: 16px 20px;
  display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--border);
}
.norm-card-body { padding: 16px 20px; }
.norm-number { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; }
.norm-title  { font-size: 15px; font-weight: 700; color: var(--text-1); }
.norm-meta   { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* SCOPE CHIPS */
.scope-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.scope-chip {
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.scope-1 { background: rgba(169,71,47,.15); color: var(--danger); border: 1px solid rgba(169,71,47,.3); }
.scope-2 { background: rgba(140,109,22,.15); color: var(--accent); border: 1px solid rgba(140,109,22,.3); }
.scope-3 { background: rgba(92,92,80,.15); color: var(--info); border: 1px solid rgba(92,92,80,.3); }

/* RESULTS BOX */
.results-box {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px; margin-top: 20px;
}
.result-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.result-row:last-child { border-bottom: none; }
.result-label { font-size: 13px; color: var(--text-2); }
.result-value { font-size: 16px; font-weight: 700; font-family: 'DM Sans', system-ui, sans-serif; font-variant-numeric: tabular-nums; }

/* COMPANY DETAIL PANEL */
.company-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
}
.company-logo-circle {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; flex-shrink: 0;
}
.stats-mini-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 12px;
  margin: 16px 0;
}
.stat-mini {
  background: var(--bg-3); border-radius: var(--radius-md);
  padding: 12px; text-align: center;
}
.stat-mini-val  { font-size: 18px; font-weight: 800; color: var(--text-1); }
.stat-mini-lbl  { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }

/* REDUCTION PLAN */
.plan-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  margin-bottom: 14px; overflow: hidden;
}
.plan-card-header {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-3); padding: 14px 18px; cursor: pointer;
}
.plan-card-body { padding: 16px 18px; }
.plan-progress { margin-bottom: 10px; }
.plan-progress-label {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-3); margin-bottom: 4px;
}

/* EXPORT */
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 16px; }
.export-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  transition: all .2s;
}
.export-card:hover { border-color: var(--border-hi); }
.export-icon { font-size: 28px; }
.export-title { font-size: 14px; font-weight: 700; color: var(--text-1); }
.export-desc  { font-size: 12px; color: var(--text-3); flex: 1; }

/* SECTION DIVIDER */
.section-gap { margin-bottom: 24px; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* TOOLTIP */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--bg-4); color: var(--text-1); font-size: 11px;
  padding: 4px 8px; border-radius: var(--radius-sm); white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity .2s; z-index: 99;
}
[data-tooltip]:hover::after { opacity: 1; }

/* MONO */
.mono { font-family: 'DM Sans', system-ui, sans-serif; font-variant-numeric: tabular-nums; }

/* GRID UTILITIES */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.flex   { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mb-16  { margin-bottom: 16px; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-3); }
.text-primary { color: var(--primary); }
.text-accent  { color: var(--accent); }
.text-danger  { color: var(--danger); }
.fw-bold  { font-weight: 700; }
.w-full   { width: 100%; }

/* RESPONSIVE */
@media (max-width: 900px) {
  :root { --sidebar-w: 0; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 260px; transform: translateX(-100%); z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  .hamburger-btn { display: flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .content-area { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 22px; }
}

/* ── Ajustes RAWE ─────────────────────────────────────── */
h1, .page-header h1, .topbar-title, .kpi-value, .card-title, .norm-title { letter-spacing: -0.02em; }
.page-header h1 { font-weight: 800; }
.card-title, .kpi-label, .nav-section-label { letter-spacing: .08em; }
.logo-icon { background: none; box-shadow: none; width: auto; height: auto; border-radius: 0; }
.logo-icon img { height: 22px; width: auto; display: block; }
.kpi-card::before { opacity: .9; }
.sidebar { border-right: 1px solid var(--border); }
.nav-item.active { color: var(--primary); font-weight: 700; }
.leaflet-container { background: #E1E0E0; font-family: 'DM Sans', sans-serif; }

/* Tooltip de fuente de la tabla de operadoras (mismo look que los tooltips de Chart.js) */
[data-fuente-t] { cursor: help; }
[data-fuente-t]:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
th[data-fuente-t] { text-decoration: underline dotted rgba(92,92,80,.5); text-underline-offset: 3px; }
.fuente-tooltip {
  position: fixed; z-index: 1000; max-width: min(380px, calc(100vw - 16px)); pointer-events: none;
  background: rgba(0,0,0,.8); color: #fff; border-radius: 6px; padding: 8px 10px;
  font: 12px/1.45 'DM Sans', system-ui, sans-serif; opacity: 0; transition: opacity .12s;
}
.fuente-tooltip .ft-t { font-weight: 700; margin-bottom: 4px; }
.fuente-tooltip .ft-f { margin-top: 8px; font-size: 11px; color: rgba(255,255,255,.75); }
.res-sub { font-size: 11px; color: var(--text-3); display: flex; justify-content: space-between; padding: 2px 0; }
.badge-reportado { white-space: nowrap; background: rgba(40,88,67,.12); color: var(--primary); border: 1px solid rgba(40,88,67,.35); }
td.col-rep, th.col-rep { background: rgba(40,88,67,.045); }
/* Calculadora en modo reporte: un bloque por segmento del Alcance 1 */
.segs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.seg { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 12px; background: var(--bg-2); }
.seg-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.seg-nombre { font-size: 13px; font-weight: 700; color: var(--text-1); }
.seg-origen { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.seg-origen:empty { display: none; }
.seg-origen[data-v="empresa"] { background: rgba(40,88,67,.12); color: var(--primary); }
.seg-origen[data-v="factores"] { background: rgba(140,109,22,.14); color: #6E5611; }
.seg-origen[data-v="no_reportado"] { background: var(--bg-3); color: var(--text-3); }
.seg-gases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.seg-gases label { font-size: 11px; color: var(--text-3); display: flex; flex-direction: column; gap: 3px; }
.seg-ayuda { margin-top: 8px; font-size: 12px; }
.seg-ayuda summary { cursor: pointer; color: var(--primary); margin-bottom: 8px; }
.seg-ayuda .seg-gases { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 8px; }
@media (max-width: 520px) { .seg-gases, .seg-ayuda .seg-gases { grid-template-columns: 1fr; } }
/* Llamado a la acción del detalle de operadora */
.cta-reporte { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius-lg); background: rgba(40,88,67,.07); border: 1px solid rgba(40,88,67,.25); }
.cta-reporte--ok { background: var(--bg-2); border-color: var(--border); }
.cta-reporte-titulo { font-size: 14px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.cta-reporte-texto { font-size: 12px; line-height: 1.5; color: var(--text-2); margin-bottom: 10px; }
/* Marco normativo: secciones y enlaces a las fuentes */
.norm-seccion { font-size: 17px; font-weight: 800; color: var(--text-1); margin: 26px 0 4px; }
.norm-seccion-bajada { font-size: 13px; color: var(--text-3); margin-bottom: 12px; }
.norm-enlaces { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.norm-enlaces a { font-size: 12px; color: var(--primary); border: 1px solid rgba(40,88,67,.3); border-radius: 999px; padding: 3px 10px; text-decoration: none; }
.norm-enlaces a:hover { background: rgba(40,88,67,.08); }
/* Planes de reducción: acciones de la provincia */
.accion-eje { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #8C6D16; margin-bottom: 2px; }
.accion-estado { white-space: normal; text-align: center; max-width: 170px; }
.accion-prov { margin-bottom: 12px; }
/* Selector de idioma de la huella */
.lang-switch { font-size: 12px; font-weight: 800; color: var(--primary); border: 1px solid rgba(40,88,67,.35); border-radius: 6px; padding: 3px 9px; text-decoration: none; }
.lang-switch:hover { background: rgba(40,88,67,.08); }
