/* Заеднички стил за двата frontend-а (Leptos и Dioxus) — фер споредба. */
:root {
  --bg: #f6f7f9; --panel: #fff; --text: #1d2330; --muted: #667085; --line: #e4e7ec;
  --accent: #2459d6; --ok: #127a3c; --err: #b42318; --row-alt: #fafbfc;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1218; --panel: #171b23; --text: #e6e9ef; --muted: #98a2b3; --line: #2a303b;
    --accent: #6c9bff; --ok: #4ade80; --err: #f97066; --row-alt: #1b2029; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
header { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel);
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; }
header h1 { font-size: 16px; margin: 0; }
header .fw { color: var(--accent); font-weight: 600; }
.stats { color: var(--muted); font-variant-numeric: tabular-nums; }
main { padding: 12px 16px; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { main { grid-template-columns: minmax(0, 1fr) 380px; } }
section { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-width: 0; }
h2 { font-size: 14px; margin: 0 0 8px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
button, input, select { font: inherit; color: inherit; }
button { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select { border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 4px 8px; min-width: 0; }
.grid-head, .row { display: grid; grid-template-columns: 70px 92px 96px 60px minmax(120px, 1fr) 120px 120px;
  gap: 8px; padding: 0 8px; align-items: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid-head { height: 30px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.row { height: 28px; border-bottom: 1px solid var(--line); }
.row:nth-child(even) { background: var(--row-alt); }
.row span { overflow: hidden; text-overflow: ellipsis; }
.num { text-align: right; }
.scroll-x { overflow-x: auto; }
.grid-inner { min-width: 760px; }
.viewport { height: 480px; overflow-y: auto; position: relative; }
.spacer { position: relative; }
.window { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.totals { display: flex; justify-content: flex-end; gap: 24px; padding: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.form-grid { display: grid; gap: 6px; grid-template-columns: 1fr 1fr; }
.form-grid label { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.form-grid .wide { grid-column: 1 / -1; }
.line { display: grid; grid-template-columns: 1.2fr 1fr 1fr 28px; gap: 6px; margin-top: 6px; }
.line input { text-align: right; }
.msg-ok { color: var(--ok); } .msg-err { color: var(--err); }
.balance { display: flex; justify-content: space-between; margin-top: 8px; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: 12px; }
