:root {
  --navy: #13294b; --navy2: #1d3a66; --amber: #f5a524; --amber-d: #d98b0b;
  --bg: #f6f7f9; --card: #fff; --text: #1d2433; --muted: #667085; --line: #e3e6ec;
  --green: #12805c; --red: #c0352b; --blue: #1f6feb; --yellow: #b7791f;
  --r: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--navy2); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 small, h2 small { font-size: .55em; color: var(--muted); font-weight: 500; margin-left: .4em; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 820px; }
.pad { padding-top: 48px; padding-bottom: 48px; }
.center { text-align: center; }
.muted { color: var(--muted); } .small { font-size: .88em; }
.lead { font-size: 1.15em; color: #3b4456; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78em; font-weight: 700; color: var(--amber-d); margin: 0 0 .5em; }

/* header */
.top { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 10; }
.bar { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 1.05em; letter-spacing: .04em; }
.logo img { width: 40px; height: 40px; }
.logo small { display: block; font-size: .68em; color: var(--amber); letter-spacing: .08em; }
.top nav { display: flex; align-items: center; gap: 4px; }
.top nav a { color: #dfe6f2; text-decoration: none; padding: 8px 12px; border-radius: 6px; }
.top nav a:hover, .top nav a.on { color: #fff; background: var(--navy2); }
.top nav a.btn { color: var(--navy); background: var(--amber); margin-left: 8px; }
.menu-btn { display: none; background: none; border: 0; color: #fff; font-size: 1.6em; cursor: pointer; }
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .top nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--navy); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; }
  .top nav.open { display: flex; }
  .top nav a.btn { margin: 8px 0 0; text-align: center; }
}

/* buttons */
.btn { display: inline-block; background: var(--amber); color: var(--navy); border: 0; padding: 12px 22px; border-radius: 8px; font-weight: 700; font-size: 1em; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--amber-d); }
.btn.ghost { background: transparent; color: inherit; border: 2px solid currentColor; }
.btn.sm { padding: 6px 12px; font-size: .88em; }
.btn.danger { background: var(--red); color: #fff; }
button.link { background: none; border: 0; color: var(--amber); cursor: pointer; padding: 0; font: inherit; }

/* hero */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%); color: #fff; padding: 88px 0; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -80px; bottom: -80px; width: 420px; height: 420px; border: 40px solid rgba(245,165,36,.12); transform: rotate(45deg); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
.hero .lead { color: #d5deeb; max-width: 640px; }
.hero.slim { padding: 56px 0; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.cta .ghost { color: #fff; }

/* grids & cards */
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; margin-bottom: 20px; overflow-x: auto; }
.card h3 { color: var(--navy); }
.card ul { padding-left: 1.2em; margin: 0; }
.choice { text-decoration: none; color: inherit; border-top: 4px solid var(--amber); transition: transform .15s; }
.choice:hover { transform: translateY(-3px); }
.band { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 48px 0; }
.split { display: grid; grid-template-columns: 3fr 2fr; gap: 32px; align-items: center; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.callout { background: #fff8e8; border-left: 5px solid var(--amber); padding: 18px; border-radius: 6px; margin-bottom: 20px; }
.stats div { text-align: center; } .stats b { display: block; font-size: 1.2em; color: var(--navy); } .stats span { color: var(--muted); }
.rules li { margin-bottom: 10px; }
.steps p { display: flex; gap: 12px; align-items: center; }
.steps .n { background: var(--navy); color: #fff; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; font-weight: 700; }
.code { font: 700 2.2em ui-monospace, Consolas, monospace; color: var(--navy); background: #fff; border: 2px dashed var(--amber); display: inline-block; padding: 8px 24px; border-radius: 8px; }

/* footer */
.foot { background: var(--navy); color: #c8d2e3; padding: 40px 0 20px; margin-top: 40px; }
.foot a { color: var(--amber); }
.foot .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.foot b { color: #fff; }
.fine { margin-top: 24px; font-size: .85em; color: #8b9bb6; }
@media (max-width: 760px) { .foot .cols { grid-template-columns: 1fr; } }

/* forms */
.form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: .95em; }
.form label small { font-weight: 400; color: var(--muted); }
.form input:not([type=checkbox]), .form select, .form textarea, .filters input, .filters select, .mini select, .mini input {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #c9ced8; border-radius: 7px; font: inherit; background: #fff; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--amber); border-color: var(--amber); }
.form fieldset { border: 1px solid var(--line); background: #fff; border-radius: var(--r); padding: 18px 20px 6px; margin: 0 0 20px; }
.form legend { font-weight: 700; color: var(--navy); padding: 0 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .row, .row3 { grid-template-columns: 1fr; gap: 0; } }
.form .check { display: flex; gap: 10px; font-weight: 400; align-items: flex-start; }
.form .check input { margin-top: 4px; flex: none; width: 18px; height: 18px; }
.consent { background: #f2f4f8; border: 1px solid var(--line); padding: 14px; border-radius: 6px; font-size: .9em; margin-bottom: 14px; max-height: 200px; overflow: auto; }
.form.inline { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.form.inline .btn { margin-bottom: 14px; }
@media (max-width: 600px) { .form.inline { grid-template-columns: 1fr; } }

.alert { padding: 12px 16px; border-radius: 7px; margin: 0 0 16px; }
.alert.ok { background: #e3f6ee; color: #0b5d42; border: 1px solid #a7e0c8; }
.alert.err { background: #fdecea; color: #8f1f17; border: 1px solid #f3b8b2; }
.alert.info { background: #eef4ff; color: #1b3d7a; border: 1px solid #bcd0f7; }

/* badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78em; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; background: #e8ebf0; color: #3b4456; vertical-align: middle; }
.badge.big { font-size: 1.2em; padding: 8px 20px; }
.badge.approved, .badge.verified, .badge.pass, .badge.risk-low { background: #dcf3e9; color: var(--green); }
.badge.conditional, .badge.warn, .badge.risk-medium, .badge.pending { background: #fdf0d5; color: var(--yellow); }
.badge.rejected, .badge.suspended, .badge.fail, .badge.risk-high { background: #fbe1de; color: var(--red); }
.status-card { text-align: center; margin-top: 20px; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: .92em; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .85em; text-transform: uppercase; letter-spacing: .03em; }
.kv th { width: 34%; text-transform: none; font-size: .9em; }
.checks tr.r-fail { background: #fff6f5; } .checks tr.r-warn { background: #fffbf0; }
.mini { display: flex; gap: 6px; min-width: 260px; } .mini select { width: 90px; } .mini input, .mini select { margin: 0; padding: 6px; }
.sum i { font-style: normal; display: inline-block; min-width: 22px; text-align: center; border-radius: 4px; margin-right: 2px; font-size: .85em; font-weight: 700; }
.sum .pass { background: #dcf3e9; color: var(--green); } .sum .warn { background: #fdf0d5; color: var(--yellow); }
.sum .fail { background: #fbe1de; color: var(--red); } .sum .pending { background: #e8ebf0; color: var(--muted); }
.ids { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.ids img { max-width: 240px; max-height: 160px; border: 1px solid var(--line); border-radius: 6px; }
form.inline { display: inline; }

/* admin */
body.admin { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #fff; padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: #c8d2e3; text-decoration: none; padding: 9px 12px; border-radius: 6px; }
.side nav a.on, .side nav a:hover { background: var(--navy2); color: #fff; }
.side .who { margin-top: auto; font-size: .9em; color: #c8d2e3; }
.content { padding: 28px; min-width: 0; }
@media (max-width: 860px) {
  body.admin { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .content { padding: 16px; }
}
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile { background: #fff; border: 1px solid var(--line); border-left: 5px solid #c9ced8; border-radius: var(--r); padding: 16px; text-decoration: none; color: var(--text); }
.tile b { display: block; font-size: 2em; color: var(--navy); }
.tile span { color: var(--muted); font-size: .9em; }
.tile.blue { border-left-color: var(--blue); } .tile.amber { border-left-color: var(--amber); }
.tile.green { border-left-color: var(--green); } .tile.red { border-left-color: var(--red); }
.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input { max-width: 320px; margin: 0; } .filters select { max-width: 180px; margin: 0; }
.decision { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; margin-bottom: 20px; }
.login-bg { background: linear-gradient(135deg, var(--navy), var(--navy2)); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-box { background: #fff; padding: 32px; border-radius: 14px; width: 100%; max-width: 380px; }
.login-logo { width: 56px; display: block; margin-bottom: 12px; }

/* jobs, quotes, invoices */
.r { text-align: right; }
.lines input { width: 100%; padding: 6px; border: 1px solid #c9ced8; border-radius: 5px; font: inherit; }
.checks tr.r-pass, .list tr.r-pass { background: #f1fbf6; }
details summary { cursor: pointer; color: var(--navy2); font-weight: 600; margin: 10px 0; }
.print-doc { background: #e9ecf1; }
.sheet { background: #fff; max-width: 820px; margin: 24px auto; padding: 36px; border-radius: 6px; }
.doc-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--navy); padding-bottom: 12px; margin-bottom: 18px; }
.doc-head > div:first-child { display: flex; gap: 10px; align-items: center; }
.no-print { text-align: right; margin-bottom: 10px; }
@media print { .no-print { display: none; } .print-doc { background: #fff; } .sheet { margin: 0; padding: 0; max-width: none; } }
@media (max-width: 600px) { .sheet { padding: 16px; margin: 0; } }

/* fair-chance steps (staff) */
.fc-steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; flex-wrap: wrap; counter-reset: f; }
.fc-steps li { counter-increment: f; flex: 1; min-width: 150px; padding: 10px 12px; border-top: 3px solid var(--line); font-size: .9em; color: var(--muted); }
.fc-steps li::before { content: counter(f) ". "; font-weight: 700; }
.fc-steps li.done { border-color: var(--green); color: var(--text); }
.fc-steps li.now { border-color: var(--amber); color: var(--text); font-weight: 700; }
.list tr.r-fail { background: #fff6f5; }
