/* Workspace, client portal, signing and payment pages. Same palette as the public site. */
:root {
  --navy: #0b2235; --navy-2: #06263b; --ink: #021a2b; --blue: #0b4a6e; --teal-blue: #0e5a7e; --teal: #127a74;
  --gold: #ad8239; --gold-dark: #8a6414; --gold-grad: linear-gradient(180deg, #e3c47a, #b8902f 60%, #a07519);
  --slate: #3d4f5f; --muted: #6b7b8a; --panel: #f3f5f7; --line: #e3e7eb; --white: #fff;
  --ok: #1d7a4a; --warn: #a3620a; --bad: #b42318; --radius: 10px;
  --shadow: 0 4px 16px rgba(2, 24, 38, .06);
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--navy); background: var(--panel);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.45; }
a { color: var(--teal-blue); }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #e3c47a; outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* top bar */
.top { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top img { height: 34px; display: block; }
.top .who { margin-left: auto; color: var(--slate); font-size: 14px; display: flex; gap: 12px; align-items: center; }
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 55px); }
.side { background: linear-gradient(180deg, var(--blue), var(--ink)); padding: 16px 10px; }
.side a { display: flex; align-items: center; gap: 10px; color: #dfe8ef; text-decoration: none; padding: 9px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.side a:hover { background: rgba(255,255,255,.08); }
.side a.on { background: rgba(227,196,122,.16); color: #f1d999; box-shadow: inset 3px 0 0 #e3c47a; }
.side .badge { margin-left: auto; background: #e3c47a; color: var(--navy); border-radius: 99px; padding: 0 7px; font-size: 12px; }
main { padding: 24px; max-width: 1400px; width: 100%; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: none; position: fixed; inset: 55px 0 0 0; z-index: 30; }
  .side.open { display: block; }
  .menu-btn { display: inline-block; }
  main { padding: 16px; }
}

/* building blocks */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 12px; font-weight: 700; color: var(--gold-dark); }
.stat .n { font-size: 26px; font-weight: 800; }
.stat .l { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--white); border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--navy); }
.btn:hover { border-color: #c7cfd6; }
.btn.gold { background: var(--gold-grad); border-color: #a07519; }
.btn.navy { background: var(--navy-2); color: #fff; border-color: var(--navy-2); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=search], input:not([type]), select, textarea {
  width: 100%; border: 1px solid #cfd6dc; border-radius: 8px; padding: 8px 10px; background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-weight: 600; font-size: 13px; margin: 10px 0 4px; }
.field-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
table { width: 100%; border-collapse: collapse; background: var(--white); }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); background: #fafbfc; position: sticky; top: 55px; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f7f9fb; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.pill { display: inline-block; border-radius: 99px; padding: 1px 9px; font-size: 12px; font-weight: 700; background: #eef2f5; color: var(--slate); white-space: nowrap; }
.pill.draft { background: #eef2f5; } .pill.sent, .pill.waiting, .pill.queued, .pill.doing, .pill.active { background: #e3eef6; color: var(--blue); }
.pill.viewed, .pill.review, .pill.in_review, .pill.sealing { background: #fff3d6; color: var(--warn); }
.pill.partial { background: #fde9cf; color: var(--warn); }
.pill.paid, .pill.signed, .pill.done, .pill.delivered, .pill.closed { background: #dcf3e6; color: var(--ok); }
.pill.void, .pill.declined, .pill.failed, .pill.returned, .pill.lost { background: #fde4e1; color: var(--bad); }
.notice { border-left: 3px solid #b8902f; background: #fffaf0; padding: 10px 14px; border-radius: 6px; font-size: 14px; }
.error { color: var(--bad); font-weight: 600; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--navy); border-color: #b8902f; }

/* board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: #e9edf1; border-radius: var(--radius); padding: 10px; min-height: 200px; }
.col h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--slate); display: flex; justify-content: space-between; }
.col.drop { outline: 2px dashed #b8902f; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.tile .t { font-weight: 700; }
.tile .m { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }

/* sign-in, portal, sign, pay */
.center { max-width: 460px; margin: 8vh auto; padding: 0 16px; }
.doc { max-width: 860px; margin: 24px auto; padding: 0 16px; }
.contract-body { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; max-height: 60vh; overflow: auto; }
.pad { border: 2px dashed #c7cfd6; border-radius: 8px; background: #fff; width: 100%; height: 160px; touch-action: none; }
.money { font-variant-numeric: tabular-nums; }
.hero-band { background: linear-gradient(120deg, var(--blue), var(--ink)); color: #fff; padding: 22px 24px; border-radius: var(--radius); }
.hero-band .eyebrow { color: #e3c47a; }
.dropzone { border: 2px dashed #c7cfd6; border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted); background: #fff; }
.dropzone.over { border-color: #b8902f; background: #fffaf0; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy-2); color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 99; box-shadow: var(--shadow); }
dialog { border: 0; border-radius: 12px; padding: 0; width: min(720px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog .dh { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
dialog .db { padding: 16px 20px; max-height: 70vh; overflow: auto; }
dialog .df { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
dialog::backdrop { background: rgba(2, 26, 43, .45); }

/* timesheets, mileage, banking */
.pill.submitted, .pill.open, .pill.unmatched { background: #fff3d6; color: var(--warn); }
.pill.approved, .pill.posted, .pill.billed, .pill.matched { background: #dcf3e6; color: var(--ok); }
.pill.rejected, .pill.sent_back { background: #fde4e1; color: var(--bad); }
.pill.excluded { background: #eef2f5; color: var(--muted); }
details.card summary { cursor: pointer; }
