:root {
  --green: #0f3b2c; --green-2: #164a38; --gold: #c8a25a; --gold-soft: #f3e7cc;
  --bg: #f5f4ef; --card: #fff; --line: #e4e0d4; --ink: #1d2420; --muted: #66706a;
  --ok: #1f7a4d; --ok-bg: #e3f2e9; --warn: #8a5b00; --warn-bg: #fbf0d9; --bad: #a3261b; --bad-bg: #fbe4e1;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--green); }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-variant: small-caps; letter-spacing: .01em; margin: 0 0 .4em; color: var(--green); }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 40px; }
main.narrow { max-width: 720px; }
.top { background: var(--green); color: #fff; }
.top-row { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand .mark { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; font-weight: 700; color: var(--gold); }
.brand b { display: block; font-family: Georgia, serif; font-variant: small-caps; font-size: 1.1rem; line-height: 1.1; }
.brand small { display: block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.env { background: var(--gold-soft); color: var(--warn); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.who small { display: block; opacity: .7; font-size: .72rem; }
nav.sub { background: var(--green-2); }
nav.sub .wrap { display: flex; gap: 4px; overflow-x: auto; }
nav.sub a { color: rgba(255,255,255,.8); text-decoration: none; padding: 10px 12px; white-space: nowrap; border-bottom: 2px solid transparent; font-size: .95rem; }
nav.sub a.on, nav.sub a:hover { color: #fff; border-bottom-color: var(--gold); }
.foot { color: var(--muted); font-size: .8rem; padding-bottom: 24px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card.dark { background: var(--green); color: #fff; border: 0; }
.card.dark h1, .card.dark h2 { color: #fff; }
.eyebrow { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.lead { color: var(--muted); margin-top: -4px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit; display: block; }
.stat b { display: block; font-size: 1.8rem; font-family: Georgia, serif; color: var(--green); }
.stat span { color: var(--muted); font-size: .9rem; }

label { display: block; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
label.inline { display: flex; gap: 10px; align-items: flex-start; text-transform: none; letter-spacing: 0; font-size: 1rem; font-weight: 400; color: var(--ink); }
label.inline input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
input, select, textarea { width: 100%; font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); min-height: 48px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
input[readonly] { background: #f7f6f2; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.err { font-size: .85rem; color: var(--bad); margin-top: 4px; font-weight: 600; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 20px; border-radius: 10px; border: 1px solid var(--green); background: var(--green); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1b1a14; }
.btn.ghost { background: transparent; color: var(--green); }
.top .btn.ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn.block { width: 100%; }
.actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.actions .btn:last-child { flex: 1; }
.flash { background: var(--gold-soft); border: 1px solid var(--gold); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }
.notice { background: #eef3f0; border-left: 4px solid var(--green); padding: 12px 16px; border-radius: 8px; font-size: .92rem; margin: 12px 0; }
.notice.warn { background: var(--warn-bg); border-color: var(--gold); }
.notice.bad { background: var(--bad-bg); border-color: var(--bad); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.muted { background: #eceae3; color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: .93rem; vertical-align: top; }
table.list th { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: #faf9f5; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; color: var(--muted); padding: 32px; }

dl.kv { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; margin: 0; }
dl.kv dt, dl.kv dd { padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
dl.kv dt { color: var(--muted); font-size: .92rem; }
dl.kv dd { text-align: right; font-weight: 500; }

.progress { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.bar { height: 6px; background: #ece9e0; border-radius: 99px; margin: 8px 0 10px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--gold); }
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.steps a, .steps span { font-size: .78rem; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); text-decoration: none; }
.steps .on { border-color: var(--gold); background: var(--gold-soft); color: var(--warn); font-weight: 600; }
.steps .done { color: var(--ok); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: end; }
.filters input, .filters select { width: auto; min-width: 160px; flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--green); border-bottom-color: var(--gold); font-weight: 600; }

.photo { width: 100%; max-width: 280px; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: #eee; border: 1px solid var(--line); }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 50%; background: #eee; }
.evidence { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.evidence figure { margin: 0; }
.evidence img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #fafafa; }
.evidence figcaption { font-size: .8rem; color: var(--muted); }
.sigpad { border: 1px dashed var(--muted); border-radius: 10px; background: #fff; width: 100%; height: 180px; touch-action: none; display: block; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 10px 0 10px 24px; border-left: 2px solid var(--gold); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); }
.qr { background: #fff; padding: 8px; border-radius: 10px; width: 180px; height: 180px; }
.qr svg { width: 100%; height: 100%; }
.split { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 860px) { .split { grid-template-columns: 2fr 1fr; } .split.even { grid-template-columns: 1fr 1fr; } }
.login { max-width: 420px; margin: 40px auto; }
.demo-users { font-size: .88rem; }
.demo-users td { padding: 4px 8px; }
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: #faf9f5; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 12px; }
.calc b { font-size: 1.2rem; font-family: Georgia, serif; }
body.public { background: #f2f1ec; }
@media print { .top, nav, .foot, .actions, .no-print { display: none !important; } body { background: #fff; } .card { border: 0; } }
