/* ═══════════════════════════════════════════════════════════════
   GREON CCTS — Complete UI System
   Responsive: Mobile → 14" → 15.6" → 27"
   Colors: #1BC49D (primary) · #D3EDE8 (accent-light)
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── Design Tokens ──────────────────────────────────────────── */
:root {
  /* Brand */
  --green-900:  #062920;
  --green-800:  #0a3d31;
  --green-700:  #0d5240;
  --green-600:  #0f6b52;
  --green-500:  #13a082;
  --green-400:  #1BC49D;
  --green-300:  #4dd6b4;
  --green-200:  #96e8d4;
  --green-100:  #D3EDE8;
  --green-50:   #edf8f5;

  /* Neutrals */
  --gray-950:   #0a0f0e;
  --gray-900:   #0d1f1b;
  --gray-800:   #1a3530;
  --gray-700:   #2d5048;
  --gray-600:   #3d6b60;
  --gray-500:   #5a8a80;
  --gray-400:   #84aaa4;
  --gray-300:   #b4ceca;
  --gray-200:   #d4e8e5;
  --gray-100:   #eaf4f2;
  --gray-50:    #f4faf8;
  --white:      #ffffff;

  /* Semantic */
  --primary:        var(--green-400);
  --primary-dark:   var(--green-500);
  --primary-light:  var(--green-300);
  --accent-light:   var(--green-100);
  --bg:             var(--gray-50);
  --bg-subtle:      var(--green-50);
  --bg-card:        var(--white);
  --border:         var(--gray-200);
  --border-strong:  var(--gray-300);
  --text-primary:   var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted:     var(--gray-400);
  --danger:         #e53e3e;
  --danger-bg:      #fff5f5;
  --warning:        #d97706;
  --warning-bg:     #fffbeb;
  --info:           #3182ce;
  --info-bg:        #ebf8ff;

  /* Effects */
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --shadow-xs:   0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:   0 1px 3px rgba(0,0,0,.07), 0 2px 8px rgba(27,196,157,.06);
  --shadow:      0 2px 6px rgba(0,0,0,.06), 0 6px 20px rgba(27,196,157,.07);
  --shadow-md:   0 4px 12px rgba(0,0,0,.08), 0 12px 32px rgba(27,196,157,.1);
  --shadow-lg:   0 8px 24px rgba(0,0,0,.1),  0 24px 64px rgba(27,196,157,.12);
  --transition:  0.18s cubic-bezier(.4,0,.2,1);

  /* Fluid spacing */
  --space-1:  clamp(0.25rem, 0.5vw, 0.375rem);
  --space-2:  clamp(0.5rem,  0.75vw, 0.75rem);
  --space-3:  clamp(0.75rem, 1vw,   1rem);
  --space-4:  clamp(1rem,    1.5vw, 1.5rem);
  --space-5:  clamp(1.25rem, 2vw,   2rem);
  --space-6:  clamp(1.5rem,  2.5vw, 2.5rem);

  /* Fluid type */
  --text-xs:   clamp(0.68rem,  0.9vw,  0.75rem);
  --text-sm:   clamp(0.78rem,  1vw,    0.875rem);
  --text-base: clamp(0.875rem, 1.1vw,  1rem);
  --text-lg:   clamp(1rem,     1.3vw,  1.125rem);
  --text-xl:   clamp(1.1rem,   1.5vw,  1.3rem);
  --text-2xl:  clamp(1.5rem,   2vw,    1.875rem);
  --text-3xl:  clamp(1.875rem, 2.5vw,  2.25rem);
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html   { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body   { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
         background: var(--bg); color: var(--text-primary); line-height: 1.6; min-height: 100vh;
         background-image:
           radial-gradient(ellipse 80% 50% at 15% -10%, rgba(27,196,157,.07) 0%, transparent 60%),
           radial-gradient(ellipse 60% 40% at 85% 110%, rgba(27,196,157,.05) 0%, transparent 60%),
           linear-gradient(180deg, #edf8f5 0%, #f4faf8 50%, #edf8f5 100%);
         background-attachment: fixed; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, select, textarea { font: inherit; }
img    { max-width: 100%; }
.hidden { display: none !important; }

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar             { width: 5px; height: 5px; }
::-webkit-scrollbar-track       { background: transparent; }
::-webkit-scrollbar-thumb       { background: var(--border-strong); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   LAYOUT SHELL
══════════════════════════════════════════════════════════════ */
#app { display: flex; flex-direction: column; min-height: 100vh; }

/* ─── Site Header ────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: linear-gradient(110deg, var(--green-800) 0%, var(--green-600) 55%, var(--green-400) 100%);
  box-shadow: 0 2px 20px rgba(0,0,0,.25);
  padding: 0 clamp(1rem, 3vw, 2rem);
  height: 60px;
  display: flex; align-items: center; gap: clamp(.75rem, 2vw, 1.5rem);
}

.header-brand { flex: 1; min-width: 0; }
.brand-logo   { display: flex; align-items: center; gap: .65rem; }
.brand-icon   { font-size: clamp(1.5rem, 2.5vw, 1.9rem); line-height: 1; }
.brand-name   { font-size: clamp(.9rem, 1.4vw, 1.1rem); font-weight: 700; color: #fff;
                white-space: nowrap; letter-spacing: -.01em; }
.brand-sub    { font-size: var(--text-xs); color: rgba(255,255,255,.65); line-height: 1.3;
                max-width: 440px; display: none; }
@media (min-width: 1100px) { .brand-sub { display: block; } }

/* Tab nav pills */
.tab-nav {
  display: flex; gap: .35rem; background: rgba(0,0,0,.15);
  padding: .3rem; border-radius: var(--radius); flex-shrink: 0;
}
.tab-btn {
  display: flex; align-items: center; gap: .4rem;
  padding: .4rem clamp(.6rem, 1.2vw, 1rem);
  border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: 500;
  color: rgba(255,255,255,.7); transition: all var(--transition);
  white-space: nowrap;
}
.tab-btn:hover  { background: rgba(255,255,255,.15); color: #fff; }
.tab-btn.active { background: rgba(255,255,255,.22); color: #fff;
                  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.tab-btn span   { font-size: .95em; }

/* ─── Page Content ───────────────────────────────────────────── */
.tab-panel {
  flex: 1; display: none;
  padding: clamp(1rem, 2.5vw, 1.75rem) clamp(1rem, 3vw, 2rem);
  max-width: min(1680px, 100%); margin: 0 auto; width: 100%;
  animation: fadeIn .2s ease;
}
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ══════════════════════════════════════════════════════════════
   NOTIFICATION BANNER
══════════════════════════════════════════════════════════════ */
.notification-banner {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: linear-gradient(100deg, var(--green-800) 0%, var(--green-500) 100%);
  color: #fff; padding: .6rem 1rem; border-radius: var(--radius);
  font-size: var(--text-xs); margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.banner-icon { font-size: 1rem; flex-shrink: 0; }
.notification-banner > span { flex: 1; min-width: 200px; line-height: 1.4; }
.banner-actions { display: flex; gap: .75rem; flex-shrink: 0; }
.btn-link {
  color: rgba(255,255,255,.85); font-size: var(--text-xs);
  text-decoration: underline; cursor: pointer; padding: 0;
  transition: color var(--transition);
}
.btn-link:hover { color: #fff; }

/* ══════════════════════════════════════════════════════════════
   KPI CARDS
══════════════════════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: var(--space-3); margin-bottom: var(--space-4);
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 1.8vw, 1.4rem) clamp(.9rem, 1.5vw, 1.25rem);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative; overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex; flex-direction: column; gap: .3rem;
}
.kpi-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--kpi-color, var(--green-400));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.kpi-card::before {
  content: ''; position: absolute; top: 3px; right: 0; bottom: 0; left: 0;
  background: var(--kpi-color, var(--green-400)); opacity: .03;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.kpi-icon  {
  font-size: 1.4rem; line-height: 1; margin-bottom: .1rem;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.1));
}
.kpi-label {
  font-size: var(--text-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-secondary); line-height: 1;
}
.kpi-value {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem); font-weight: 800;
  color: var(--text-primary); line-height: 1; letter-spacing: -.02em;
}
.kpi-date { font-size: clamp(1rem, 1.6vw, 1.3rem) !important; font-weight: 700; letter-spacing: -.01em; }
.kpi-sub  { font-size: var(--text-xs); color: var(--text-muted); line-height: 1.3; }

/* ══════════════════════════════════════════════════════════════
   SECTION HEADER
══════════════════════════════════════════════════════════════ */
.section-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-3); margin-bottom: var(--space-3); flex-wrap: wrap;
}
.section-header.mt-0 { margin-top: var(--space-5); }
.section-title { font-size: var(--text-lg); font-weight: 700; color: var(--text-primary); letter-spacing: -.01em; }
.section-sub   { font-size: var(--text-sm); color: var(--text-secondary); margin-top: .15rem; }
.section-meta  {
  background: var(--accent-light); color: var(--primary-dark);
  padding: .3rem .9rem; border-radius: 99px; font-size: var(--text-xs);
  font-weight: 600; white-space: nowrap; border: 1px solid var(--green-200);
}
.sort-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════════
   FILTER BAR
══════════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex; align-items: flex-end; gap: var(--space-2);
  flex-wrap: wrap; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-3);
  box-shadow: var(--shadow-sm); margin-bottom: var(--space-4);
}
.filter-bar .search-wrap { flex: 1 1 220px; }

.search-wrap {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: .5rem .9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-wrap:focus-within {
  border-color: var(--primary); background: var(--white);
  box-shadow: 0 0 0 3px rgba(27,196,157,.12);
}
.search-icon  { font-size: .95rem; color: var(--text-muted); flex-shrink: 0; }
.search-input { border: none; background: transparent; flex: 1; outline: none;
                font-size: var(--text-sm); color: var(--text-primary); min-width: 0; }
.search-clear { color: var(--text-muted); font-size: .75rem; cursor: pointer; line-height: 1; padding: .1rem .3rem;
                border-radius: 4px; transition: all var(--transition); }
.search-clear:hover { background: var(--border); color: var(--text-primary); }
.search-input-sm { font-size: var(--text-xs); }

.filter-group  { display: flex; flex-direction: column; gap: .25rem; flex: 1 1 140px; min-width: 130px; max-width: 220px; }
.filter-label  { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase;
                 letter-spacing: .06em; color: var(--text-secondary); }
.filter-select {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: .48rem .75rem; font-size: var(--text-sm); color: var(--text-primary);
  background: var(--bg); outline: none; cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a8a80' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .65rem center;
  padding-right: 2rem;
}
.filter-select:focus {
  border-color: var(--primary); background-color: var(--white);
  box-shadow: 0 0 0 3px rgba(27,196,157,.12);
}
.filter-select-sm { font-size: var(--text-xs); padding: .35rem .65rem; padding-right: 1.8rem; }

/* ══════════════════════════════════════════════════════════════
   CHARTS LAYOUT
══════════════════════════════════════════════════════════════ */
.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
  gap: var(--space-3); margin-bottom: var(--space-3);
  align-items: start;
}
/* Charts row 2: 3:2 split */
.charts-row.split-wide {
  grid-template-columns: 3fr 2fr;
}
@media (max-width: 1024px) {
  .charts-row.split-wide { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .charts-row { grid-template-columns: 1fr; }
}

/* Chart Card */
.chart-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  padding: clamp(1rem, 2vw, 1.5rem);
  display: flex; flex-direction: column; gap: .75rem;
  transition: box-shadow var(--transition);
}
.chart-card:hover { box-shadow: var(--shadow); }

/* Chart header */
.chart-header { display: flex; flex-direction: column; gap: .2rem; }
.chart-badge  {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--accent-light); color: var(--primary-dark);
  font-size: var(--text-xs); font-weight: 600; padding: .2rem .6rem;
  border-radius: 99px; margin-bottom: .2rem; width: fit-content;
  border: 1px solid var(--green-200);
}
.chart-title { font-size: var(--text-base); font-weight: 700; color: var(--text-primary); letter-spacing: -.01em; }
.chart-sub   { font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.5; }
.chart-note  {
  font-size: var(--text-xs); color: var(--text-muted); font-style: italic;
  border-left: 2px solid var(--green-200); padding-left: .6rem; margin-top: .25rem; line-height: 1.5;
}

/* Chart canvas containers — use aspect-ratio to avoid squishing */
.chart-wrap        { position: relative; width: 100%; }
.chart-wrap-bar    { height: clamp(200px, 25vh, 280px); }
.chart-wrap-bar-lg { height: clamp(200px, 22vh, 260px); }
.chart-wrap-pie    { height: clamp(180px, 22vh, 240px); max-width: 240px; margin: 0 auto; }
.chart-wrap-sm     { height: clamp(160px, 20vh, 220px); }
.chart-inner-label {
  font-size: var(--text-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-secondary); margin-bottom: .4rem;
}

/* Dual chart inner layout */
.charts-inner-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3);
}
@media (max-width: 640px) { .charts-inner-row { grid-template-columns: 1fr; } }

/* Pie Legend */
.pie-legend {
  display: flex; flex-wrap: wrap; gap: .4rem .9rem;
  justify-content: center; padding-top: .35rem;
}
.pie-leg-item { display: flex; align-items: center; gap: .35rem; font-size: var(--text-xs); color: var(--text-secondary); }
.pie-leg-dot  { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════
   REDESIGNED CHART ROW 1  (sector bar + reduction donut)
══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@600;700&display=swap');

.charts-row-r1 {
  grid-template-columns: 3fr 2fr;
}
@media (max-width: 900px) {
  .charts-row-r1 { grid-template-columns: 1fr; }
}

/* Glassmorphic card base for the two redesigned cards */
.chart-card-sector,
.chart-card-donut {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #ffffff 0%, #f0faf7 100%);
  border: 1px solid rgba(27,196,157,.18);
  border-radius: 20px;
  padding: 1.6rem 1.75rem;
  box-shadow: 0 4px 24px rgba(11,61,49,.07), 0 1px 3px rgba(0,0,0,.04);
  transition: box-shadow .22s ease, transform .22s ease;
  gap: 0;
}
.chart-card-sector:hover,
.chart-card-donut:hover {
  box-shadow: 0 8px 40px rgba(27,196,157,.16), 0 2px 8px rgba(0,0,0,.06);
  transform: translateY(-2px);
}

/* Glow blobs */
.chart-card-glow {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
  filter: blur(60px); opacity: .22;
}
.chart-card-glow-green {
  width: 220px; height: 220px;
  background: radial-gradient(circle, #1BC49D, #0b3d31);
  top: -60px; right: -50px;
}
.chart-card-glow-teal {
  width: 180px; height: 180px;
  background: radial-gradient(circle, #57e5c3, #13a082);
  bottom: -40px; left: -40px;
}

/* Header row 1 */
.chart-header-r1 {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: .22rem;
  margin-bottom: 1rem;
}
.chart-eyebrow {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--green-500); background: rgba(27,196,157,.10);
  border: 1px solid rgba(27,196,157,.25);
  padding: .22rem .65rem; border-radius: 99px; width: fit-content;
}
.chart-eyebrow-teal {
  color: #0d5240; background: rgba(27,196,157,.08);
}
.chart-eyebrow-icon { font-size: .8rem; line-height: 1; }

.chart-title-r1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.2rem); font-weight: 700;
  color: var(--green-900); letter-spacing: -.02em; line-height: 1.25;
}
.chart-sub-r1 {
  font-size: .78rem; color: var(--gray-500); line-height: 1.5;
  font-family: 'DM Sans', sans-serif;
}

/* Decorative divider */
.chart-divider {
  position: relative; z-index: 1;
  height: 2px; margin-bottom: 1rem;
  background: linear-gradient(90deg, #1BC49D 0%, rgba(27,196,157,.15) 60%, transparent 100%);
  border-radius: 2px;
}

/* Make canvas wrappers sit above the glow */
.chart-card-sector .chart-wrap,
.chart-card-donut .chart-wrap {
  position: relative; z-index: 1;
}

/* Donut layout: canvas + legend side by side on wider screens */
.donut-layout {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: .9rem;
}
@media (min-width: 480px) {
  .donut-layout {
    flex-direction: row; align-items: center; justify-content: center;
  }
  .donut-layout .chart-wrap-pie { flex-shrink: 0; margin: 0; }
}

/* Re-styled legend for the donut card */
.pie-legend-r1 {
  display: flex; flex-direction: column; gap: .55rem;
  justify-content: center; padding-top: 0;
}
@media (max-width: 479px) {
  .pie-legend-r1 { flex-direction: row; flex-wrap: wrap; justify-content: center; }
}
.pie-legend-r1 .pie-leg-item {
  display: flex; align-items: center; gap: .55rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem; font-weight: 500; color: var(--gray-700);
}
.pie-legend-r1 .pie-leg-dot {
  width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

/* ══════════════════════════════════════════════════════════════
   DONUT CARD — matches light card, equal height layout
══════════════════════════════════════════════════════════════ */

/* Remove dark override — donut card now inherits the shared light base */
.chart-card-donut {
  background: linear-gradient(145deg, #ffffff 0%, #f0faf7 100%);
  border: 1px solid rgba(27,196,157,.18);
  box-shadow: 0 4px 24px rgba(11,61,49,.07), 0 1px 3px rgba(0,0,0,.04);
  padding: 0;
  overflow: hidden;
}
.chart-card-donut:hover {
  box-shadow: 0 8px 40px rgba(27,196,157,.16), 0 2px 8px rgba(0,0,0,.06);
  transform: translateY(-2px);
}

/* Equal height — both cards stretch to the same row height */
.charts-row-r1 {
  align-items: stretch;
}
.chart-card-sector,
.chart-card-donut {
  height: 100%;
  display: flex !important;
  flex-direction: column !important;
}
/* Bar chart canvas wrapper fills remaining vertical space */
.chart-card-sector .chart-wrap-bar {
  flex: 1;
  height: auto !important;
  min-height: clamp(200px, 25vh, 280px);
}

/* Remove decorative dark elements — not needed on light bg */
.donut-grid-bg,
.donut-orb { display: none; }

/* Inner wrapper */
.donut-card-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  padding: 1.6rem 1.75rem;
  gap: 0; height: 100%;
}

/* Donut header — mirrors .chart-header-r1 */
.donut-header {
  display: flex; flex-direction: column; gap: .22rem;
  margin-bottom: 1rem;
}
.donut-eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--green-500); background: rgba(27,196,157,.10);
  border: 1px solid rgba(27,196,157,.25);
  padding: .22rem .65rem; border-radius: 99px; width: fit-content;
}
.donut-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.2rem); font-weight: 700;
  color: var(--green-900); letter-spacing: -.02em; line-height: 1.25;
}
.donut-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: .78rem; color: var(--gray-500); line-height: 1.5;
}

/* Divider — same as .chart-divider */
.donut-divider {
  height: 2px; margin-bottom: 1rem;
  background: linear-gradient(90deg, #1BC49D 0%, rgba(27,196,157,.15) 60%, transparent 100%);
  border-radius: 2px;
}

/* Ring chart centred, flex-grows to fill space between header and legend */
.donut-ring-wrap {
  flex: 1;
  display: flex; justify-content: center; align-items: center;
  padding: .5rem 0;
}
.donut-canvas-shell {
  position: relative;
  width: clamp(150px, 16vw, 190px);
  height: clamp(150px, 16vw, 190px);
  flex-shrink: 0;
}
.donut-canvas-shell canvas {
  width: 100% !important; height: 100% !important;
}

/* Centre stat overlay */
.donut-centre-stat {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  pointer-events: none;
}
.donut-centre-label {
  font-family: 'DM Sans', sans-serif;
  font-size: .62rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--gray-500);
  margin-bottom: .15rem;
}
.donut-centre-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.3rem, 2vw, 1.6rem); font-weight: 700;
  color: var(--green-900); letter-spacing: -.03em; line-height: 1;
}

/* Legend band rows — light card style */
.donut-legend-rows {
  display: flex; flex-direction: column; gap: .38rem;
  margin-top: .75rem;
}
.donut-band-row {
  display: grid;
  grid-template-columns: 8px 1fr auto auto;
  align-items: center; gap: .55rem;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: 10px;
  padding: .42rem .7rem;
  transition: background .18s ease, border-color .18s ease;
}
.donut-band-row:hover {
  background: var(--green-100);
  border-color: var(--green-200);
}
.donut-band-pip {
  width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0;
}
.donut-band-label {
  font-family: 'DM Sans', sans-serif;
  font-size: .78rem; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.donut-band-count {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .82rem; font-weight: 700; color: var(--primary-dark);
  text-align: right;
}
.donut-band-pct {
  font-family: 'DM Sans', sans-serif;
  font-size: .7rem; font-weight: 600;
  color: var(--text-muted);
  text-align: right; min-width: 32px;
}

/* ══════════════════════════════════════════════════════════════
   REDESIGNED CHART ROW 2  (GEI grouped bar + Top Movers)
══════════════════════════════════════════════════════════════ */

.charts-row-r2 { align-items: stretch; }
.r2-card {
  position: relative; overflow: hidden;
  background: linear-gradient(145deg, #ffffff 0%, #f0faf7 100%);
  border: 1px solid rgba(27,196,157,.18);
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 4px 24px rgba(11,61,49,.07), 0 1px 3px rgba(0,0,0,.04);
  transition: box-shadow .22s ease, transform .22s ease;
  display: flex; flex-direction: column;
  height: 100%;
}
.r2-card:hover {
  box-shadow: 0 8px 40px rgba(27,196,157,.16), 0 2px 8px rgba(0,0,0,.06);
  transform: translateY(-2px);
}
.r2-card-glow {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
  filter: blur(70px); opacity: .18;
}
.r2-glow-amber {
  width: 260px; height: 260px;
  background: radial-gradient(circle, #f59e0b, #d97706);
  top: -80px; right: -60px;
}
.r2-glow-green {
  width: 220px; height: 220px;
  background: radial-gradient(circle, #1BC49D, #0b3d31);
  bottom: -60px; left: -40px;
}
.r2-card-body {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  padding: 1.6rem 1.75rem;
  gap: 0; flex: 1;
}
.r2-header { display: flex; flex-direction: column; gap: .22rem; margin-bottom: 1rem; }
.r2-eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: .22rem .65rem; border-radius: 99px; width: fit-content; border: 1px solid;
}
.r2-eyebrow-amber { color: #92400e; background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.3); }
.r2-eyebrow-green { color: var(--green-600); background: rgba(27,196,157,.10); border-color: rgba(27,196,157,.25); }
.r2-eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.r2-dot-amber { background: #f59e0b; }
.r2-dot-green { background: #1BC49D; }
.r2-title-row { display: flex; align-items: flex-start; gap: .75rem; flex-wrap: wrap; }
.r2-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.2rem); font-weight: 700;
  color: var(--green-900); letter-spacing: -.02em; line-height: 1.25;
  flex: 1; min-width: 160px;
}
.r2-sub { font-family: 'DM Sans', sans-serif; font-size: .78rem; color: var(--gray-500); line-height: 1.5; }
.r2-note {
  display: flex; align-items: flex-start; gap: .4rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .72rem; color: var(--text-muted); font-style: italic; line-height: 1.5;
  border-left: 2px solid var(--green-200); padding-left: .6rem; margin-top: .2rem;
}
.r2-legend-pills { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-top: .1rem; }
.r2-pill {
  display: inline-flex; align-items: center; gap: .3rem;
  font-family: 'DM Sans', sans-serif; font-size: .68rem; font-weight: 600;
  padding: .18rem .55rem; border-radius: 99px; border: 1px solid; white-space: nowrap;
}
.r2-pill-amber { color: #92400e; background: rgba(245,158,11,.09); border-color: rgba(245,158,11,.28); }
.r2-pill-green { color: var(--green-600); background: rgba(27,196,157,.09); border-color: rgba(27,196,157,.25); }
.r2-pill-dark  { color: var(--green-800); background: rgba(11,61,49,.08); border-color: rgba(11,61,49,.2); }
.r2-pill-dot { width: 6px; height: 6px; border-radius: 50%; }
.r2-pill-amber .r2-pill-dot { background: #f59e0b; }
.r2-pill-green .r2-pill-dot { background: #1BC49D; }
.r2-pill-dark  .r2-pill-dot { background: #0b3d31; }
.r2-divider {
  height: 2px; margin-bottom: 1rem;
  background: linear-gradient(90deg, #1BC49D 0%, rgba(27,196,157,.15) 60%, transparent 100%);
  border-radius: 2px;
}
.r2-gei-card .chart-wrap-bar-lg {
  flex: 1; height: auto !important;
  min-height: clamp(180px, 22vh, 240px);
}

/* ── Top Movers leaderboard ── */
.te2-list {
  display: flex; flex-direction: column;
  flex: 1; overflow-y: auto; gap: .32rem; margin-bottom: .9rem;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.te2-item {
  display: grid; grid-template-columns: 26px 1fr auto;
  align-items: center; gap: .65rem;
  padding: .55rem .7rem; border-radius: 12px;
  background: var(--green-50); border: 1px solid var(--green-100);
  transition: background .18s, border-color .18s, transform .18s;
}
.te2-item:hover { background: var(--green-100); border-color: var(--green-200); transform: translateX(3px); }
.te2-rank {
  width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: .72rem; font-weight: 700; flex-shrink: 0;
}
.te2-rank-1 { background: #fef3c7; color: #92400e; border: 1.5px solid #fcd34d; }
.te2-rank-2 { background: #f1f5f9; color: #475569; border: 1.5px solid #cbd5e1; }
.te2-rank-3 { background: #fff7ed; color: #9a3412; border: 1.5px solid #fed7aa; }
.te2-rank-n { background: var(--green-100); color: var(--green-700); border: 1.5px solid var(--green-200); }
.te2-meta { min-width: 0; display: flex; flex-direction: column; gap: .18rem; }
.te2-name {
  font-family: 'DM Sans', sans-serif; font-size: .8rem; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.te2-sector { font-size: .68rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.te2-bar-track { height: 3px; background: var(--green-200); border-radius: 99px; overflow: hidden; margin-top: .2rem; }
.te2-bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #1BC49D, #13a082); }
.te2-right { text-align: right; flex-shrink: 0; }
.te2-pct { font-family: 'Space Grotesk', sans-serif; font-size: .9rem; font-weight: 700; color: var(--primary-dark); line-height: 1.1; }
.te2-tonne { font-family: 'DM Sans', sans-serif; font-size: .67rem; color: var(--text-muted); margin-top: .1rem; white-space: nowrap; }
.te2-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem .8rem;
  background: linear-gradient(90deg, rgba(27,196,157,.08), rgba(27,196,157,.03));
  border: 1px solid var(--green-200); border-radius: 12px; gap: .5rem;
}
.te2-footer-left { display: flex; flex-direction: column; gap: .1rem; }
.te2-footer-label {
  font-family: 'DM Sans', sans-serif; font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted);
}
.te2-footer-value { font-family: 'Space Grotesk', sans-serif; font-size: .95rem; font-weight: 700; color: var(--primary-dark); }
.te2-footer-badge {
  font-family: 'Space Grotesk', sans-serif; font-size: .7rem; font-weight: 700;
  background: var(--green-100); color: var(--green-700);
  border: 1px solid var(--green-200); padding: .25rem .65rem; border-radius: 99px;
}

/* ── Geo grid decorative bg ── */
.r3-geo-grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background-image:
    linear-gradient(rgba(99,102,241,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 30%, transparent 100%);
  border-radius: 20px;
}

/* Footnote below r3 panels */
.r3-footnote {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: .45rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem; color: var(--text-muted);
  border-top: 1px dashed rgba(99,102,241,.15);
  padding-top: .75rem; margin-top: .25rem;
  line-height: 1.4;
}

/* ══════════════════════════════════════════════════════════════
   EMISSION REDUCTION CTA CARD
══════════════════════════════════════════════════════════════ */
.emission-cta-card {
  position: relative; overflow: hidden;
  background: linear-gradient(118deg, var(--green-800) 0%, var(--green-600) 45%, var(--green-500) 70%, #13c398 100%);
  border-radius: 20px;
  padding: clamp(1.4rem, 2.5vw, 2rem) clamp(1.5rem, 3vw, 2.5rem);
  margin-bottom: var(--space-4);
  box-shadow: 0 8px 40px rgba(10,61,49,.22), 0 2px 8px rgba(0,0,0,.1);
  display: flex; align-items: center; gap: 2rem; flex-wrap: wrap;
  border: 1px solid rgba(255,255,255,.12);
}

/* Orb glows */
.emission-cta-orb {
  position: absolute; border-radius: 50%; pointer-events: none;
  animation: ctaOrb 6s ease-in-out infinite alternate;
}
.emission-cta-orb-1 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,.08), transparent 70%);
  top: -120px; right: 10%;
  animation-delay: 0s;
}
.emission-cta-orb-2 {
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(27,196,157,.25), transparent 70%);
  bottom: -60px; left: 5%;
  animation-delay: 2s;
}
.emission-cta-orb-3 {
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(255,255,255,.07), transparent 70%);
  top: 50%; left: 45%; transform: translate(-50%,-50%);
  animation-delay: 4s;
}
@keyframes ctaOrb { from { transform: scale(1) translateY(0); } to { transform: scale(1.08) translateY(-10px); } }
.emission-cta-orb-3 { animation: ctaOrb3 6s ease-in-out infinite alternate; }
@keyframes ctaOrb3 { from { transform: translate(-50%,-50%) scale(1); } to { transform: translate(-50%,-50%) scale(1.1); } }

/* SVG decorative background */
.emission-cta-hexbg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

/* Left content */
.emission-cta-left {
  position: relative; z-index: 1; flex: 1; min-width: 260px;
  display: flex; flex-direction: column; gap: .85rem;
}

.emission-cta-badge {
  display: inline-flex; align-items: center; gap: .45rem;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9); font-size: .7rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .28rem .8rem; border-radius: 99px; width: fit-content;
  backdrop-filter: blur(4px);
}
.emission-cta-pulse {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%; background: #4dffc3;
  box-shadow: 0 0 0 0 rgba(77,255,195,.5);
  animation: ctaPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(77,255,195,.5); }
  50%       { box-shadow: 0 0 0 5px rgba(77,255,195,0); }
}

.emission-cta-headline h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 700;
  color: #fff; letter-spacing: -.02em; line-height: 1.2; margin-bottom: .35rem;
}
.emission-cta-headline h3 em {
  font-style: normal; color: #4dffc3;
}
.emission-cta-headline p {
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem; color: rgba(255,255,255,.75); line-height: 1.55;
}

.emission-cta-stats {
  display: flex; align-items: center; gap: .8rem;
  background: rgba(0,0,0,.15); border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; padding: .5rem 1rem; width: fit-content;
}
.emission-cta-stat { display: flex; flex-direction: column; align-items: center; gap: .06rem; }
.emission-cta-stat-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .78rem; font-weight: 700; color: #4dffc3; white-space: nowrap;
}
.emission-cta-stat-lbl {
  font-family: 'DM Sans', sans-serif;
  font-size: .6rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: rgba(255,255,255,.5);
}
.emission-cta-stat-div { width: 1px; height: 26px; background: rgba(255,255,255,.15); }

/* Right content */
.emission-cta-right {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  flex-shrink: 0;
}

.emission-cta-icon-ring {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: 2px solid rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; line-height: 1;
  animation: ctaLeaf 3s ease-in-out infinite alternate;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 0 8px rgba(255,255,255,.04), 0 4px 16px rgba(0,0,0,.1);
}
@keyframes ctaLeaf {
  from { transform: rotate(-5deg) scale(1); }
  to   { transform: rotate(5deg) scale(1.05); }
}

.emission-cta-btn {
  display: inline-flex; align-items: center; gap: .65rem;
  background: #fff; color: var(--green-700);
  font-family: 'Space Grotesk', sans-serif;
  font-size: .88rem; font-weight: 700; letter-spacing: -.01em;
  padding: .75rem 1.6rem; border-radius: 12px;
  text-decoration: none; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  transition: all .22s cubic-bezier(.4,0,.2,1);
  border: 2px solid rgba(255,255,255,.5);
  position: relative; overflow: hidden;
}
.emission-cta-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(27,196,157,.08) 50%, transparent 100%);
  transform: translateX(-100%); transition: transform .5s ease;
}
.emission-cta-btn:hover::before { transform: translateX(100%); }
.emission-cta-btn:hover {
  background: #f0fdf9; color: var(--green-800);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.emission-cta-btn-inner { display: flex; align-items: center; gap: .5rem; }
.emission-cta-arrow { transition: transform .22s ease; }
.emission-cta-btn:hover .emission-cta-arrow { transform: translateX(4px); }

.emission-cta-footnote {
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem; color: rgba(255,255,255,.5);
  text-align: center; white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════
   ENHANCED REGISTRY SECTION HEADER
══════════════════════════════════════════════════════════════ */
.registry-section-header {
  align-items: flex-start; padding: 1rem 1.25rem;
  background: linear-gradient(110deg, #fff 0%, var(--green-50) 100%);
  border: 1px solid var(--green-100); border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(27,196,157,.06);
  margin-bottom: var(--space-3);
}

.registry-title-group { display: flex; flex-direction: column; gap: .25rem; }

.registry-title-eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--green-600); background: rgba(27,196,157,.1);
  border: 1px solid rgba(27,196,157,.25);
  padding: .2rem .6rem; border-radius: 99px; width: fit-content;
  margin-bottom: .15rem;
}
.registry-title-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green-400);
  flex-shrink: 0;
  animation: ctaPulse 2.5s ease-in-out infinite;
}

.top-entities-list {
  display: flex; flex-direction: column;
  flex: 1; overflow-y: auto; max-height: 320px;
  gap: 0;
}
.te-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; padding: .55rem 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.te-item:last-child  { border-bottom: none; }
.te-rank {
  width: 22px; height: 22px; border-radius: 50%; background: var(--green-100);
  color: var(--primary-dark); font-size: var(--text-xs); font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.te-meta        { flex: 1; min-width: 0; }
.te-name        { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary);
                  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.te-sector      { font-size: var(--text-xs); color: var(--text-secondary); margin-top: .1rem; }
.te-right       { text-align: right; flex-shrink: 0; }
.te-pct         { font-size: .95rem; font-weight: 800; color: var(--primary); }
.te-tonne       { font-size: var(--text-xs); color: var(--text-muted); margin-top: .1rem; }

.top-entities-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 0 0; border-top: 1.5px dashed var(--border-strong); margin-top: .25rem;
}
.te-label { font-size: var(--text-xs); font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; }
.te-value { font-size: var(--text-sm); font-weight: 700; color: var(--primary); }

/* ══════════════════════════════════════════════════════════════
   REDESIGNED CHART ROW 3  (full-width State + Sub-Sector split)
══════════════════════════════════════════════════════════════ */

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

.r3-card {
  position: relative; overflow: hidden;
  background: linear-gradient(145deg, #ffffff 0%, #f0faf7 100%);
  border: 1px solid rgba(27,196,157,.18);
  border-radius: 20px;
  padding: 1.6rem 1.75rem;
  box-shadow: 0 4px 24px rgba(11,61,49,.07), 0 1px 3px rgba(0,0,0,.04);
  transition: box-shadow .22s ease, transform .22s ease;
  grid-column: 1 / -1;
}
.r3-card:hover {
  box-shadow: 0 8px 40px rgba(27,196,157,.13), 0 2px 8px rgba(0,0,0,.05);
}

/* Glow blobs */
.r3-glow {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
  filter: blur(80px); opacity: .14;
}
.r3-glow-left {
  width: 320px; height: 320px;
  background: radial-gradient(circle, #3b82f6, #6366f1);
  top: -100px; left: -60px;
}
.r3-glow-right {
  width: 280px; height: 280px;
  background: radial-gradient(circle, #a855f7, #6366f1);
  bottom: -80px; right: -50px;
}

/* Card-level header */
.r3-card-header {
  position: relative; z-index: 1;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: .9rem;
}
.r3-header-left { display: flex; flex-direction: column; gap: .22rem; }

.r3-eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #5b21b6; background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.22);
  padding: .22rem .65rem; border-radius: 99px; width: fit-content;
}
.r3-eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #6366f1; flex-shrink: 0;
}
.r3-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.2rem); font-weight: 700;
  color: var(--green-900); letter-spacing: -.02em; line-height: 1.25;
}
.r3-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: .78rem; color: var(--gray-500); line-height: 1.5;
}

/* Header stat pills */
.r3-header-stats {
  display: flex; align-items: center; gap: .75rem;
  background: rgba(99,102,241,.06);
  border: 1px solid rgba(99,102,241,.16);
  border-radius: 14px; padding: .5rem 1.1rem;
  flex-shrink: 0;
}
.r3-stat { display: flex; flex-direction: column; align-items: center; gap: .05rem; }
.r3-stat-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem; font-weight: 700; color: #4f46e5; line-height: 1;
}
.r3-stat-label {
  font-family: 'DM Sans', sans-serif;
  font-size: .62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted);
}
.r3-stat-div { width: 1px; height: 28px; background: rgba(99,102,241,.2); }

/* Horizontal rule below header */
.r3-divider-h {
  position: relative; z-index: 1;
  height: 2px; margin-bottom: 1.2rem;
  background: linear-gradient(90deg, #6366f1 0%, rgba(99,102,241,.15) 55%, transparent 100%);
  border-radius: 2px;
}

/* Two panels side by side */
.r3-panels {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1fr 2px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 700px) {
  .r3-panels { grid-template-columns: 1fr; }
  .r3-panel-sep { display: none; }
}

/* Vertical separator */
.r3-panel-sep {
  width: 2px; align-self: stretch;
  background: linear-gradient(180deg, transparent 0%, rgba(99,102,241,.25) 20%, rgba(99,102,241,.25) 80%, transparent 100%);
  border-radius: 2px;
}

/* Panel */
.r3-panel { display: flex; flex-direction: column; gap: .65rem; }

.r3-panel-header {
  display: flex; align-items: center; justify-content: space-between;
}
.r3-panel-label {
  display: flex; align-items: center; gap: .45rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-secondary);
}
.r3-panel-icon {
  width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0;
}
.r3-icon-blue   { background: #3b82f6; box-shadow: 0 0 6px rgba(59,130,246,.5); }
.r3-icon-purple { background: #a855f7; box-shadow: 0 0 6px rgba(168,85,247,.5); }

.r3-panel-hint {
  font-family: 'DM Sans', sans-serif;
  font-size: .67rem; font-weight: 600; color: var(--text-muted);
  background: var(--gray-100); border: 1px solid var(--border);
  padding: .15rem .5rem; border-radius: 99px;
}

/* State chart canvas */
.r3-chart-wrap { height: clamp(200px, 24vh, 260px); }

/* ── Lollipop chart (sub-sector) ── */
.r3-lollipop-wrap {
  display: flex; flex-direction: column; gap: .45rem;
}
.r3-lolly-row {
  display: grid;
  grid-template-columns: clamp(100px, 22%, 180px) 1fr 38px;
  align-items: center; gap: .7rem;
  padding: .3rem 0;
}
.r3-lolly-label {
  font-family: 'DM Sans', sans-serif;
  font-size: .76rem; font-weight: 600; color: var(--text-primary);
  text-align: right; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.r3-lolly-track {
  position: relative; height: 2px;
  background: rgba(168,85,247,.15);
  border-radius: 2px;
}
.r3-lolly-line {
  position: absolute; left: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, rgba(168,85,247,.3), #a855f7);
  border-radius: 2px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.r3-lolly-dot {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 10px; height: 10px; border-radius: 50%;
  background: #a855f7;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(168,85,247,.3), 0 2px 6px rgba(168,85,247,.35);
  transition: left .5s cubic-bezier(.4,0,.2,1);
}
.r3-lolly-count {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .82rem; font-weight: 700; color: #7c3aed;
  text-align: right;
}
.r3-lolly-row:hover .r3-lolly-dot {
  background: #7c3aed;
  box-shadow: 0 0 0 3px rgba(168,85,247,.4), 0 2px 8px rgba(168,85,247,.5);
}
.r3-lolly-row:hover .r3-lolly-label { color: #4f46e5; }

/* ══════════════════════════════════════════════════════════════
   ENTITY CARDS
══════════════════════════════════════════════════════════════ */
.entity-cards-grid { display: flex; flex-direction: column; gap: var(--space-3); }

.entity-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.entity-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--green-200); }

/* Card header strip */
.entity-card-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding: .9rem clamp(.9rem, 1.5vw, 1.3rem);
  background: linear-gradient(100deg, var(--green-100) 0%, var(--green-50) 60%, var(--white) 100%);
  border-bottom: 1px solid var(--green-200);
}
.entity-card-title-row { display: flex; flex-direction: column; gap: .1rem; }
.entity-card-label { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase;
                     letter-spacing: .07em; color: var(--primary-dark); }
.entity-card-name  { font-size: var(--text-base); font-weight: 700; color: var(--text-primary); }
.entity-card-reg   {
  font-family: 'SF Mono', 'Consolas', monospace; font-size: var(--text-sm);
  font-weight: 700; color: var(--primary-dark);
  background: rgba(27,196,157,.12); border: 1px solid rgba(27,196,157,.25);
  padding: .25rem .65rem; border-radius: var(--radius-sm);
  white-space: nowrap; letter-spacing: .02em;
}

/* Fields grid — auto responsive columns */
.entity-fields-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px; background: var(--border);
}
@media (max-width: 1400px) { .entity-fields-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px)  { .entity-fields-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 580px)  { .entity-fields-grid { grid-template-columns: repeat(2, 1fr); } }

.entity-field {
  background: var(--bg-card); padding: .65rem clamp(.7rem, 1.2vw, 1rem);
}
.entity-field-label {
  font-size: .62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); margin-bottom: .2rem; line-height: 1.3;
}
.entity-field-value { font-size: var(--text-sm); color: var(--text-primary); font-weight: 500; line-height: 1.3; }
.entity-field-value.mono { font-family: 'SF Mono','Consolas', monospace; font-size: .78rem; color: var(--primary-dark); }
.entity-field-value.null-val { color: var(--text-muted); font-weight: 400; }


.entity-field-source {
  grid-column: span 2;
}
.entity-field-value-source {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
@media (max-width: 580px) {
  .entity-field-source { grid-column: span 2; }
}

/* Reduction highlights row */
.entity-reduction-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--green-200);
  border-top: 2px solid var(--green-200);
}
@media (max-width: 900px)  { .entity-reduction-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px)  { .entity-reduction-grid { grid-template-columns: 1fr 1fr; } }

.entity-reduction-field {
  background: var(--green-50); padding: .7rem clamp(.7rem, 1.2vw, 1rem);
}
.entity-reduction-label {
  font-size: .62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--primary-dark); margin-bottom: .2rem; line-height: 1.3;
}
.entity-reduction-value            { font-size: var(--text-base); font-weight: 800; color: var(--primary); }
.entity-reduction-value.null-val   { font-size: var(--text-sm); font-weight: 400; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════════════════════ */
.pagination-wrap {
  display: flex; align-items: center; justify-content: center;
  gap: .35rem; padding: 1.5rem 0; flex-wrap: wrap;
}
.page-btn {
  min-width: 34px; height: 34px; padding: 0 .5rem;
  border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: 500;
  border: 1.5px solid var(--border); color: var(--text-secondary);
  background: var(--bg-card); display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); cursor: pointer; white-space: nowrap;
}
.page-btn:hover    { border-color: var(--primary); color: var(--primary); background: var(--green-50); }
.page-btn.active   { background: var(--primary); color: #fff; border-color: var(--primary);
                     box-shadow: 0 2px 8px rgba(27,196,157,.4); }
.page-btn.disabled { opacity: .35; cursor: not-allowed; }
.page-info         { font-size: var(--text-xs); color: var(--text-muted); padding: 0 .4rem; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS (global)
══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1.1rem; border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: 600;
  transition: all var(--transition); white-space: nowrap; cursor: pointer;
}
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(27,196,157,.3);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(27,196,157,.4); }
.btn-outline {
  border: 1.5px solid var(--border); color: var(--text-secondary); background: var(--bg-card);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--green-50); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c53030; transform: translateY(-1px); }
.btn-danger:disabled { background: #feb2b2; cursor: not-allowed; transform: none; }
.btn-sm    { padding: .35rem .8rem; font-size: var(--text-xs); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ══════════════════════════════════════════════════════════════
   ADMIN TAB
══════════════════════════════════════════════════════════════ */
.admin-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--space-3); align-items: start;
}
@media (max-width: 960px) { .admin-grid { grid-template-columns: 1fr; } }
.mt-lg { margin-top: var(--space-4); }

.admin-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  padding: clamp(1.1rem, 2vw, 1.6rem);
}
.admin-card-header { margin-bottom: var(--space-3); }
.admin-card-header h3 { font-size: var(--text-base); font-weight: 700; color: var(--text-primary);
                        margin-bottom: .3rem; }
.admin-card-header p  { font-size: var(--text-sm); color: var(--text-secondary); }
.admin-card-header-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3);
}
.admin-header-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.5rem) 1.5rem;
  text-align: center; cursor: pointer; position: relative;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  background: var(--bg);
}
.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--primary); background: var(--green-50);
  box-shadow: 0 0 0 4px rgba(27,196,157,.1);
}
.drop-zone-inner { pointer-events: none; }
.drop-icon { font-size: 2.5rem; line-height: 1; margin-bottom: .6rem; }
.drop-text { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); }
.drop-hint { font-size: var(--text-xs); color: var(--text-muted); margin-top: .3rem; }
.file-input-hidden { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.upload-filename {
  margin-top: .6rem; font-size: var(--text-xs); color: var(--primary-dark);
  background: var(--accent-light); padding: .4rem .8rem;
  border-radius: var(--radius-sm); border: 1px solid var(--green-200);
}
.upload-results {
  margin-top: var(--space-3); padding: .9rem 1rem;
  border-radius: var(--radius); background: var(--green-50);
  border: 1px solid var(--green-200); font-size: var(--text-xs);
}
.upload-results .result-row { display: flex; justify-content: space-between; padding: .2rem 0;
                               border-bottom: 1px solid rgba(27,196,157,.1); }
.upload-results .result-row:last-child { border-bottom: none; }
.upload-results .result-key { color: var(--text-secondary); }
.upload-results .result-val { font-weight: 700; color: var(--text-primary); }
.upload-results.error-state { background: var(--danger-bg); border-color: rgba(229,62,62,.2); }
.upload-errors         { margin-top: .5rem; }
.upload-error-item     { font-size: var(--text-xs); color: var(--danger); padding: .15rem 0;
                         border-bottom: 1px dashed rgba(229,62,62,.12); }

/* Form */
.entity-form .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
@media (max-width: 480px) { .entity-form .form-grid { grid-template-columns: 1fr; } }
.form-group       { display: flex; flex-direction: column; gap: .25rem; }
.form-group-full  { grid-column: span 2; }
.form-group label { font-size: var(--text-xs); font-weight: 600; color: var(--text-secondary); }
.form-group input, .form-group select {
  padding: .5rem .75rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: var(--text-sm); outline: none;
  background: var(--bg); color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--primary); background: var(--white);
  box-shadow: 0 0 0 3px rgba(27,196,157,.12);
}
.required     { color: var(--danger); }
.form-actions { display: flex; gap: .5rem; margin-top: var(--space-3); }
.form-msg     { padding: .5rem .8rem; border-radius: var(--radius-sm); font-size: var(--text-xs); margin-top: .5rem; }
.form-msg.success { background: var(--green-50); color: var(--primary-dark); border: 1px solid var(--green-200); }
.form-msg.error   { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(229,62,62,.2); }

/* Admin table */
.admin-table-wrap {
  overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border);
}
.admin-table                       { width: 100%; border-collapse: collapse; font-size: var(--text-xs); }
.admin-table thead tr              { background: var(--bg-subtle); }
.admin-table th, .admin-table td   { padding: .6rem .85rem; text-align: left;
                                     border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table th                    { font-size: .66rem; font-weight: 700; text-transform: uppercase;
                                     letter-spacing: .07em; color: var(--text-secondary); }
.admin-table tbody tr:hover        { background: var(--green-50); }
.admin-table tbody tr:last-child td{ border-bottom: none; }
.admin-source-cell {
  min-width: 220px;
  max-width: 320px;
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.action-btn         { padding: .22rem .55rem; border-radius: 5px; font-size: .72rem; font-weight: 600;
                      cursor: pointer; transition: all var(--transition); }
.action-btn-edit    { background: var(--info-bg); color: var(--info);   border: 1px solid #bee3f8; }
.action-btn-edit:hover   { background: #bee3f8; }
.action-btn-delete  { background: var(--danger-bg); color: var(--danger); border: 1px solid #fed7d7; }
.action-btn-delete:hover { background: #fed7d7; }
.admin-serial { color: var(--text-muted); }
.no-data      { text-align: center; padding: 2.5rem; color: var(--text-muted); font-size: var(--text-sm); }

/* ══════════════════════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(6,41,32,.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; animation: fadeIn .2s ease;
}
.modal-card {
  background: var(--bg-card); border-radius: var(--radius-xl);
  width: 100%; max-width: 560px; box-shadow: var(--shadow-lg);
  max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
  animation: slideUp .25s cubic-bezier(.34,1.56,.64,1);
}
.modal-card-lg { max-width: 780px; }
@keyframes slideUp { from { transform: translateY(20px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.4rem; border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}
.modal-header h3   { font-size: var(--text-base); font-weight: 700; }
.modal-close       { color: var(--text-muted); font-size: 1.1rem; padding: .2rem .4rem;
                     border-radius: var(--radius-sm); transition: all var(--transition); }
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-body        { padding: 1.4rem; overflow-y: auto; }

/* Sources (legacy — keep for backward compat) */
.source-item { display: flex; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--border); }
.source-item:last-child { border-bottom: none; }
.source-name   { font-size: var(--text-sm); font-weight: 700; color: var(--text-primary); margin-bottom: .3rem; }
.source-detail { font-size: var(--text-xs); color: var(--text-secondary); margin-top: .15rem; }

/* ─── Sources Modal — Enhanced ──────────────────────────────── */
.sources-modal-header {
  background: linear-gradient(110deg, var(--green-800) 0%, var(--green-600) 100%);
  border-bottom: none;
  padding: 1.25rem 1.5rem;
}
.sources-header-content {
  display: flex; align-items: center; gap: .85rem; flex: 1; min-width: 0;
}
.sources-header-icon {
  font-size: 1.75rem; line-height: 1; flex-shrink: 0;
  background: rgba(255,255,255,.15); border-radius: var(--radius);
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
}
.sources-modal-header h3 {
  font-size: var(--text-base); font-weight: 700; color: #fff; margin-bottom: .15rem;
}
.sources-header-sub {
  font-size: var(--text-xs); color: rgba(255,255,255,.65); line-height: 1.4;
}
.sources-modal-header .modal-close {
  color: rgba(255,255,255,.7); flex-shrink: 0;
}
.sources-modal-header .modal-close:hover {
  background: rgba(255,255,255,.15); color: #fff;
}

.sources-modal-body {
  padding: 1.25rem 1.4rem; display: flex; flex-direction: column; gap: .8rem;
}

/* Source Cards */
.source-card {
  display: flex; gap: .9rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.source-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}
.source-card-highlight {
  background: var(--green-50);
  border-color: var(--green-200);
}
.source-card-highlight:hover {
  border-color: var(--green-300);
  box-shadow: 0 2px 12px rgba(27,196,157,.12);
}

.source-card-left {
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  flex-shrink: 0; padding-top: .1rem;
}
.source-seq {
  font-size: .62rem; font-weight: 700; color: var(--text-muted);
  letter-spacing: .05em;
}
.source-badge {
  padding: .28rem .6rem; border-radius: var(--radius-sm);
  font-size: .68rem; font-weight: 800;
  white-space: nowrap; text-align: center; min-width: 68px;
  border: 1.5px solid transparent;
}
.source-badge-green  { background: var(--green-100); color: var(--green-700); border-color: var(--green-200); }
.source-badge-blue   { background: #ebf8ff; color: #2b6cb0; border-color: #bee3f8; }
.source-badge-purple { background: #faf5ff; color: #6b46c1; border-color: #d6bcfa; }
.source-badge-orange { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.source-badge-teal   { background: #e6fffa; color: #2c7a7b; border-color: #81e6d9; }

.source-card-body { flex: 1; min-width: 0; }
.source-card-title {
  font-size: var(--text-sm); font-weight: 700; color: var(--text-primary);
  margin-bottom: .4rem; line-height: 1.4;
}
.source-card-meta {
  display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem;
}
.source-meta-pill {
  background: var(--white); border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: 999px;
  padding: .12rem .6rem; font-size: .68rem; font-weight: 600;
}
.source-meta-pill-green { background: var(--green-100); border-color: var(--green-200); color: var(--green-700); }
.source-meta-pill-orange { background: #fffbeb; border-color: #fde68a; color: #b45309; }

.source-card-desc {
  font-size: var(--text-xs); color: var(--text-secondary);
  line-height: 1.55; margin-bottom: .7rem;
}
.source-card-desc strong { color: var(--text-primary); }

.source-link-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--white); color: var(--text-secondary);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: .35rem .75rem; font-size: .72rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: all var(--transition);
}
.source-link-btn:hover {
  background: var(--bg-subtle); border-color: var(--border-strong);
  color: var(--text-primary); text-decoration: none;
  box-shadow: var(--shadow-xs);
}
.source-link-btn-primary {
  background: var(--green-100); color: var(--green-700);
  border-color: var(--green-200);
}
.source-link-btn-primary:hover {
  background: var(--green-200); border-color: var(--green-300);
  color: var(--green-800);
}

.sources-footer {
  display: flex; align-items: flex-start; gap: .6rem;
  background: var(--info-bg); border: 1px solid #bee3f8;
  border-radius: var(--radius); padding: .7rem .9rem;
  font-size: var(--text-xs); color: var(--info); line-height: 1.5;
}
.sources-footer-icon { flex-shrink: 0; }

/* Timeline (legacy — replaced by CJ modal below) */
.timeline  { display: flex; flex-direction: column; }

/* ══════════════════════════════════════════════════════════════
   TIMELINE MODAL — CJ (Compliance Journey)
══════════════════════════════════════════════════════════════ */

/* Modal card override */
.cj-modal-card {
  max-width: 780px !important;
  max-height: 92vh !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ── */
.cj-header {
  background: linear-gradient(120deg, var(--green-800) 0%, var(--green-600) 60%, #1BC49D 100%);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}
.cj-header-inner { display: flex; flex-direction: column; gap: .3rem; }
.cj-header-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.92);
  font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: .22rem .7rem; border-radius: 99px; width: fit-content;
}
.cj-header-pulse {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #4dffc3; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(77,255,195,.5);
  animation: cjPulse 2s ease-in-out infinite;
}
@keyframes cjPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(77,255,195,.5); }
  50% { box-shadow: 0 0 0 5px rgba(77,255,195,0); }
}
.cj-header-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(.95rem, 1.5vw, 1.15rem); font-weight: 700;
  color: #fff; letter-spacing: -.02em; line-height: 1.2;
}
.cj-header-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: .75rem; color: rgba(255,255,255,.65); line-height: 1.4;
}
.cj-close {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  color: rgba(255,255,255,.7); flex-shrink: 0; margin-top: .1rem;
  transition: background .15s, color .15s;
}
.cj-close:hover { background: rgba(255,255,255,.18); color: #fff; }

/* ── Tab bar ── */
.cj-tabs {
  display: flex; gap: 0;
  background: var(--green-50);
  border-bottom: 2px solid var(--green-200);
  padding: .6rem .75rem .5rem;
  flex-shrink: 0;
  gap: .4rem;
}
.cj-tab {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .42rem 1rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem; font-weight: 600;
  color: var(--text-secondary);
  border: 1.5px solid transparent;
  transition: all .18s ease;
}
.cj-tab:hover { background: var(--green-100); color: var(--green-700); }
.cj-tab--active {
  background: #fff;
  border-color: var(--green-200);
  color: var(--green-700);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ── Panel ── */
.cj-panel {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.cj-panel::-webkit-scrollbar { width: 5px; }
.cj-panel::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

/* ══ PANEL 1: TIMELINE ══ */

.tl-wrap {
  position: relative;
  padding-left: 2.6rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Vertical glowing rail */
.tl-rail {
  position: absolute;
  left: .8rem;
  top: 10px; bottom: 10px;
  width: 2px;
  background: linear-gradient(180deg,
    rgba(100,116,139,.3) 0%,
    rgba(14,165,233,.5) 18%,
    rgba(59,130,246,.5) 36%,
    rgba(13,148,136,.55) 54%,
    rgba(22,163,74,.55) 72%,
    rgba(27,196,157,.8) 100%
  );
  border-radius: 2px;
}

/* Step wrapper */
.tl-step {
  position: relative;
  display: flex;
  gap: .9rem;
  padding-bottom: 1.4rem;
  align-items: flex-start;
}
.tl-step:last-child { padding-bottom: 0; }

/* Node */
.tl-node-col {
  position: absolute;
  left: -2.6rem;
  top: .1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  flex-shrink: 0;
}
.tl-node {
  position: relative;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
}
.tl-node-ring {
  position: absolute; inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--step-clr);
  opacity: .35;
}
.tl-node-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--step-clr);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--step-clr);
  position: relative; z-index: 1;
}
.tl-node-vivid .tl-node-dot {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--step-clr), 0 0 10px rgba(27,196,157,.4);
  animation: vivid-pulse 2s ease-in-out infinite;
}
@keyframes vivid-pulse {
  0%,100% { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1BC49D, 0 0 10px rgba(27,196,157,.4); }
  50% { box-shadow: 0 0 0 2px #fff, 0 0 0 6px #1BC49D, 0 0 16px rgba(27,196,157,.6); }
}

/* Content area */
.tl-content { flex: 1; min-width: 0; }
.tl-year-tag {
  display: inline-flex; align-items: center;
  background: var(--step-bg);
  border: 1px solid var(--step-border);
  color: var(--step-clr);
  font-family: 'Space Grotesk', sans-serif;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .2rem .65rem; border-radius: 99px; margin-bottom: .55rem;
}
.tl-year-vivid {
  background: rgba(27,196,157,.12);
  border-color: rgba(27,196,157,.35);
  color: var(--green-600);
}
.tl-card {
  background: var(--bg-card);
  border: 1px solid var(--step-border);
  border-left: 3px solid var(--step-clr);
  border-radius: 10px;
  padding: .85rem 1rem;
  transition: box-shadow .18s, transform .18s;
}
.tl-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.07);
  transform: translateX(2px);
}
.tl-card-top {
  display: flex; align-items: center; gap: .45rem;
  margin-bottom: .35rem;
}
.tl-phase-icon { font-size: 1rem; line-height: 1; }
.tl-phase-label {
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--step-clr);
}
.tl-card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .92rem; font-weight: 700;
  color: var(--green-900); letter-spacing: -.01em; margin-bottom: .3rem; line-height: 1.3;
}
.tl-card-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: .78rem; color: var(--text-secondary); line-height: 1.55; margin-bottom: .45rem;
}
.tl-card-ref {
  display: inline-flex;
  background: var(--bg-subtle); border: 1px solid var(--border);
  font-size: .65rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted); padding: .18rem .55rem; border-radius: 5px;
}
.tl-card-pills {
  display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem;
}
.tl-pill {
  background: var(--step-bg); border: 1px solid var(--step-border);
  color: var(--step-clr);
  font-size: .68rem; font-weight: 600; padding: .18rem .55rem; border-radius: 99px;
}

/* Action card (step 6) */
.tl-action-card {
  background: linear-gradient(120deg, var(--green-800) 0%, var(--green-700) 50%, #0d5240 100%);
  border: 1px solid rgba(27,196,157,.3);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  overflow: hidden;
}
.tl-action-header { margin-bottom: .85rem; }
.tl-action-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(27,196,157,.18); border: 1px solid rgba(27,196,157,.4);
  color: #4dffc3;
  font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  padding: .2rem .6rem; border-radius: 99px; margin-bottom: .5rem;
}
.tl-action-pulse {
  width: 6px; height: 6px; border-radius: 50%; background: #4dffc3; flex-shrink: 0;
  animation: cjPulse 1.8s ease-in-out infinite;
}
.tl-action-title {
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem; color: rgba(255,255,255,.8); line-height: 1.45;
}
.tl-action-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem .75rem;
}
@media (max-width: 560px) { .tl-action-steps { grid-template-columns: 1fr; } }
.tl-action-step {
  display: flex; align-items: flex-start; gap: .55rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .76rem; color: rgba(255,255,255,.82); line-height: 1.4;
}
.tl-an {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  min-width: 22px; height: 22px; border-radius: 6px;
  background: rgba(27,196,157,.2); border: 1px solid rgba(27,196,157,.35);
  color: #4dffc3;
  font-family: 'Space Grotesk', sans-serif;
  font-size: .65rem; font-weight: 700;
}

/* ══ PANEL 2: HOW GREON HELPS ══ */

.gh-intro {
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem; color: var(--text-secondary); line-height: 1.55;
  margin-bottom: 1rem;
  padding: .65rem .85rem;
  background: var(--green-50); border: 1px solid var(--green-200);
  border-radius: 10px;
}

/* Bridge layout */
.gh-bridge { display: flex; flex-direction: column; gap: .55rem; }

/* Column headers */
.gh-cols-hdr {
  display: grid; grid-template-columns: 1fr 60px 1fr;
  align-items: center; gap: .5rem;
  padding-bottom: .5rem;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: .2rem;
}
.gh-col-hdr {
  display: flex; align-items: center; gap: .4rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.gh-col-entity { color: var(--text-secondary); }
.gh-col-greon  { color: var(--green-600); }
.gh-greon-pip  {
  display: inline-block; width: 8px; height: 8px; border-radius: 2px;
  background: var(--primary); flex-shrink: 0;
}
.gh-col-hdr-spacer { /* arrow column */ }

/* Row */
.gh-row {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  align-items: center;
  gap: .5rem;
  padding: .55rem 0;
  border-bottom: 1px dashed var(--border);
  transition: background .15s;
  border-radius: 6px;
}
.gh-row:last-child { border-bottom: none; }
.gh-row:hover { background: var(--green-50); }

/* Step (left column) */
.gh-step {
  display: flex; align-items: flex-start; gap: .65rem;
  padding: .1rem .4rem;
}
.gh-step-num {
  display: flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; border-radius: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: .7rem; font-weight: 800; flex-shrink: 0;
  border: 1.5px solid;
}
.gh-num-slate  { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.gh-num-blue   { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.gh-num-teal   { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; }
.gh-num-green  { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.gh-num-amber  { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.gh-num-primary{ background: var(--green-100); color: var(--green-700); border-color: var(--green-300); }

.gh-step-body { flex: 1; min-width: 0; }
.gh-step-title {
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem; font-weight: 700; color: var(--text-primary); margin-bottom: .12rem;
  line-height: 1.35;
}
.gh-step-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: .7rem; color: var(--text-muted); line-height: 1.4;
}

/* Connector (center column) */
.gh-connector {
  display: flex; align-items: center; justify-content: center; gap: 0;
  position: relative;
}
.gh-connector-line {
  position: absolute;
  height: 1.5px;
  left: 0; right: 16px;
  background: linear-gradient(90deg, var(--border) 0%, var(--green-300) 100%);
}
.gh-arr-svg { color: var(--green-500); flex-shrink: 0; position: relative; z-index: 1; }

/* Capabilities column (right) */
.gh-caps-col {
  display: flex; flex-wrap: wrap; gap: .35rem;
  padding: .1rem .4rem;
}
.gh-cap-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .7rem; font-weight: 600;
  padding: .25rem .6rem; border-radius: 99px; border: 1.5px solid;
  white-space: nowrap;
}
.gh-cap-audit   { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.gh-cap-consult { background: var(--green-50); color: var(--green-700); border-color: var(--green-200); }
.gh-cap-saas    { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.gh-cap-iot     { background: #faf5ff; color: #6b21a8; border-color: #d8b4fe; }
.gh-cap-plan    { background: #fff7ed; color: #b45309; border-color: #fed7aa; }

/* All capabilities summary */
.gh-all-caps {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, var(--green-50) 0%, #f0fdf4 100%);
  border: 1px solid var(--green-200);
  border-radius: 12px;
}
.gh-all-caps-title {
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-secondary); margin-bottom: .65rem;
}
.gh-all-caps-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: .4rem;
  margin-bottom: .85rem;
}
@media (max-width: 560px) { .gh-all-caps-grid { grid-template-columns: 1fr 1fr; } }
.gh-all-cap {
  display: flex; align-items: center; gap: .4rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .73rem; font-weight: 600;
  padding: .35rem .6rem; border-radius: 8px; border: 1px solid;
}
.gh-all-consult { background: #fff; border-color: var(--green-200); color: var(--green-700); }
.gh-all-plan    { background: #fff7ed; border-color: #fed7aa; color: #b45309; }
.gh-all-saas    { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.gh-all-iot     { background: #faf5ff; border-color: #d8b4fe; color: #6b21a8; }
.gh-all-audit   { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

.gh-cta-row { display: flex; justify-content: center; }
.gh-cta-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: linear-gradient(100deg, var(--green-700), var(--green-500));
  color: #fff; text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-size: .78rem; font-weight: 700;
  padding: .6rem 1.3rem; border-radius: 99px;
  box-shadow: 0 2px 10px rgba(27,196,157,.3);
  transition: all .18s ease;
}
.gh-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(27,196,157,.45);
  color: #fff; text-decoration: none;
}

/* Mobile adjustments */
@media (max-width: 500px) {
  .cj-header { padding: 1rem; }
  .cj-panel  { padding: 1rem; }
  .tl-wrap   { padding-left: 2.2rem; }
  .gh-cols-hdr, .gh-row { grid-template-columns: 1fr 40px 1fr; }
  .gh-connector-line { right: 12px; }
}


/* ══════════════════════════════════════════════════════════════
   LOADING & TOAST
══════════════════════════════════════════════════════════════ */
.loading-state {
  display: flex; align-items: center; justify-content: center;
  gap: .75rem; padding: 3rem; color: var(--text-secondary); font-size: var(--text-sm);
}
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .75s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9000;
  display: flex; align-items: center; gap: .65rem;
  background: var(--gray-900); color: #fff;
  padding: .7rem 1.1rem; border-radius: var(--radius);
  font-size: var(--text-sm); font-weight: 500;
  box-shadow: var(--shadow-lg); max-width: 360px;
  animation: slideUp .3s cubic-bezier(.34,1.56,.64,1);
}
.toast.success { background: var(--primary-dark); }
.toast.error   { background: var(--danger); }

/* ══════════════════════════════════════════════════════════════
   UTILITY
══════════════════════════════════════════════════════════════ */
.card { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }

/* Full-span chart card */
.charts-row > .chart-card[style*="grid-column"] { grid-column: 1 / -1; }

/* Mobile overrides ------------------------------------------------ */
@media (max-width: 480px) {
  .site-header         { height: auto; padding: .65rem 1rem; flex-wrap: wrap; }
  .tab-nav             { width: 100%; justify-content: center; }
  .tab-btn             { flex: 1; justify-content: center; font-size: .72rem; padding: .38rem .5rem; }
  .tab-panel           { padding: .85rem; }
  .kpi-grid            { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .kpi-value           { font-size: 1.5rem; }
  .filter-bar          { gap: .5rem; }
  .filter-group        { flex: 1 1 100%; max-width: 100%; }
  .notification-banner { font-size: .7rem; }
  .banner-actions      { width: 100%; }
  .section-header      { flex-direction: column; align-items: flex-start; }
  .sort-row            { width: 100%; }
  .entity-card-header  { flex-direction: column; align-items: flex-start; }
  .admin-grid          { grid-template-columns: 1fr; }
  .entity-form .form-grid { grid-template-columns: 1fr; }
  .form-group-full     { grid-column: span 1; }
}

/* 27" / large screen enhancements -------------------------------- */
@media (min-width: 2000px) {
  .tab-panel           { padding: 2rem 3rem; }
  .kpi-grid            { grid-template-columns: repeat(5, 1fr); }
  .charts-row          { grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); }
  .charts-row.split-wide { grid-template-columns: 3fr 2fr; }
  .entity-fields-grid  { grid-template-columns: repeat(6, 1fr); }
}

/* Print styles ---------------------------------------------------- */
@media print {
  .site-header, .filter-bar, .pagination-wrap, .notification-banner { display: none; }
  .tab-panel   { padding: 0; }
  .chart-card  { break-inside: avoid; }
  .entity-card { break-inside: avoid; }
}