/* BDA Demo — global styles. SYNTHETIC DATA ONLY. */
:root {
  --bg: #0a0f1c;
  --bg-soft: #131b2f;
  --bg-card: #182441;
  --border: #1f2d4d;
  --fg: #e9eef8;
  --fg-muted: #9aa6bd;
  --fg-dim: #6b7691;
  --accent: #4ade80;
  --accent-soft: #06321e;
  --warn: #fbbf24;
  --link: #60a5fa;
  --danger: #ef4444;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0,0,0,.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #1f2a44; padding: 1px 6px; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, "Cascadia Code", monospace; font-size: 0.9em; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font: inherit; }

.banner-top {
  background: var(--warn);
  color: #1a1a1a;
  text-align: center;
  font-weight: 600;
  padding: 10px 16px;
  letter-spacing: 0.02em;
  font-size: 0.92rem;
}

header.nav {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(10, 15, 28, 0.85);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
header.nav .brand { font-weight: 700; font-size: 1.15rem; }
header.nav .brand .sub { color: var(--fg-muted); font-weight: 400; font-size: 0.85rem; margin-left: 10px; }
header.nav nav a { margin-left: 18px; color: var(--fg-muted); font-size: 0.92rem; }
header.nav nav a:hover { color: var(--fg); text-decoration: none; }
header.nav nav a.active { color: var(--accent); }

/* Live activity indicator */
.live-dot {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--fg-muted); margin-right: 18px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--border);
}
.live-dot .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--fg-dim);
  box-shadow: 0 0 0 0 rgba(74,222,128, 0.7);
}
.live-dot.online .dot {
  background: var(--accent);
  animation: pulse 1.8s infinite;
}
.live-dot.online #live-text { color: var(--accent); }
.live-dot.stale .dot { background: var(--warn); animation: none; }
.live-dot.stale #live-text { color: var(--warn); }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(74,222,128, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(74,222,128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128, 0); }
}

main { max-width: 1100px; margin: 0 auto; padding: 36px 24px 100px; }

/* Hero */
.hero { padding: 40px 0 30px; }
.hero h1 { font-size: 2.5rem; line-height: 1.15; margin-bottom: 12px; }
.hero h1 .accent { color: var(--accent); }
.hero p.lead { color: var(--fg-muted); font-size: 1.1rem; max-width: 760px; }
.hero .stats { display: flex; gap: 32px; margin-top: 22px; flex-wrap: wrap; }
.hero .stats .stat { display: flex; flex-direction: column; }
.hero .stats .stat .num { font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.hero .stats .stat .lbl { color: var(--fg-muted); font-size: 0.85rem; margin-top: 2px; }

/* Tabs */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin: 30px 0 0; overflow-x: auto; }
.tabs button {
  padding: 12px 18px; color: var(--fg-muted); font-size: 0.95rem; font-weight: 500;
  border-bottom: 2px solid transparent; transition: all .15s ease;
  white-space: nowrap;
}
.tabs button:hover { color: var(--fg); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel { display: none; padding: 30px 0; }
.tab-panel.active { display: block; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card h3 { font-size: 1.1rem; margin-bottom: 12px; color: var(--fg); }
.card .muted { color: var(--fg-muted); font-size: 0.92rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Buttons */
.btn {
  display: inline-block; padding: 10px 18px;
  border-radius: 8px; font-weight: 600; font-size: 0.92rem;
  transition: all .15s ease;
}
.btn-primary { background: var(--accent); color: #052414; }
.btn-primary:hover { filter: brightness(1.08); text-decoration: none; }
.btn-ghost { border: 1px solid var(--border); color: var(--fg); }
.btn-ghost:hover { background: var(--bg-card); text-decoration: none; }

/* Pills */
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.78rem; background: var(--bg-soft); color: var(--fg-muted);
  margin-right: 6px;
}
.pill.green { background: var(--accent-soft); color: var(--accent); }
.pill.warn  { background: #3d2a08; color: var(--warn); }
.pill.red   { background: #3a0d0d; color: var(--danger); }
.pill.blue  { background: #0c2540; color: var(--link); }

/* Inputs */
.input {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; color: var(--fg);
  width: 100%; font-size: 0.95rem;
}
.input:focus { outline: none; border-color: var(--accent); }
label { display: block; color: var(--fg-muted); font-size: 0.85rem; margin-bottom: 6px; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.tbl th { color: var(--fg-muted); font-weight: 500; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }
.tbl tbody tr:hover { background: var(--bg-soft); }
.tbl td.right, .tbl th.right { text-align: right; }
.tbl td.amount { font-family: ui-monospace, SFMono-Regular, monospace; font-weight: 600; }

/* Chat onboarding */
.chat-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg-card) 100%);
}
.chat-header .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-right: 6px;
  animation: pulse 1.8s infinite;
}
.chat-log {
  flex: 1; padding: 18px; min-height: 360px; max-height: 460px;
  overflow-y: auto; background: var(--bg);
  display: flex; flex-direction: column; gap: 10px;
}
.chat-msg { display: flex; }
.chat-msg.chat-ai { justify-content: flex-start; }
.chat-msg.chat-user { justify-content: flex-end; }
.chat-bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 14px;
  font-size: 0.92rem; line-height: 1.45; word-wrap: break-word;
}
.chat-ai .chat-bubble { background: var(--bg-soft); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-user .chat-bubble { background: var(--accent); color: #052414; border-bottom-right-radius: 4px; font-weight: 500; }
.chat-typing .chat-bubble { padding: 12px 16px; }
.chat-typing .chat-bubble .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg-muted); margin: 0 2px;
  animation: typing 1.4s infinite;
}
.chat-typing .chat-bubble .dot:nth-child(2) { animation-delay: 0.18s; }
.chat-typing .chat-bubble .dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.chat-input-row {
  display: flex; gap: 10px; padding: 14px 18px;
  border-top: 1px solid var(--border); background: var(--bg-card);
}
.chat-input-row .input { flex: 1; }

/* Copilot tool-call blocks */
.tool-block {
  margin: 6px 0;
  border-left: 3px solid var(--link);
  background: rgba(96, 165, 250, 0.06);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.86rem;
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.tool-block.tool-pending { border-left-color: var(--warn); background: rgba(251, 191, 36, 0.07); }
.tool-block.tool-done { border-left-color: var(--accent); background: rgba(74, 222, 128, 0.06); }
.tool-block .tool-head {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
}
.tool-block .tool-head .tool-icon { display: inline-block; width: 16px; }
.tool-block .tool-head .tool-name { color: var(--link); font-weight: 600; }
.tool-block .tool-head .tool-status { color: var(--fg-muted); font-size: 0.78rem; margin-left: auto; }
.tool-block.tool-done .tool-head .tool-name { color: var(--accent); }
.tool-block .tool-body {
  margin-top: 8px;
  display: none;
  color: var(--fg-muted);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.8rem;
  max-height: 240px;
  overflow-y: auto;
  background: rgba(0,0,0,0.2);
  padding: 8px 10px;
  border-radius: 4px;
}
.tool-block.open .tool-body { display: block; }
.tool-block .tool-args { color: var(--fg); }

/* Prompt chips */
.prompt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.prompt-chips .chip {
  background: var(--bg-soft); border: 1px solid var(--border);
  color: var(--fg); padding: 6px 12px; border-radius: 999px;
  font-size: 0.82rem; transition: background .12s;
}
.prompt-chips .chip:hover { background: var(--bg-card); border-color: var(--accent); color: var(--accent); }

/* USSD simulator */
.phone {
  max-width: 320px; margin: 0 auto;
  background: #1a1f2e; border-radius: 24px; border: 1px solid #2a3045;
  padding: 24px 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.phone .screen {
  background: #0a0a0a; color: #4ade80;
  font-family: ui-monospace, SFMono-Regular, monospace;
  border-radius: 8px; padding: 14px 14px; min-height: 220px;
  font-size: 0.9rem; line-height: 1.45; white-space: pre-wrap;
}
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.keypad button {
  background: #232940; color: var(--fg);
  padding: 14px; border-radius: 8px; font-size: 1.05rem;
  transition: background .12s ease;
}
.keypad button:hover { background: #2c3554; }
.keypad button:active { background: var(--accent); color: #0a0a0a; }
.keypad button.special { background: #3b1a1a; color: #ff8a8a; }
.keypad button.send    { background: var(--accent-soft); color: var(--accent); }

/* QR */
.qr-card { text-align: center; padding: 30px; }
.qr-card .qr { display: inline-block; padding: 16px; background: white; border-radius: 12px; margin: 16px 0; }
.qr-card .qr canvas, .qr-card .qr img { display: block; }
.qr-card .meta { color: var(--fg-muted); font-size: 0.9rem; }

/* Scoring */
.score-bar { height: 12px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; margin: 12px 0; }
.score-bar > div { height: 100%; transition: width .6s cubic-bezier(.4,0,.2,1); }
.score-text { font-size: 2.4rem; font-weight: 700; }

/* Footer */
footer { margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--fg-dim); font-size: 0.85rem; text-align: center; }
footer p { margin-bottom: 8px; }

/* Utility */
.center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 36px; }
.fg-muted { color: var(--fg-muted); }
.fg-accent { color: var(--accent); }
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
