/* ===========================================================================
   DeclineShield app — shared styles.
   Reuses the marketing site's "inari" design tokens so the product looks like
   the homepage for free. One stylesheet powers demo, live dashboard, and report.
   =========================================================================== */

/* ============ Tokens (mirrors apps/homepage/public/index.html) ============ */
:root {
  --inari-white:#FFFFFF; --inari-black:#030303;
  --inari-primary:#00DD8E; --inari-secondary:#3CE5D5; --inari-background:#103B3D; --inari-lite:#B6F2DC;
  --black-80:rgba(3,3,3,.80); --black-60:rgba(3,3,3,.60); --black-40:rgba(3,3,3,.40);
  --black-20:rgba(3,3,3,.20); --black-10:rgba(3,3,3,.10); --black-05:rgba(3,3,3,.05);
  --white-80:rgba(255,255,255,.80); --white-60:rgba(255,255,255,.60); --white-40:rgba(255,255,255,.40);
  --white-20:rgba(255,255,255,.20); --white-10:rgba(255,255,255,.10);
  --font-sans:"Manrope",system-ui,-apple-system,sans-serif;
  --tracking:-0.02em;
  --shadow-sm:0 1px 2px rgba(3,3,3,.06),0 1px 3px rgba(3,3,3,.04);
  --shadow-md:0 4px 12px rgba(3,3,3,.08);
  --ease:cubic-bezier(.2,.7,.2,1);
  --accent:#0E5C46; --accent-h:#0a7a55; --accent-bright:#00DD8E;
  /* Semantic status colors */
  --risk:#B7791F; --risk-bg:#FEF3C7; --risk-bd:#FDE68A;
  --good:#0a7a55; --good-bg:#D1FAE5; --good-bd:#A7F3D0;
  --bad:#B91C1C;  --bad-bg:#FEE2E2;  --bad-bd:#FECACA;
  --sidebar-w:248px;
}

/* ============ Reset / base ============ */
*,*::before,*::after { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  margin:0; font-family:var(--font-sans); font-size:16px; line-height:140%;
  letter-spacing:var(--tracking); color:var(--inari-black); background:#F7F9F8;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
a { text-decoration:none; color:inherit; }
img,svg { display:block; }
h1,h2,h3,h4 { font-family:var(--font-sans); font-weight:600; letter-spacing:var(--tracking); margin:0; }

.body-12{font-size:12px;line-height:150%;} .body-14{font-size:14px;line-height:150%;}
.body-16{font-size:16px;line-height:140%;} .body-18{font-size:18px;line-height:140%;}
.fw-medium{font-weight:500;} .fw-semibold{font-weight:600;} .fw-bold{font-weight:700;}
.muted{color:var(--black-60);} .muted-2{color:var(--black-40);}
.label { font-weight:600; font-size:11px; letter-spacing:0.08em; text-transform:uppercase; color:var(--black-40); }
.mono { font-variant-numeric:tabular-nums; }

/* ============ App shell ============ */
.app { display:grid; grid-template-columns:var(--sidebar-w) 1fr; min-height:100vh; }

.sidebar {
  background:var(--inari-background); color:#fff; padding:22px 16px;
  display:flex; flex-direction:column; gap:28px; position:sticky; top:0; height:100vh;
}
.sb-logo { display:flex; align-items:center; gap:10px; padding:4px 8px; }
.sb-logo .mark { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:9px; background:var(--accent-bright); }
.sb-logo .name { font-weight:700; font-size:19px; color:#fff; }
.sb-nav { display:flex; flex-direction:column; gap:2px; }
.sb-nav a, .sb-nav span.item {
  display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:10px;
  color:var(--white-60); font-weight:500; font-size:14px; cursor:pointer; transition:background 150ms var(--ease), color 150ms var(--ease);
}
.sb-nav a:hover { background:var(--white-10); color:#fff; }
.sb-nav a.active { background:var(--white-10); color:#fff; }
.sb-nav .item.soon { color:var(--white-40); cursor:default; }
.sb-nav .item.soon:hover { background:transparent; }
.sb-pill { margin-left:auto; font-size:10px; font-weight:600; letter-spacing:.04em; text-transform:uppercase; color:var(--white-40); border:1px solid var(--white-20); border-radius:9999px; padding:2px 7px; }
.sb-foot { margin-top:auto; color:var(--white-40); font-size:12px; padding:0 8px; }
.sb-foot a { color:var(--white-60); text-decoration:underline; }

.main { padding:0; min-width:0; }
.topbar {
  position:sticky; top:0; z-index:10; background:rgba(247,249,248,.85); backdrop-filter:blur(10px);
  border-bottom:1px solid var(--black-05); padding:20px 32px; display:flex; align-items:center; gap:16px; flex-wrap:wrap;
}
.topbar h1 { font-size:26px; }
.topbar .spacer { flex:1; }
.content { padding:28px 32px 64px; max-width:1160px; }

/* Demo banner */
.demo-banner {
  background:var(--inari-background); color:#fff; padding:10px 32px; font-size:14px;
  display:flex; align-items:center; justify-content:center; gap:10px;
}
.demo-banner a { color:var(--accent-bright); font-weight:600; text-decoration:none; }
.demo-banner a:hover { text-decoration:underline; }

/* ============ Buttons ============ */
.btn { display:inline-flex; align-items:center; gap:8px; font-family:var(--font-sans); font-weight:600; font-size:14px;
  letter-spacing:var(--tracking); border-radius:9999px; border:1px solid transparent; cursor:pointer; padding:9px 16px;
  transition:all 150ms var(--ease); white-space:nowrap; }
.btn-primary { background:var(--accent); color:#fff; }
.btn-primary:hover { background:var(--accent-h); }
.btn-bright { background:var(--accent-bright); color:#030303; }
.btn-bright:hover { background:var(--inari-secondary); }
.btn-ghost { background:#fff; color:var(--black-80); border-color:var(--black-10); }
.btn-ghost:hover { border-color:var(--accent); color:var(--accent); }
.btn:disabled { opacity:.55; cursor:not-allowed; }
.btn svg { width:16px; height:16px; }

select.range { font-family:var(--font-sans); font-size:14px; font-weight:600; letter-spacing:var(--tracking);
  padding:9px 14px; border-radius:9999px; border:1px solid var(--black-10); background:#fff; color:var(--black-80); cursor:pointer; }

/* ============ Cards ============ */
.card { background:#fff; border:1px solid var(--black-05); border-radius:16px; box-shadow:var(--shadow-sm); }
.card-pad { padding:22px; }
.section-title { font-size:13px; font-weight:600; letter-spacing:.04em; text-transform:uppercase; color:var(--black-40); margin:0 0 14px; }

/* ============ Metric cards ============ */
.metrics { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:24px; }
.metric { background:#fff; border:1px solid var(--black-05); border-radius:16px; box-shadow:var(--shadow-sm); padding:20px; }
.metric .k { font-size:12px; font-weight:600; letter-spacing:.03em; text-transform:uppercase; color:var(--black-40); margin-bottom:10px; }
.metric .v { font-size:30px; font-weight:700; letter-spacing:-0.03em; line-height:1; }
.metric .sub { font-size:13px; color:var(--black-60); margin-top:8px; }
.metric.accent { background:linear-gradient(150% 130% at 100% 0%, #14494a 0%, #103B3D 70%); border-color:transparent; color:#fff; }
.metric.accent .k { color:var(--inari-lite); }
.metric.accent .sub { color:var(--white-60); }

/* ============ Reasons breakdown ============ */
.reasons { display:flex; flex-direction:column; gap:14px; }
.reason { display:grid; grid-template-columns:180px 1fr auto; gap:14px; align-items:center; }
.reason .rl { font-size:14px; font-weight:500; }
.reason .rbar { height:8px; border-radius:9999px; background:var(--black-05); overflow:hidden; }
.reason .rbar > span { display:block; height:100%; border-radius:9999px; background:var(--accent-bright); }
.reason .rv { font-size:13px; color:var(--black-60); text-align:right; min-width:120px; }

/* ============ Action Center ============ */
.ac-head { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.ac-head .warn { color:var(--risk); }
.ac-list { display:flex; flex-direction:column; gap:10px; }
.ac-row {
  display:flex; align-items:center; gap:16px; padding:14px 18px;
  background:#fff; border:1px solid var(--black-05); border-radius:14px; box-shadow:var(--shadow-sm);
}
.ac-row .who { min-width:0; flex:1; }
.ac-row .who .nm { font-weight:600; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ac-row .who .em { font-size:13px; color:var(--black-40); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ac-row .amt { text-align:right; }
.ac-row .amt .a { font-weight:700; font-size:16px; }
.ac-row .amt .l { font-size:12px; color:var(--black-40); }
.ac-row .urg { font-size:13px; font-weight:600; min-width:170px; text-align:right; }
.ac-row .urg.danger { color:var(--bad); }
.ac-row .urg.soon { color:var(--risk); }

.badge { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; padding:4px 10px; border-radius:9999px; border:1px solid; white-space:nowrap; }
.badge.risk { color:var(--risk); background:var(--risk-bg); border-color:var(--risk-bd); }
.badge.good { color:var(--good); background:var(--good-bg); border-color:var(--good-bd); }
.badge.bad  { color:var(--bad);  background:var(--bad-bg);  border-color:var(--bad-bd); }

/* ============ Onboarding checklist ============ */
.checklist { display:flex; flex-direction:column; gap:2px; }
.check-row { display:flex; align-items:center; gap:12px; padding:10px 0; }
.check-ico { flex:none; width:24px; height:24px; border-radius:9999px; border:2px solid var(--black-20); display:inline-flex; align-items:center; justify-content:center; }
.check-row.done .check-ico { border-color:var(--accent-bright); background:var(--accent-bright); color:#fff; }
.check-row.done .ct { color:var(--black-40); text-decoration:line-through; }
.ct { font-weight:600; font-size:15px; }
.cprog { height:6px; border-radius:9999px; background:var(--black-05); overflow:hidden; margin:6px 0 16px; }
.cprog > span { display:block; height:100%; background:var(--accent-bright); border-radius:9999px; }

/* ============ States ============ */
.center-state { text-align:center; padding:80px 24px; color:var(--black-60); }
.spinner { width:34px; height:34px; border:3px solid var(--black-10); border-top-color:var(--accent); border-radius:50%; margin:0 auto 18px; animation:spin 800ms linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ============ Responsive ============ */
@media (max-width:980px) {
  .app { grid-template-columns:1fr; }
  .sidebar { position:static; height:auto; flex-direction:row; align-items:center; gap:16px; overflow-x:auto; }
  .sb-nav { flex-direction:row; }
  .sb-foot, .sb-pill { display:none; }
  .metrics { grid-template-columns:1fr 1fr; }
  .reason { grid-template-columns:130px 1fr; }
  .reason .rv { display:none; }
}
@media (max-width:560px) {
  .metrics { grid-template-columns:1fr; }
  .content, .topbar, .demo-banner { padding-left:18px; padding-right:18px; }
  .ac-row .urg { display:none; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation-duration:.001ms !important; transition-duration:.001ms !important; }
}
