/* DTI South Africa SEZ - BAT PRISM(tm) - brand tokens
   Palette matches the approved dtic PRISM Palette reference
   (https://claude.ai/code/artifact/e469f0ac-9625-4fe5-8b9f-8a40563ff36e).
   This file styles the PARENT shell only. Individual SEZ dashboards (FTSEZ)
   keep their own BAT brand.css untouched - see project memory. */

@import url('https://fonts.googleapis.com/css2?family=Bitter:wght@500;700;800&family=Poppins:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --green: #006532;
  --green-deep: #024424;
  --orange: #F58220;
  --maroon: #93191C;
  --grey: #58595B;
  --gold: #FBAB18;
  --ivory: #F4EEDC;
  --paper: #FFFFFF;
  --ink: #33342F;
  --ink-soft: #58595B;
  --line: #E4DFCF;
  --raised: #FFFFFF;
  --shadow: rgba(51, 34, 6, 0.10);
  --danger: #93191C;
  --ok: #006532;
  --pending: #9A9A94;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

a { color: inherit; }

h1, h2, h3, h4 { font-family: 'Bitter', Georgia, serif; margin: 0; text-wrap: balance; }

/* ---------------- top bar ---------------- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--raised);
  position: sticky; top: 0; z-index: 40;
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; padding: 16px 28px; }
.topbar .brandmark { display: flex; align-items: center; gap: 14px; }
.crest-mark { position: static; width: 30px; height: 30px; border-radius: 50%; background: var(--green);
  display: flex; align-items: center; justify-content: center; flex: none; }
.crest-mark::after { content: ""; width: 46%; height: 46%; border-radius: 50%; background: var(--gold); }
.dtic-logo { height: 40px; width: auto; flex: none; background: #fff; padding: 3px 8px;
  border-radius: 3px; }
.topbar .id { font-family: 'Bitter', serif; font-weight: 700; font-size: 15px; letter-spacing: .04em;
  color: var(--green); white-space: nowrap; border-left: 1px solid var(--line); padding-left: 14px; }
.topbar .id small { display: block; font-family: 'Poppins', sans-serif; font-weight: 500;
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }

.footer-credit { display: inline-flex; align-items: center; gap: 8px; }
.bat-logo { height: 22px; width: auto; opacity: .85; }
.sez-header-logo { height: 34px; width: auto; background: #fff; padding: 2px 6px; border-radius: 3px; flex: none; }

.topnav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.topnav button {
  font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 600; letter-spacing: .01em;
  color: var(--ink-soft); background: none; border: none; border-bottom: 2px solid transparent;
  padding: 8px 10px; cursor: pointer; transition: color .15s ease, border-color .15s ease;
}
.topnav button:hover { color: var(--green); }
.topnav button.active { color: var(--green); border-bottom-color: var(--orange); }

/* ---------------- hero / crests ---------------- */
.hero { padding: 60px 0 100px; position: relative; overflow: hidden; }
.hero-text { position: relative; z-index: 1; max-width: 640px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--orange); margin: 0 0 14px; }
.hero h1 { font-weight: 800; font-size: clamp(32px, 4.4vw, 50px); line-height: 1.08;
  color: var(--green); margin: 0 0 18px; max-width: 16ch; }
.hero .lede { font-size: 17px; color: var(--ink-soft); max-width: 58ch; margin: 0; }
.rule { height: 4px; width: 64px; background: var(--orange); margin: 30px 0 0; }

.crest { position: absolute; width: auto; height: 130%; pointer-events: none; z-index: 0; }
.crest.br { top: -15%; right: -10px; }
.crest.detail { height: 460px; top: 0; right: -10px; }
@media (max-width: 900px) {
  .crest.detail { display: none; }
}

/* ---------------- section headings ---------------- */
section.block { margin-top: 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
h2.block-title { font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-soft); }
.block-note { font-size: 13px; color: var(--ink-soft); max-width: 60ch; }

/* ---------------- KPI tiles ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.kpi {
  background: var(--raised); border: 1px solid var(--line); border-top: 3px solid var(--green);
  padding: 20px 20px 18px; border-radius: 3px;
}
.kpi .v { font-family: 'Bitter', serif; font-weight: 800; font-size: 30px; color: var(--green);
  line-height: 1; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12.5px; color: var(--ink-soft); }
.kpi.orange { border-top-color: var(--orange); }
.kpi.orange .v { color: var(--orange); }
.kpi.gold { border-top-color: var(--gold); }
.kpi.gold .v { color: var(--grey); }

.citation { margin-top: 14px; font-size: 11.5px; color: var(--ink-soft); font-style: italic; }

/* ---------------- SEZ cards ---------------- */
.sez-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.sez-card {
  display: block; text-decoration: none; color: inherit; background: var(--raised);
  border: 1px solid var(--line); border-left: 4px solid var(--pending);
  padding: 20px 22px; border-radius: 3px; cursor: pointer;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.sez-card:hover { box-shadow: 0 10px 26px var(--shadow); transform: translateY(-2px); }
.sez-card.active { border-left-color: var(--green); }
.sez-card.report { border-left-color: var(--orange); }
.sez-card h3 { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.sez-card .meta { font-size: 12px; color: var(--orange); letter-spacing: .03em; margin-bottom: 10px;
  text-transform: uppercase; font-weight: 600; }
.sez-card .sector { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 12px; }

/* ---------------- executive snapshot cards ---------------- */
.snap-group { margin-top: 30px; }
.snap-group:first-of-type { margin-top: 18px; }
.snap-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.snap-group-head h3 { font-size: 15px; font-weight: 700; color: var(--ink); text-transform: uppercase;
  letter-spacing: .04em; }
.snap-group-head .cnt { font-size: 12px; color: var(--ink-soft); }
.snap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.snap-card { display: flex; flex-direction: column; background: var(--raised); border: 1px solid var(--line);
  border-top: 3px solid var(--orange); border-radius: 3px; padding: 18px 20px; }
.snap-card .snh { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  margin-bottom: 8px; }
.snap-card h4 { font-size: 15.5px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.snap-card .score { flex: none; text-align: right; }
.snap-card .score .v { font-size: 19px; font-weight: 800; color: var(--green); line-height: 1; }
.snap-card .score .v.weak { color: var(--maroon); }
.snap-card .score .v.developing { color: var(--orange); }
.snap-card .score .b { font-size: 9.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); }
.snap-card .summary { font-size: 12.5px; color: var(--ink-soft); line-height: 1.55; margin-bottom: 8px; }
.snap-card .value { font-size: 12px; color: var(--ink); line-height: 1.5; margin-bottom: 8px; }
.snap-card .value b { color: var(--green); font-weight: 700; }
.snap-card .dti-note { font-size: 11.5px; color: var(--orange); line-height: 1.5; margin-bottom: 14px;
  font-style: italic; }
.snap-card .explore { margin-top: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--green); text-decoration: none; }
.snap-card .explore:hover { text-decoration: underline; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 20px; }
.pill.active { background: rgba(0,101,50,.12); color: var(--green); }
.pill.report { background: rgba(245,130,32,.14); color: var(--orange); }
.pill.pending { background: rgba(88,89,91,.10); color: var(--ink-soft); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; background: var(--green); color: #fff;
  padding: 14px 26px; border-radius: 3px; font-size: 14.5px; font-weight: 600; letter-spacing: .02em;
  border: 2px solid var(--green); box-shadow: 0 2px 8px rgba(0,101,50,.22); text-decoration: none;
  transition: background .18s ease, border-color .18s ease; cursor: pointer;
}
.btn:hover { background: var(--green-deep); border-color: var(--green-deep); }
.btn .arrow { transition: transform .18s ease; }
.btn:hover .arrow { transform: translateX(4px); }
.btn.disabled { background: var(--pending); border-color: var(--pending); box-shadow: none;
  cursor: not-allowed; pointer-events: none; }
.hint { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-soft); }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 3px; }
table.analytics { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
table.analytics th, table.analytics td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
table.analytics th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft);
  background: var(--ivory); font-weight: 700; }
table.analytics td.num { font-variant-numeric: tabular-nums; text-align: right; }
table.analytics tr.muted td { color: var(--pending); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.badge.est { background: rgba(0,101,50,.12); color: var(--green); }
.badge.dev { background: rgba(245,130,32,.14); color: var(--orange); }
.badge.pending { background: rgba(88,89,91,.10); color: var(--ink-soft); }

/* ---------------- province groups ---------------- */
.province-group { margin-bottom: 30px; }
.province-group h3 { font-size: 15px; color: var(--maroon); font-weight: 700; margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 2px solid var(--maroon); display: inline-block; }

/* ---------------- module list ---------------- */
.module-list { display: grid; gap: 10px; }
.module-row { display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 16px; background: var(--raised); border: 1px solid var(--line); border-radius: 3px; }
.module-row .n { font-family: 'Bitter', serif; font-weight: 800; font-size: 18px; color: var(--gold); text-align: center; }
.module-row .name { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.module-row .note { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.module-row .code { font-size: 11px; color: var(--ink-soft); font-family: monospace; }

/* ---------------- report list ---------------- */
.report-list { display: grid; gap: 8px; }
.report-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--raised); border: 1px solid var(--line); border-radius: 3px;
  text-decoration: none; color: inherit; transition: border-color .15s ease; }
.report-row:hover { border-color: var(--orange); }
.report-row .rname { font-size: 13.5px; font-weight: 600; }
.report-row .rmeta { font-size: 12px; color: var(--ink-soft); }

/* ---------------- placeholder detail ---------------- */
.detail-card { background: var(--raised); border: 1px solid var(--line); border-top: 4px solid var(--pending);
  padding: 34px 36px; border-radius: 3px; max-width: 760px; }
.detail-card.active { border-top-color: var(--green); }
.detail-card.report { border-top-color: var(--orange); }
.detail-card h2 { font-size: 26px; color: var(--ink); margin-bottom: 6px; }
.detail-card .prov { font-size: 13px; color: var(--orange); text-transform: uppercase; letter-spacing: .04em;
  font-weight: 600; margin-bottom: 18px; }
.detail-card dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 13.5px; margin: 18px 0; }
.detail-card dt { color: var(--ink-soft); }
.detail-card dd { margin: 0; }
.detail-card .note-box { margin-top: 18px; padding: 14px 16px; background: var(--ivory); border-radius: 3px;
  font-size: 12.5px; color: var(--ink-soft); }

/* ---------------- IP notice + footer ---------------- */
.ip { margin: 70px 0 0; padding: 26px 30px; background: var(--raised); border: 1px solid var(--line);
  border-top: 3px solid var(--gold); }
.ip h4 { font-family: 'Bitter', serif; font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--orange); margin: 0 0 12px; font-weight: 700; }
.ip p { margin: 0 0 10px; font-size: 12px; line-height: 1.65; color: var(--ink-soft); }
.ip p:last-child { margin-bottom: 0; color: var(--ink); }

footer { margin-top: 50px; border-top: 1px solid var(--line); }
footer .wrap { padding: 26px 28px; font-size: 12.5px; color: var(--ink-soft);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

main.wrap { padding-bottom: 30px; overflow-x: clip; }
.view { display: none; position: relative; }
.view.active { display: block; }

/* ---------------- mosaic decoration system ----------------
   Reusable crops of the one real mosaic artwork (assets/mosaic-pattern.svg),
   framed via background-position/background-size so each placement can show
   a different region at a different scale without needing separate files. */
.crest-deco {
  position: absolute; pointer-events: none; z-index: 0;
  background-image: url('assets/mosaic-pattern.svg');
  background-repeat: no-repeat;
}
.crest-deco.full { background-size: contain; }
.crest-deco.crop-top { background-size: 210% auto; background-position: 60% 0%; }
.crest-deco.crop-mid { background-size: 230% auto; background-position: 35% 45%; }
.crest-deco.crop-bird { background-size: 260% auto; background-position: 0% 100%; }
.crest-deco.flip { transform: scaleX(-1); }

.crest-deco.pos-tr { top: 0; right: -16px; }
.crest-deco.pos-br { bottom: -16px; right: -16px; }
.crest-deco.pos-tl { top: 0; left: -16px; }
.crest-deco.pos-bl { bottom: -16px; left: -16px; }

.crest-deco.sz-xs { width: 72px; height: 72px; }
.crest-deco.sz-sm { width: 110px; height: 110px; }
.crest-deco.sz-md { width: 170px; height: 170px; }
.crest-deco.sz-lg { width: 240px; height: 280px; }

/* A small decoration anchored to the page header only - sized well under the
   header's own natural height (measured, not guessed) so it can never reach
   down into a grid, table or card list below, without clipping the header's
   own text (no overflow:hidden - the paragraph's height stays whatever it
   needs to be). */
.view-header { position: relative; }
.view-header .crest-deco { top: 2px; }

@media (max-width: 720px) {
  .crest-deco { display: none; }
}
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  color: var(--green); text-decoration: none; margin-bottom: 22px; cursor: pointer; background: none; border: none; padding: 0; }

@media (max-width: 720px) {
  .topbar .wrap { flex-wrap: wrap; padding: 14px 18px; }
  .dtic-logo { height: 32px; }
  .topbar .id { font-size: 12.5px; padding-left: 10px; }
  .topbar .id small { font-size: 9px; }
  .topnav { width: 100%; justify-content: flex-start; gap: 2px; overflow-x: auto;
    -webkit-overflow-scrolling: touch; padding-top: 4px; }
  .topnav button { padding: 8px 8px; white-space: nowrap; font-size: 12.5px; }
  .hero { padding: 34px 0 26px; }
  .crest.tl, .crest.br { display: none; }
  .btn { width: 100%; justify-content: center; }
  .detail-card { padding: 24px 22px; }
}
