:root {
  --bg: #f5f6f8; --card: #fff; --text: #1d2330; --muted: #6b7280; --line: #e3e6eb;
  --primary: #1f5fbf; --primary-text: #fff; --danger: #b42318; --success: #067647; --mine: #fff8e1;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171c; --card: #1d2128; --text: #e7e9ee; --muted: #9aa1ad; --line: #30353e;
          --primary: #5b8def; --danger: #f97066; --success: #47cd89; --mine: #2d2a1c; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: .75rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.org { color: var(--muted); }
.topbar nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; }
.topbar nav a { text-decoration: none; }
.langs a.active { font-weight: 700; }
main { padding: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; max-width: 760px; margin: 0 auto 1rem; }
.card.narrow { max-width: 420px; }
.card.wide { max-width: 1200px; }
h1 { font-size: 1.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
label { display: block; margin: 0 0 .9rem; font-weight: 600; }
label.check { display: inline-flex; gap: .35rem; font-weight: 400; margin-right: .8rem; }
input:not([type=checkbox]), textarea, select { display: block; width: 100%; margin-top: .25rem; padding: .55rem .65rem; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 1rem; padding: .75rem 1rem 0; }
button, .button { display: inline-block; padding: .55rem 1rem; font: inherit; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; text-decoration: none; }
button.primary, .button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.link { border: 0; background: none; color: var(--primary); padding: 0; }
form.inline { display: inline; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.error { color: var(--danger); font-weight: 400; }
.success { color: var(--success); }
.muted { color: var(--muted); }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1rem; }
.tabs a { padding: .3rem .7rem; border-radius: 999px; text-decoration: none; border: 1px solid var(--line); font-size: .9rem; }
.tabs a.active { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
table.list { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.list th, table.list td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list .num { text-align: right; white-space: nowrap; }
tr.mine { background: var(--mine); }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; border: 1px solid currentColor; white-space: nowrap; }
.status-paid { color: var(--success); }
.status-rejected { color: var(--danger); }
.status-submitted, .status-approved, .status-payment_prepared { color: var(--primary); }
.steps { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; counter-reset: s; }
.steps li { counter-increment: s; padding: .25rem .6rem; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.steps li::before { content: counter(s) ". "; }
.steps li.done { color: var(--success); border-color: var(--success); }
.steps li.current { color: var(--primary-text); background: var(--primary); border-color: var(--primary); }
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; white-space: pre-wrap; }
.task { border: 1px solid var(--primary); border-radius: 8px; padding: .75rem 1rem; margin: 0 0 1rem; }
.task p { margin: 0 0 .5rem; }
.reject { margin-top: 1.5rem; }
.reject summary { cursor: pointer; color: var(--danger); }
ul.files, ul.history { padding-left: 1.2rem; }
form.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 1rem; align-items: end; }
@media (max-width: 640px) {
  table.list thead { display: none; }
  table.list tr { display: block; border-bottom: 1px solid var(--line); padding: .4rem 0; }
  table.list td { display: block; border: 0; padding: .1rem 0; }
  table.list .num { text-align: left; }
}
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
