/* ============================================================
   NGX FY2025 Intelligence — stylesheet
   ============================================================ */
:root {
  --accent: #1fc78c;        /* NGX emerald */
  --accent-2: #14b8c4;      /* teal */
  --accent-3: #e3b341;      /* gold */
  --accent-rgb: 31, 199, 140;
  --pos: #2dd4a7;
  --neg: #ff6b6b;
  --warn: #f5b942;
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1320px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --display: "Sora", "Inter", sans-serif;
  --t: .25s cubic-bezier(.4,0,.2,1);
}
[data-theme="dark"] {
  --bg: #070b14;
  --bg-2: #0b1120;
  --surface: rgba(20, 28, 45, 0.62);
  --surface-solid: #111a2e;
  --surface-2: rgba(30, 41, 64, 0.5);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eaf0fb;
  --text-dim: #9fb0cc;
  --text-faint: #64748b;
  --shadow: 0 24px 60px -28px rgba(0,0,0,.85);
  --glow: 0 0 0 1px rgba(var(--accent-rgb),.18), 0 18px 50px -25px rgba(var(--accent-rgb),.45);
}
[data-theme="light"] {
  --bg: #eef2f8;
  --bg-2: #e3e9f3;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-2: rgba(255, 255, 255, 0.6);
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0c1626;
  --text-dim: #475569;
  --text-faint: #8090a8;
  --shadow: 0 20px 48px -26px rgba(20,40,80,.32);
  --glow: 0 0 0 1px rgba(var(--accent-rgb),.22), 0 18px 44px -24px rgba(var(--accent-rgb),.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ---------- Ambient background ---------- */
.aurora {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60% 50% at 12% 0%, rgba(var(--accent-rgb),.18), transparent 60%),
    radial-gradient(50% 50% at 90% 8%, rgba(20,184,196,.16), transparent 60%),
    radial-gradient(60% 60% at 50% 110%, rgba(227,179,65,.10), transparent 60%),
    var(--bg);
}
.grid-overlay {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .4;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
}

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 16px clamp(16px, 4vw, 40px);
  max-width: var(--maxw); margin: 0 auto;
  width: 100%;
  backdrop-filter: blur(14px);
}
.topbar::after {
  content:""; position:absolute; inset:0; z-index:-1;
  background: linear-gradient(180deg, var(--bg) 30%, transparent);
  -webkit-mask: linear-gradient(180deg,#000 60%,transparent);
  mask: linear-gradient(180deg,#000 60%,transparent);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--glow);
}
.brand-text h1 {
  font-family: var(--display); font-size: 1.18rem; margin: 0; letter-spacing: -.02em; font-weight: 800;
}
.brand-text h1 span { color: var(--accent); }
.brand-text p { margin: 1px 0 0; font-size: .76rem; color: var(--text-dim); }

.topbar-tools { display: flex; align-items: center; gap: 10px; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap > svg { position: absolute; left: 12px; color: var(--text-faint); pointer-events: none; }
#globalSearch {
  width: 230px; max-width: 40vw;
  padding: 10px 12px 10px 34px;
  border-radius: 11px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-size: .85rem; font-family: var(--sans);
  transition: var(--t);
}
#globalSearch:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.18); width: 280px; }
.search-results {
  position: absolute; top: calc(100% + 8px); right: 0; width: 320px; max-height: 360px; overflow-y: auto;
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: var(--shadow); padding: 6px; z-index: 60;
}
.search-results .sr-item {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  padding: 9px 11px; border-radius: 9px; cursor: pointer; font-size: .85rem;
}
.search-results .sr-item:hover { background: var(--surface-2); }
.search-results .sr-item .sr-tick { font-family: var(--mono); font-size: .72rem; color: var(--text-faint); }
.search-results .sr-empty { padding: 14px; color: var(--text-faint); font-size: .82rem; text-align: center; }

.icon-btn {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 11px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); cursor: pointer; font-size: 1.1rem; transition: var(--t);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* ---------- Market switcher ---------- */
.market-bar {
  max-width: var(--maxw); margin: 0 auto 2px; width: 100%;
  padding: 4px clamp(16px, 4vw, 40px) 8px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.market-bar .mkt-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-faint); font-weight: 700; margin-right: 2px; }
.market-bar .mkt-div { width: 1px; height: 20px; background: var(--border-strong); margin: 0 4px; }
.mkt-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 100px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
  font-size: .8rem; font-weight: 600; transition: var(--t); backdrop-filter: blur(8px);
}
.mkt-pill .mkt-flag { font-size: 1.05rem; line-height: 1; }
.mkt-pill .mkt-name { color: var(--text); }
.mkt-pill .mkt-exch { font-size: .66rem; color: var(--text-faint); border-left: 1px solid var(--border-strong); padding-left: 7px; }
.mkt-pill[data-mkt]:hover { border-color: var(--accent); transform: translateY(-1px); }
.mkt-pill.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; box-shadow: var(--glow); }
.mkt-pill.active .mkt-name, .mkt-pill.active .mkt-exch { color: #04130d; border-color: rgba(0,0,0,.2); }
[data-theme="light"] .mkt-pill.active .mkt-name, [data-theme="light"] .mkt-pill.active .mkt-exch { color: #fff; }
.mkt-pill.cmp { border-style: dashed; }
.mkt-pill.cmp.active { border-style: solid; }
.mkt-pill.soon { cursor: default; opacity: .55; }
.mkt-pill.soon .mkt-name { color: var(--text-dim); }
.mkt-pill.soon .mkt-soon { font-size: .6rem; text-transform: uppercase; letter-spacing: .06em; padding: 1px 6px; border-radius: 100px; background: var(--surface-2); color: var(--text-faint); }
@media (max-width: 720px) { .market-bar .mkt-pill .mkt-exch { display: none; } }

/* ---------- Macro strip ---------- */
.macro-strip {
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  padding: 0 clamp(16px, 4vw, 40px) 6px;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.macro-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 14px; border-radius: 100px;
  background: var(--surface); border: 1px solid var(--border); font-size: .8rem;
  backdrop-filter: blur(8px);
}
.macro-chip .mc-label { color: var(--text-dim); }
.macro-chip .mc-val { font-family: var(--mono); font-weight: 600; color: var(--text); }
.macro-chip .mc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* ---------- Sector nav ---------- */
.sector-nav {
  position: sticky; top: 78px; z-index: 30;
  max-width: var(--maxw); margin: 12px auto 0; width: 100%;
  padding: 10px clamp(16px, 4vw, 40px);
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin;
}
.sector-nav::-webkit-scrollbar { height: 5px; }
.sector-nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
.nav-pill {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 100px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim); font-size: .84rem; font-weight: 600; white-space: nowrap;
  transition: var(--t); backdrop-filter: blur(8px);
}
.nav-pill:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.nav-pill.active { color: #04130d; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; box-shadow: var(--glow); }
[data-theme="light"] .nav-pill.active { color: #fff; }
.nav-pill .np-ico { font-size: 1rem; line-height: 1; }
.nav-pill .np-count { font-size: .68rem; padding: 1px 7px; border-radius: 100px; background: rgba(0,0,0,.18); }
.nav-pill.active .np-count { background: rgba(0,0,0,.22); }

/* ---------- Layout ---------- */
.view {
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  padding: 22px clamp(16px, 4vw, 40px) 60px;
  animation: fade .4s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.boot { display: grid; place-items: center; gap: 16px; padding: 100px 0; color: var(--text-dim); }
.boot-spin { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--border-strong); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 36px 0 16px; flex-wrap: wrap; }
.section-head:first-child { margin-top: 4px; }
.section-head h2 { font-family: var(--display); font-size: 1.32rem; margin: 0; letter-spacing: -.02em; }
.section-head .eyebrow { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.section-head .sub { color: var(--text-dim); font-size: .85rem; }

/* ---------- Card primitives ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* ---------- Hero KPI cards ---------- */
.kpi {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.kpi::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background: linear-gradient(var(--accent), var(--accent-2)); border-radius: 3px; }
.kpi .k-label { font-size: .74rem; color: var(--text-dim); letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.kpi .k-val { font-family: var(--display); font-size: 1.85rem; font-weight: 800; margin: 6px 0 2px; letter-spacing: -.02em; }
.kpi .k-val .unit { font-size: .9rem; color: var(--text-dim); font-weight: 600; margin-left: 3px; }
.kpi .k-sub { font-size: .76rem; color: var(--text-faint); }
.kpi .k-spark { position: absolute; right: 14px; top: 14px; opacity: .5; }

/* ---------- Pills / tags ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 600; padding: 3px 9px; border-radius: 100px; }
.tag.pos { color: var(--pos); background: rgba(45,212,167,.12); }
.tag.neg { color: var(--neg); background: rgba(255,107,107,.12); }
.tag.neutral { color: var(--text-dim); background: var(--surface-2); }
.tag.gold { color: var(--accent-3); background: rgba(227,179,65,.13); }
.delta { font-family: var(--mono); font-weight: 600; font-size: .78rem; }
.delta.pos { color: var(--pos); }
.delta.neg { color: var(--neg); }

/* ---------- Charts ---------- */
.chart { width: 100%; height: 340px; }
.chart.tall { height: 420px; }
.chart.sm { height: 260px; }
.chart-card h3, .panel h3 { font-family: var(--display); font-size: 1rem; margin: 0 0 4px; }
.chart-card .ch-sub, .panel .p-sub { font-size: .78rem; color: var(--text-dim); margin: 0 0 12px; }

/* ---------- Sector banner ---------- */
.sector-banner {
  position: relative; overflow: hidden;
  border-radius: var(--radius); padding: 26px 28px; margin-bottom: 20px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(120deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
}
.sector-banner::after {
  content:""; position:absolute; right:-40px; top:-60px; width:280px; height:280px; border-radius:50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb),.22), transparent 70%); pointer-events:none;
}
.sector-banner .sb-ico { font-size: 2rem; }
.sector-banner h2 { font-family: var(--display); font-size: 1.5rem; margin: 8px 0 6px; letter-spacing: -.02em; }
.sector-banner .sb-narr { color: var(--text-dim); font-size: .92rem; max-width: 760px; line-height: 1.6; }
.sector-banner .sb-insight {
  margin-top: 16px; display: inline-flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border-strong); max-width: 760px;
}
.sector-banner .sb-insight .si-ico { color: var(--accent-3); font-size: 1.1rem; }
.sector-banner .sb-insight span { font-size: .88rem; }

/* ---------- Benchmark cards ---------- */
.bench-card { text-align: center; }
.bench-card .bc-label { font-size: .72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.bench-card .bc-val { font-family: var(--display); font-size: 1.6rem; font-weight: 800; margin: 5px 0; }
.bench-card .bc-meta { font-size: .72rem; color: var(--text-faint); }
.bench-card.accent .bc-val { color: var(--accent); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.data { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 720px; }
table.data thead th {
  position: sticky; top: 0; background: var(--surface-solid); text-align: right;
  padding: 13px 14px; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-dim); font-weight: 600; cursor: pointer; white-space: nowrap; border-bottom: 1px solid var(--border-strong);
  user-select: none;
}
table.data thead th:first-child { text-align: left; }
table.data thead th.sortable:hover { color: var(--text); }
table.data thead th .arrow { opacity: .4; font-size: .7rem; }
table.data thead th.sorted .arrow { opacity: 1; color: var(--accent); }
table.data tbody td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--border); font-family: var(--mono); white-space: nowrap; }
table.data tbody td:first-child { text-align: left; font-family: var(--sans); }
table.data tbody tr { transition: background .15s; cursor: pointer; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: none; }
.co-cell { display: flex; align-items: center; gap: 10px; }
.co-cell .co-logo { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: .7rem; color: #04130d; flex: 0 0 auto; }
.co-cell .co-name { font-weight: 600; }
.co-cell .co-tick { font-family: var(--mono); font-size: .68rem; color: var(--text-faint); }
.bar-cell { position: relative; }
.bar-cell .bc-fill { position: absolute; left: 0; top: 50%; transform: translateY(-50%); height: 22px; border-radius: 5px; background: linear-gradient(90deg, rgba(var(--accent-rgb),.28), rgba(var(--accent-rgb),.08)); z-index: 0; }
.bar-cell span { position: relative; z-index: 1; }
.vs-avg { font-size: .68rem; padding: 1px 6px; border-radius: 5px; margin-left: 6px; font-family: var(--sans); }
.vs-avg.up { color: var(--pos); background: rgba(45,212,167,.12); }
.vs-avg.down { color: var(--neg); background: rgba(255,107,107,.12); }

/* ---------- Company cards grid ---------- */
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.co-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; backdrop-filter: blur(12px); transition: var(--t); position: relative; overflow: hidden;
}
.co-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--glow); }
.co-card .cc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.co-card .cc-logo { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: .9rem; color: #04130d; flex: 0 0 auto; }
.co-card .cc-title { font-family: var(--display); font-size: 1.02rem; font-weight: 700; line-height: 1.2; }
.co-card .cc-tick { font-family: var(--mono); font-size: .7rem; color: var(--text-faint); }
.co-card .cc-period { margin-left: auto; font-size: .68rem; color: var(--text-faint); border: 1px solid var(--border); padding: 3px 8px; border-radius: 100px; }
.cc-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.cc-metric { background: var(--surface-2); border-radius: 11px; padding: 10px 12px; }
.cc-metric .m-label { font-size: .68rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; }
.cc-metric .m-val { font-family: var(--mono); font-weight: 600; font-size: 1rem; margin-top: 3px; }
.cc-metric .m-vs { font-size: .66rem; }
.cc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.cc-note { font-size: .76rem; color: var(--text-dim); line-height: 1.45; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.cc-src { font-size: .66rem; color: var(--text-faint); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.conf-dot { width: 7px; height: 7px; border-radius: 50%; }
.conf-high { background: var(--pos); } .conf-medium { background: var(--warn); } .conf-low { background: var(--neg); }

/* ---------- Callouts ---------- */
.callout {
  border-radius: var(--radius); padding: 18px 20px; border: 1px solid var(--border);
  background: var(--surface); position: relative; overflow: hidden; backdrop-filter: blur(10px);
}
.callout::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; }
.callout.positive::before { background: var(--pos); }
.callout.risk::before { background: var(--neg); }
.callout.neutral::before { background: var(--accent-2); }
.callout .co-ico { font-size: 1.2rem; }
.callout h4 { font-family: var(--display); font-size: .98rem; margin: 0 0 6px; }
.callout p { font-size: .85rem; color: var(--text-dim); margin: 0; line-height: 1.5; }

/* ---------- Narrative panel ---------- */
.narrative { font-size: .95rem; line-height: 1.7; color: var(--text-dim); max-width: 900px; }
.narrative strong { color: var(--text); }

/* ---------- Leaderboard ---------- */
.lead { display: flex; flex-direction: column; gap: 2px; }
.lead-row { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--border); }
.lead-row:last-child { border-bottom: none; }
.lead-rank { font-family: var(--display); font-weight: 800; color: var(--text-faint); font-size: .9rem; text-align: center; }
.lead-row:nth-child(1) .lead-rank { color: var(--accent-3); }
.lead-name { font-weight: 600; font-size: .88rem; }
.lead-name .ln-sec { font-size: .7rem; color: var(--text-faint); display: block; }
.lead-val { font-family: var(--mono); font-weight: 600; }

/* ---------- Quarterly tracker ---------- */
.qt-card { display: flex; flex-direction: column; gap: 10px; }
.qt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.qt-row:last-child { border-bottom: none; }
.qt-name { font-weight: 600; font-size: .86rem; }
.qt-bars { flex: 1; max-width: 240px; }
.qt-bar { height: 9px; border-radius: 5px; background: var(--surface-2); overflow: hidden; margin-bottom: 4px; }
.qt-bar i { display: block; height: 100%; border-radius: 5px; }
.qt-bar.run i { background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.qt-bar.fy i { background: var(--text-faint); opacity: .5; }
.qt-legend { font-size: .68rem; color: var(--text-faint); }

/* ---------- Empty / note ---------- */
.note-line { font-size: .78rem; color: var(--text-faint); display: flex; align-items: center; gap: 7px; }
.empty { padding: 30px; text-align: center; color: var(--text-faint); font-size: .88rem; }

/* ---------- Footer ---------- */
.site-foot { max-width: var(--maxw); margin: 0 auto; padding: 30px clamp(16px,4vw,40px) 50px; border-top: 1px solid var(--border); }
.site-foot p { font-size: .78rem; color: var(--text-faint); margin: 4px 0; }
.site-foot .disclaimer { font-style: italic; }

/* ---------- Segmented control ---------- */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 100px; padding: 3px; border: 1px solid var(--border); }
.seg button { border: none; background: none; color: var(--text-dim); font-size: .78rem; font-weight: 600; padding: 6px 14px; border-radius: 100px; cursor: pointer; transition: var(--t); font-family: var(--sans); }
.seg button.active { background: var(--accent); color: #04130d; }
[data-theme="light"] .seg button.active { color: #fff; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(4, 8, 16, .62); backdrop-filter: blur(6px);
}
.modal-overlay.show { display: flex; animation: fade .2s ease; }
.modal {
  width: min(880px, 100%); max-height: 90vh; overflow-y: auto;
  background: var(--surface-solid); border: 1px solid var(--border-strong);
  border-radius: 22px; padding: 26px; position: relative; box-shadow: var(--shadow);
}
.modal::before { content:""; position:absolute; left:0; right:0; top:0; height:4px; border-radius:22px 22px 0 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.modal-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim); cursor: pointer; font-size: .9rem; }
.modal-close:hover { color: var(--text); border-color: var(--border-strong); }
.modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.modal-title { font-family: var(--display); font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.modal-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.modal-kpis .mk { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.modal-kpis .mk-l { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
.modal-kpis .mk-v { font-family: var(--mono); font-weight: 600; font-size: 1.1rem; margin: 4px 0 2px; }
.modal-kpis .mk-s { font-size: .68rem; color: var(--text-faint); }
.modal-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 6px; }
.mc-box { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; }
.mc-box h4 { font-family: var(--display); font-size: .85rem; margin: 0 0 4px; }
@media (max-width: 680px) { .modal-kpis { grid-template-columns: repeat(2, 1fr); } .modal-charts { grid-template-columns: 1fr; } }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .brand-text p { display: none; }
  #globalSearch { width: 160px; }
  .sector-nav { top: 70px; }
  .co-grid { grid-template-columns: 1fr; }
  .section-head h2 { font-size: 1.15rem; }
}
