/* Прототип стенда. Палитра и шрифт — из портфолио, чтобы демо не выглядело
   как чужая админка. Внешних запросов нет: только локальный woff2. */

@font-face {
  font-family: 'Onest';
  src: url('/static/fonts/onest-cyrillic.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  src: url('/static/fonts/onest-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #e5e6e1;
  --sheet: #ffffff;
  --ink: #111311;
  --muted: #565b55;
  --rule: #c2c5be;
  --rule-soft: #e2e3dd;
  --accent: #b33518;
  --accent-tint: #f3e0da;
  --ok: #2f6b4a;
  --ok-tint: #dfe9e2;
  --warn: #8a5a12;
  --warn-tint: #f2e7d3;
  --gutter: clamp(18px, 4vw, 44px);
  --maxw: 1180px;
  --r: 10px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Onest', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

a { color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }

/* --- шапка -------------------------------------------------------------- */
.topbar {
  border-bottom: 1px solid var(--rule);
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 10;
}
.topbar__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand__mark {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--ink); border-radius: 50%;
  font-weight: 600; font-size: 14px;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__text b { font-weight: 600; font-size: 14px; letter-spacing: -.01em; }
.brand__text i { font-style: normal; font-size: 11.5px; color: var(--muted); }
.topbar__nav { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.topbar__nav a { text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 1px; }
.topbar__nav a:hover { color: var(--ink); border-color: var(--rule); }

/* --- вступление --------------------------------------------------------- */
.intro { padding: clamp(34px, 5vw, 62px) 0 clamp(22px, 3vw, 34px); max-width: 760px; }
.eyebrow {
  margin: 0 0 10px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.intro h1 {
  margin: 0 0 14px;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  line-height: 1.06;
  letter-spacing: -.02em;
  font-weight: 600;
}
.lead { margin: 0; font-size: clamp(1rem, 1.3vw, 1.1rem); color: var(--muted); max-width: 62ch; }

/* --- раскладка ---------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(320px, 390px) 1fr;
  gap: clamp(18px, 2.4vw, 30px);
  align-items: start;
  padding-bottom: clamp(40px, 6vw, 72px);
}

.panel {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: clamp(16px, 2vw, 22px);
}

/* --- форма -------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 78px; }
.field { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; }
.label {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 600; color: var(--muted); padding: 0;
}
.hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: #6f746d; }

select, input[type="date"] {
  width: 100%;
  font: inherit; font-size: 14px;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 9px 11px;
  appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
select:focus-visible, input:focus-visible, .chip:focus-within, .btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dates label { display: flex; flex-direction: column; gap: 4px; }
.dates span { font-size: 11px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--rule-soft); border-radius: 999px;
  padding: 5px 11px 5px 9px; font-size: 13px; cursor: pointer;
  background: var(--sheet);
  transition: border-color .12s ease, background-color .12s ease, opacity .12s ease;
}
.chip input { width: 13px; height: 13px; accent-color: var(--accent); margin: 0; }
.chip__name { white-space: nowrap; }
.chip:has(input:checked) { border-color: var(--ink); background: #f4f4f1; }
.chip.is-off { opacity: .38; cursor: not-allowed; }
.chip.is-off .chip__name { text-decoration: line-through; text-decoration-thickness: 1px; }

.grade {
  font-size: 10px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600;
  padding: 1px 6px; border-radius: 4px; background: #ecece8; color: var(--muted);
}
.g3 { background: var(--ok-tint); color: var(--ok); }
.g4 { background: var(--accent-tint); color: var(--accent); }

.radios { display: flex; flex-direction: column; gap: 6px; }
.radio {
  display: flex; gap: 9px; align-items: flex-start;
  border: 1px solid var(--rule-soft); border-radius: 8px; padding: 9px 11px; cursor: pointer;
}
.radio:has(input:checked) { border-color: var(--ink); background: #f7f7f4; }
.radio input { margin: 3px 0 0; accent-color: var(--accent); }
.radio span { display: flex; flex-direction: column; gap: 1px; }
.radio b { font-size: 13px; font-weight: 600; }
.radio i { font-style: normal; font-size: 12px; color: var(--muted); line-height: 1.35; }

.btn {
  font: inherit; font-weight: 600; font-size: 14px;
  background: var(--ink); color: #fff; border: 0; border-radius: 8px;
  padding: 11px 16px; min-height: 46px; cursor: pointer;
  transition: background-color .12s ease;
}
.btn:hover { background: var(--accent); }
.btn:disabled { opacity: .5; cursor: progress; }
.tiny { margin: 0; font-size: 11.5px; color: var(--muted); }

/* --- результаты --------------------------------------------------------- */
.results { display: flex; flex-direction: column; gap: 16px; min-height: 320px; }

.empty { border: 1px dashed var(--rule); border-radius: var(--r); padding: clamp(22px, 3vw, 34px); }
.empty h2 { margin: 0 0 10px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.empty p { margin: 0 0 10px; color: var(--muted); font-size: 14.5px; max-width: 58ch; }
.empty__hint { font-size: 13px !important; color: var(--warn) !important; }

.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: clamp(16px, 2vw, 22px); }
.card__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--rule-soft);
}
.card__head h2 { margin: 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.card__meta { font-size: 12px; color: var(--muted); }

/* рекомендованный мастер */
.rec__top { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 600; font-size: 17px;
  background: var(--paper); border: 1px solid var(--rule);
}
.rec__id { display: flex; flex-direction: column; gap: 3px; }
.rec__name { font-size: 21px; font-weight: 600; letter-spacing: -.015em; line-height: 1.15; }
.rec__sub { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rec__price { margin-left: auto; text-align: right; }
.rec__price b { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.rec__price i { font-style: normal; display: block; font-size: 12px; color: var(--muted); }

.reason {
  margin: 14px 0 0; padding: 11px 13px; border-radius: 8px;
  background: #f6f6f3; border-left: 2px solid var(--accent);
  font-size: 13.5px; color: #2a2d29;
}

.load { margin-top: 16px; }
.load__row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.bar { height: 6px; border-radius: 99px; background: #ecece7; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.bar--busy span { background: var(--accent); }
.bar--mid span { background: var(--warn); }

/* слоты */
.slots { display: grid; gap: 8px; }
.slot {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--rule-soft); border-radius: 8px; padding: 10px 12px;
  background: var(--sheet);
}
.slot__day {
  min-width: 92px; font-size: 12px; font-weight: 600; letter-spacing: .02em;
  text-transform: capitalize;
}
.slot__time { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.slot__dur { font-size: 12px; color: var(--muted); }
.slot__price { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* альтернативы */
.alts { display: grid; gap: 6px; }
.alt {
  display: flex; align-items: center; gap: 10px; font-size: 13.5px;
  padding: 7px 0; border-bottom: 1px solid var(--rule-soft);
}
.alt:last-child { border-bottom: 0; }
.alt__load { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; }
.alt__slots { color: var(--muted); font-size: 12.5px; min-width: 84px; text-align: right; }

/* таблица кандидатов */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding: 0 8px 8px 0; border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
tr.is-win td { background: #f8f3f1; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { white-space: nowrap; }

.notes { display: flex; flex-direction: column; gap: 6px; }
.note {
  font-size: 13px; color: var(--warn); background: var(--warn-tint);
  border-radius: 7px; padding: 8px 11px;
}

details.json { border: 1px solid var(--rule); border-radius: var(--r); background: var(--sheet); }
details.json > summary {
  cursor: pointer; padding: 12px 18px; font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); font-weight: 600; list-style: none;
}
details.json > summary::-webkit-details-marker { display: none; }
details.json pre {
  margin: 0; padding: 0 18px 18px; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.55; color: #2a2d29;
}

.error { border-color: var(--accent); }
.error h2 { color: var(--accent); }

/* --- подвал ------------------------------------------------------------- */
.foot { border-top: 1px solid var(--rule); padding: 18px 0 26px; }
.foot__in { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.foot a { text-decoration: none; border-bottom: 1px solid var(--rule); }

/* --- адаптив ------------------------------------------------------------ */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .form { position: static; }
  .rec__price { margin-left: 0; text-align: left; }
  .slot { flex-wrap: wrap; }
  .slot__price { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
