/* CISO on Demand — design system (matches the client dashboard mockup). */
:root {
  --navy-1: #1a3a5f;
  --navy-2: #0f2742;
  --navy-active-1: #2f63a8;
  --navy-active-2: #274f8c;
  --ink: #1b2a44;
  --ink-soft: #3a4a63;
  --muted: #6b7a90;
  --muted-2: #9aa7b8;
  --line: #e5e9f0;
  --bg: #f3f6fa;
  --card: #ffffff;
  --accent: #2f5aa8;
  --green: #17924e;
  --green-bg: #e8f6ee;
  --amber: #b9770f;
  --amber-bg: #fbf0dc;
  --red: #c0392b;
  --red-bg: #fbe9e7;
  --rag-amber-bg: #fdf6ea;
  --rag-amber-bd: #efd7a4;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.55 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout shell ─────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  flex: 0 0 248px;
  background: linear-gradient(180deg, var(--navy-1), var(--navy-2));
  color: #dbe6f4;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand { padding: 22px 22px 10px; }
.sidebar .brand .name { color: #fff; font-size: 20px; font-weight: 800; letter-spacing: .2px; }
.sidebar .brand .sub { color: #9db4d2; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; margin-top: 2px; }
.nav { padding: 10px 12px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  color: #c3d3e8; padding: 11px 14px; border-radius: 9px; margin-bottom: 2px;
  font-weight: 500; font-size: 14px;
}
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.active {
  background: linear-gradient(90deg, var(--navy-active-1), var(--navy-active-2));
  color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
.nav a .ico { width: 18px; text-align: center; opacity: .9; }
.nav .divider { height: 1px; background: rgba(255,255,255,.10); margin: 10px 14px; }
.tenant-badge {
  margin: 12px; padding: 14px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  display: flex; gap: 11px; align-items: flex-start;
}
.tenant-badge .av {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 34px;
  background: #2f63a8; color: #fff; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.tenant-badge .t-name { color: #fff; font-weight: 700; font-size: 13px; }
.tenant-badge .t-meta { color: #9db4d2; font-size: 11px; }
.tenant-badge .t-sov { color: #7fd3a2; font-size: 11px; margin-top: 4px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── Top bar ──────────────────────────────────────────────────── */
.topbar {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 12px 26px; display: flex; align-items: center; gap: 18px;
  position: sticky; top: 0; z-index: 5;
}
.topbar .ws-name { font-weight: 700; font-size: 16px; }
.topbar .ws-sub { color: var(--muted); font-size: 12px; }
.pill-illustrative {
  border: 1px solid var(--rag-amber-bd); color: var(--amber);
  background: var(--rag-amber-bg); border-radius: 20px; padding: 5px 14px;
  font-size: 11px; font-weight: 700; letter-spacing: .4px; white-space: nowrap;
}
.topbar .search {
  flex: 1; max-width: 340px; background: #f1f4f9; border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 14px; color: var(--muted); font-size: 13px;
}
.btn {
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  border-radius: 9px; padding: 9px 16px; font: inherit; font-weight: 600;
  cursor: pointer; font-size: 13px;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; color: #fff; }
.btn-navy { background: #21497e; border-color: #21497e; }
.topbar .spacer { flex: 1; }
.topbar .user { display: flex; align-items: center; gap: 10px; }
.topbar .user .av {
  width: 34px; height: 34px; border-radius: 50%; background: #2f63a8; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px;
}
.topbar .user .u-name { font-weight: 700; font-size: 13px; }
.topbar .user .u-role { color: var(--muted); font-size: 11px; }
.bell { position: relative; color: var(--muted); font-size: 18px; }
.bell .dot {
  position: absolute; top: -6px; right: -8px; background: var(--red); color: #fff;
  border-radius: 10px; font-size: 10px; padding: 0 5px; font-weight: 700;
}

/* ── Content ──────────────────────────────────────────────────── */
.content { padding: 22px 26px 40px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.3px; }
.page-head .sub { color: var(--muted); font-size: 13px; }

.rag {
  border: 1px solid var(--rag-amber-bd); background: var(--rag-amber-bg);
  border-radius: 12px; padding: 10px 18px; display: flex; gap: 20px; align-items: center;
  position: relative;
}
.rag .status { font-weight: 800; font-size: 15px; color: var(--amber); }
.rag .trend { color: var(--green); font-size: 12px; font-weight: 700; }
.rag .lbl { color: var(--muted); font-size: 11px; }
.rag .score { font-size: 28px; font-weight: 800; }
.rag .score small { font-size: 13px; color: var(--muted); font-weight: 600; }
.rag .dot { display:inline-block; width:9px; height:9px; border-radius:50%; background: var(--amber); margin-right:6px; }
.rag.green { border-color:#bfe6cd; background: var(--green-bg); } .rag.green .status { color: var(--green); } .rag.green .dot { background: var(--green); }
.rag.red { border-color:#f0c5c0; background: var(--red-bg); } .rag.red .status { color: var(--red); } .rag.red .dot { background: var(--red); }

/* Cards & grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 20px 22px; box-shadow: 0 1px 2px rgba(20,40,80,.04); }
.card h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); }

.metric-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 16px; }
.metric { background:#fff; border:1px solid var(--line); border-radius:13px; padding:16px 18px; box-shadow: 0 1px 2px rgba(20,40,80,.04); position: relative; }
.metric .m-label { color: var(--ink-soft); font-weight: 700; font-size: 13px; }
.metric .m-value { font-size: 30px; font-weight: 800; margin-top: 6px; }
.metric .m-value small { font-size: 13px; color: var(--muted); font-weight: 600; }
.metric .m-foot { margin-top: 10px; font-size: 12px; font-weight: 700; }
.metric .m-foot.up { color: var(--green); }
.metric .m-foot.warn { color: var(--amber); }
.metric .m-foot.muted { color: var(--muted); font-weight: 600; }

/* Help tooltip - pure CSS (:hover/:focus-within), no JS: a "?" badge pinned to a
   pane's top-right corner (per-pane help, ADR-026 guidance pattern) explaining
   exactly what that number/trend means and how it's derived. */
.help-wrap { position: absolute; top: 10px; right: 10px; }
.help-icon {
  display: flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; border: none;
  background: var(--line); color: var(--muted); font-size: 10px; font-weight: 800;
  line-height: 1; cursor: help; padding: 0;
}
.help-icon:hover, .help-wrap:focus-within .help-icon { background: var(--accent); color: #fff; }
.help-tooltip {
  display: none;
  position: absolute; z-index: 30; top: 22px; right: 0; width: 230px;
  background: var(--ink); color: #fff; padding: 10px 12px; border-radius: 8px;
  font-size: 11.5px; line-height: 1.55; font-weight: 400; text-align: left;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.help-wrap:hover .help-tooltip, .help-wrap:focus-within .help-tooltip { display: block; }

.grid-2 { display: grid; grid-template-columns: 1.65fr 1fr; gap: 16px; align-items: start; }
.stack > * + * { margin-top: 16px; }

/* Feed */
.feed-item { padding: 12px 0; border-top: 1px solid var(--line); }
.feed-item:first-of-type { border-top: none; }
.feed-item .title { font-weight: 700; font-size: 14.5px; margin: 4px 0 2px; }
.feed-item .desc { color: var(--muted); font-size: 13px; }
.feed-head { display:flex; justify-content: space-between; align-items:center; }
.time-ago { color: var(--muted-2); font-size: 12px; float: right; }

.badge { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .5px; padding: 3px 9px; border-radius: 6px; text-transform: uppercase; }
.badge-critical { color: var(--red); background: var(--red-bg); }
.badge-high, .badge-med, .badge-drift { color: var(--amber); background: var(--amber-bg); }
.chip { display:inline-block; font-size:11px; font-weight:700; padding:4px 11px; border-radius: 20px; }
.chip-blue { color: var(--accent); background: #eaf0fb; }
.chip-green { color: var(--green); background: var(--green-bg); }
.chip-amber { color: var(--amber); background: var(--amber-bg); }
.chip-red { color: var(--red); background: var(--red-bg); }
.chip-gray { color: var(--muted-2); background: #f1f3f6; }
.sla { float: right; font-size: 11px; font-weight: 800; padding: 4px 12px; border-radius: 20px; }
.sla-24 { color: var(--red); background: var(--red-bg); }
.sla-48 { color: var(--amber); background: var(--amber-bg); }

/* To-do list */
.todo { display: flex; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.todo:first-of-type { border-top: none; }
.todo .num { color: var(--accent); font-weight: 800; font-size: 16px; flex: 0 0 20px; }
.todo .t-title { font-weight: 700; }
.todo .t-desc { color: var(--muted); font-size: 13px; margin: 2px 0; }
.todo .t-ref { color: var(--accent); font-size: 12px; font-weight: 700; }

/* AI panel */
.ai-panel { border-top: 3px solid var(--accent); }
.ai-panel .ai-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; }
.ai-panel .hy { color: var(--accent); font-weight: 700; margin: 12px 0 6px; }
.ai-panel .summary { font-size: 13px; color: var(--ink-soft); }
.ai-panel .ask-lbl { color: var(--muted); font-size: 12px; margin: 12px 0 6px; }
.ai-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; padding: 0; border: none; }
.ai-pill { border: 1px solid var(--line); background: #f6f8fc; border-radius: 20px; padding: 7px 13px; font-size: 12px; color: var(--ink-soft); font-family: inherit; cursor: pointer; }
.ai-pill:hover { background: #eaf0fb; }
.ask-box { margin-top: 10px; display: flex; border: 1px solid var(--line); border-radius: 9px; padding: 0; color: var(--muted); font-size: 13px; justify-content: space-between; overflow: hidden; }
.ask-box input { flex: 1; border: none; background: none; padding: 9px 13px; font: inherit; color: inherit; }
.ask-box input:focus { outline: none; }
.ask-box button { border: none; background: none; padding: 9px 13px; font: inherit; cursor: pointer; color: var(--accent); }

/* Advisories rail */
.adv-item { display: flex; gap: 10px; padding: 9px 0; }
.adv-item .rd { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: 0 0 9px; }
.rd-red { background: var(--red); } .rd-amber { background: var(--amber); } .rd-gray { background: var(--muted-2); }
.adv-item .a-title { font-weight: 700; font-size: 13.5px; }
.adv-item .a-sub { color: var(--muted); font-size: 12px; }

/* E8 maturity */
.e8-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.e8-row .e8-name { flex: 1; font-size: 13px; }
.e8-bars { display: flex; gap: 5px; }
.e8-seg { width: 34px; height: 8px; border-radius: 4px; background: #e5e9f0; }
.e8-seg.g { background: var(--green); }
.e8-seg.a { background: var(--amber); }
.e8-tag { font-size: 11px; font-weight: 700; width: 110px; text-align: right; }
.e8-tag.warn { color: var(--amber); }
.e8-edit { display: flex; align-items: center; gap: 10px; margin: 0; }
.e8-edit label { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.e8-edit select { font-size: 12px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* Trend chart */
.trend-head { display: flex; justify-content: space-between; align-items: baseline; }

/* Tables (context pages) */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }

.page-foot { color: var(--muted-2); font-size: 12px; text-align: center; padding: 20px; }

.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; background: var(--amber-bg); color: var(--amber); }
.msg-error { background: var(--red-bg); color: var(--red); }
.msg-success { background: var(--green-bg); color: var(--green); }

/* Forms */
input[type=text], input[type=password], input[type=email], select, textarea {
  font: inherit; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; width: 100%; max-width: 420px;
}
label { font-weight: 600; }

/* Forms */
.form-row { margin-bottom: 14px; max-width: 460px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 13px; }
.form-row .help, .helptext { color: var(--muted); font-size: 12px; margin-top: 4px; display: block; }
form p { margin: 0 0 14px; }
form p label { font-weight: 600; font-size: 13px; }
ul.errorlist { color: var(--red); font-size: 12px; margin: 4px 0; padding-left: 16px; }
.checkbox-list label { font-weight: 500; display: block; margin: 4px 0; }

/* Auth screens (login / MFA) */
.auth-wrap { max-width: 420px; margin: 8vh auto; padding: 0 20px; }
.auth-brand { text-align: center; font-weight: 800; font-size: 22px; color: var(--ink); margin-bottom: 18px; }
.auth-brand span { display: block; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.auth-card { padding: 26px 28px; }
.auth-card h1, .auth-h1 { font-size: 20px; margin: 0 0 4px; }
.auth-msgs { background: var(--amber-bg); color: var(--amber); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 14px; }
.auth-err { color: var(--red); font-size: 13px; margin: 8px 0; }
.auth-foot { text-align: center; color: var(--muted-2); font-size: 12px; margin-top: 16px; }
.auth-card input { max-width: none; }

/* Relevance score pill (threat feed) */
.rel { font-weight: 800; font-size: 15px; }
.rel-matters { color: var(--red); } .rel-worth { color: var(--amber); } .rel-bg { color: var(--muted); }
.tech-chip { display:inline-block; background:#eef2f8; padding:2px 9px; border-radius:12px; margin:2px 4px 2px 0; font-size:12px; }

/* Public landing page (signed-out home) */
.btn-outline {
  background: transparent; color: var(--accent); border: 1px solid var(--accent);
  border-radius: 9px; padding: 9px 16px; font: inherit; font-weight: 600;
  cursor: pointer; font-size: 13px; display: inline-block;
}
.btn-outline:hover { background: #eef2f8; text-decoration: none; }
.landing-hero { text-align: center; padding: 36px 0 28px; }
.landing-hero h1 { font-size: 34px; line-height: 1.2; margin: 0 0 14px; color: var(--ink); }
.landing-hero .sub { max-width: 620px; margin: 0 auto 26px; color: var(--ink-soft); font-size: 16px; line-height: 1.5; }
.landing-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.landing-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 30px 0; }
.landing-feature h3 { font-size: 14px; margin: 0 0 6px; color: var(--ink); }
.landing-feature p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }
.landing-feature .ico { font-size: 20px; margin-bottom: 8px; display: block; }
.landing-band {
  background: linear-gradient(180deg, var(--navy-1), var(--navy-2)); color: #fff;
  border-radius: 13px; padding: 28px 26px; text-align: center; margin-top: 10px;
}
.landing-band h2 { margin: 0 0 8px; font-size: 19px; }
.landing-band p { color: #cfd9e8; margin: 0 0 18px; font-size: 14px; }
.landing-band .btn { background: #fff; color: var(--navy-2); border-color: #fff; }
.landing-band .btn:hover { color: var(--navy-2); }
@media (max-width: 900px) {
  .landing-features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .landing-features { grid-template-columns: 1fr; }
  .landing-hero h1 { font-size: 26px; }
}

@media (max-width: 1100px) {
  .metric-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
}

/* Guidance components - two flavours, used consistently across the app instead of
   ad hoc inline styles per page:
   .hint-card    - actionable: something's missing/blocking, here's the one thing
                   to do about it (empty states). Sits at page level.
   .hint-pointer - informational: you already have this, here's what it connects
                   to elsewhere in the app. Lighter weight, sits inline near the
                   relevant data rather than as its own card. */
.hint-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.hint-card strong { color: var(--ink); }
.hint-pointer {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  margin: 10px 0;
}
.hint-pointer .ico { color: var(--accent); flex-shrink: 0; }

/* OSINT scan output pane - a live terminal feel while a check runs (ADR-026) */
.term-pane {
  background: #0f2742;
  color: #d8e3f2;
  border-radius: 8px;
  padding: 12px 14px;
  font: 12px/1.7 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  max-height: 260px;
  overflow-y: auto;
}
.term-line { display: flex; gap: 10px; }
.term-line + .term-line { margin-top: 2px; }
.term-time { color: #6f8bb3; flex-shrink: 0; }
.term-text { white-space: pre-wrap; word-break: break-word; }
.term-done { color: var(--green); font-weight: 700; margin-top: 6px; }
