/* Design tokens lifted directly from the DIOS.dc.html design-system export
   (claude.ai/design project d52a66af, file DIOS.dc.html) -- same palette,
   type scale, spacing and card language as the full 82-screen product
   design. Only 4 screens are wired to real data here; see app.js. */

@import url('https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300..800;1,400&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #eef0f3;
  --card: #fff;
  --border: #dfe3e9;
  --border-hover: #b9c0cc;
  --divider: #eceff3;
  --divider-soft: #f2f4f7;
  --tint: #f7f8fa;
  --tint-2: #fafbfc;

  --text: #0f1420;
  --text-2: #2b3444;
  --text-3: #5b6472;
  --text-4: #8b94a3;

  --blue: #2258d8;
  --blue-hover: #17408f;
  --purple: #6b39c9;
  --purple-hover: #5a2eb0;
  --purple-bg: #faf8ff;
  --purple-bg-2: #f7f5fd;
  --purple-border: #e4dcf7;
  --red: #c22e2e;
  --red-dark: #8f1f1f;
  --red-bg: #fdf6f6;
  --amber: #b06f00;
  --amber-dark: #7d4f00;
  --green: #147a4a;
  --green-dark: #0e5a36;

  --nav-bg: #0f1420;
  --nav-text: #aab3c0;
  --nav-border: #1c2333;
  --nav-label: #4d5871;
  --nav-dot: #3a4a68;

  --radius: 3px;
}

* , *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  font-family: 'Public Sans', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  font-size: 13px;
  letter-spacing: -0.005em;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); text-decoration: underline; }
.mono { font-family: 'IBM Plex Mono', monospace; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c8cdd6; border-radius: 6px; border: 3px solid transparent; background-clip: content-box; }
@keyframes diosPulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }

#app { display: flex; height: 100vh; overflow: hidden; }

/* ---- sidebar ---- */
.sidebar {
  width: 220px; flex: 0 0 auto;
  background: var(--nav-bg); color: var(--nav-text);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-head {
  height: 56px; flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; border-bottom: 1px solid var(--nav-border);
}
.sidebar-logo {
  width: 22px; height: 22px; border-radius: 3px; background: var(--blue);
  display: grid; place-items: center; font-weight: 800; font-size: 11px; color: #fff;
  font-family: 'IBM Plex Mono', monospace;
}
.sidebar-title { color: #fff; font-weight: 700; font-size: 14px; line-height: 1.1; white-space: nowrap; }
.sidebar-sub { font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--nav-label); white-space: nowrap; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 0 24px; }
.nav-group-label {
  padding: 0 14px 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .12em;
  color: var(--nav-label); text-transform: uppercase; white-space: nowrap;
}
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 14px;
  font-size: 12px; font-weight: 600; color: var(--nav-text); cursor: pointer;
  border-inline-start: 2px solid transparent; white-space: nowrap;
}
.nav-item:hover { color: #fff; background: #1b2436; }
.nav-item.active { color: #fff; background: #1b2436; border-inline-start-color: var(--blue); }
.nav-item.disabled { cursor: default; opacity: .55; }
.nav-item.disabled:hover { color: var(--nav-text); background: transparent; }
.nav-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--nav-dot); flex: 0 0 auto; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-badge { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--nav-label); }
.sidebar-foot {
  flex: 0 0 auto; border-top: 1px solid var(--nav-border); padding: 10px 14px;
  font-size: 10.5px; color: var(--nav-label); display: flex; align-items: center; gap: 8px;
}
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: diosPulse 2.4s infinite; }
.pulse-dot.bad { background: var(--red); animation: none; }

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

.topbar {
  height: 56px; flex: 0 0 auto; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
}
.screen-title { font-size: 14px; font-weight: 700; white-space: nowrap; }
.screen-sub { font-size: 11px; color: var(--text-4); white-space: nowrap; }
.spacer { flex: 1; }
.btn {
  height: 30px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; border-radius: var(--radius); font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
}
.btn:hover { border-color: var(--border-hover); }
.btn.primary { background: var(--blue); color: #fff; border: none; }
.btn.primary:hover { background: var(--blue-hover); }
.btn.ai { background: var(--purple); color: #fff; border: none; }
.btn.ai:hover { background: var(--purple-hover); }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn[disabled]:hover, .btn.disabled:hover { border-color: var(--border); background: #fff; }

.context-bar {
  height: 40px; flex: 0 0 auto; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 16px; font-size: 10.5px; color: var(--text-3);
}
.freshness { display: flex; align-items: center; gap: 5px; }
.freshness .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.freshness .dot.stale { background: var(--amber); }

.content { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px 60px; }

/* ---- shared card components ---- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--divider);
  font-size: 12.5px; font-weight: 700;
}
.card-head .sub { font-size: 10.5px; font-weight: 400; color: var(--text-4); }

.kpi-row { display: grid; gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 12px; }
.kpi-label { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-4); }
.kpi-value { font-family: 'IBM Plex Mono', monospace; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-top: 7px; }
.kpi-note { margin-top: 8px; font-size: 10.5px; color: var(--text-4); }

.pill {
  display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 2px; text-transform: uppercase;
}
.pill.critical { background: var(--red); color: #fff; }
.pill.high { background: #fbeaea; color: var(--red-dark); border: 1px solid #f0cccc; }
.pill.medium { background: #fdf3e0; color: var(--amber-dark); border: 1px solid #f2ddad; }
.pill.low { background: #eaf5ef; color: var(--green-dark); border: 1px solid #cfe9dc; }
.pill.open { background: var(--tint-2); color: var(--text-2); border: 1px solid var(--border); }

.table { width: 100%; border-collapse: collapse; }
.table-wrap { overflow-x: auto; }
.table-head-row {
  display: grid; padding: 9px 14px; border-bottom: 1px solid var(--divider); background: var(--tint-2);
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-4);
  min-width: 860px; gap: 10px;
}
.table-row {
  display: grid; padding: 10px 14px; border-bottom: 1px solid var(--divider-soft); align-items: center; font-size: 12px;
  min-width: 860px; gap: 10px;
}
.table-row.clickable { cursor: pointer; }
.table-row.clickable:hover { background: var(--tint); }
.end { text-align: end; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty-state { padding: 40px 20px; text-align: center; color: var(--text-4); font-size: 12.5px; }
.error-state {
  padding: 12px 14px; background: var(--red-bg); border: 1px solid #f0cccc; border-radius: var(--radius);
  color: var(--red-dark); font-size: 12.5px; margin-bottom: 14px;
}
.not-real {
  font-size: 10.5px; color: var(--text-4); background: var(--tint-2); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 8px 10px; margin-top: 6px;
}

.stage-strip { display: flex; align-items: center; gap: 0; }
.stage { display: flex; align-items: center; gap: 7px; flex: 1; }
.stage-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.stage-line { flex: 1; height: 1px; background: var(--border); }
.stage-line:last-child { display: none; }

.badge-ai {
  font-size: 8.5px; font-weight: 800; letter-spacing: .08em; padding: 2px 6px; border-radius: 2px;
  background: var(--purple-bg-2); color: var(--purple);
}

.ai-box {
  background: var(--purple-bg); border: 1px solid var(--purple-border); border-inline-start: 3px solid var(--purple);
  border-radius: var(--radius); padding: 14px 15px;
}

.spin {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--blue);
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- login ---- */
.login-screen {
  height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--nav-bg);
}
.login-card {
  width: 340px; background: var(--card); border: 1px solid var(--border); border-radius: 4px;
  padding: 32px 28px; display: flex; flex-direction: column;
}
.login-title { font-size: 20px; font-weight: 800; color: var(--text); }
.login-sub { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-4); margin-bottom: 22px; }
.login-label { display: block; font-size: 11px; font-weight: 600; color: var(--text-3); margin-bottom: 5px; margin-top: 12px; }
.login-input {
  display: block; width: 100%; height: 36px; border: 1px solid var(--border); border-radius: 3px; padding: 0 10px;
  font-size: 13px; font-family: inherit; color: var(--text);
}
.login-input:focus { outline: none; border-color: var(--blue); }
.login-error {
  margin-top: 12px; padding: 8px 10px; background: var(--red-bg); border: 1px solid #f0cccc; border-radius: 3px;
  color: var(--red-dark); font-size: 12px;
}

/* ---- user menu ---- */
.user-menu { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; white-space: nowrap; }
.user-menu .who { text-align: end; }
.user-menu .name { font-size: 11.5px; font-weight: 600; color: var(--text); }
.user-menu .role { font-size: 9.5px; color: var(--text-4); text-transform: uppercase; letter-spacing: .06em; }
.user-menu .avatar {
  width: 30px; height: 30px; border-radius: 3px; background: var(--text); color: #fff; display: grid;
  place-items: center; font-size: 11px; font-weight: 700; flex: 0 0 auto;
}
.user-menu .logout { cursor: pointer; color: var(--text-4); font-size: 11px; }
.user-menu .logout:hover { color: var(--red); }
.login-back { text-align: center; margin-top: 16px; font-size: 11.5px; color: var(--text-4); cursor: pointer; }
.login-back:hover { color: var(--blue); }
.login-switch { text-align: center; margin-top: 14px; font-size: 12px; color: var(--text-3); }
.login-switch span { color: var(--blue); font-weight: 600; cursor: pointer; }
.login-switch span:hover { text-decoration: underline; }
.landing-link { font-size: 12.5px; font-weight: 600; color: #c7cfe8; cursor: pointer; }
.landing-link:hover { color: #fff; }

/* ---- auth shell: shared dark topbar over landing/signin/signup ---- */
#auth-shell { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto; }
.auth-topbar { height: 56px; flex: 0 0 auto; display: flex; align-items: center; gap: 16px; padding: 0 24px; background: var(--nav-bg); }
.auth-topbar-sub { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--nav-label); margin-inline-start: 4px; }
.auth-topbar-link { font-size: 12px; color: var(--nav-text); cursor: pointer; font-weight: 600; }
.auth-topbar-link:hover { color: #fff; }

/* ---- landing page (matches DIOS.dc.html's isLanding block) ---- */
.landing { background: var(--bg); color: var(--text); }
.landing-nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 14px; }
.landing-section-inner { max-width: 1080px; margin: 0 auto; padding: 0 40px; }
.landing-kicker { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-4); }
.landing-h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; margin-top: 12px; text-wrap: pretty; }
.landing-p { font-size: 14px; line-height: 1.7; color: var(--text-3); margin-top: 16px; text-wrap: pretty; }

.landing-hero-full { background: var(--nav-bg); padding: 72px 40px 64px; }
.landing-hero-full > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.landing-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 11px; color: var(--nav-text);
  border: 1px solid var(--nav-border); border-radius: 999px; padding: 5px 11px;
}
.landing-eyebrow-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--purple); }
.landing-title-full {
  color: #fff; font-size: 46px; line-height: 1.12; font-weight: 700; letter-spacing: -0.03em;
  margin-top: 22px; max-width: 820px; text-wrap: pretty;
}
.landing-sub-full { color: var(--nav-text); font-size: 16px; line-height: 1.6; margin-top: 18px; max-width: 640px; text-wrap: pretty; }
.landing-cta { display: flex; gap: 10px; margin-top: 28px; }
.landing-stat-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-top: 52px; }
.landing-stat { padding: 16px; border: 1px solid var(--nav-border); border-radius: 3px; }
.landing-stat-value { font-family: 'IBM Plex Mono', monospace; font-size: 24px; font-weight: 600; color: #fff; }
.landing-stat-note { font-size: 11.5px; color: var(--nav-label); margin-top: 4px; }

.landing-section { padding: 56px 0; }
.landing-section-white { background: var(--card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.landing-problem { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.landing-decision-card { background: var(--card); border: 1px solid var(--border); border-inline-start: 3px solid var(--red); border-radius: 3px; padding: 16px; }
.landing-decision-stats {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 10px 0; margin-bottom: 11px;
  border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider);
}
.landing-decision-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-4); font-weight: 700; }
.landing-decision-value { font-family: 'IBM Plex Mono', monospace; font-size: 16px; font-weight: 600; }

.landing-step-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-top: 28px; }
.landing-step { padding: 16px; border: 1px solid var(--border); border-top: 2px solid var(--blue); border-radius: 3px; }
.landing-step-num { font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 600; color: var(--border-hover); }
.landing-step-label { font-size: 14px; font-weight: 700; margin-top: 6px; }
.landing-step-detail { font-size: 12px; line-height: 1.6; color: var(--text-3); margin-top: 6px; }

.landing-domain-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-top: 24px; }
.landing-domain-card { background: var(--card); border: 1px solid var(--border); border-radius: 3px; padding: 14px; }
.landing-domain-name { font-size: 13.5px; font-weight: 700; }
.landing-domain-note { font-size: 11.5px; color: var(--text-4); margin-top: 4px; }

.landing-gov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.landing-gov-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.landing-gov-facts > div { padding: 12px; border: 1px solid var(--border); border-radius: 3px; }
.landing-connector-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 20px; }
.landing-connector-chip { height: 30px; padding: 0 12px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 3px; font-size: 12px; font-weight: 600; color: var(--text-3); }

.landing-final-cta { background: var(--nav-bg); padding: 56px 0; }
.landing-footer-full { background: var(--card); border-top: 1px solid var(--border); padding: 26px 0; font-size: 11.5px; color: var(--text-4); }

@media (max-width: 860px) {
  .landing-problem, .landing-gov-grid { grid-template-columns: 1fr; }
  .landing-stat-row, .landing-step-grid, .landing-domain-grid { grid-template-columns: 1fr 1fr; }
  .landing-title-full { font-size: 32px; }
}

/* ---- sign in (two-column, matches isSignIn) ---- */
.signin-screen { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 56px); }
.signin-form-side { display: grid; place-items: center; padding: 40px; }
.signin-info-side { background: var(--nav-bg); padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.signin-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 32px; max-width: 460px; }
.signin-stat-grid > div { padding: 14px; border: 1px solid var(--nav-border); border-radius: 3px; }
.signin-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--border-hover); font-size: 11px; }
.signin-divider span { flex: 1; height: 1px; background: var(--border); }
.signin-sso-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 860px) {
  .signin-screen { grid-template-columns: 1fr; }
  .signin-info-side { display: none; }
}

/* ---- sign up (matches isSignUp, trimmed to real fields only) ---- */
.signup-screen { min-height: calc(100vh - 56px); display: grid; place-items: center; padding: 40px 20px; }
.signup-card { width: 420px; max-width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 3px; padding: 24px; }

/* ---- plans (matches isPlans) ---- */
.plans-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin: 22px 0 14px; }
.plan-card { background: var(--card); border: 1px solid var(--border); border-radius: 3px; padding: 18px; display: flex; flex-direction: column; }
.plan-card.featured { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.plan-name { font-size: 15px; font-weight: 700; }
.plan-tag { font-size: 8.5px; font-weight: 800; letter-spacing: .08em; color: var(--blue); text-transform: uppercase; }
.plan-price-row { display: flex; align-items: baseline; gap: 7px; margin-top: 12px; }
.plan-price { font-family: 'IBM Plex Mono', monospace; font-size: 24px; font-weight: 600; }
.plan-per { font-size: 11px; color: var(--text-4); }
.plan-detail { font-size: 12px; line-height: 1.55; color: var(--text-3); margin-top: 10px; min-height: 40px; }
.plan-features { padding-top: 12px; border-top: 1px solid var(--divider); }
.plan-feature { display: flex; gap: 8px; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.plan-feature .check { color: var(--green); }
.addon-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }

/* ---- setup checklist (matches isSetup, adapted to real capability) ---- */
.setup-step-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--divider-soft); }
.setup-step-row:last-child { border-bottom: none; }
.setup-badge {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600;
}
.setup-badge.done { background: var(--green); color: #fff; }
.setup-badge.pending { background: var(--tint-2); border: 1px solid var(--border); color: var(--text-4); }
.setup-step-label { font-size: 13px; font-weight: 700; }
.setup-step-detail { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

@media (max-width: 860px) {
  .plans-grid, .addon-grid { grid-template-columns: 1fr; }
}
