/* =====================================================
   ESG COMMAND CENTER — Corporate Stylesheet
   Theme: Deep Forest Green + Slate Navy + Warm Ivory
   Font: Playfair Display (headings) + DM Sans (body)
===================================================== */

:root {
  --primary: #0d4f3c;
  --primary-mid: #1a6b52;
  --primary-light: #2d8a68;
  --accent: #38c98e;
  --accent-gold: #d4a843;
  --accent-gold-light: #f0c96a;
  --navy: #1e2d40;
  --navy-mid: #2c3e55;
  --slate: #455a72;
  --ivory: #f7f4ef;
  --ivory-dark: #ede9e3;
  --white: #ffffff;
  --text-dark: #1a2332;
  --text-mid: #3d4f5e;
  --text-light: #6b7c8d;

  --env-color: #2d8a68;
  --env-light: #e6f5f0;
  --soc-color: #1a6bb5;
  --soc-light: #e6f0f9;
  --gov-color: #8a5c2d;
  --gov-light: #f5ece6;

  --scope1-color: #d44e38;
  --scope1-light: #fdf0ed;
  --scope2-color: #e0941a;
  --scope2-light: #fdf5e6;
  --scope3-color: #6b42b8;
  --scope3-light: #f2eefb;

  --red: #dc3545;
  --amber: #ff9900;
  --green-status: #28a745;
  --red-light: #ffeaea;
  --amber-light: #fff3cd;
  --green-light: #e6f5ea;

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 16px rgba(13,79,60,0.09);
  --shadow-lg: 0 8px 40px rgba(13,79,60,0.14);
  --transition: 0.22s ease;
}

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

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--ivory);
  color: var(--text-dark);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--ivory-dark); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }

/* ===================== SIDEBAR ===================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
  transition: transform var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo-mark {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.logo-title {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.logo-sub {
  display: block;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.04em;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 14px 20px 4px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
  border-left-color: var(--accent);
}

.nav-item.active {
  color: #fff;
  background: rgba(56,201,142,0.14);
  border-left-color: var(--accent);
}

.nav-icon { font-size: 1rem; opacity: 0.9; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-name { display: block; font-size: 0.83rem; font-weight: 600; color: #fff; }
.user-role { display: block; font-size: 0.68rem; color: rgba(255,255,255,0.45); }

/* ===================== MAIN ===================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}

/* ===================== TOPBAR ===================== */
.topbar {
  height: var(--topbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--ivory-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}

.topbar-left { display: flex; align-items: center; gap: 14px; }

.sidebar-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-mid);
  padding: 4px;
  display: none;
}

.page-breadcrumb {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
}

.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-filter { display: flex; gap: 8px; }

.filter-select {
  border: 1.5px solid var(--ivory-dark);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.82rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-mid);
  background: var(--ivory);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--accent); }

.topbar-actions { display: flex; gap: 6px; }
.btn-icon {
  background: none; border: none; font-size: 1.1rem;
  cursor: pointer; padding: 6px; border-radius: 6px;
  transition: background var(--transition);
}
.btn-icon:hover { background: var(--ivory-dark); }

/* ===================== PAGES ===================== */
.page-container { flex: 1; }
.page { display: none; padding: 28px 32px 48px; animation: fadeIn 0.25s ease; }
.page.active { display: block; }

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

.page-header { margin-bottom: 24px; }
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}
.page-subtitle { font-size: 0.88rem; color: var(--text-light); margin-top: 5px; }

/* ===================== SCORE STRIP ===================== */
.score-strip {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.score-card {
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.score-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  border-radius: 0 0 0 60px;
  opacity: 0.12;
}

.score-overall {
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: #fff;
}
.score-overall::before { background: #fff; }
.score-env { background: var(--env-light); border: 1.5px solid var(--env-color); }
.score-soc { background: var(--soc-light); border: 1.5px solid var(--soc-color); }
.score-gov { background: var(--gov-light); border: 1.5px solid var(--gov-color); }

.score-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; opacity: 0.8; text-transform: uppercase; }
.score-overall .score-label { color: rgba(255,255,255,0.8); }

.score-value {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 4px 0;
}
.score-overall .score-value { color: #fff; }
.score-env .score-value { color: var(--env-color); }
.score-soc .score-value { color: var(--soc-color); }
.score-gov .score-value { color: var(--gov-color); }

.score-change { font-size: 0.78rem; font-weight: 600; }
.score-change.positive { color: var(--accent); }
.score-badge {
  display: inline-block;
  font-size: 0.7rem;
  background: rgba(0,0,0,0.08);
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 4px;
}

/* ===================== KPI GRID ===================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-left: 4px solid transparent;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.kpi-card.env { border-left-color: var(--env-color); }
.kpi-card.soc { border-left-color: var(--soc-color); }
.kpi-card.gov { border-left-color: var(--gov-color); }

.kpi-icon { font-size: 1.3rem; margin-top: 2px; }
.kpi-label { font-size: 0.72rem; color: var(--text-light); font-weight: 500; letter-spacing: 0.02em; }
.kpi-value { font-size: 1.3rem; font-weight: 700; color: var(--text-dark); line-height: 1.2; margin: 2px 0; }
.kpi-trend { font-size: 0.7rem; font-weight: 600; }
.kpi-trend.positive { color: var(--green-status); }
.kpi-trend.negative { color: var(--red); }
.kpi-trend.amber { color: var(--amber); }

/* ===================== CHARTS ===================== */
.charts-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.chart-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.chart-card.large { flex: 2 1 400px; min-width: 0; }
.chart-card.medium { flex: 1 1 250px; min-width: 0; }
.chart-card.full-width { flex: 1 1 100%; }

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.chart-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
}
.chart-tag {
  font-size: 0.68rem;
  background: var(--ivory-dark);
  color: var(--text-light);
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 500;
}

canvas { max-height: 280px; }

/* ===================== TABS ===================== */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tab {
  padding: 8px 18px;
  border: 1.5px solid var(--ivory-dark);
  background: var(--white);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: all var(--transition);
}
.tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.tab:hover:not(.active) { border-color: var(--accent); color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s ease; }

/* ===================== ENV MODULE ===================== */
.env-sub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.env-stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.env-stat-icon { font-size: 1.5rem; margin-bottom: 8px; }
.env-stat-label { font-size: 0.72rem; color: var(--text-light); font-weight: 500; }
.env-stat-val { font-size: 1.5rem; font-weight: 700; color: var(--text-dark); margin: 4px 0 10px; }
.env-stat-bar { height: 6px; background: var(--ivory-dark); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }
.env-bar { background: linear-gradient(90deg, var(--env-color), var(--accent)); }
.green-bar { background: linear-gradient(90deg, #28a745, #4ddf82); }
.amber-bar { background: linear-gradient(90deg, #e07b00, var(--amber)); }
.red-bar { background: linear-gradient(90deg, #b02020, var(--red)); }

/* ===================== SCOPE CARDS ===================== */
.scope-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.scope-card {
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
}

.scope-card.scope1 { background: var(--scope1-light); border: 1.5px solid var(--scope1-color); }
.scope-card.scope2 { background: var(--scope2-light); border: 1.5px solid var(--scope2-color); }
.scope-card.scope3 { background: var(--scope3-light); border: 1.5px solid var(--scope3-color); }

.scope-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.scope1 .scope-tag { background: var(--scope1-color); color: #fff; }
.scope2 .scope-tag { background: var(--scope2-color); color: #fff; }
.scope3 .scope-tag { background: var(--scope3-color); color: #fff; }

.scope-title { font-weight: 700; font-size: 1rem; color: var(--text-dark); margin-bottom: 6px; }
.scope-value { font-family: 'Playfair Display', serif; font-size: 1.8rem; font-weight: 700; }
.scope1 .scope-value { color: var(--scope1-color); }
.scope2 .scope-value { color: var(--scope2-color); }
.scope3 .scope-value { color: var(--scope3-color); }

.scope-sources { font-size: 0.75rem; color: var(--text-light); margin: 6px 0; line-height: 1.5; }
.scope-trend { font-size: 0.78rem; font-weight: 600; }
.scope-trend.positive { color: var(--green-status); }
.scope-trend.negative { color: var(--red); }

/* ===================== FACTORY GRID ===================== */
.factory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.factory-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  border-top: 4px solid var(--primary-light);
}
.factory-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.factory-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.factory-name { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; }
.factory-score-badge {
  font-size: 1rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--primary);
  color: #fff;
}

.factory-metrics { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.fac-metric { text-align: center; }
.fac-metric-label { font-size: 0.65rem; color: var(--text-light); }
.fac-metric-val { font-size: 0.95rem; font-weight: 700; color: var(--text-dark); }

.traffic-light {
  display: flex;
  gap: 4px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ivory-dark);
}
.tl-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tl-dot.green { background: var(--green-status); }
.tl-dot.amber { background: var(--amber); }
.tl-dot.red { background: var(--red); }
.tl-label { font-size: 0.7rem; color: var(--text-light); }

/* ===================== FACTORY DETAIL ===================== */
.btn-back {
  background: var(--ivory-dark);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 20px;
  transition: background var(--transition);
}
.btn-back:hover { background: var(--primary); color: #fff; }

/* ===================== DATA TABLES ===================== */
.audit-table-wrapper, .scope-table-wrapper { overflow-x: auto; margin-top: 16px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.data-table th {
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--ivory-dark);
  color: var(--text-dark);
}
.data-table tr:hover td { background: var(--ivory); }
.data-table tfoot td {
  background: var(--ivory-dark);
  font-weight: 700;
  border-top: 2px solid var(--primary);
}

.s1-col { background: rgba(212,78,56,0.07) !important; }
.s2-col { background: rgba(224,148,26,0.07) !important; }
.s3-col { background: rgba(107,66,184,0.07) !important; }

.status-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.status-green { background: var(--green-light); color: #1a6b35; }
.status-amber { background: var(--amber-light); color: #7a4e00; }
.status-red { background: var(--red-light); color: #8b1a1a; }

/* ===================== POLICY LIST ===================== */
.policy-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

.policy-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
}
.policy-icon { font-size: 1.6rem; }
.policy-name { font-weight: 600; font-size: 0.9rem; color: var(--text-dark); }
.policy-version { font-size: 0.7rem; color: var(--text-light); margin: 2px 0; }
.policy-status { font-size: 0.7rem; font-weight: 700; color: var(--green-status); }

/* ===================== COMPLIANCE GRID ===================== */
.compliance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

.compliance-item {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow);
}
.comp-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.comp-title { font-size: 0.85rem; font-weight: 600; color: var(--text-dark); }
.comp-progress { height: 8px; background: var(--ivory-dark); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.comp-bar { height: 100%; border-radius: 4px; transition: width 1s ease; }
.comp-green .comp-bar { background: var(--green-status); }
.comp-amber .comp-bar { background: var(--amber); }
.comp-red .comp-bar { background: var(--red); }

/* ===================== FORM ===================== */
.form-selector { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }

.form-sections { display: grid; gap: 20px; margin-bottom: 24px; }

.form-section-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.form-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ivory-dark);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 5px;
}

.form-group input {
  width: 100%;
  border: 1.5px solid var(--ivory-dark);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 0.85rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-dark);
  background: var(--ivory);
  outline: none;
  transition: border-color var(--transition);
}
.form-group input:focus { border-color: var(--accent); background: var(--white); }

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  font-family: 'DM Sans', sans-serif;
}
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); }

.btn-secondary {
  background: var(--white);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'DM Sans', sans-serif;
}
.btn-secondary:hover { background: var(--primary); color: #fff; }

.form-success {
  margin-top: 14px;
  padding: 12px 18px;
  background: var(--green-light);
  border: 1.5px solid var(--green-status);
  border-radius: var(--radius-sm);
  color: #1a6b35;
  font-weight: 600;
  font-size: 0.85rem;
}

/* ===================== REPORTS ===================== */
.report-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.report-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.report-icon { font-size: 2rem; }
.report-card h3 { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 700; color: var(--text-dark); }
.report-card p { font-size: 0.8rem; color: var(--text-light); line-height: 1.5; flex: 1; }
.report-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag {
  font-size: 0.65rem;
  background: var(--ivory-dark);
  color: var(--text-mid);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.report-preview {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--primary);
}

/* ===================== HEATMAP ===================== */
.heatmap-section { margin-top: 4px; }
.heatmap-grid { overflow-x: auto; padding-bottom: 8px; }
.heatmap-table { border-collapse: collapse; width: 100%; }
.heatmap-table th {
  background: var(--primary);
  color: #fff;
  padding: 9px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}
.heatmap-table td {
  text-align: center;
  padding: 9px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--ivory-dark);
}

/* ===================== SCOPE TRACKER ===================== */
.scope-explainer-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.scope-explainer {
  border-radius: var(--radius);
  padding: 18px;
}
.scope-explainer.s1 { background: var(--scope1-light); border: 1.5px solid var(--scope1-color); }
.scope-explainer.s2 { background: var(--scope2-light); border: 1.5px solid var(--scope2-color); }
.scope-explainer.s3 { background: var(--scope3-light); border: 1.5px solid var(--scope3-color); }

.se-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
}
.s1 .se-tag { background: var(--scope1-color); color: #fff; }
.s2 .se-tag { background: var(--scope2-color); color: #fff; }
.s3 .se-tag { background: var(--scope3-color); color: #fff; }

.se-title { font-weight: 700; font-size: 0.92rem; color: var(--text-dark); }
.se-desc { font-size: 0.75rem; color: var(--text-light); margin-top: 5px; line-height: 1.5; }

.scope3-breakdown { margin-top: 6px; }
.scope3-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 4px 0;
}
.scope3-cat-item {
  background: var(--scope3-light);
  border: 1px solid rgba(107,66,184,0.18);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.scope3-cat-num { font-size: 0.65rem; font-weight: 800; color: var(--scope3-color); letter-spacing: 0.06em; }
.scope3-cat-name { font-size: 0.8rem; font-weight: 600; color: var(--text-dark); margin: 2px 0; }
.scope3-cat-val { font-size: 0.75rem; color: var(--text-light); }

/* ===================== LEARNING HUB ===================== */
.learning-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.learn-tab {
  padding: 9px 20px;
  border: 1.5px solid var(--ivory-dark);
  background: var(--white);
  border-radius: 20px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: all var(--transition);
}
.learn-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.learn-tab:hover:not(.active) { border-color: var(--navy); color: var(--navy); }

.learn-content { display: none; }
.learn-content.active { display: block; animation: fadeIn 0.2s ease; }

/* Learning Hero */
.learn-hero {
  display: flex;
  gap: 28px;
  align-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  color: #fff;
}

.learn-hero-text { flex: 1; }
.learn-hero-text h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.learn-hero-text p { font-size: 0.88rem; line-height: 1.7; opacity: 0.9; }
.learn-hero-text strong { color: var(--accent-gold-light); }

.learn-hero-visual { flex-shrink: 0; }

.esg-triangle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.tri-e, .tri-s, .tri-g {
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  text-align: center;
  font-weight: 800;
  font-size: 1.1rem;
}
.tri-e { background: rgba(45,138,104,0.9); color: #fff; width: 100px; }
.tri-s { background: rgba(26,107,181,0.9); color: #fff; width: 120px; }
.tri-g { background: rgba(138,92,45,0.9); color: #fff; width: 140px; }
.tri-e small, .tri-s small, .tri-g small { display: block; font-size: 0.6rem; font-weight: 500; opacity: 0.85; }

.learn-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.pillar-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.pillar-card.env { border-top: 4px solid var(--env-color); }
.pillar-card.soc { border-top: 4px solid var(--soc-color); }
.pillar-card.gov { border-top: 4px solid var(--gov-color); }

.pillar-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text-dark);
}
.pillar-card ul { list-style: none; }
.pillar-card li {
  font-size: 0.82rem;
  color: var(--text-mid);
  padding: 4px 0;
  border-bottom: 1px solid var(--ivory-dark);
  line-height: 1.4;
}
.pillar-card li::before { content: '→ '; color: var(--accent); font-weight: 700; }

/* Scope Learn Cards */
.scope-learn-card {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.sl-header {
  padding: 28px 32px;
  color: #fff;
}
.s1-learn .sl-header { background: linear-gradient(135deg, #b03020, var(--scope1-color)); }
.s2-learn .sl-header { background: linear-gradient(135deg, #a06810, var(--scope2-color)); }
.s3-learn .sl-header { background: linear-gradient(135deg, #4a2890, var(--scope3-color)); }

.sl-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  margin-bottom: 10px;
}

.sl-header h2 { font-family: 'Playfair Display', serif; font-size: 1.5rem; margin-bottom: 6px; }
.sl-tagline { font-size: 0.88rem; opacity: 0.85; }

.sl-body {
  background: var(--white);
  padding: 28px 32px;
}

.sl-section { margin-bottom: 26px; }
.sl-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--text-dark);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--ivory-dark);
}

.sl-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.sl-cat {
  display: flex;
  gap: 12px;
  background: var(--ivory);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.sl-cat-icon { font-size: 1.4rem; flex-shrink: 0; }
.sl-cat strong { font-size: 0.85rem; color: var(--text-dark); display: block; margin-bottom: 2px; }
.sl-cat div { font-size: 0.78rem; color: var(--text-light); line-height: 1.4; }

.formula-box {
  background: var(--navy);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  color: #fff;
}
.formula { font-family: 'Courier New', monospace; font-size: 0.9rem; color: var(--accent); margin-bottom: 8px; }
.formula-eg { font-size: 0.78rem; color: rgba(255,255,255,0.75); }

.strategy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.strategy-item {
  background: var(--ivory);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--text-dark);
  font-weight: 500;
  border-left: 3px solid var(--accent);
}

.method-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.method-card {
  background: var(--ivory);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.method-card h4 { font-size: 0.88rem; font-weight: 700; color: var(--text-dark); margin-bottom: 6px; }
.method-card p { font-size: 0.78rem; color: var(--text-light); line-height: 1.5; margin-bottom: 10px; }
.method-formula { font-family: 'Courier New', monospace; font-size: 0.78rem; color: var(--scope2-color); background: var(--white); padding: 8px 10px; border-radius: 4px; }

/* Scope 3 Learn */
.scope3-categories-learn { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.s3-half h4 { font-size: 0.88rem; font-weight: 700; color: var(--text-dark); margin-bottom: 10px; }
.s3-cat-list { display: flex; flex-direction: column; gap: 6px; }
.s3-cat-item-learn {
  background: var(--scope3-light);
  border-left: 3px solid var(--scope3-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--text-dark);
}
.s3-cat-item-learn strong { display: block; font-size: 0.72rem; color: var(--scope3-color); }

.insight-box {
  background: linear-gradient(135deg, var(--scope3-light), #f7f0ff);
  border: 1.5px solid var(--scope3-color);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.insight-box p { font-size: 0.88rem; color: var(--text-dark); line-height: 1.7; }
.insight-box strong { color: var(--scope3-color); }

/* Frameworks */
.frameworks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.framework-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.fw-logo {
  font-size: 2rem;
  margin-bottom: 8px;
}
.fw-name { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; }
.fw-full { font-size: 0.72rem; color: var(--text-light); margin-bottom: 10px; }
.fw-desc { font-size: 0.8rem; color: var(--text-mid); line-height: 1.55; margin-bottom: 12px; }
.fw-tags { display: flex; flex-wrap: wrap; gap: 5px; }

/* Glossary */
.glossary-search { margin-bottom: 16px; }
.glossary-list { display: grid; gap: 6px; }
.glossary-item {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.glossary-term { font-weight: 700; font-size: 0.88rem; color: var(--primary); min-width: 180px; flex-shrink: 0; }
.glossary-def { font-size: 0.82rem; color: var(--text-mid); line-height: 1.5; }

/* Quiz */
.quiz-container { max-width: 720px; }
.quiz-header { margin-bottom: 20px; }
.quiz-progress { height: 6px; background: var(--ivory-dark); border-radius: 3px; margin-bottom: 6px; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.5s ease; }
.quiz-prog-text { font-size: 0.75rem; color: var(--text-light); }

.quiz-question-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 16px;
}
.quiz-q-num { font-size: 0.72rem; color: var(--text-light); font-weight: 600; margin-bottom: 6px; }
.quiz-q-text { font-size: 1rem; font-weight: 700; color: var(--text-dark); line-height: 1.5; margin-bottom: 18px; }
.quiz-options { display: grid; gap: 8px; }

.quiz-option {
  background: var(--ivory);
  border: 1.5px solid var(--ivory-dark);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  font-family: 'DM Sans', sans-serif;
}
.quiz-option:hover { border-color: var(--primary); background: var(--white); }
.quiz-option.correct { background: var(--green-light); border-color: var(--green-status); color: #1a6b35; }
.quiz-option.wrong { background: var(--red-light); border-color: var(--red); color: #8b1a1a; }
.quiz-option:disabled { cursor: default; }

.quiz-explanation {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--ivory);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.5;
  display: none;
}

.quiz-nav { display: flex; justify-content: space-between; align-items: center; }
.quiz-score-final {
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: #fff;
}
.quiz-score-final h2 { font-family: 'Playfair Display', serif; font-size: 2rem; margin-bottom: 10px; }
.quiz-score-big { font-size: 3.5rem; font-weight: 800; color: var(--accent); }
.quiz-score-label { font-size: 0.88rem; opacity: 0.8; margin-top: 6px; }

/* Community */
.community-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 16px; }
.csr-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--soc-color);
}
.csr-title { font-weight: 700; font-size: 0.88rem; color: var(--text-dark); }
.csr-factory { font-size: 0.72rem; color: var(--text-light); margin: 3px 0; }
.csr-impact { font-size: 0.78rem; color: var(--soc-color); font-weight: 600; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .score-strip { grid-template-columns: 1fr 1fr; }
  .scope-overview { grid-template-columns: 1fr; }
  .learn-pillars { grid-template-columns: 1fr; }
  .scope3-categories-learn { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 300;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle { display: block; }
  .main-content { margin-left: 0; }
  .page { padding: 18px 16px 36px; }
  .score-strip { grid-template-columns: 1fr 1fr; }
  .charts-row { flex-direction: column; }
  .chart-card.large, .chart-card.medium { flex: none; width: 100%; }
  .scope-explainer-strip { grid-template-columns: 1fr; }
  .scope-overview { grid-template-columns: 1fr; }
  .learn-hero { flex-direction: column; }
  .method-compare { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .topbar-filter { gap: 5px; }
  .filter-select { font-size: 0.75rem; padding: 5px 8px; }
}

@media (max-width: 480px) {
  .score-strip { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* ════════════════════════════════════════════════════
   ESG RESOURCE DOWNLOADS — Learning Hub
   ════════════════════════════════════════════════════ */
.resource-downloads {
  background: linear-gradient(135deg, #0d4f3c08, #38c98e12);
  border: 1.5px solid #38c98e40;
  border-radius: 16px;
  padding: 24px 28px;
  margin: 20px 0 28px;
}
.resource-downloads-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.resource-downloads-header .resource-icon {
  font-size: 28px;
  line-height: 1;
}
.resource-downloads-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 2px;
}
.resource-downloads-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
.resource-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.resource-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border-radius: 12px;
  padding: 16px 18px;
  cursor: pointer;
  border: 1.5px solid #e2e8f0;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.resource-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  border-color: var(--accent);
}
.handbook-card:hover { border-color: #0d4f3c; }
.faq-card:hover      { border-color: #1e2d40; }
.policy-card:hover   { border-color: #38c98e; }
.resource-card .rc-icon {
  font-size: 32px;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--ivory);
}
.handbook-card .rc-icon { background: #e8f5f0; }
.faq-card .rc-icon      { background: #e8edf5; }
.policy-card .rc-icon   { background: #f0faf5; }
.rc-body { flex: 1; }
.rc-title    { font-size: 14px; font-weight: 700; color: var(--dark); margin-bottom: 3px; }
.rc-subtitle { font-size: 11.5px; color: var(--text-muted); margin-bottom: 5px; }
.rc-meta     { font-size: 11px; color: #94a3b8; font-style: italic; }
.rc-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--primary), #1a7a5c);
  color: #fff;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.handbook-card .rc-btn { background: linear-gradient(135deg, #0d4f3c, #1a7a5c); }
.faq-card .rc-btn      { background: linear-gradient(135deg, #1e2d40, #2d4a6e); }
.policy-card .rc-btn   { background: linear-gradient(135deg, #38c98e, #2aab77); }
.resource-card:hover .rc-btn { opacity: 0.88; }
.rc-dl-icon { font-size: 14px; }

/* ════════════════════════════════════════════════════
   KPI STRIP — Dashboard ticker-style row
   ════════════════════════════════════════════════════ */
.kpi-strip {
  display: flex;
  gap: 0;
  background: var(--white);
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  overflow: hidden;
  margin: 20px 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.strip-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-right: 1px solid #f1f5f9;
  transition: background 0.2s;
  cursor: default;
}
.strip-item:last-child { border-right: none; }
.strip-item:hover { background: #f8fafc; }
.strip-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.strip-val  { font-size: 15px; font-weight: 800; color: var(--dark); line-height: 1.1; }
.strip-lbl  { font-size: 10px; color: var(--text-muted); margin-top: 2px; line-height: 1.2; }

@media (max-width: 1200px) {
  .kpi-strip { flex-wrap: wrap; }
  .strip-item { flex: 0 0 25%; border-bottom: 1px solid #f1f5f9; }
}
@media (max-width: 768px) {
  .kpi-strip { display: none; }
  .resource-cards { grid-template-columns: 1fr; }
}
