/* Интерфейс v2 — основа: цвета темы, шрифт, кнопки, поля, чипы, карточки, таблицы.
   Раскладка экранов — css/layout.css, заказ — css/order.css, шаги — css/steps.css. */
:root {
  --bg: #f3f2ee; --bg2: #eae8e2; --panel: #fff; --panel2: #f8f7f4;
  --ink: #1d2125; --ink2: #3a4046; --muted: #626970; --faint: #8b9198;
  --line: #e2dfd7; --line2: #d2cec4;
  --accent: #0b6e69; --accent-h: #095c58; --accent-soft: #dcefeb; --accent-ink: #fff;
  --ok: #1e7b3a; --ok-soft: #e0f1e4; --warn: #a45f06; --warn-soft: #fbeed6;
  --fail: #c0352b; --fail-soft: #fbe2de; --run: #1f63d6; --run-soft: #e0eafc; --todo: #a2a7ad;
  --file-page: #fff; --file-edge: #c3c8ce; --file-fold: #e8eaed; --file-line: #d5d9de;
  --shadow: 0 1px 2px rgba(20, 24, 28, .07), 0 2px 8px rgba(20, 24, 28, .05);
  --shadow-l: 0 10px 40px rgba(20, 24, 28, .18);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #141618; --bg2: #1c1f22; --panel: #1f2225; --panel2: #25292d;
  --ink: #e8e7e2; --ink2: #cfcdc7; --muted: #a2a7ad; --faint: #7c828a;
  --line: #30353a; --line2: #3c4248;
  --accent: #33b5a8; --accent-h: #45c9bb; --accent-soft: #173936; --accent-ink: #0c1918;
  --ok: #52c874; --ok-soft: #173223; --warn: #e4a53f; --warn-soft: #3a2c13;
  --fail: #f06a5e; --fail-soft: #3d1d1a; --run: #72a5ff; --run-soft: #1a2a47; --todo: #6f757c;
  --file-page: #2b3035; --file-edge: #4b5159; --file-fold: #373c42; --file-line: #484e56;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35); --shadow-l: 0 10px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased;
}
.tnum, .num { font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 21px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; margin: 0; }
h3 { font-size: 14px; font-weight: 600; margin: 0; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nowrap { white-space: nowrap; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico { flex: none; display: inline-block; vertical-align: middle; }
.boot { padding: 40px; color: #888; font: 14px "Segoe UI", sans-serif; }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line2); border-radius: 7px; background: var(--panel); color: var(--ink);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--faint); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--bg2); color: var(--ink); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12.5px; border-radius: 6px; }
.btn.lg { height: 40px; padding: 0 18px; font-size: 15px; }
.btn.icon { width: 32px; padding: 0; }
.btn.sm.icon { width: 26px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.danger { color: var(--fail); }

/* поля ввода */
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line2);
  border-radius: 6px; padding: 5px 8px; min-width: 0;
}
input, select { height: 32px; }
textarea { resize: vertical; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.fld { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.fld > input, .fld > select, .fld > textarea { font-size: 14px; color: var(--ink); }
.search { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; min-width: 260px;
  border: 1px solid var(--line2); border-radius: 7px; background: var(--panel); color: var(--faint); }
.search input { border: 0; outline: 0; background: none; height: 28px; padding: 0; flex: 1; }
.search:focus-within { border-color: var(--accent); }

/* чипы и точки статусов */
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px;
  background: var(--bg2); color: var(--ink2); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.fail { background: var(--fail-soft); color: var(--fail); }
.chip.run { background: var(--run-soft); color: var(--run); }
.chip.acc { background: var(--accent-soft); color: var(--accent); }
.chip.off { background: transparent; color: var(--faint); border: 1px dashed var(--line2); }
.chip.click { cursor: pointer; }
.chip.click.on { outline: 2px solid currentColor; outline-offset: -2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--todo); display: inline-block; flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); }
.dot.fail { background: var(--fail); } .dot.run { background: var(--run); }
.t-ok { color: var(--ok); } .t-warn { color: var(--warn); } .t-fail { color: var(--fail); } .t-run { color: var(--run); }

/* карточки */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.hint { background: var(--panel2); border: 1px dashed var(--line2); border-radius: 8px; padding: 10px 12px; color: var(--muted); overflow-wrap: anywhere; }

/* таблицы */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  position: sticky; top: 0; z-index: 1; background: var(--panel2); text-align: left; font-weight: 600;
  color: var(--muted); font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--panel2); }
.tbl tr.sel td { background: var(--accent-soft); }
.tbl tr.dim td { color: var(--faint); }
.tbl tfoot td { font-weight: 600; border-bottom: 0; border-top: 2px solid var(--line2); }
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }

/* сегменты, загрузка, полосы */
.seg { display: inline-flex; background: var(--bg2); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button {
  border: 0; background: none; padding: 0 12px; height: 28px; border-radius: 6px; font: inherit;
  color: var(--muted); cursor: pointer; white-space: nowrap;
}
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 4px; background: var(--run-soft); border-radius: 2px; overflow: hidden; position: relative; }
.bar i { position: absolute; top: 0; bottom: 0; left: 0; background: var(--run); border-radius: 2px; transition: width .3s; }
.bar.indet i { width: 35%; animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { from { left: -35%; } to { left: 100%; } }
.empty { padding: 36px; text-align: center; color: var(--muted); }
