:root {
  --bg: #f6f7f9; --card: #fff; --fg: #1c2330; --muted: #6b7280; --line: #e5e7eb;
  --accent: #2456d6; --ok: #137a3b; --ok-bg: #dff5e6; --bad: #b42318; --bad-bg: #fde4e1;
  --warn: #8a5a00; --warn-bg: #fdf0d0; --off: #6b7280; --off-bg: #eceef2;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --card: #1a1f28; --fg: #e6e9ef; --muted: #98a2b3; --line: #2a303b;
    --accent: #7ea2ff; --ok: #6fdc98; --ok-bg: #16351f; --bad: #ff8f84; --bad-bg: #3d1a17;
    --warn: #f2c76b; --warn-bg: #3a2d10; --off: #98a2b3; --off-bg: #232935;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
header { display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card); }
h1 { font-size: 18px; margin: 0; } h1 small, h2 small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 8px; }
h2 { font-size: 15px; margin: 0 0 10px; } h3 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); }
main { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; padding: 14px 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px; overflow-x: auto; }
.card.wide { grid-column: 1 / -1; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; } .num { text-align: right; font-variant-numeric: tabular-nums; }
form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: 6px; margin-bottom: 8px; }
input, select, button { font: inherit; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--card); color: var(--fg); }
button { cursor: pointer; background: var(--accent); color: #fff; border-color: transparent; }
button.ghost { background: transparent; color: var(--accent); border-color: var(--line); }
button:disabled, input:disabled { opacity: .5; cursor: not-allowed; }
form button { grid-column: 1 / -1; }
.pill { padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.pill.on { background: var(--ok-bg); color: var(--ok); } .pill.off { background: var(--off-bg); color: var(--off); }
.tag { padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.ACKED, .CONFIRMED, .SETTLED, .FILLED, .ACCEPTED { background: var(--ok-bg); color: var(--ok); }
.REJECTED, .HIGH { background: var(--bad-bg); color: var(--bad); }
.SENT, .BOOKED, .OPEN, .MEDIUM { background: var(--warn-bg); color: var(--warn); }
.NOT_SENT, .CANCELLED, .ACKNOWLEDGED { background: var(--off-bg); color: var(--off); }
.stuck { outline: 2px solid var(--bad); }
.up { color: var(--ok); } .down { color: var(--bad); }
.flash { animation: flash .6s; } @keyframes flash { from { background: var(--warn-bg); } }
.summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.stat { background: var(--off-bg); border-radius: 6px; padding: 4px 10px; font-size: 12px; }
.stat b { font-size: 15px; margin-right: 4px; } .stat.bad b { color: var(--bad); }
.msg { min-height: 1.3em; color: var(--muted); margin: 8px 0 0; } .msg.err { color: var(--bad); }
.hint { color: var(--muted); font-size: 12px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.row button { margin: 0 6px 6px 0; }
.cp { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; } .cp span:first-child { width: 110px; }
.cp button.cur { background: var(--fg); color: var(--bg); }
.cell { display: flex; align-items: center; gap: 4px; } .cell button { padding: 0 6px; }
.empty { color: var(--muted); padding: 8px; }
