/*
 * Стили веб-интерфейса Pincho (EPIC-REPORT-DISH-COST K4). Отдаются как /static/app.css из go:embed:
 * CSP "default-src 'self'" запрещает и <style>, и атрибут style="", поэтому весь вид живёт здесь,
 * в классах. Палитра и структура — макет владельца (Main, Product); шрифт системный: Google Fonts
 * из макета CSP не пропустит.
 *
 * Контраст текста не ниже 4.5:1 на своём фоне (считан по WCAG 2.x): основной #1c2321 на #f6f7f5 —
 * 14.9, приглушённый #4a5451 — 7.3, подсказки #5d6763 — 5.45, неактивное меню #6b7471 на белом —
 * 4.8, ссылки и кнопки #0f5f5a — 7.0, ошибки #8a1f17 на #fdecea — 8.0. Границы полей #8a9490 — 3.1:1
 * к белому (контрол различим), цели нажатия не меньше 44px.
 */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: #1c2321;
  background: #f6f7f5;
}

a { color: #0f5f5a; }
a:hover { color: #0a4440; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #0f5f5a;
  outline-offset: 2px;
}

h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
h2 { margin: 0; font-size: 18px; font-weight: 700; }
p { margin: 0; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted { color: #4a5451; }
.faint { color: #5d6763; font-size: 13px; }

/* Шапка и меню */

.site-header { background: #ffffff; border-bottom: 1px solid #dfe3e0; }
.site-header__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 60px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
}
.brand { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; color: #1c2321; text-decoration: none; }
.brand:hover { color: #1c2321; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.site-nav a, .site-nav__soon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
}
.site-nav a { text-decoration: none; color: #3d4744; }
.site-nav a:hover { background: #eef1ef; color: #1c2321; }
.site-nav a[aria-current="page"] { background: #e3efed; color: #0f5f5a; font-weight: 600; }
.site-nav__soon { color: #6b7471; }
.site-nav__soon small { font-size: 12px; }
.logout { margin: 0 0 0 auto; }

/* Страница */

.page { max-width: 1240px; margin: 0 auto; padding: 28px 24px 48px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head--top { align-items: flex-start; }
.page-head__text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lead { color: #4a5451; font-size: 15px; max-width: 70ch; }
.back { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; text-decoration: none; }
.footnote { font-size: 13px; color: #5d6763; }

/* Кнопки */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  text-decoration: none;
  color: #1c2321;
  background: #ffffff;
  border: 1px solid #8a9490;
  border-radius: 10px;
  cursor: pointer;
}
.btn:hover { background: #eef1ef; color: #1c2321; }
.btn-primary { font-weight: 600; color: #ffffff; background: #0f5f5a; border-color: #0f5f5a; }
.btn-primary:hover { background: #0a4440; color: #ffffff; }
.btn-danger { color: #8a1f17; border-color: #b5534a; }
.btn-danger:hover { background: #fdecea; color: #8a1f17; }
.btn-small { font-size: 14px; padding: 0 12px; }
.btn svg { flex: none; }

/* Фильтр */

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.filter__label { font-size: 13px; font-weight: 600; color: #3d4744; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  font-size: 14px;
  text-decoration: none;
  color: #1c2321;
  background: #ffffff;
  border: 1px solid #8a9490;
  border-radius: 10px;
}
.chip:hover { background: #eef1ef; color: #1c2321; }
.chip[aria-current="true"] { color: #ffffff; background: #0f5f5a; border-color: #0f5f5a; }
.results { display: flex; flex-direction: column; gap: 16px; }

/* Поля форм */

.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field--grow { flex: 1 1 320px; }
.field--wide { flex: 2 1 160px; }
.field--narrow { flex: 1 1 110px; }
.field label, .field legend, .field__label { padding: 0; font-size: 13px; font-weight: 600; color: #3d4744; }
.field input[type="text"], .field input[type="search"], .field select {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  font: inherit;
  color: #1c2321;
  background: #ffffff;
  border: 1px solid #8a9490;
  border-radius: 10px;
}
.field input[aria-invalid="true"] { border-color: #8a1f17; border-width: 2px; }
.field-error { font-size: 14px; font-weight: 600; color: #8a1f17; }
.hint { font-size: 13px; color: #5d6763; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 400;
  color: #1c2321;
  background: #ffffff;
  border: 1px solid #8a9490;
  border-radius: 10px;
  cursor: pointer;
}
.choice input { width: 18px; height: 18px; margin: 0; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.form-row .btn { margin-top: 25px; }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
form { margin: 0; }

/* Карточки */

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #dfe3e0;
  border-radius: 14px;
}
.card--form { max-width: 640px; }
.card__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; align-items: start; }
.big-value { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; color: #4a5451; }
.empty { padding: 20px; color: #4a5451; }

.badges { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.badge { padding: 4px 10px; border-radius: 999px; background: #eef1ef; color: #3d4744; }
.badge--accent { background: #e3efed; color: #0f5f5a; font-weight: 600; }
.badge--warn { background: #fff4e5; color: #5c3d0e; font-weight: 600; }

.notice { padding: 14px 18px; border-radius: 12px; font-size: 15px; }
.notice--error { background: #fdecea; color: #8a1f17; border: 1px solid #b5534a; }
.notice--info { background: #fff4e5; color: #5c3d0e; border: 1px solid #c58a2f; }
.notice a { color: inherit; font-weight: 600; }

/* Раскрывающееся подтверждение архивации (details): работает без JS */

.confirm { position: relative; }
.confirm summary { list-style: none; }
.confirm summary::-webkit-details-marker { display: none; }
.confirm__panel {
  position: absolute;
  right: 0;
  z-index: 5;
  width: min(340px, calc(100vw - 48px));
  margin-top: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #8a9490;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(28, 35, 33, 0.18);
}

/* Фасовки */

.pack-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pack-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 8px 8px 14px;
  background: #f6f7f5;
  border-radius: 10px;
}
.pack-list__label { font-weight: 600; overflow-wrap: anywhere; }
.pack-list__qty { flex: 1 1 auto; color: #4a5451; font-variant-numeric: tabular-nums; }

/* Таблицы */

.table-card { background: #ffffff; border: 1px solid #dfe3e0; border-radius: 14px; overflow-x: auto; }
.table-card table { width: 100%; min-width: 880px; border-collapse: collapse; font-size: 15px; }
.table-card--narrow table { min-width: 760px; }
.table-card th {
  padding: 14px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4a5451;
  border-bottom: 1px solid #dfe3e0;
}
.table-card td { padding: 14px 12px; color: #4a5451; border-bottom: 1px solid #eef1ef; }
.table-card th:first-child, .table-card td:first-child { padding-left: 18px; }
.table-card th:last-child, .table-card td:last-child { padding-right: 18px; }
.table-card tbody tr:last-child td { border-bottom: 0; }
.table-card .num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-name a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.cell-name a:hover { text-decoration: underline; }

/* Телефон */

@media (max-width: 600px) {
  .site-header__inner { padding: 8px 16px; }
  .site-nav { order: 3; flex: 1 1 100%; }
  .page { padding: 20px 16px 40px; }
  h1 { font-size: 24px; }
  .page-head .btn-primary { width: 100%; }
  .toolbar .field--grow { flex-basis: 100%; }
  .form-row .field { flex: 1 1 100%; }
  .form-row .btn { margin-top: 0; width: 100%; }
  .confirm__panel { right: auto; left: 0; }
}
.review-table input[type="text"], .review-table select { font: inherit; font-size: 14px; padding: 8px; border: 1px solid #c9d0cd; border-radius: 8px; width: 100%; min-width: 64px; box-sizing: border-box; }
.review-table input[aria-invalid="true"], .review-table select[aria-invalid="true"] { border-color: #8a1f17; border-width: 2px; }
