/* Хадия — общий стиль консоли и страницы получателя */
:root {
  --ink: #1b2421;
  --ink-2: #4a5752;
  --ink-3: #75817c;
  --page: #f3f7f8;
  --paper: #ffffff;
  --line: #d9e0db;
  --line-2: #e9eeea;
  --brand: #06799a;
  --brand-2: #045068;
  --brand-tint: #e1f3f8;
  --gold: #c9a800;
  --ok: #1f7a4d;
  --ok-tint: #e2f3e9;
  --wait: #9a6412;
  --wait-tint: #fbf0dc;
  --bad: #b42318;
  --bad-tint: #fbe7e5;
  --muted-tint: #eceeed;
  --r-s: 6px;
  --r-m: 10px;
  --r-l: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid #36b6d6; outline-offset: 2px; }

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--paper); color: var(--ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: #b9c4be; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.wa { background: #1f8f4e; border-color: #1f8f4e; color: #fff; }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.big { min-height: 56px; font-size: 1.05rem; border-radius: var(--r-l); width: 100%; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .9rem; }

label.field { display: grid; gap: 4px; font-size: .9rem; color: var(--ink-2); }
input, select, textarea {
  font: inherit; color: var(--ink);
  min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--paper);
  width: 100%;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-tint); }
.search { font-size: 1.05rem; min-height: 52px; padding-left: 16px; }

/* ---------- статусы ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px;
  font-size: .82rem; font-weight: 600; white-space: nowrap;
  background: var(--muted-tint); color: var(--ink-2);
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.signed { background: var(--ok-tint); color: var(--ok); }
.chip.link_sent { background: var(--wait-tint); color: var(--wait); }
.chip.failed, .chip.cancelled { background: var(--bad-tint); color: var(--bad); }
.chip.planned { background: var(--brand-tint); color: var(--brand); }

/* Номер корзины — главный опознавательный знак на всех экранах */
.basket-no {
  font-variant-numeric: lining-nums proportional-nums;
  display: inline-flex; align-items: baseline; gap: 4px;
  font-weight: 750; letter-spacing: .01em;
  color: var(--brand);
}
.basket-no small { font-weight: 600; color: var(--gold); font-size: .8em; }
.basket-no.large { font-size: 1.9rem; line-height: 1; }

.muted { color: var(--ink-3); }
.small-text { font-size: .88rem; }
.error-text { color: var(--bad); }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1 1 auto; }

/* ---------- таблица состава корзины ---------- */
.items { width: 100%; border-collapse: collapse; }
.items td { padding: 9px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.items tr:last-child td { border-bottom: 0; }
.items .q { text-align: right; white-space: nowrap; font-weight: 650; padding-left: 12px; }
.items .repl { display: block; font-size: .82rem; color: var(--wait); }

/* ---------- уведомления ---------- */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-m);
  max-width: calc(100% - 32px); z-index: 50; box-shadow: 0 8px 24px rgba(20, 30, 27, .25);
}
.toast.err { background: var(--bad); }
.notice { padding: 12px 14px; border-radius: var(--r-m); background: var(--wait-tint); color: #6b470d; font-size: .92rem; }
.notice.bad { background: var(--bad-tint); color: var(--bad); }
.notice.ok { background: var(--ok-tint); color: var(--ok); }

@media (prefers-reduced-motion: no-preference) {
  .pulse::before { animation: pulse 1.6s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: .25; } }
}
