:root {
  --ink: #17243a;
  --muted: #67748a;
  --brand: #0b675f;
  --brand-soft: #e9f4f1;
  --line: #dce3ea;
  --surface: #ffffff;
  --background: #f3f6f8;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--background); font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: var(--brand); text-decoration: none; }
.topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 5vw; background: #102b36; color: white; }
.topbar strong { letter-spacing: .02em; }
.topbar span { margin-left: 10px; color: #abc3c7; font-size: 13px; }
.topbar nav { display: flex; align-items: center; gap: 18px; }
.topbar nav a { color: #d9eeeb; }
.logout-form { margin: 0; }
.logout-form button { padding: 0; border: 0; background: none; color: #d9eeeb; font: inherit; cursor: pointer; }
.page { width: min(1120px, 92vw); margin: 36px auto 72px; }
.hero { padding: 34px 36px; border-radius: 20px; color: white; background: linear-gradient(130deg, #12394a, #0b675f); box-shadow: 0 14px 34px rgba(21, 54, 67, .15); }
.hero.compact { padding: 25px 30px; }
.hero h1 { margin: 4px 0 8px; font-size: clamp(28px, 4vw, 46px); }
.hero p { max-width: 760px; margin: 0; color: #d6ece9; line-height: 1.7; }
.eyebrow { margin: 0 !important; color: #78bcb3 !important; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0; }
.metrics article, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 6px 20px rgba(36, 56, 78, .05); }
.metrics article { padding: 22px; }
.metrics span { display: block; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.metrics strong { font-size: 25px; }
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0; }
.quick-actions article { display: flex; min-height: 168px; flex-direction: column; justify-content: space-between; padding: 23px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 6px 20px rgba(36, 56, 78, .05); }
.quick-actions h2 { margin: 5px 0 7px; font-size: 20px; }
.quick-actions p:not(.eyebrow) { margin: 0; color: var(--muted); line-height: 1.55; }
.action-link { display: inline-block; width: fit-content; margin-top: 20px; font-weight: 800; }
.status { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: #0b5b54; background: var(--brand-soft); font-size: 12px; font-weight: 800; }
.panel { margin-top: 20px; overflow: hidden; }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 24px 26px 14px; }
.panel h2 { margin: 3px 0 0; font-size: 22px; }
.privacy-note { color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 26px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); background: #f9fbfc; font-size: 12px; letter-spacing: .03em; }
td small { display: block; margin-top: 4px; color: var(--muted); }
.empty { padding: 32px; color: var(--muted); text-align: center; }
.message { margin-bottom: 16px; padding: 13px 16px; border-radius: 10px; background: var(--brand-soft); }
.back { display: inline-block; margin-bottom: 14px; }
.auth-shell { width: min(440px, 92vw); margin: 7vh auto; }
.auth-card { padding: 32px; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 45px rgba(20, 43, 56, .12); }
.auth-card h1 { margin: 5px 0 8px; }
.auth-card p { color: var(--muted); line-height: 1.6; }
.auth-card label { display: block; margin: 18px 0 7px; font-weight: 700; }
.auth-card input { width: 100%; padding: 12px 13px; border: 1px solid #b9c4cf; border-radius: 9px; font: inherit; }
.button { width: 100%; margin-top: 22px; padding: 13px; border: 0; border-radius: 9px; background: var(--brand); color: white; font: inherit; font-weight: 800; cursor: pointer; }
.help { margin-top: 18px; font-size: 13px; }
@media (max-width: 720px) {
  .topbar { align-items: flex-start; padding: 16px 4vw; }
  .topbar span { display: none; }
  .page { width: 94vw; margin-top: 18px; }
  .hero { padding: 25px 22px; border-radius: 15px; }
  .metrics { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .metrics article { padding: 17px 20px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  th, td { padding: 13px 18px; }
}
/* Phase 1 visual system: role-first, task-first, compact on mobile. */
:root {
  --ink: #162033;
  --muted: #697386;
  --brand: #0d776f;
  --brand-deep: #0b4f51;
  --brand-soft: #e8f5f2;
  --navy: #111b2c;
  --line: #e6e9ef;
  --surface: #ffffff;
  --background: #f6f7fb;
}
body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -8%, rgba(13,119,111,.09), transparent 30rem),
    var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.topbar {
  min-height: 76px;
  padding: 0 max(5vw, 32px);
  background: rgba(17, 27, 44, .98);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 24px rgba(16, 28, 46, .13);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
}
.brand:hover { color: #fff; }
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 10px;
  background: linear-gradient(140deg, #1da89a, #0c5f6b);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { color: #fff; font-size: 15px; letter-spacing: .02em; }
.brand-copy small { color: #9fb0c5; font-size: 11px; }
.topbar nav { gap: 10px; }
.topbar nav .nav-link,
.logout-form button {
  padding: 8px 10px;
  border-radius: 8px;
  color: #dce5ef;
  font-size: 13px;
}
.topbar nav .nav-link:hover,
.logout-form button:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.topbar nav .subtle { color: #aebbd0; }
.user-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  margin: 0 4px 0 0 !important;
  color: #c8d3e0 !important;
  font-size: 12px !important;
}
.user-chip b {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: #24364f;
  color: #e9f8f4;
  font-size: 11px;
}
.page { width: min(1160px, 92vw); margin: 34px auto 80px; }
.hero {
  position: relative;
  display: flex;
  min-height: 188px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  padding: 34px 38px;
  border: 1px solid rgba(11, 79, 81, .22);
  border-radius: 22px;
  background: linear-gradient(117deg, #13213a 0%, #15344a 65%, #115c60 100%);
  box-shadow: 0 18px 46px rgba(15, 39, 58, .16);
}
.hero::before,
.hero::after {
  position: absolute;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.hero::before {
  width: 260px;
  height: 260px;
  right: -96px;
  bottom: -160px;
  border: 1px solid rgba(203, 255, 244, .22);
}
.hero::after {
  width: 140px;
  height: 140px;
  right: 42px;
  top: -80px;
  background: rgba(73, 209, 190, .12);
}
.hero > * { position: relative; z-index: 1; }
.hero h1 {
  max-width: 760px;
  margin: 7px 0 10px;
  letter-spacing: -.035em;
  line-height: 1.12;
}
.hero p { max-width: 700px; color: #c3d9df; }
.hero .eyebrow { color: #85d8ca !important; }
.hero-badge {
  flex: 0 0 auto;
  margin-bottom: 4px;
  padding: 9px 12px;
  border: 1px solid rgba(203,255,244,.25);
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  color: #edfffb;
  font-size: 13px;
  font-weight: 750;
}
.metrics {
  gap: 14px;
  margin: 18px 0 0;
}
.metrics article,
.panel,
.quick-actions article {
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(23, 36, 58, .045);
}
.metrics article {
  position: relative;
  min-height: 133px;
  overflow: hidden;
  padding: 23px 24px;
  border-radius: 16px;
}
.metrics article::after {
  position: absolute;
  width: 66px;
  height: 66px;
  right: -24px;
  bottom: -27px;
  border-radius: 50%;
  content: "";
  background: var(--brand-soft);
}
.metrics article:nth-child(2)::after { background: #eef1ff; }
.metrics article:nth-child(3)::after { background: #fff4e8; }
.metrics span { position: relative; z-index: 1; margin-bottom: 10px; color: #7b8494; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.metrics strong { position: relative; z-index: 1; display: block; font-size: clamp(24px, 2.5vw, 31px); letter-spacing: -.025em; }
.metrics small { position: relative; z-index: 1; display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.quick-actions { gap: 14px; margin: 18px 0 0; }
.quick-actions article {
  position: relative;
  min-height: 174px;
  overflow: hidden;
  padding: 25px 24px 22px;
  border-radius: 16px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.quick-actions article:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(23, 36, 58, .09); }
.quick-actions article::after {
  position: absolute;
  right: 19px;
  top: 17px;
  color: #dae3e8;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.05em;
}
.quick-actions article:nth-child(1)::after { content: "01"; color: #cde6e2; }
.quick-actions article:nth-child(2)::after { content: "02"; color: #d8def2; }
.quick-actions article:nth-child(3)::after { content: "03"; color: #f0dfc7; }
.quick-actions h2 { margin: 7px 0 9px; color: #202a3d; letter-spacing: -.02em; }
.quick-actions .eyebrow { color: var(--brand) !important; }
.action-link {
  padding: 8px 0 2px;
  border-bottom: 1px solid rgba(13,119,111,.35);
  color: var(--brand);
  font-size: 13px;
}
.panel {
  margin-top: 18px;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(23, 36, 58, .045);
}
.panel-heading { padding: 23px 26px 15px; }
.panel-heading .eyebrow { color: var(--brand) !important; }
.panel h2 { font-size: 20px; letter-spacing: -.02em; }
.privacy-note {
  padding: 5px 9px;
  border-radius: 999px;
  background: #f2f5f8;
  color: #788294;
}
table { font-size: 14px; }
th, td { padding: 15px 26px; border-color: #edf0f4; }
th { color: #7a8494; background: #fafbfc; font-size: 11px; font-weight: 750; letter-spacing: .055em; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #fbfdfd; }
.status {
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
}
.status-approved,
.status-imported,
.status-reconciled {
  border-color: #bce6dd;
  background: #e8f7f3;
  color: #0b6b62;
}
.status-calculated,
.status-reviewed,
.status-payment_pending {
  border-color: #f2d59f;
  background: #fff6df;
  color: #a26705;
}
.status-failed,
.status-quarantined,
.status-disputed {
  border-color: #f3c0c2;
  background: #fff0f0;
  color: #b13c44;
}
.auth-shell { margin: 9vh auto; }
.auth-card {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 22px 60px rgba(20, 38, 62, .12);
}
.auth-card .eyebrow { color: var(--brand) !important; }
.auth-card input { border-color: #d7dce4; background: #fbfcfd; }
.auth-card input:focus {
  outline: 3px solid rgba(13,119,111,.15);
  border-color: var(--brand);
  background: #fff;
}
.button {
  border-radius: 10px;
  background: linear-gradient(110deg, #0d776f, #0a676d);
  box-shadow: 0 8px 18px rgba(13,119,111,.18);
}
@media (max-width: 720px) {
  .topbar { min-height: 62px; align-items: center; padding: 0 18px; }
  .brand-copy small, .user-chip span, .topbar nav .subtle { display: none; }
  .topbar nav { gap: 2px; }
  .topbar nav .nav-link, .logout-form button { padding: 8px 7px; font-size: 12px; }
  .user-chip { margin-right: 0 !important; }
  .page { width: min(100% - 28px, 560px); margin: 18px auto 54px; }
  .hero { min-height: 205px; align-items: flex-start; flex-direction: column; padding: 26px 23px; border-radius: 18px; }
  .hero h1 { font-size: 31px; }
  .hero-badge { margin-top: auto; }
  .metrics article { min-height: 112px; padding: 20px; }
  .quick-actions article { min-height: 148px; }
  .panel-heading { padding: 21px 20px 13px; }
  th, td { padding: 13px 18px; }
}


