/* ColorShield ID V2 — Customer Dashboard (enterprise application surface) */
:root {
  color-scheme: dark;
  --bg: #070b16;
  --bg-soft: #0a1020;
  --surface: #0f1626;
  --surface-2: #131c30;
  --field: #0b1222;
  --text: #e3e9f4;
  --muted: #94a2bb;
  --navy: #f1f5fc;
  --metallic: #3b82f6;
  --metallic-deep: #7cb2ff;
  --accent: #38bdf8;
  --line: #1f2a40;
  --line-strong: #2b3a57;
  --ok: #4cc29a;
  --warn: #f2b544;
  --danger: #f27272;
  --ok-bg: rgba(76, 194, 154, 0.12);
  --warn-bg: rgba(242, 181, 68, 0.12);
  --danger-bg: rgba(242, 114, 114, 0.12);
  --info-bg: rgba(96, 150, 250, 0.13);
  --font: "Manrope", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1100px 420px at 15% -8%, rgba(59, 130, 246, 0.13), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  color: var(--text);
  min-height: 100vh;
}
.top {
  padding: 1.15rem 1.5rem 0.65rem;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 16, 32, 0.92);
}
.brand {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--navy);
}
.brand span { color: var(--metallic-deep); text-shadow: 0 0 14px rgba(96, 150, 250, 0.35); }
.sub { color: var(--muted); font-size: 0.85rem; margin-top: 0.1rem; }
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  padding: 0.7rem 1.5rem;
  border-bottom: 1px solid var(--line);
  align-items: center;
  background: rgba(12, 19, 36, 0.92);
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--navy); box-shadow: inset 0 -2px 0 var(--metallic); padding-bottom: 0.2rem; }
.nav a:focus-visible, .btn:focus-visible, .subnav a:focus-visible { outline: 2px solid var(--metallic-deep); outline-offset: 2px; }
.nav .logout { margin-left: auto; }
.nav button, .btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  display: inline-block;
}
.btn-primary {
  border-color: var(--metallic);
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(124, 178, 255, 0.15), 0 4px 14px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover { background: linear-gradient(180deg, #4b8ef8, #2f6df0); }
.btn:hover { border-color: var(--line-strong); }
.meta { padding: 0.45rem 1.5rem; color: var(--muted); font-size: 0.82rem; margin: 0; background: transparent; }
.main { padding: 1.35rem 1.5rem 3rem; max-width: 980px; }
h1 { font-size: 1.4rem; margin: 0 0 0.35rem; color: var(--navy); }
h2 { font-size: 1.05rem; margin: 1.6rem 0 0.7rem; color: var(--navy); font-weight: 600; }
.lede { color: var(--muted); margin: 0 0 1.1rem; font-size: 0.92rem; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.95rem 1rem;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.06);
}
.stat .k { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stat .v { font-size: 1.05rem; margin-top: 0.35rem; font-weight: 600; color: var(--navy); }
.stat .v.mono { font-family: var(--mono); font-size: 0.95rem; font-weight: 500; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; background: var(--surface-2); }
tr:last-child td { border-bottom: none; }
code, .mono { font-family: var(--mono); font-size: 0.85em; }
.banner {
  padding: 0.7rem 0.9rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
}
.banner.err { border-color: rgba(242, 114, 114, 0.4); color: var(--danger); background: var(--danger-bg); }
.banner.ok { border-color: rgba(76, 194, 154, 0.4); color: var(--ok); background: var(--ok-bg); }
.login-wrap {
  max-width: 420px;
  margin: 2rem auto;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1.6rem;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(96, 150, 250, 0.06);
}
label { display: block; margin: 0.75rem 0 0.3rem; color: var(--muted); font-size: 0.85rem; font-weight: 500; }
input[type="email"], input[type="password"], input[type="text"] {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--field);
  color: var(--text);
  font: inherit;
}
input[readonly] { background: var(--surface-2); color: var(--muted); }
.foot {
  padding: 1rem 1.5rem 2rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.pager { margin-top: 1rem; display: flex; gap: 1rem; align-items: center; }
.note { color: var(--muted); font-size: 0.85rem; }
.empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 1.25rem 1rem;
  color: var(--muted);
}
.status-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--info-bg);
  color: var(--metallic-deep);
}
.status-pill.warn { background: var(--warn-bg); color: var(--warn); }
.status-pill.ok { background: var(--ok-bg); color: var(--ok); }
.status-pill.bad { background: var(--danger-bg); color: var(--danger); }
.verify-panel table.detail {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.verify-panel table.detail th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  width: 10rem;
  padding: 0.35rem 0.5rem 0.35rem 0;
  vertical-align: top;
}
.verify-panel table.detail td {
  padding: 0.35rem 0;
}
table.detail {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.detail th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  width: 10rem;
  padding: 0.35rem 0.5rem 0.35rem 0;
  vertical-align: top;
}
table.detail td { padding: 0.35rem 0; }
.mini-form {
  display: grid;
  gap: 0.65rem;
  max-width: 32rem;
}
.mini-form .field {
  display: grid;
  gap: 0.25rem;
  font-size: 0.88rem;
}
.mini-form .field span { color: var(--muted); font-weight: 600; }
.mini-form input, .mini-form select {
  font: inherit;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--text);
}
.onboarding-progress {
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.1rem;
}
.onboarding-progress h2 { margin-top: 0; }
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.steps li.done { color: var(--ok); font-weight: 600; }
.steps .mark { font-family: var(--mono); width: 1.1rem; }
.ops-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: end;
  margin: 1.1rem 0 1.25rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.ops-filters label {
  margin: 0;
  display: grid;
  gap: 0.25rem;
  font-size: 0.82rem;
}
.ops-filters label span { color: var(--muted); font-weight: 600; }
.ops-filters select {
  font: inherit;
  min-width: 9rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--text);
}
.ops-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.ops-layout:has(.ops-detail) {
  grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 0.9fr);
}
.ops-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  position: sticky;
  top: 0.75rem;
}
.ops-detail h2 { margin-top: 0; }
.ops-table { min-width: 0; overflow-x: auto; }
@media (max-width: 900px) {
  .ops-layout:has(.ops-detail) { grid-template-columns: 1fr; }
  .ops-detail { position: static; }
}
@media (max-width: 640px) {
  .nav .logout { margin-left: 0; width: 100%; }
}

/* Security Operations analytics (Phase 3B) */
.ops-summary { margin-bottom: 0.25rem; }
.ops-panel {
  margin: 1.25rem 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.1rem;
}
.ops-panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.ops-analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 900px) {
  .ops-analytics-grid { grid-template-columns: 1fr; }
}
table.compact { font-size: 0.9rem; }
.incident-summary {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  color: var(--text);
  line-height: 1.45;
}
.incident-summary li { margin: 0.25rem 0; }
.trend-chart { margin-top: 0.5rem; }
.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
}
.trend-legend span::before {
  content: "";
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  margin-right: 0.35rem;
  border-radius: 2px;
  vertical-align: -0.05rem;
}
.lg-ok::before { background: var(--ok); }
.lg-warn::before { background: var(--warn); }
.lg-bad::before { background: var(--danger); }

/* Phase 5B — dark enterprise surface additions */
a { color: var(--metallic-deep); }
a:hover { color: var(--navy); }
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
}
.subnav a {
  font-size: 0.85rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  background: var(--surface);
}
.subnav a.on { color: var(--navy); border-color: rgba(96, 150, 250, 0.55); background: var(--info-bg); }
.section-title { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1.4rem 0 0.6rem; }
.stat .v .of { color: var(--muted); font-size: 0.78rem; font-weight: 400; }
.stat .v.small { font-size: 0.82rem; }
.stat .v.is-warn { color: var(--warn); }
.stat .v.is-bad { color: var(--danger); }
.muted { color: var(--muted); }
pre { color: var(--text); border: 1px solid var(--line); }

/* Trend chart (inline SVG — CSP-safe, no inline styles) */
.trend-svg { display: block; width: 100%; height: 9rem; border-bottom: 1px solid var(--line); }
.trend-svg .t-ok { fill: var(--ok); }
.trend-svg .t-warn { fill: var(--warn); }
.trend-svg .t-blocked { fill: var(--danger); }
.trend-svg .t-empty { fill: var(--line-strong); }
.trend-axis { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--muted); margin-top: 0.3rem; font-family: var(--mono); }

/* Utility classes replacing inline styles (CSP style-src has no 'unsafe-inline') */
.mt-075 { margin-top: 0.75rem; }
.mt-1 { margin-top: 1rem; }
.mt-125 { margin-top: 1.25rem; }
.mt-15 { margin-top: 1.5rem; }
.mb-035 { margin: 0 0 0.35rem; }
.mb-05 { margin: 0 0 0.5rem; }
.mb-075 { margin: 0 0 0.75rem; }
.ml-05 { margin-left: 0.5rem; }
.card-title { font-size: 1.05rem; }
.break-all { word-break: break-all; }
.inline { display: inline; }
.actions-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.code-block { white-space: pre-wrap; background: var(--field); padding: 1rem; border-radius: 8px; font-size: 0.78rem; }

/* Responsive tables: scroll inside their panel instead of widening the page */
.ops-panel, .onboarding-progress, .ops-table { overflow-x: auto; }
.main { min-width: 0; overflow-wrap: anywhere; }
time { white-space: nowrap; }
@media (max-width: 640px) {
  .main { padding: 1rem 1rem 2.5rem; }
  .top, .nav, .meta { padding-left: 1rem; padding-right: 1rem; }
  table.compact th, table.compact td { padding: 0.5rem 0.55rem; }
}
.stat time { white-space: normal; }

/* Phase 5G-B1 onboarding next step + field explanations */
.next-step { border: 1px solid var(--border, rgba(127, 140, 170, 0.3)); border-radius: 10px; padding: 0.9rem 1rem; }
.next-step .k { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.75; }
.next-step h3 { margin: 0.25rem 0 0.35rem; }
.steps li .note { display: block; font-weight: 400; margin-left: 1.6rem; }
.explain { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; font-size: 0.9rem; }
.explain dt { font-weight: 700; }
.explain dd { margin: 0; }
@media (max-width: 640px) { .explain { grid-template-columns: 1fr; } }
