/* Кабинет Wolt. Спокойный деловой вид, без украшательств. */

:root {
  --bg: #f4f6f5;
  --card: #ffffff;
  --ink: #17211d;
  --muted: #67736d;
  --line: #dfe5e2;
  --line-strong: #c3cdc8;
  --accent: #00623f;
  --accent-soft: #e3efea;
  --warn: #9a5b12;
  --warn-soft: #fbf0e2;
  --err: #a32b21;
  --err-soft: #fbeae8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 26px; padding-bottom: 70px; }

/* Шапка */
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar { display: flex; align-items: center; gap: 26px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
}
.brand-text { font-weight: 600; font-size: 15px; white-space: nowrap; }
.nav { display: flex; gap: 4px; margin-left: 8px; flex: 1; flex-wrap: wrap; }
.nav a {
  padding: 7px 12px; border-radius: 6px; text-decoration: none;
  color: var(--muted); font-size: 14.5px;
}
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.exit { color: var(--muted); display: grid; place-items: center; padding: 6px; border-radius: 6px; }
.exit:hover { background: var(--bg); color: var(--ink); }
.exit svg { width: 18px; height: 18px; }

/* Заголовки */
h1 { font-size: 24px; margin: 0 0 4px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0 0 14px; font-weight: 650; }
.sub { color: var(--muted); margin: 0 0 22px; font-size: 14.5px; }

/* Карточки */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 20px; margin-bottom: 16px;
}
.card-tight { padding: 16px 18px; }

/* Плитки статистики */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.tile .n { font-size: 26px; font-weight: 650; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile .n.warn { color: var(--warn); }
.tile .t { color: var(--muted); font-size: 13.5px; margin-top: 3px; }

/* Формы */
.field { padding: 16px 0; border-top: 1px solid var(--line); }
.field:first-child { border-top: none; padding-top: 0; }
.field-row { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.field-label { flex: 1; min-width: 240px; }
.field-label b { font-weight: 600; display: block; font-size: 14.5px; }
.field-label small { color: var(--muted); display: block; margin-top: 3px; font-size: 13px; line-height: 1.45; }
.field-input { display: flex; align-items: center; gap: 8px; }

input[type=text], input[type=number], input[type=password] {
  width: 120px; padding: 8px 11px; font: inherit;
  border: 1px solid var(--line-strong); border-radius: 7px;
  background: #fff; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
input.wide { width: 100%; }
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.unit { color: var(--muted); font-size: 14px; min-width: 26px; }

select { padding: 8px 11px; font: inherit; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; }

/* Переключатель */
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--line-strong); border-radius: 999px; transition: .15s;
}
.toggle span:before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: .15s;
}
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span:before { transform: translateX(18px); }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border: none; border-radius: 7px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 550;
  cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line-strong); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); filter: none; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }

/* Пояснение расчёта */
.explain {
  background: var(--accent-soft); border-radius: 8px; padding: 14px 16px;
  font-size: 14px; line-height: 1.6;
}
.explain b { font-variant-numeric: tabular-nums; }
.formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; background: #fff; border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 12px; margin: 10px 0 0;
  overflow-x: auto; white-space: pre;
}

/* Предупреждение */
.note {
  display: flex; gap: 11px; padding: 14px 16px; border-radius: 8px;
  background: var(--warn-soft); color: var(--ink); font-size: 14px; line-height: 1.55;
}
.note svg { width: 17px; height: 17px; color: var(--warn); flex: none; margin-top: 2px; }
.note-accent { background: var(--accent-soft); }
.note-accent svg { color: var(--accent); }

/* Таблицы */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th {
  text-align: left; padding: 11px 14px; font-size: 11.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.dim { color: var(--muted); }

/* Метки */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  font-size: 12.5px; white-space: nowrap;
}
.tag-ok { background: var(--accent-soft); color: var(--accent); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-err { background: var(--err-soft); color: var(--err); }
.tag-dim { background: var(--bg); color: var(--muted); }

/* Сообщения */
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14.5px;
}
.flash svg { width: 17px; height: 17px; flex: none; }
.flash-ok { background: var(--accent-soft); color: var(--accent); }
.flash-err { background: var(--err-soft); color: var(--err); }

/* Вход */
.login-page { display: grid; place-items: center; min-height: 100vh; }
.login-box { width: 340px; }
.login-box .card { padding: 26px; }
.login-box h1 { font-size: 19px; margin-bottom: 18px; }
.login-box input { width: 100%; margin-bottom: 12px; }
.login-box .btn { width: 100%; justify-content: center; }

/* Список ключ-значение */
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 0; }
.kv > div { padding: 11px 0; border-top: 1px solid var(--line); }
.kv > div:nth-child(-n+2) { border-top: none; }
.kv .k { color: var(--muted); font-size: 14px; }
.kv .v { font-size: 14px; word-break: break-all; }
.kv .v small { color: var(--muted); display: block; font-size: 13px; }

@media (max-width: 760px) {
  .kv { grid-template-columns: 1fr; }
  .kv .k { padding-bottom: 0; border-top: 1px solid var(--line); }
  .kv .v { padding-top: 2px; border-top: none; }
  .topbar { height: auto; padding: 12px 0; flex-wrap: wrap; }
}
