/* Musa Proposal Tool — Workforcer operations cockpit
   One family (Hanken Grotesk), brand palette, calm by default, bold only
   at the stage timeline and the pricing gate. */

:root {
  /* Brand */
  --ink-deep: #013835;   /* top bar, primary buttons */
  --ink: #12403a;        /* headings, strong text */
  --ink-soft: #2a544d;
  --paper: #faf9f5;      /* page background (Workforcer cream) */
  --surface: #ffffff;    /* panels */
  --surface-sunk: #f4f2ec;

  --sage: #c9dcc5;
  --sage-tint: #eef4ea;
  --grass: #2b8a3e;      /* approve / done */
  --grass-bright: #5cb948;
  --gold: #8a6410;       /* waiting / pending text */
  --gold-tint: #fbf1d8;
  --gold-line: #e7cd8c;
  --rust: #9c3320;       /* blocked / reject */
  --rust-tint: #f8e9e5;
  --rust-line: #e6b3a6;

  --line: #e4e0d6;
  --line-strong: #d3cdbf;
  --muted: #6c6a61;
  --text: #22251f;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(1,56,53,.05), 0 6px 20px rgba(1,56,53,.06);
  --shadow-sm: 0 1px 2px rgba(1,56,53,.06);
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Top bar ------------------------------------------------------ */
.topbar {
  background: var(--ink-deep);
  color: #eaf3ee;
  border-bottom: 1px solid #002a28;
}
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -.01em;
  font-size: 18px;
}
.wordmark .mark { display: block; }
.wordmark .sub {
  font-weight: 500;
  color: var(--sage);
  font-size: 13px;
  padding-left: 11px;
  margin-left: 1px;
  border-left: 1px solid rgba(201,220,197,.35);
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}
.nav a {
  color: #cfe3d9;
  text-decoration: none;
  font-weight: 500;
  font-size: 14.5px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  line-height: 1;
}
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.active { background: rgba(255,255,255,.14); color: #fff; }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.whoami { color: var(--sage); font-size: 13.5px; }
.whoami strong { color: #fff; font-weight: 600; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--gold-bright, #f0c34e);
  background: #f3c34d;
  color: #3a2b00;
  font-weight: 800;
  font-size: 12.5px;
  line-height: 1;
}
.nav-badge {
  margin-left: 2px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #cfe3d9;
  font-size: 13px;
}

.linkbtn {
  background: none;
  border: 1px solid rgba(255,255,255,.25);
  color: #eaf3ee;
  font: inherit;
  font-size: 13.5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.linkbtn:hover { background: rgba(255,255,255,.1); }

/* ---- Page shell --------------------------------------------------- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 36px 24px 72px;
}
.narrow { max-width: 760px; }

h1 {
  font-size: 27px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 0 0 6px;
}
h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
  margin: 28px 0 12px;
}
a { color: var(--grass); }
a:hover { color: var(--ink); }

.pagehead {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.pagehead .titles { flex: 1 1 auto; min-width: 0; }
.subtle { color: var(--muted); font-size: 14px; margin: 0; }
.kpi {
  color: var(--ink-soft);
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 0;
}

.backlink {
  display: inline-block;
  margin-top: 28px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.backlink:hover { color: var(--ink); }
.backlink::before { content: "\2190"; margin-right: 6px; }

/* ---- Status chips ------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
  border: 1px solid transparent;
  vertical-align: middle;
}
.chip::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 999px;
  background: currentColor;
}
.chip.running  { background: var(--sage-tint); color: var(--ink);  border-color: #cfe1c9; }
.chip.waiting  { background: var(--gold-tint); color: var(--gold); border-color: var(--gold-line); }
.chip.blocked  { background: var(--rust-tint); color: var(--rust); border-color: var(--rust-line); }
.chip.done     { background: #e6f3e2; color: var(--grass); border-color: #bfe0b4; }
.chip.rejected { background: var(--surface-sunk); color: var(--muted); border-color: var(--line-strong); }
.chip.running::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

h1 .chip { font-size: 12.5px; transform: translateY(-3px); margin-left: 4px; }

/* ---- Board -------------------------------------------------------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.rows li { display: block; }
.rows li + li { border-top: 1px solid var(--line); }
.row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 18px;
  text-decoration: none;
  color: inherit;
}
.row:hover { background: var(--sage-tint); }
.row .client {
  font-weight: 700;
  color: var(--ink);
  font-size: 15.5px;
  flex: 0 0 auto;
  min-width: 180px;
}
.row .row-kpi {
  color: var(--muted);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row .who { color: var(--muted); font-size: 13px; flex: 0 0 auto; }
.rows li.is-waiting .row { box-shadow: inset 3px 0 0 var(--gold); }

/* ---- Cards / panels ----------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
}
.card + .card { margin-top: 18px; }

/* Document-style content (requirements, review findings) */
.doc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 8px;
  max-height: 540px;
  overflow: auto;
}

/* ---- Stage timeline ----------------------------------------------- */
.timeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 22px 0 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.stage {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 18px;
  position: relative;
}
.stage + .stage { border-left: 1px solid var(--line); }
.stage .num {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  background: var(--surface-sunk);
  color: var(--muted);
  border: 1px solid var(--line-strong);
}
.stage .lab { font-weight: 600; font-size: 14px; color: var(--muted); }
.stage.is-current { background: var(--gold-tint); }
.stage.is-current .num { background: var(--gold); color: #fff; border-color: var(--gold); }
.stage.is-current .lab { color: var(--gold); }
.stage.is-done .num { background: var(--grass); color: #fff; border-color: var(--grass); }
.stage.is-done .lab { color: var(--ink); }
.stage.is-done .num::after { content: "\2713"; }
.stage.is-done .num span { display: none; }

/* ---- Forms -------------------------------------------------------- */
form { margin: 0; }
.field { display: block; margin-bottom: 16px; }
.field > span, label.field {
  display: block;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
  margin-bottom: 6px;
}
input[type=text], input[type=email], input[type=password],
input[type=number], input:not([type]), select, textarea, input[type=file] {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
input[type=number] { font-variant-numeric: tabular-nums; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(18,64,58,.14);
}
textarea { resize: vertical; min-height: 72px; }
input[type=file] { padding: 9px 12px; background: var(--surface-sunk); cursor: pointer; }

.help { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

/* ---- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s ease, border-color .12s ease;
}
.btn-primary { background: var(--ink-deep); color: #fff; }
.btn-primary:hover { background: #024d49; color: #fff; }
.btn-approve { background: var(--grass); color: #fff; }
.btn-approve:hover { background: #237a34; color: #fff; }
.btn-danger { background: var(--surface); color: var(--rust); border-color: var(--rust-line); }
.btn-danger:hover { background: var(--rust-tint); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-sunk); }
.btn-block { width: 100%; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.actions--spread { justify-content: flex-start; }

/* ---- Banners / alerts --------------------------------------------- */
.alert {
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14.5px;
  margin-bottom: 16px;
  border: 1px solid var(--rust-line);
  background: var(--rust-tint);
  color: var(--rust);
}
.banner {
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.banner.blocked {
  border: 1px solid var(--rust-line);
  background: var(--rust-tint);
  color: #6f2415;
}
.banner.blocked h2 { color: var(--rust); margin-top: 0; }
.banner.blocked ul { margin: 8px 0 12px 20px; }
.banner.blocked li { margin: 3px 0; }
.note { color: var(--muted); font-size: 13px; }
.warn {
  color: var(--gold);
  background: var(--gold-tint);
  border: 1px solid var(--gold-line);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-top: 12px;
}

/* ---- Pricing gate (the hero) -------------------------------------- */
.pricing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1.05fr);
  gap: 20px;
  align-items: start;
}
.pricing-grid .card h2 { margin-top: 0; }
.inputs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.inputs-grid .field { margin-bottom: 4px; }

.totals-card { background: var(--ink-deep); color: #eaf3ee; border: none; }
.totals-card h2 { color: #fff; }
table.totals {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 14.5px;
}
table.totals th, table.totals td { text-align: left; padding: 8px 0; }
table.totals td:last-child, table.totals th:last-child { text-align: right; }
table.totals thead th {
  font-size: 12px;
  font-weight: 700;
  color: var(--sage);
  border-bottom: 1px solid rgba(201,220,197,.25);
  padding-bottom: 7px;
}
.totals-card table.totals td { color: #d7e7df; border-bottom: 1px solid rgba(255,255,255,.07); }
.totals-card .subtotal td { color: #fff; font-weight: 600; }
.totals-card .grand th {
  font-size: 18px;
  color: #fff;
  padding-top: 14px;
  border-top: 2px solid rgba(201,220,197,.4);
  border-bottom: none;
}
.totals-card .grand td {
  font-size: 18px;
  font-weight: 800;
  color: var(--grass-bright);
  padding-top: 14px;
  border-top: 2px solid rgba(201,220,197,.4);
  border-bottom: none;
}

/* Plain totals table fallback (non-pricing tables) */
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
table.data th, table.data td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
table.data thead th {
  background: var(--surface-sunk);
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 700;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data td form { display: inline-flex; gap: 6px; align-items: center; }
table.data select { width: auto; padding: 6px 9px; font-size: 13.5px; }
table.data .btn { padding: 6px 11px; font-size: 13px; }

/* ---- Login / empty states ----------------------------------------- */
.auth-wrap {
  min-height: calc(100vh - 60px);
  display: grid;
  place-items: center;
  padding: 40px 20px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 32px 30px;
}
.auth-card .mark-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.auth-card h1 { font-size: 20px; margin-bottom: 18px; }

.empty {
  text-align: center;
  padding: 56px 24px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty p { margin: 0 0 16px; font-size: 15px; }

/* ---- Lists -------------------------------------------------------- */
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.files { list-style: none; padding: 0; margin: 0; }
ul.files li {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 8px;
  font-size: 14.5px;
}

.rolepill {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--sage-tint);
  color: var(--ink);
}
.state-off { color: var(--muted); }

/* ---- Responsive --------------------------------------------------- */
@media (max-width: 860px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .timeline { flex-direction: column; }
  .stage + .stage { border-left: none; border-top: 1px solid var(--line); }
}
@media (max-width: 680px) {
  main { padding: 24px 16px 56px; }
  .topbar-inner { padding: 0 16px; gap: 14px; height: 56px; }
  .wordmark .sub { display: none; }
  .nav a { padding: 6px 9px; font-size: 14px; }
  .whoami { display: none; }
  .row { flex-wrap: wrap; gap: 8px 12px; }
  .row .client { min-width: 0; }
  .row .row-kpi { flex-basis: 100%; white-space: normal; }
  .inputs-grid { grid-template-columns: 1fr; }
  h1 { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
