:root {
  --bg: #F4F1EA; --card: #FFFDF8; --ink: #15201C; --muted: #5F6B66; --line: #E2DDD2; --field: #CFC9BC;
  --brand: #0B4A3A; --brand-ink: #fff; --brand-soft: #DCEFE7; --gold: #F2B544;
  --bad: #A3271F; --bad-soft: #FBE1DE; --good: #1B6B3A; --good-soft: #DFF3E5; --warn: #8A5300; --warn-soft: #FFF1D6;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
h1, h2, h3 { letter-spacing: -0.01em; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; }
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
input, select, textarea { width: 100%; padding: 12px; border: 1px solid var(--field); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
textarea { min-height: 96px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.secondary { background: transparent; border-color: var(--field); color: var(--ink); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 14px; }
.btn.block { width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; }
.stack > * + * { margin-top: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.error { color: var(--bad); font-size: 14px; margin: 8px 0 0; }
.notice { padding: 12px 14px; border-radius: 10px; font-size: 14px; border: 1px solid; }
.notice.warn { background: var(--warn-soft); border-color: #F0D49A; color: #5C3A00; }
.notice.bad { background: var(--bad-soft); border-color: #F0B5AE; color: #6E1712; }
.notice.good { background: var(--good-soft); border-color: #A9DDB9; color: #114A26; }
.notice.info { background: var(--brand-soft); border-color: #B3DCCB; color: #0B4A3A; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: #ECE8DF; color: #4B4A43; }
.badge.successful, .badge.approved, .badge.active, .badge.balanced, .badge.resolved { background: var(--good-soft); color: var(--good); }
.badge.pending, .badge.proposed, .badge.waiting_customer, .badge.open, .badge.unavailable, .badge.high { background: var(--warn-soft); color: var(--warn); }
.badge.failed, .badge.refused, .badge.frozen, .badge.rejected, .badge.gaps, .badge.restricted, .badge.urgent, .badge.disabled { background: var(--bad-soft); color: var(--bad); }
dl.kv { margin: 0; }
dl.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
dl.kv > div.total { border-bottom: 0; font-size: 18px; } dl.kv > div.total dt { color: var(--ink); font-weight: 700; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.data td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr.click { cursor: pointer; } table.data tr.click:hover td { background: #F7F4EC; }
.table-wrap { overflow-x: auto; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.modal-back { position: fixed; inset: 0; background: rgba(10, 20, 16, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: var(--card); border-radius: 16px; padding: 22px; width: min(480px, 100%); max-height: 90vh; overflow: auto; }
.modal h3 { margin: 0 0 8px; }
.code-inputs input { font-size: 22px; letter-spacing: .3em; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 60; font-size: 14px; }
.hidden { display: none !important; }
