/* Business Pulse Solutions — approved card design (desktop + mobile, one stylesheet). */
:root {
  --navy: #0B1B33;
  --blue: #2F6FB0;
  --blue-tint: #E4EEF9;
  --teal: #17807F;
  --teal-tint: #DFF1F0;
  --amber: #8A4B00;
  --amber-ink: #6B3A00;
  --amber-tint: #FFF1DE;
  --amber-graphic: #E08A1E;
  --ink: #0B1B33;
  --ink-2: #33445C;
  --muted: #4B5B70;
  --line: #DCE3EC;
  --line-soft: #EDF1F5;
  --ground: #EEF2F7;
  --card: #FFFFFF;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 27, 51, 0.05), 0 4px 16px rgba(11, 27, 51, 0.04);
  --font: Inter, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: "tnum" 1;
}
a { color: var(--blue); }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid #7FB8E6; outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }

.skip { position: absolute; left: -9999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- Top bar ---------- */
.topbar { background: var(--navy); color: #fff; }
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 32px; min-height: 60px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { flex: none; border-radius: 6px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { color: #9FB2CC; font-size: 12px; }
.nav-top { display: flex; flex-wrap: wrap; gap: 2px; font-size: 14px; }
.nav-top a { color: #C9D5E6; text-decoration: none; padding: 8px 14px; border-radius: 8px; }
.nav-top a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav-top a[aria-current="page"] { color: #fff; font-weight: 600; background: rgba(255, 255, 255, 0.14); }
.account { display: flex; align-items: center; gap: 10px; margin: 0; }
.account-who { color: #C9D5E6; font-size: 13px; }
.btn-ghost {
  min-height: 44px; padding: 0 12px; border: 1px solid #3A4E6E; border-radius: 8px;
  background: transparent; color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}

/* ---------- Page ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 24px 32px 56px; display: flex; flex-direction: column; gap: 20px; }
.page-title h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.warn { color: var(--amber); }
.ok { color: var(--teal); }
.block { display: block; }
.right { text-align: right; }
.footnote { font-size: 12px; color: var(--muted); }

.row { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.row-top { align-items: flex-start; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; min-width: 0;
}
.card-main { flex: 7 1 520px; }
.card-side { flex: 5 1 340px; }
.card-half { flex: 1 1 420px; }
.narrow { max-width: 640px; }

.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 16px; margin-bottom: 4px; border-bottom: 1px solid var(--line-soft);
}
.card-head-main { display: flex; align-items: center; gap: 12px; }
.card-head h2 { font-size: 18px; font-weight: 700; }
.card-head-side { font-size: 14px; }
.card-head-side a { font-weight: 600; display: inline-block; padding: 10px 0; }
.sub-h { font-size: 15px; font-weight: 700; margin: 22px 0 6px; }

.tile {
  width: 36px; height: 36px; flex: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.tile-sm { width: 28px; height: 28px; border-radius: 7px; }
.tile-blue { background: var(--blue-tint); color: var(--blue); }
.tile-teal { background: var(--teal-tint); color: var(--teal); }
.tile-amber { background: var(--amber-tint); color: var(--amber); }
.tile-navy { background: #E6EAF0; color: var(--navy); }
.tile-hero { background: rgba(255, 255, 255, 0.10); color: #FFC98A; }

/* ---------- Notices ---------- */
.notice {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px;
  background: var(--amber-tint); border: 1px solid #F2CF9C; color: var(--amber-ink); font-size: 14px;
}
.flash { padding: 12px 16px; border-radius: 12px; font-size: 14px; border: 1px solid; }
.flash-success { background: var(--teal-tint); border-color: #A9D9D6; color: #0F5352; }
.flash-info { background: var(--blue-tint); border-color: #BFD4EC; color: #1C4878; }
.flash-error { background: var(--amber-tint); border-color: #F2CF9C; color: var(--amber-ink); }
.inline-warn { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--amber-tint); color: var(--amber-ink); font-size: 13px; }

/* ---------- Hero ---------- */
.hero {
  flex: 7 1 520px; min-width: 0; background: var(--navy); color: #fff; border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 18px;
}
.hero-head { display: flex; align-items: center; gap: 12px; }
.hero-head h1 { font-size: 16px; font-weight: 600; color: #DCE6F2; }
.eyebrow-hero { color: #9FB2CC; }
.hero-line { font-size: 40px; line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; }
.amt-warn { color: #FFC98A; }
.hero-note { font-size: 14px; color: #C9D5E6; }
.hero-note strong { color: #fff; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.chart { display: block; width: 100%; max-width: 560px; height: auto; }
.chart-neg { fill: var(--amber-graphic); opacity: 0.16; }
.chart-zero { stroke: #9FB2CC; stroke-dasharray: 3 4; }
.chart-line { fill: none; stroke: #7FB8E6; stroke-width: 3; stroke-linejoin: round; }
.chart-dot { fill: var(--amber-graphic); }
.chart-label { fill: #B7C6DA; font-size: 11px; font-family: var(--font); }
.chart-label-warn { fill: #FFC98A; font-size: 11px; font-family: var(--font); }

/* ---------- Math card ---------- */
.math { margin: 0; }
.math-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.math-row dt { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; }
.math-row dd { margin: 0; font-size: 20px; font-weight: 600; white-space: nowrap; }
.math-row .sub { flex-basis: 100%; padding-left: 18px; font-size: 12px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 4px; display: inline-block; }
.dot-blue { background: var(--blue); }
.dot-navy { background: var(--navy); }
.gap { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 12px; padding: 14px 16px; border-radius: 10px; }
.gap span { font-weight: 700; }
.gap strong { font-size: 28px; font-weight: 700; }
.gap-neg { background: var(--amber-tint); color: var(--amber-ink); }
.gap-neg strong { color: var(--amber); }
.gap-pos { background: var(--teal-tint); color: #0F5352; }

/* ---------- Tables & lists ---------- */
.table-wrap { overflow-x: auto; margin-top: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.table th {
  padding: 12px 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); text-align: left; background: #F6F8FB;
}
.table td { padding: 14px 10px; border-bottom: 1px solid var(--line-soft); }
.table .num { text-align: right; white-space: nowrap; }
.date-chip {
  display: inline-block; min-width: 56px; text-align: center; padding: 2px 8px; border-radius: 6px;
  font-weight: 600; font-size: 13px; background: var(--blue-tint); color: var(--blue); margin-right: 10px;
}
.date-chip-warn { background: var(--amber-tint); color: var(--amber); }
.tag-warn { font-size: 11px; font-weight: 700; color: var(--amber); margin-left: 6px; text-transform: uppercase; letter-spacing: 0.04em; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.list-dashed li { border-bottom: 1px dashed #C3CDDA; }
.list-top { display: flex; justify-content: space-between; gap: 10px; }
.list-sub { font-size: 13px; color: var(--muted); margin: 4px 0 0 18px; }
.list-sub.block { margin-left: 0; }
.list-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.row-actions { display: flex; align-items: center; gap: 8px; }
.who { display: flex; align-items: center; gap: 8px; }
.sq { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.split { display: block; width: 100%; height: 10px; border-radius: 5px; margin: 16px 0 6px; }
.seg-1 { fill: var(--navy); background: var(--navy); }
.seg-2 { fill: var(--blue); background: var(--blue); }
.seg-3 { fill: #8DB4DD; background: #8DB4DD; }
.empty { padding: 16px 0 4px; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px;
  border-radius: 10px; border: 0; background: var(--navy); color: #fff; font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: #1A2E4F; color: #fff; }
.btn-block { width: 100%; }
.btn-outline { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn-outline:hover { background: #F2F6FB; color: var(--navy); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: #E8EEF6; color: var(--navy); }
.btn-outline-light { background: transparent; color: #fff; border: 1px solid #4F6688; font-weight: 600; }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.btn-small {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--navy); font: inherit; font-size: 13px; text-decoration: none; cursor: pointer;
}
.btn-small-warn { border-color: #E3B98A; color: var(--amber); font-weight: 600; }
.inline-form { display: inline; margin: 0; }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; min-height: 44px; border: 1px solid #A9B6C7; border-radius: 8px; background: #fff;
  font: inherit; font-size: 15px; padding: 0 12px; color: var(--ink);
}
select:disabled { background: #F6F8FB; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-grid { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.form-grid .field { flex: 1 1 200px; min-width: 0; }
.form-grid .wide, .form-actions { flex-basis: 100%; }
.form-stack { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.form-stack label { margin-top: 8px; }
.form-stack .btn { margin-top: 14px; }

/* ---------- Auth screens ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; gap: 20px; }
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-name { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.auth-sub { font-size: 12px; font-weight: 600; letter-spacing: 0.22em; color: var(--muted); margin-top: 4px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.auth-card .flash { margin-top: 14px; }

/* ---------- Mobile ---------- */
.nav-bottom { display: none; }
@media (max-width: 720px) {
  .topbar-inner { padding: 8px 16px; min-height: 56px; }
  .nav-top, .account-who { display: none; }
  .brand-name { font-size: 15px; }
  .page { padding: 16px 16px 96px; gap: 14px; }
  .card { padding: 20px; }
  .hero { padding: 22px; }
  .hero-line { font-size: 30px; }
  .hero-actions { flex-direction: column; }
  .page-title h1 { font-size: 26px; }
  .nav-bottom {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0;
    height: 64px; padding-bottom: env(safe-area-inset-bottom, 0); background: #fff; border-top: 1px solid var(--line); z-index: 5;
  }
  .nav-bottom a { display: flex; align-items: center; justify-content: center; color: var(--muted); text-decoration: none; font-size: 12px; }
  .nav-bottom a[aria-current="page"] { color: var(--blue); font-weight: 700; border-top: 3px solid var(--blue); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
