:root {
  --brand: #0b7a4f;        /* forest green */
  --brand-dark: #064d33;   /* deep jungle */
  --brand-soft: #e1f4ea;
  --sun: #f6b800;          /* sun yellow */
  --sun-soft: #fff3c4;
  --sun-ink: #5c4300;
  --lagoon: #1565c0;       /* lagoon blue */
  --lagoon-bright: #1e7de0;
  --lagoon-soft: #e0edff;
  --gold: #f6b800;
  --bg: #eef8f2;
  --card: #ffffff;
  --ink: #12241b;
  --muted: #566b60;
  --line: #d3e4da;
  --danger: #b3261e;
  --red: #d62f2f;
  --red-soft: #fde8e8;
  --red-dark: #8f1a1a;
  --warn: #a35f00;
  --radius: 18px;
  --nav-h: 80px;
  --weave: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22160%22 height=%22160%22 viewBox=%220 0 160 160%22%3E %3Cpath d=%22M80 34 L126 80 L80 126 L34 80 Z%22 fill=%22none%22 stroke=%22%231565c0%22 stroke-width=%221.6%22 stroke-opacity=%220.3%22/%3E %3Cpath d=%22M80 44 L116 80 L80 116 L44 80 Z%22 fill=%22none%22 stroke=%22%230b7a4f%22 stroke-width=%221.2%22 stroke-opacity=%220.28%22/%3E %3Cpath d=%22M80 56 L104 80 L80 104 L56 80 Z%22 fill=%22none%22 stroke=%22%23d62f2f%22 stroke-width=%221.6%22 stroke-opacity=%220.38%22/%3E %3Cpath d=%22M80 69 L91 80 L80 91 L69 80 Z%22 fill=%22%23f6b800%22 fill-opacity=%220.6%22/%3E %3Cpath d=%22M10 73 L18 80 L10 87 M20 73 L28 80 L20 87 M150 73 L142 80 L150 87 M140 73 L132 80 L140 87%22 fill=%22none%22 stroke=%22%230b7a4f%22 stroke-width=%221.4%22 stroke-opacity=%220.28%22 stroke-linejoin=%22miter%22/%3E %3Cpath d=%22M80 4 L85 10 L80 16 L75 10Z M80 144 L85 150 L80 156 L75 150Z%22 fill=%22%23f6b800%22 fill-opacity=%220.6%22/%3E %3Cpath d=%22M0 -7 L7 0 L0 7 L-7 0Z M160 -7 L167 0 L160 7 L153 0Z M0 153 L7 160 L0 167 L-7 160Z M160 153 L167 160 L160 167 L153 160Z%22 fill=%22%23d62f2f%22 fill-opacity=%220.38%22/%3E %3C/svg%3E");
  --weave-dark: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22160%22 height=%22160%22 viewBox=%220 0 160 160%22%3E %3Cpath d=%22M80 34 L126 80 L80 126 L34 80 Z%22 fill=%22none%22 stroke=%22%237fb8ff%22 stroke-width=%221.6%22 stroke-opacity=%220.34%22/%3E %3Cpath d=%22M80 44 L116 80 L80 116 L44 80 Z%22 fill=%22none%22 stroke=%22%239be3bd%22 stroke-width=%221.2%22 stroke-opacity=%220.3%22/%3E %3Cpath d=%22M80 56 L104 80 L80 104 L56 80 Z%22 fill=%22none%22 stroke=%22%23ff7b7b%22 stroke-width=%221.6%22 stroke-opacity=%220.4%22/%3E %3Cpath d=%22M80 69 L91 80 L80 91 L69 80 Z%22 fill=%22%23ffd23f%22 fill-opacity=%220.55%22/%3E %3Cpath d=%22M10 73 L18 80 L10 87 M20 73 L28 80 L20 87 M150 73 L142 80 L150 87 M140 73 L132 80 L140 87%22 fill=%22none%22 stroke=%22%239be3bd%22 stroke-width=%221.4%22 stroke-opacity=%220.3%22 stroke-linejoin=%22miter%22/%3E %3Cpath d=%22M80 4 L85 10 L80 16 L75 10Z M80 144 L85 150 L80 156 L75 150Z%22 fill=%22%23ffd23f%22 fill-opacity=%220.55%22/%3E %3Cpath d=%22M0 -7 L7 0 L0 7 L-7 0Z M160 -7 L167 0 L160 7 L153 0Z M0 153 L7 160 L0 167 L-7 160Z M160 153 L167 160 L160 167 L153 160Z%22 fill=%22%23ff7b7b%22 fill-opacity=%220.4%22/%3E %3C/svg%3E");
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; color: var(--ink);
  font: 18px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; background-color: var(--bg); background-image: var(--weave); background-size: 160px 160px; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif; letter-spacing: .01em; }
a { color: var(--lagoon); }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  background: linear-gradient(100deg, var(--brand-dark) 0%, var(--brand) 55%, #0d6f86 100%); color: #fff; padding: 0 14px; height: 62px;
  padding-top: env(safe-area-inset-top); box-sizing: content-box; box-shadow: 0 4px 14px rgba(6,77,51,.22); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 10px; background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2296%22 height=%2210%22 viewBox=%220 0 96 10%22%3E %3Crect width=%2296%22 height=%222%22 fill=%22%23f6b800%22/%3E %3Cpath d=%22M0 2 L12 10 L24 2Z%22 fill=%22%23f6b800%22/%3E%3Cpath d=%22M24 2 L36 10 L48 2Z%22 fill=%22%23d62f2f%22/%3E%3Cpath d=%22M48 2 L60 10 L72 2Z%22 fill=%22%231e7de0%22/%3E%3Cpath d=%22M72 2 L84 10 L96 2Z%22 fill=%22%232fb36f%22/%3E%3C/svg%3E") repeat-x 0 0 / 96px 10px; pointer-events: none; }
.top h1 { font-size: 23px; font-weight: 700; letter-spacing: .03em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .icon { background: rgba(255,255,255,.14); border: 0; border-radius: 12px; color: #fff; font-size: 34px; line-height: 1; width: 46px; height: 46px; cursor: pointer; }
.page { max-width: 760px; margin: 0 auto; padding: 30px 16px calc(var(--nav-h) + 34px + env(safe-area-inset-bottom)); }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(6,77,51,.08);
  display: flex; justify-content: space-around; }
.bottom::before { content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 10px; background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2296%22 height=%2210%22 viewBox=%220 0 96 10%22%3E %3Crect y=%228%22 width=%2296%22 height=%222%22 fill=%22%23f6b800%22/%3E %3Cpath d=%22M0 8 L12 0 L24 8Z%22 fill=%22%23f6b800%22/%3E%3Cpath d=%22M24 8 L36 0 L48 8Z%22 fill=%22%23d62f2f%22/%3E%3Cpath d=%22M48 8 L60 0 L72 8Z%22 fill=%22%231e7de0%22/%3E%3Cpath d=%22M72 8 L84 0 L96 8Z%22 fill=%22%232fb36f%22/%3E%3C/svg%3E") repeat-x 0 0 / 96px 10px; pointer-events: none; }
.bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 600; position: relative; }
.bottom a .ico { font-size: 28px; line-height: 1; }
.bottom a.on { color: var(--lagoon); font-weight: 800; }
.bottom a.on::after { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, var(--sun), var(--red), var(--sun)); }
.bottom a.new { color: var(--brand-dark); font-weight: 800; }
.bottom a.new .ico { background: var(--sun); color: var(--brand-dark); width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 34px; margin-top: -26px; border: 4px solid #fff; box-shadow: 0 4px 12px rgba(6,77,51,.4); }
.badge { position: absolute; top: 8px; left: calc(50% + 10px); background: var(--danger); color: #fff; font-size: 13px; font-weight: 800;
  min-width: 22px; height: 22px; border-radius: 11px; display: flex; align-items: center; justify-content: center; padding: 0 6px; border: 2px solid #fff; }

.splash { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; color: var(--muted); gap: 12px; }
.spinner { width: 42px; height: 42px; border: 5px solid var(--sun-soft); border-top-color: var(--lagoon); border-right-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- cards & lists ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--sun); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: 0 8px 22px rgba(6,77,51,.08); }
.card h2 { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; color: var(--brand-dark); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.card h2::before { content: ""; flex: 0 0 auto; width: 11px; height: 11px; background: var(--sun); transform: rotate(45deg); border-radius: 1px; box-shadow: 6px 0 0 -3px var(--red); margin-right: 5px; }
.card:nth-of-type(3n+2) h2::before { background: var(--lagoon-bright); box-shadow: 6px 0 0 -3px var(--sun); }
.card:nth-of-type(3n) h2::before { background: var(--brand); box-shadow: 6px 0 0 -3px var(--sun); }
.card:nth-of-type(4n) h2::before { background: var(--red); box-shadow: 6px 0 0 -3px var(--sun); }
.empty { text-align: center; color: var(--muted); padding: 44px 16px; background: rgba(255,255,255,.88); border: 2px dashed var(--line); border-radius: var(--radius); }
.empty b { display: block; font-family: Georgia, serif; font-size: 21px; color: var(--ink); margin-bottom: 6px; }

.tabs { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 14px; }
.tabs button { flex: 0 0 auto; border: 1px solid #b9cfc3; background: #fff; color: var(--ink); padding: 10px 18px; border-radius: 26px;
  font-size: 17px; font-weight: 600; cursor: pointer; min-height: 50px; }
.tabs button.on { background: var(--lagoon); border-color: var(--lagoon); color: #fff; font-weight: 800; box-shadow: 0 4px 10px rgba(21,101,192,.30); }
.tabs .n { background: var(--sun); color: var(--brand-dark); border-radius: 12px; font-size: 14px; font-weight: 800; padding: 2px 8px; margin-left: 6px; }

.filters { display: flex; gap: 10px; margin-bottom: 14px; }
.filters input, .filters select { flex: 1; min-width: 0; }

.v-item { display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line);
  border-left: 6px solid var(--sun); border-radius: var(--radius); padding: 16px 16px 16px 16px; margin-bottom: 14px; box-shadow: 0 6px 18px rgba(6,77,51,.08); }
.v-item:has(.s-wait2) { border-left-color: var(--lagoon-bright); }
.v-item:has(.s-ok) { border-left-color: var(--brand); }
.v-item:has(.s-paid) { border-left-color: var(--brand-dark); }
.v-item:has(.s-ret) { border-left-color: var(--danger); }
.v-item:has(.s-can) { border-left-color: #9aa8a1; }
.v-item:active { background: var(--sun-soft); }
.v-item .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.v-item .num { font-family: Georgia, serif; font-weight: 700; font-size: 20px; color: var(--brand-dark); }
.v-item .amt { font-weight: 800; font-size: 20px; white-space: nowrap; color: var(--lagoon); }
.v-item .payee { margin: 4px 0 6px; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-item .meta { color: var(--muted); font-size: 15px; }

.chip { display: inline-block; font-size: 14px; font-weight: 700; padding: 5px 12px; border-radius: 14px; margin: 4px 4px 0 0; }
.s-wait { background: var(--sun-soft); color: var(--sun-ink); }
.s-wait2 { background: var(--lagoon-soft); color: #0c3f86; }
.s-ok { background: #d5f3e2; color: #08502f; }
.s-paid { background: var(--brand); color: #fff; }
.s-ret { background: #fde2e0; color: #8c1d18; }
.s-can { background: #e8ecea; color: #51605a; }

/* ---------- forms ---------- */
label { display: block; font-size: 17px; font-weight: 700; margin: 16px 0 6px; color: var(--brand-dark); }
label small { font-weight: 400; color: var(--muted); font-size: 15px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid #b9cfc3;
  border-radius: 12px; padding: 13px 14px; min-height: 56px; }
textarea { min-height: 104px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--sun); outline-offset: 0; border-color: var(--lagoon); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { color: var(--muted); font-size: 15px; margin: 8px 0 0; }
.hint.warn { color: var(--warn); font-weight: 600; }
.error { color: var(--danger); font-size: 16px; font-weight: 600; margin-top: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 58px; padding: 0 22px;
  border-radius: 14px; border: 1px solid var(--brand-dark); background: linear-gradient(180deg, #0f8a5a, var(--brand)); color: #fff; font: inherit; font-size: 18px; font-weight: 700; letter-spacing: 0;
  cursor: pointer; text-decoration: none; box-shadow: 0 4px 12px rgba(6,77,51,.30); transition: transform .08s, box-shadow .08s; }
.btn:active { background: var(--brand-dark); transform: translateY(2px); box-shadow: 0 1px 3px rgba(6,77,51,.3); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.block { display: flex; width: 100%; margin-top: 18px; }
.btn.ghost { background: #fff; color: var(--lagoon); border-color: var(--lagoon); box-shadow: 0 3px 10px rgba(21,101,192,.18); }
.btn.warn { background: linear-gradient(180deg, #ffcb1f, var(--sun)); color: var(--brand-dark); border-color: #b98a00; box-shadow: 0 4px 12px rgba(185,138,0,.32); }
.btn.danger { background: #fff; color: var(--danger); border-color: var(--danger); box-shadow: 0 3px 10px rgba(179,38,30,.16); }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 16px; border-radius: 10px; box-shadow: 0 3px 8px rgba(6,77,51,.25); }
.btn.small.danger { box-shadow: 0 3px 8px rgba(179,38,30,.16); }
.actions { display: grid; gap: 14px; margin-top: 16px; }

.item-row { display: grid; grid-template-columns: 1fr 130px 50px; gap: 10px; margin-bottom: 10px; align-items: start; }
.item-row .rm { background: #fff; border: 2px solid var(--line); border-radius: 14px; min-height: 56px; font-size: 22px; color: var(--danger); cursor: pointer; }
.total-line { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: space-between; font-size: 22px; font-weight: 800; padding: 14px 4px 0; border-top: 2px solid var(--sun); margin-top: 10px; color: var(--brand-dark); }

.files { list-style: none; padding: 0; margin: 12px 0 0; }
.files li { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; background: #f7fbf9; }
.files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .sz { color: var(--muted); font-size: 14px; }
.files button { border: 0; background: transparent; font-size: 22px; color: var(--danger); cursor: pointer; width: 40px; height: 40px; }
.file-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- voucher detail ---------- */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 12px; font-size: 17px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.big-amt { font-family: Georgia, serif; font-size: 38px; font-weight: 700; margin: 8px 0 2px; color: var(--lagoon); letter-spacing: -.01em; }
table.items { width: 100%; border-collapse: collapse; font-size: 17px; }
table.items td { padding: 9px 0; border-bottom: 2px dotted var(--line); vertical-align: top; }
table.items td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
table.items tr.tot td { font-weight: 800; border-bottom: 0; color: var(--brand-dark); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 4px dotted #b9cfc3; }
.timeline li { position: relative; padding: 0 0 18px 16px; }
.timeline li::before { content: ""; position: absolute; left: -29px; top: 6px; width: 16px; height: 16px; transform: rotate(45deg); border-radius: 3px; background: var(--brand); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--sun); }
.timeline li.ret::before { background: var(--danger); }
.timeline .who { font-weight: 700; }
.timeline .when { color: var(--muted); font-size: 15px; }
.timeline .cmt { background: var(--sun-soft); border-radius: 10px; padding: 8px 12px; margin-top: 6px; font-size: 16px; }
.returned-banner { background: #fde2e0; color: #6d1410; border: 2px solid #f1b0ab; border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; font-weight: 600; }

/* ---------- auth ---------- */
body:has(.auth) { background-color: var(--brand-dark); background-image: var(--weave-dark); }
.auth { max-width: 460px; margin: 0 auto; padding: 36px 18px 48px; }
.auth .logo { width: 104px; height: 104px; border-radius: 26px; display: block; margin: 8px auto 14px; border: 2px solid var(--sun); box-shadow: 0 10px 26px rgba(0,0,0,.35); background: #fff; }
.auth h1 { text-align: center; font-size: 30px; font-weight: 700; letter-spacing: .04em; color: #fff; }
.auth .sub { text-align: center; color: #ffe27a; font-family: Georgia, serif; font-style: italic; font-size: 20px; font-weight: 400; letter-spacing: .03em; margin: 6px 0 22px; }
.auth .card { border-color: var(--sun); border-width: 2px; box-shadow: 0 14px 34px rgba(0,0,0,.35); position: relative; padding-top: 26px; }
.auth .card::before { content: ""; position: absolute; left: 14px; right: 14px; top: 8px; height: 8px; background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2248%22 height=%228%22 viewBox=%220 0 48 8%22%3E %3Cpath d=%22M12 0 L18 4 L12 8 L6 4Z%22 fill=%22%23f6b800%22/%3E%3Cpath d=%22M36 0 L42 4 L36 8 L30 4Z%22 fill=%22%23d62f2f%22/%3E%3Ccircle cx=%2224%22 cy=%224%22 r=%221.4%22 fill=%22%231e7de0%22/%3E%3Ccircle cx=%220%22 cy=%224%22 r=%221.4%22 fill=%22%231e7de0%22/%3E%3Ccircle cx=%2248%22 cy=%224%22 r=%221.4%22 fill=%22%231e7de0%22/%3E%3C/svg%3E") repeat-x center / 48px 8px; }
.auth .links { display: flex; justify-content: space-between; margin-top: 18px; font-size: 17px; font-weight: 600; }
.auth .links a { cursor: pointer; }
.auth > p, .auth .hint { color: #d7f2e3; }
.auth .card .hint { color: var(--muted); }
.auth .card h2 { color: var(--brand-dark); }

/* ---------- admin ---------- */
.user-row { border-bottom: 2px dotted var(--line); padding: 14px 0; }
.user-row:last-child { border-bottom: 0; }
.user-row .nm { font-weight: 800; font-size: 19px; }
.user-row .em { color: var(--muted); font-size: 15px; margin-bottom: 8px; word-break: break-all; }
.dept-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 2px dotted var(--line); }
.dept-add { display: flex; gap: 10px; margin-top: 14px; }

/* ---------- modal & toast ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(6,40,28,.72); display: flex; align-items: center; justify-content: center; padding: 14px; }
.modal .sheet { background: #fff; border-radius: 20px; border: 2px solid var(--sun); box-shadow: 0 18px 40px rgba(0,0,0,.3); max-width: 600px; width: 100%; max-height: 90vh; overflow: auto; padding: 16px; }
.modal img { width: 100%; height: auto; border-radius: 10px; display: block; }
.modal .bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.modal .bar b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom)); z-index: 60;
  background: var(--brand-dark); color: #fff; padding: 14px 20px; border-radius: 16px; border: 2px solid var(--sun); max-width: 92vw; font-size: 17px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s; text-align: center; }
#toast.show { opacity: 1; }
#toast.err { background: var(--danger); border-color: #fff; }

@media (min-width: 760px) {
  .bottom { max-width: 760px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .bottom::before { display: none; }
}

.chip.s-high { background: #fde2e0; color: #8c1d18; font-weight: 800; }

.seg { display: flex; border: 2px solid var(--lagoon); border-radius: 16px; overflow: hidden; margin-bottom: 12px; background: #fff; }
.seg button { flex: 1; border: 0; background: #fff; color: var(--lagoon); padding: 15px 8px; font: inherit; font-size: 17px; font-weight: 600; cursor: pointer; }
.seg button + button { border-left: 2px solid var(--lagoon); }
.seg button.on { background: var(--lagoon); color: #fff; font-weight: 800; }

@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } .btn { transition: none; } }

/* ---- final approver company ticks ---- */
.co-box { margin-top: 12px; padding: 12px 14px; border: 2px dashed var(--lagoon-bright); border-radius: 14px; background: var(--lagoon-soft); font-size: 16px; }
.co-box small { color: var(--muted); }
.chk { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; font-weight: 600; color: var(--ink); font-size: 17px; }
.chk input { width: 24px; height: 24px; min-height: 0; flex: 0 0 auto; accent-color: var(--brand); }

/* cash proof */
.cash-box { margin-top: 14px; padding: 14px; border: 2px dashed var(--sun); border-radius: 16px; background: #fffbea; }
.sigpad { width: 100%; height: auto; aspect-ratio: 9 / 4; border: 3px dashed var(--line); border-radius: 14px; background: #fff; touch-action: none; display: block; cursor: crosshair; }
.proof-card { border: 2px solid var(--sun); }

/* signature-before-sending */
.sig-box { margin-top: 14px; padding: 14px; border: 2px dashed var(--sun); border-radius: 16px; background: #fffbea; }
.sig-prev { display: block; max-width: 260px; width: 100%; height: auto; margin: 8px 0 10px; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.sig-prev.small { max-width: 150px; margin: 6px 0 0; }

/* purchase-type evidence */
.sup-box { margin-top: 14px; padding: 14px; border: 2px dashed var(--sun); border-radius: 16px; background: #fffbea; }

/* ---------- company colours ---------- */
.co-leron { --co: #0b7a4f; --co-ink: #fff; } .co-topbull { --co: #e8706a; --co-ink: #fff; } .co-opaoti { --co: #f6b800; --co-ink: #3d2b00; }
.co-prr { --co: #1565c0; --co-ink: #fff; } .co-madbull { --co: #ef7d00; --co-ink: #fff; } .co-other { --co: #0b6e4f; --co-ink: #fff; }
.co-tag { display: inline-block; max-width: 100%; margin: 2px 0 8px; padding: 4px 10px; background: #fff; color: #c00000; font-size: 14px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .03em; border: 2px solid var(--co); border-left: 10px solid var(--co); border-radius: 8px; }
.co-hero { padding: 0; overflow: hidden; border: 0; box-shadow: 0 8px 22px rgba(6,77,51,.14); }
.co-band { background: var(--co); color: var(--co-ink); padding: 14px 14px 0; }
.co-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 16px; }
.co-top span:last-child { white-space: nowrap; }
.co-title { text-align: center; font-family: Georgia, "Palatino Linotype", serif; font-weight: 700; font-size: 18px; letter-spacing: .08em; margin: 6px 0 10px; }
.co-plate { background: #fff; color: #c00000; text-align: center; font-weight: 900; text-transform: uppercase; letter-spacing: .02em; line-height: 1.15;
  font-size: clamp(17px, 5.6vw, 28px); padding: 14px 10px; border-radius: 10px 10px 0 0; }
.co-body { padding: 12px 18px 16px; border-top: 4px solid var(--co); }
.co-body .big-amt { margin-top: 6px; }
.fund-line { margin-top: 12px; padding: 10px 14px; background: #f4f4ee; border-left: 8px solid var(--co, var(--brand)); border-radius: 10px; }
.fund-line small { display: block; font-size: 13px; letter-spacing: .08em; color: var(--muted); }
.fund-line b { font-size: 21px; color: var(--ink); }

/* ---------- duplicate payment warning ---------- */
.dup-banner { background: #fde8e8; color: #7a1010; border: 2px solid #c00000; border-left-width: 10px; border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; }
.dup-banner b:first-child { display: block; font-size: 18px; letter-spacing: .03em; color: #c00000; }
.dup-banner ul { margin: 8px 0; padding-left: 20px; }
.dup-banner li { margin-bottom: 6px; }
.chip.s-dup { background: #c00000; color: #fff; }

/* bank receipt pending (bank transfers: the bank's receipt arrives about a day after payment) */
.rcpt-banner { background: #fff4d6; color: #5c4200; border: 2px solid #f6b800; border-left-width: 10px; border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; }
.rcpt-banner b { display: block; font-size: 16px; letter-spacing: .03em; color: #8a5a00; margin-bottom: 2px; }
.card.rcpt-pending { border: 2px dashed #f6b800; background: #fffaf0; }
.rcpt-warn { margin: 0; color: #5c4200; }
.chip.s-rcpt { background: #fff0c2; color: #6b4a00; border: 1px solid #f6b800; font-weight: 700; }

/* submission rules: bank / cheque windows and the petty cash limit */
.rule-note { margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: #eef6ff; color: #12365c; border: 1px solid #9cc4ee; border-left-width: 8px; font-size: 15px; }
.rule-note.closed { background: #fde8e8; color: #7a1010; border-color: #c00000; }
.rule-note.warn { background: #fff4d6; color: #5c4200; border-color: #f6b800; }
.rule-note b { display: block; margin-bottom: 2px; }
.rule-note textarea { margin-top: 8px; }
.rule-banner { background: #fff4d6; color: #5c4200; border: 2px solid #f6b800; border-left-width: 10px; border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; }
.rule-banner b { display: block; font-size: 15px; letter-spacing: .03em; color: #8a5a00; margin-bottom: 2px; }
.chip.s-over { background: #fff0c2; color: #6b4a00; border: 1px solid #f6b800; font-weight: 700; }
.s-po { background: #e4e0fb; color: #35278a; }
.v-item:has(.s-po) { border-left-color: #6a5acd; }
.po-banner { background: #ece9fd; color: #2d2377; border: 2px solid #6a5acd; border-left-width: 10px; border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; }
.po-banner b { display: block; font-size: 16px; letter-spacing: .03em; margin-bottom: 2px; }
.win-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; padding: 8px; background: #f4f4ee; border-radius: 10px; }
.win-row select { flex: 1 1 120px; min-width: 0; } .win-row input[type=time] { flex: 1 1 130px; min-width: 120px; }
.win-row .sep { font-weight: 700; }

/* copyright notice */
.copyright { text-align: center; font-size: 13px; line-height: 1.5; color: var(--muted, #667); margin: 18px 0 8px; }
.auth .copyright { color: #d6ead9; }

/* people covering more than one department */
details.dept-extra { margin: 10px 0 0; padding: 8px 12px; background: #f4f4ee; border-radius: 10px; border-left: 6px solid var(--sun, #f6b800); }
details.dept-extra summary { cursor: pointer; font-weight: 700; color: var(--brand-dark, #064d33); }
details.dept-extra small { display: block; margin: 6px 0 4px; color: var(--muted, #667); }

.proj-box{margin-top:8px;padding:10px 12px;border:1px dashed #b9c8c0;border-radius:12px;background:rgba(6,77,51,.035)}
.bflag{display:inline-block;font-size:11px;font-weight:700;letter-spacing:.03em;padding:2px 8px;border-radius:999px;vertical-align:middle;margin-left:6px}
.b-ok .bflag,.bflag.b-ok{background:#e3f4e5;color:#1b5e20}
.b-low .bflag,.bflag.b-low{background:#fff3cd;color:#7a5a00}
.b-over .bflag,.bflag.b-over{background:#fde2e1;color:#b71c1c}
.budget-card.b-ok{border-left:5px solid #2e7d32}
.budget-card.b-low{border-left:5px solid #f0a500}
.budget-card.b-over{border-left:5px solid #c62828}
.budget-card.inline{margin:10px 0 0;padding:10px 12px;border-radius:12px;background:#fff;border-top:1px solid #dde3e0;border-right:1px solid #dde3e0;border-bottom:1px solid #dde3e0}
.budget-card h2{display:flex;align-items:center;justify-content:space-between}
.budget-card .neg,table.rep .neg{color:#c62828}
.budget-card .bmsg{margin:8px 0 0;font-size:13px}
.budget-card .vnote{margin-top:8px;padding:8px 10px;background:#fff8e1;border-radius:8px;font-size:13px}
.rep-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
table.rep{width:100%;border-collapse:collapse;font-size:12px}
table.rep th,table.rep td{padding:6px 4px;border-bottom:1px solid #e6ebe8;text-align:right;white-space:nowrap}
table.rep th{font-size:11px;color:#556}
table.rep th:first-child,table.rep td:first-child{text-align:left;white-space:normal;min-width:110px}
table.rep tr.tot td{font-weight:700;border-top:2px solid #cfd8d3}
.proj-form .ph-row{align-items:center;margin:4px 0}
.proj-form .ph-row span{font-size:13px}
.prog-sum{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:8px}
.prog-sum div{background:#f4f4ee;border-radius:10px;padding:8px}
.prog-sum small{display:block;font-size:11px;color:#667}
.prog-sum b{font-size:16px}
.prog-head,.prog-row{display:grid;grid-template-columns:1fr 72px 72px;gap:6px;align-items:center}
.prog-head{font-size:11px;color:#667;margin-top:10px}
.prog-row{margin:4px 0}
.prog-row span{font-size:13px}
.prog-photos{display:flex;gap:6px;flex-wrap:wrap;margin:6px 0}
.prog-photos img{width:72px;height:72px;object-fit:cover;border-radius:8px;cursor:pointer}

/* v36: receipts - overdue, ready to be seen, seen */
.rcpt-banner.overdue { background: #fde8e8; color: #6b0f0f; border-color: #c62828; }
.rcpt-banner.overdue b { color: #b71c1c; }
.seen-banner { background: #e6f4ea; color: #0b3d22; border: 2px solid #1f8a4c; border-left-width: 10px; border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; }
.seen-banner b { display: block; font-size: 16px; letter-spacing: .03em; color: #064d33; margin-bottom: 2px; }
.chip.s-seen { background: #dff3e6; color: #064d33; border: 1px solid #1f8a4c; font-weight: 700; }
.seen-card .seen-ok { margin: 0; color: #064d33; }
ul.files li .btn.small + .btn.small { margin-left: 4px; }

/* v37: final invoice check */
.fi-card.fi-diff { border: 2px solid #c62828; background: #fff7f7; }
.fi-card.fi-ok { border: 2px solid #1f8a4c; }
.fi-card.fi-wait { border: 2px dashed #c9a227; }
.fi-cmp { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 4px 0 10px; }
.fi-cmp dt { color: #555; }
.fi-cmp dd { margin: 0; font-weight: 700; }
.fi-cmp dd.fi-bad { color: #b71c1c; }
.radio-row { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 2px 0 10px; }

/* v38: several at once, payment run, suppliers, hand-overs */
.bulk-row { border-top: 1px solid #e3e8e5; padding: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.bulk-row:first-of-type { border-top: 0; }
.bulk-row .chk { align-items: flex-start; }
.bulk-row .btn.small { align-self: flex-start; }
#prSum { margin-left: 8px; }

/* v40: contractor contracts */
.ctr-box { border: 1px solid #dfe7e2; border-radius: 12px; padding: 12px; margin: 0 0 12px; background: #fbfdfc; }
.ctr-form { background: #fffaf0; border-color: #f1d79a; }
.ctr-st { border-top: 1px dashed #e3d6b5; padding-top: 8px; margin-top: 8px; }
.ctr-st .two { margin-bottom: 6px; }
