/* ============================================================
   Apptad Design System — Navigate demo for PwC
   Brand: Navy #262F56 · Orange #FF9900 · Inter
   ============================================================ */
:root {
  --navy: #262f56;
  --navy-800: #1d2444;
  --navy-900: #151a33;
  --navy-100: #e8eaf3;
  --navy-200: #cdd2e4;
  --orange: #ff9900;
  --orange-600: #e68a00;
  --orange-100: #fff3e0;
  --bg: #f4f5fa;
  --surface: #ffffff;
  --ink: #1c2237;
  --muted: #6b7290;
  --line: #e3e6f0;
  --green: #1e9e6a;
  --green-100: #e3f6ee;
  --red: #d64545;
  --red-100: #fdeaea;
  --amber: #d97706;
  --amber-100: #fef3e2;
  --blue: #2f6fed;
  --blue-100: #e9f0fe;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 34, 55, .06), 0 6px 24px rgba(28, 34, 55, .07);
  --shadow-lg: 0 8px 40px rgba(28, 34, 55, .16);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 28px; height: 64px;
}
.topbar .logo { height: 36px; display: block; }
.topbar .divider { width: 1px; height: 28px; background: var(--line); }
.product-name { font-weight: 700; font-size: 15px; color: var(--navy); letter-spacing: -.01em; }
.product-name span { color: var(--orange); }
.topbar .env-chip {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px;
}
.env-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* ---------- Scene nav ---------- */
.scene-nav {
  position: sticky; top: 64px; z-index: 99;
  display: flex; gap: 6px; align-items: center;
  background: var(--navy); padding: 10px 28px;
}
.scene-tab {
  display: flex; align-items: center; gap: 9px;
  background: transparent; border: 1px solid transparent;
  color: rgba(255,255,255,.62); font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: 9px; transition: all .18s;
}
.scene-tab .num {
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 6px;
  background: rgba(255,255,255,.12); font-size: 11px; font-weight: 700;
}
.scene-tab:hover { color: #fff; background: rgba(255,255,255,.07); }
.scene-tab.active { color: #fff; background: rgba(255,255,255,.1); border-color: rgba(255,153,0,.55); }
.scene-tab.active .num { background: var(--orange); color: var(--navy); }
.scene-nav .story {
  margin-left: auto; color: rgba(255,255,255,.5);
  font-size: 12px; font-style: italic;
}

/* ---------- Layout ---------- */
.scene { display: none; max-width: 1320px; margin: 0 auto; padding: 26px 28px 80px; }
.scene.active { display: block; animation: sceneIn .35s ease; }
@keyframes sceneIn { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }

.scene-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.scene-header h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--navy); }
.scene-header .sub { color: var(--muted); font-size: 13px; margin-top: 3px; max-width: 720px; }
.scene-header .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.grid { display: grid; gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px;
}
.card h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 700; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.card h3 .spacer { margin-left: auto; }

/* ---------- Chips, badges, buttons ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.chip.green { background: var(--green-100); color: var(--green); }
.chip.red { background: var(--red-100); color: var(--red); }
.chip.amber { background: var(--amber-100); color: var(--amber); }
.chip.blue { background: var(--blue-100); color: var(--blue); }
.chip.navy { background: var(--navy-100); color: var(--navy); }
.chip.orange { background: var(--orange-100); color: var(--orange-600); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; border-radius: 9px; font-weight: 700; font-size: 13px;
  padding: 9px 18px; transition: all .15s;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-600); transform: translateY(-1px); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-800); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--navy-200); background: var(--bg); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

select.control, input.control {
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--ink); outline: none;
}
select.control:focus, input.control:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,153,0,.15); }

/* ---------- KPI strip ---------- */
.kpis { grid-template-columns: repeat(6, 1fr); margin-bottom: 16px; }
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi .value { font-size: 26px; font-weight: 800; letter-spacing: -.03em; color: var(--navy); margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 11.5px; font-weight: 600; margin-top: 4px; color: var(--muted); }
.kpi.hero { background: var(--navy); border-color: var(--navy); }
.kpi.hero .label { color: rgba(255,255,255,.65); }
.kpi.hero .value { color: var(--orange); }
.kpi.hero .delta { color: rgba(255,255,255,.6); }
.kpi .flash { animation: valFlash .8s ease; }
@keyframes valFlash { 0% { color: var(--green); transform: scale(1.06) } 100% { transform: none } }
.kpi.hero .flash { animation: valFlashHero .8s ease; }
@keyframes valFlashHero { 0% { color: #7dffc0; transform: scale(1.06) } 100% { transform: none } }

/* countdown */
.countdown { display: flex; gap: 5px; align-items: baseline; margin-top: 6px; flex-wrap: nowrap; }
.countdown .unit { text-align: center; min-width: 0; }
.countdown .n {
  font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--navy);
  background: var(--bg); border: 1px solid var(--line); border-radius: 7px;
  padding: 3px 5px; display: block; min-width: 34px; font-variant-numeric: tabular-nums;
}
.countdown .u { font-size: 9.5px; text-transform: uppercase; color: var(--muted); font-weight: 700; letter-spacing: .05em; }
.kpi.deadline .value { font-size: 15px; color: var(--red); font-weight: 800; margin-top: 8px; }

/* ---------- Tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .15s; }
table.data tbody tr:hover { background: #fafbfe; }
tr.leaving { animation: rowOut .45s ease forwards; }
@keyframes rowOut { to { opacity: 0; transform: translateX(24px) } }
.mono { font-family: var(--mono); font-size: 12px; }
.amt { font-variant-numeric: tabular-nums; font-weight: 700; }
td .vendor-name { font-weight: 600; }
td .vendor-gstin { font-size: 11px; color: var(--muted); font-family: var(--mono); }

.risk-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; }
.risk-bar { width: 44px; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.risk-bar i { display: block; height: 100%; border-radius: 3px; }

.row-actions { display: flex; gap: 6px; }
.act {
  border: 1px solid var(--line); background: var(--surface); border-radius: 7px;
  font-size: 11.5px; font-weight: 700; padding: 5px 10px; transition: all .12s;
}
.act.accept:hover { background: var(--green); border-color: var(--green); color: #fff; }
.act.reject:hover { background: var(--red); border-color: var(--red); color: #fff; }
.act.pend:hover { background: var(--amber); border-color: var(--amber); color: #fff; }

/* ---------- Scene 1 specific ---------- */
.s1-main { grid-template-columns: 2.1fr 1fr; align-items: start; }
.bucket-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.bucket { border-radius: 12px; padding: 14px 16px; border: 1px solid var(--line); background: var(--surface); position: relative; }
.bucket .b-count { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bucket .b-label { font-size: 12px; font-weight: 700; margin-top: 2px; }
.bucket .b-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.bucket::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 4px; }
.bucket.accept::before { background: var(--green); } .bucket.accept .b-count { color: var(--green); }
.bucket.reject::before { background: var(--red); } .bucket.reject .b-count { color: var(--red); }
.bucket.review::before { background: var(--amber); } .bucket.review .b-count { color: var(--amber); }

.alert-vendor {
  border: 1px solid rgba(214,69,69,.35); background: linear-gradient(180deg, #fff, #fff8f8);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 14px;
}
.alert-vendor .head { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--red); font-size: 13px; }
.alert-vendor p { font-size: 12.5px; color: var(--ink); margin-top: 8px; }
.alert-vendor .facts { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.alert-vendor .facts div { font-size: 11px; color: var(--muted); }
.alert-vendor .facts b { display: block; font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }

.cn-clock { display: flex; flex-direction: column; gap: 10px; }
.cn-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.cn-item .cn-meta { flex: 1; min-width: 0; }
.cn-item .cn-doc { font-weight: 700; font-size: 12.5px; }
.cn-item .cn-sub { font-size: 11px; color: var(--muted); }
.cn-badge { font-size: 10.5px; font-weight: 800; padding: 4px 9px; border-radius: 7px; white-space: nowrap; }
.cn-badge.last { background: var(--red-100); color: var(--red); }
.cn-badge.ok { background: var(--amber-100); color: var(--amber); }

.recompute {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
  background: var(--orange-100); border: 1px solid rgba(255,153,0,.4);
  border-radius: 12px; padding: 12px 16px; font-size: 13px;
}
.recompute b { color: var(--orange-600); }
.recompute .btn { margin-left: auto; }
.recompute.done { background: var(--green-100); border-color: rgba(30,158,106,.35); }
.recompute.done b { color: var(--green); }

.chart-box { position: relative; height: 210px; }

/* ---------- Scene 2 ---------- */
.s2-grid { grid-template-columns: 1.05fr 1.5fr; align-items: start; }
.advisory-doc {
  background: #fbfbfd; border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; font-size: 12.5px; line-height: 1.65; max-height: 430px; overflow-y: auto;
}
.advisory-doc .doc-head { display: flex; gap: 10px; align-items: center; border-bottom: 1px dashed var(--navy-200); padding-bottom: 10px; margin-bottom: 10px; }
.advisory-doc .gstn-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 10px; }
.advisory-doc h4 { font-size: 13px; color: var(--navy); }
.advisory-doc .doc-meta { font-size: 11px; color: var(--muted); }
.advisory-doc p { margin-bottom: 8px; }
.advisory-doc .hl { border-radius: 3px; padding: 0 2px; transition: background .4s; }
.advisory-doc.parsed .hl.h-module { background: rgba(47,111,237,.16); }
.advisory-doc.parsed .hl.h-rule { background: rgba(255,153,0,.22); }
.advisory-doc.parsed .hl.h-date { background: rgba(214,69,69,.16); font-weight: 700; }

.adv-text {
  width: 100%; min-height: 260px; resize: vertical;
  border: 1.5px dashed var(--navy-200); border-radius: 10px;
  background: #fbfbfd; padding: 14px; font-family: inherit;
  font-size: 12.5px; line-height: 1.6; color: var(--ink); outline: none;
  transition: border-color .2s;
}
.adv-text:focus { border-color: var(--orange); border-style: solid; background: #fff; }
.adv-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.adv-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--navy-100); color: var(--navy); font-weight: 700; font-size: 11.5px;
  border-radius: 999px; padding: 4px 10px;
}
.adv-chip button { border: none; background: none; color: var(--navy); font-weight: 800; cursor: pointer; }

.copilot-stream { display: flex; flex-direction: column; gap: 12px; }
.copilot-msg { display: flex; gap: 12px; animation: sceneIn .3s ease; }
.copilot-msg .avatar {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px;
  background: var(--navy); display: grid; place-items: center;
}
.copilot-msg .avatar svg { width: 16px; height: 16px; }
.copilot-msg .bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; flex: 1; box-shadow: var(--shadow); }
.copilot-msg .bubble .msg-title { font-weight: 800; font-size: 13px; color: var(--navy); margin-bottom: 6px; }
.typing-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--navy-200); animation: bounce 1s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s } .typing-dots i:nth-child(3) { animation-delay: .3s }
@keyframes bounce { 0%,100% { transform: none; opacity:.5 } 50% { transform: translateY(-4px); opacity: 1 } }

.impact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.impact-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fbfcff; }
.impact-card .ic-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 12.5px; color: var(--navy); }
.impact-card ul { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.impact-card li { font-size: 11.5px; color: var(--ink); display: flex; gap: 6px; align-items: baseline; }
.impact-card li .mono { color: var(--muted); }
.sev { font-size: 9.5px; font-weight: 800; padding: 2px 7px; border-radius: 5px; margin-left: auto; }
.sev.high { background: var(--red-100); color: var(--red); }
.sev.med { background: var(--amber-100); color: var(--amber); }
.sev.low { background: var(--blue-100); color: var(--blue); }

.tc-table td { padding: 7px 10px; font-size: 12px; }
.tc-table .tc-id { font-family: var(--mono); font-weight: 700; color: var(--navy); font-size: 11px; }

.plan-timeline { display: flex; flex-direction: column; gap: 0; margin-top: 4px; }
.plan-step { display: flex; gap: 14px; position: relative; padding-bottom: 16px; }
.plan-step::before { content: ""; position: absolute; left: 9px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.plan-step:last-child::before { display: none; }
.plan-dot { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--navy-200); background: #fff; display: grid; place-items: center; z-index: 1; }
.plan-dot.done { background: var(--green); border-color: var(--green); }
.plan-dot.done::after { content: "✓"; color: #fff; font-size: 10px; font-weight: 800; }
.plan-dot.active { border-color: var(--orange); } .plan-dot.active::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.plan-step .ps-body { flex: 1; }
.plan-step .ps-title { font-weight: 700; font-size: 12.5px; }
.plan-step .ps-sub { font-size: 11px; color: var(--muted); }
.plan-step .ps-date { font-family: var(--mono); font-size: 11px; color: var(--navy); font-weight: 700; white-space: nowrap; }

.deadline-banner {
  display: flex; align-items: center; gap: 14px;
  background: var(--navy); border-radius: 12px; padding: 14px 18px; color: #fff; margin-bottom: 16px;
}
.deadline-banner .db-title { font-weight: 800; font-size: 14px; }
.deadline-banner .db-sub { font-size: 12px; color: rgba(255,255,255,.65); }
.deadline-banner .db-days { margin-left: auto; text-align: right; }
.deadline-banner .db-days b { font-size: 26px; color: var(--orange); font-variant-numeric: tabular-nums; }
.deadline-banner .db-days span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.6); }

/* ---------- Scene 3 ---------- */
.ask-hero { text-align: center; padding: 34px 20px 10px; }
.ask-hero h2 { font-size: 26px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; }
.ask-hero p { color: var(--muted); margin-top: 6px; font-size: 13.5px; }
.ask-bar {
  display: flex; gap: 10px; max-width: 780px; margin: 22px auto 14px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 8px 8px 8px 18px; box-shadow: var(--shadow-lg); align-items: center;
  transition: border-color .2s;
}
.ask-bar:focus-within { border-color: var(--orange); }
.ask-bar svg { flex-shrink: 0; }
.ask-bar input { flex: 1; border: none; outline: none; font-size: 15px; background: transparent; color: var(--ink); }
.suggestions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; max-width: 860px; margin: 0 auto 26px; }
.sugg {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--navy); padding: 7px 14px; transition: all .15s;
}
.sugg:hover { border-color: var(--orange); background: var(--orange-100); }
.answer-wrap { max-width: 980px; margin: 0 auto; }
.sql-peek {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  background: var(--navy-900); color: #9fb0e8; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
  white-space: pre-wrap; overflow-x: auto;
}
.sql-peek .kw { color: var(--orange); }
.insight {
  border-left: 3px solid var(--orange); background: var(--orange-100);
  border-radius: 0 10px 10px 0; padding: 12px 16px; font-size: 13px; margin-top: 14px;
}
.insight b { color: var(--navy); }
.insight .ai-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--orange-600); margin-bottom: 4px; }
.big-chart { position: relative; height: 320px; }
.positioning {
  max-width: 980px; margin: 26px auto 0; display: flex; gap: 12px; align-items: center;
  border: 1px dashed var(--navy-200); border-radius: 12px; padding: 14px 18px; font-size: 12.5px; color: var(--muted);
}
.positioning b { color: var(--navy); }

/* ---------- Intro overlay ---------- */
#intro {
  position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 22px;
  background: radial-gradient(1200px 700px at 70% 20%, #33406f 0%, var(--navy) 45%, var(--navy-900) 100%);
  color: #fff; text-align: center; padding: 30px; transition: opacity .5s, visibility .5s;
}
#intro.hidden { opacity: 0; visibility: hidden; }
#intro .logo-badge { background: #fff; border-radius: 16px; padding: 14px 26px; box-shadow: var(--shadow-lg); }
#intro .logo-badge img { height: 52px; display: block; }
#intro h1 { font-size: clamp(26px, 4vw, 42px); font-weight: 800; letter-spacing: -.02em; max-width: 800px; line-height: 1.2; }
#intro h1 em { color: var(--orange); font-style: normal; }
#intro .intro-sub { color: rgba(255,255,255,.72); font-size: 15px; max-width: 640px; }
#intro .scene-cards { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
#intro .sc {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px; padding: 16px 18px; width: 240px; text-align: left; transition: all .2s; cursor: pointer;
}
#intro .sc:hover { background: rgba(255,255,255,.13); transform: translateY(-3px); border-color: rgba(255,153,0,.6); }
#intro .sc .sc-num { font-size: 11px; font-weight: 800; color: var(--orange); letter-spacing: .1em; }
#intro .sc .sc-title { font-weight: 800; font-size: 14.5px; margin: 5px 0 4px; }
#intro .sc .sc-sub { font-size: 12px; color: rgba(255,255,255,.6); line-height: 1.45; }
#intro .enter { margin-top: 8px; font-size: 14px; padding: 12px 30px; border-radius: 12px; }
#intro .fine { font-size: 11px; color: rgba(255,255,255,.4); }

/* toast */
#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff; font-size: 13px; font-weight: 600;
  padding: 11px 20px; border-radius: 10px; box-shadow: var(--shadow-lg);
  opacity: 0; transition: all .3s; z-index: 600; pointer-events: none; max-width: 90vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .s1-main, .s2-grid { grid-template-columns: 1fr; }
  .scene-nav .story { display: none; }
}
