/* shared/brand.css — Contoso Securities design tokens + base components */
:root {
  --brand-900: #0a1f33;
  --brand-800: #0e2a45;
  --brand-700: #123a5e;
  --brand-500: #1f6feb;
  --brand-400: #3b82f6;
  --teal: #14b8a6;
  --teal-dark: #0f766e;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #0f1c2e;
  --muted: #5b6b7f;
  --border: #dbe3ec;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16,32,48,.08), 0 8px 24px rgba(16,32,48,.06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-500); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px;
  background: linear-gradient(100deg, var(--brand-900), var(--brand-700));
  color: #fff;
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 20;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--teal), var(--brand-400));
  display: grid; place-items: center; font-weight: 800; color: #05131f;
}
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: .2px; }
.brand-tag { font-size: .74rem; opacity: .8; margin-top: -3px; }
.topbar .spacer { flex: 1; }
.pill {
  font-size: .72rem; padding: 3px 10px; border-radius: 999px;
  background: rgba(255,255,255,.14); color: #eaf2ff; border: 1px solid rgba(255,255,255,.18);
}
.pill.ai-on { background: rgba(20,184,166,.22); border-color: rgba(20,184,166,.5); }
.pill.ai-off { background: rgba(217,119,6,.22); border-color: rgba(217,119,6,.5); }

.nav-link {
  color: #dbe7f7; font-size: .82rem; padding: 6px 12px; border-radius: 8px;
}
.nav-link:hover { background: rgba(255,255,255,.1); text-decoration: none; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 16px 18px; }
.card h3 { margin: 0 0 10px; font-size: .95rem; }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 0 0 8px; }

.btn {
  border: none; border-radius: 9px; padding: 9px 16px; font-weight: 600; font-size: .86rem;
  cursor: pointer; background: var(--brand-500); color: #fff; transition: filter .15s;
}
.btn:hover { filter: brightness(1.07); }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.ghost { background: transparent; color: var(--brand-500); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.badge {
  display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.badge.risk-low { background: #e7f6ec; color: var(--green); border-color: #bfe6cb; }
.badge.risk-moderate { background: #fff4e0; color: var(--amber); border-color: #f3ddb0; }
.badge.risk-high, .badge.risk-very-high { background: #fde7e7; color: var(--red); border-color: #f3bcbc; }

.pos { color: var(--green); }
.neg { color: var(--red); }
.muted { color: var(--muted); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand-500), var(--teal));
  flex: none;
}

table.grid { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.grid th { text-align: left; color: var(--muted); font-weight: 600; padding: 7px 8px; border-bottom: 1px solid var(--border); }
table.grid td { padding: 8px; border-bottom: 1px solid var(--surface-2); }

/* Chat / assistant */
.chat { display: flex; flex-direction: column; height: 100%; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px; }
.msg { max-width: 88%; padding: 9px 13px; border-radius: 12px; font-size: .86rem; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--brand-500); color: #fff; border-bottom-right-radius: 3px; }
.msg.bot { align-self: flex-start; background: var(--surface-2); color: var(--text); border-bottom-left-radius: 3px; }
.msg .cite { display: block; margin-top: 6px; font-size: .72rem; color: var(--muted); }
.chat-input { display: flex; gap: 8px; margin-top: 10px; }
.chat-input input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; font-size: .88rem; }
.mic-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-size: 1.05rem;
}
.mic-btn[disabled] { opacity: .55; cursor: not-allowed; }

.flow-step { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--surface-2); }
.flow-num { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-500); color: #fff; display: grid; place-items: center; font-size: .74rem; font-weight: 700; flex: none; }
.chan { font-size: .66rem; text-transform: uppercase; letter-spacing: .5px; padding: 1px 7px; border-radius: 999px; }
.chan.voice { background: #e6f7f4; color: var(--teal-dark); }
.chan.app { background: #eaf1ff; color: var(--brand-500); }
.chan.crm { background: #f0e9ff; color: #7c3aed; }
