:root {
  font: 100%/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #18181b;
  background: #f7f7f8;
  color-scheme: light;
  --paper: #fff;
  --canvas: #f7f7f8;
  --ink: #18181b;
  --muted: #56565e;
  --rule: #dedee2;
  --control: #878791;
  --blue: #002fa7;
  --blue-wash: color-mix(in srgb, var(--blue) 6%, var(--paper));
  --danger: #a02538;
  --radius: 4px;
  --gutter: clamp(20px, 4vw, 64px);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.12; }
h1 { font-size: clamp(2.25rem, 5vw, 4.25rem); letter-spacing: -.06em; }
h2 { font-size: 1.25rem; letter-spacing: -.025em; }
h3 { font-size: clamp(1.2rem, 2.1vw, 1.65rem); letter-spacing: -.035em; }
p + p { margin-top: 12px; }
small, .muted { color: var(--muted); }
small { font-size: .875rem; }
main, .row > *, .grid > *, .card, .metric { min-width: 0; }
#app { overflow-wrap: anywhere; }
/* Keyboard focus: thin, translucent steel ring. */
:focus-visible { outline: 1px solid rgb(65 97 118 / 50%); outline-offset: 2px; }
/* Scrollable tables, panels and headings never get the ring; buttons and links inside keep it. */
[role="region"][tabindex]:focus-visible, [tabindex="-1"]:focus-visible, .request-history-panel:focus-visible { outline: none; }
button, input, select { font: inherit; }
button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--blue);
  color: var(--paper);
  font-size: .9375rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
/* Keep the base hover below component classes so transparent and icon buttons own their surface. */
button:where(:hover:not(:disabled)) { background: color-mix(in srgb, var(--blue) 84%, var(--ink)); }
button:disabled { background: var(--rule); color: var(--muted); cursor: not-allowed; }
button.secondary, button.favorite-button, button.danger {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--rule);
}
button.secondary:hover:not(:disabled), button.favorite-button:hover:not(:disabled),
button.danger:hover:not(:disabled) { background: var(--canvas); border-color: var(--control); }
button.danger, .form-error, .late { color: var(--danger); }
button.favorite-button { font-size: .875rem; padding-inline: 12px; }
button.favorite-button.selected { background: var(--blue-wash); color: var(--blue); }
.icon { width: 20px; height: 20px; flex: 0 0 auto; }

input:not([type="checkbox"]), select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--control);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
}
/* Fields show a calm steel border instead of the orange focus ring. */
input:not([type="checkbox"]):focus, select:focus, textarea:focus { outline: none; border-color: var(--steel, var(--blue)); box-shadow: 0 0 0 1px var(--steel, var(--blue)); }
input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
}
label { display: grid; align-content: start; gap: 6px; font-size: .875rem; font-weight: 600; }
form { display: grid; gap: 16px; }
form > button { justify-self: start; }
.option { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 16px; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.between { justify-content: space-between; }
.brand-field { position: relative; }
.variant > form + form { margin-top: 8px; }
/* Floats over the form so neighbouring fields do not move. */
.brand-options { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; display: grid; gap: 8px; max-height: 232px; overflow: auto; padding: 8px; border: 1px solid var(--control); border-radius: 7px; background: var(--paper); box-shadow: 0 8px 24px rgb(32 50 61 / 18%); }
.brand-options:empty, .form-error:empty { display: none; }
.brand-options button { justify-content: flex-start; }

.skip-link {
  position: fixed;
  z-index: 30;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 12px 16px;
  background: var(--blue);
  color: var(--paper);
}
.skip-link:focus { transform: none; }
.layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
  border-right: 1px solid var(--rule);
  background: var(--paper);
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.055em;
}
.brand .icon { width: 28px; height: 28px; color: var(--blue); }
.menu-button { display: none; }
nav { display: grid; gap: 18px; padding: 20px 14px; }
.nav-group { display: grid; gap: 4px; }
.nav-group p { padding: 0 12px 3px; color: var(--muted); font-size: .8125rem; }
.nav-group button { justify-content: start; padding-inline: 12px; background: transparent; color: var(--ink); }
.nav-group button:hover:not(:disabled) { background: var(--canvas); }
.nav-group button[aria-current="page"] {
  border-left: 2px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding-left: 11px;
  background: var(--blue-wash);
  color: var(--blue);
}
.nav-group button:disabled { color: var(--muted); background: var(--canvas); }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-height: 76px;
  padding: 10px var(--gutter);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.role-label { color: var(--muted); font-size: .875rem; font-weight: 600; }
.account { display: flex; min-width: 0; align-items: center; gap: 10px; font-size: .875rem; }
.account-mark {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  height: 32px;
  background: var(--blue-wash);
  color: var(--blue);
  font-weight: 700;
}
.account button { margin-left: 4px; }
.workspace-body { max-width: 1480px; margin-inline: auto; padding: 42px var(--gutter) 64px; }
.heading { display: flex; align-items: end; flex-wrap: wrap; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 32px;
  border-block: 1px solid var(--rule);
  background: var(--paper);
}
.metric { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 18px clamp(12px, 2vw, 28px); }
.metric + .metric { border-left: 1px solid var(--rule); }
.metric dt { color: var(--muted); font-size: .875rem; }
.metric dd { color: var(--blue); font-size: clamp(1.8rem, 4.5vw, 3.5rem); line-height: 1; font-weight: 700; letter-spacing: -.05em; }
.metric dd, .price, .request-number, .badge, table { font-variant-numeric: tabular-nums; }
.section-heading { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; }
.section-count { padding: 1px 8px; background: var(--paper); border: 1px solid var(--rule); color: var(--muted); font-size: .875rem; }
.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  border-left: 3px solid var(--blue);
  background: var(--blue-wash);
}
.notice p { margin-top: 4px; color: var(--muted); }
.cards { display: grid; gap: 12px; }
.card, .empty { padding: clamp(16px, 2.1vw, 28px); border: 1px solid var(--rule); background: var(--paper); }
.card h2 + p, .card h2 + form, .card p + form, .card .row + form { margin-top: 16px; }
.card > p + p { margin-top: 12px; }
.card > p:not(:last-child) { margin-bottom: 12px; }
.request-card { display: grid; grid-template-columns: minmax(90px, .13fr) minmax(0, 1fr); padding: 0; }
.request-number { padding: 20px clamp(12px, 1.6vw, 22px); border-right: 1px solid var(--rule); }
.request-number strong { display: block; margin-top: 4px; color: var(--blue); font-size: clamp(1.4rem, 2.7vw, 2.15rem); letter-spacing: -.06em; line-height: 1.1; }
.request-body { min-width: 0; padding: clamp(14px, 2vw, 24px); }
.request-header { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.request-header > * { min-width: 0; }
.request-header h3 { margin-top: 4px; }
.request-meta, .request-body > p { margin-top: 12px; }
.request-meta { font-size: .9375rem; }
.request-body .actions { border-top: 1px solid var(--rule); padding-top: 16px; }
.card.is-favorite, .variant.is-favorite { border-left: 3px solid var(--blue); }
/* "Избранное": product, numbers and buttons in one line; the line wraps only on a narrow screen. */
.favorite-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; }
.favorite-row > strong { flex: 0 1 260px; min-width: 0; overflow-wrap: anywhere; } /* numbers line up from row to row */
.favorite-stats { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.favorite-actions { margin-left: auto; }
.badge {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid var(--rule);
  background: var(--canvas);
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 600;
}
/* The administrator's brands look like the others' badges but open the brand window. */
button.brand-badge { min-height: 0; min-width: 0; padding: 4px 8px; border-color: var(--rule); border-radius: 0; background: var(--canvas); color: var(--muted); font-size: .8125rem; }
button.brand-badge:hover { background: var(--paper); border-color: var(--control); color: var(--ink); }
/* A brand request waiting for a decision: amber, like other records that need an action. */
button.brand-badge.is-pending { border-color: #b7791f; background: #fff8e6; color: #8a5a12; }
button.brand-badge.is-pending:hover { border-color: #8a5a12; }
.badge.late { border-color: var(--danger); color: var(--danger); }
.variant, .subtle { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--rule); }
.variant.is-favorite { padding-left: 12px; }
.variant > .row, .variant > p + form, .variant > p + button, .variant > small + form { margin-top: 8px; }
.variant input[type="number"] { width: 92px; }
.variant select { width: auto; max-width: 100%; }
.price { font-size: 1.5rem; font-weight: 700; letter-spacing: -.035em; }
.empty { padding-block: 32px; color: var(--muted); }
.actions { margin-top: 16px; }
.spaced { margin-bottom: 16px; }
.tablewrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; margin-block: 12px 16px; font-size: .875rem; }
td, th { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--rule); }
th { color: var(--muted); background: var(--canvas); }
.log { padding-block: 8px; border-bottom: 1px solid var(--rule); color: var(--muted); font-size: .875rem; }
.stats-period { display: flex; flex-wrap: wrap; gap: 8px; }
.stats-period [aria-pressed="true"] { border-color: var(--blue); background: var(--blue-wash); color: var(--blue); }
.stats-note { margin-block: 12px 16px; }
#content > .card + .card { margin-top: 12px; }
.stats-table th[scope="row"] { color: inherit; background: none; white-space: nowrap; }
.stats-table td, .stats-table thead th, .journal-table td, .journal-table th { white-space: nowrap; }
.journal-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; gap: 12px; margin-bottom: 16px; }

.initial-status { margin: 32px; color: var(--muted); }
.login { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.login-intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  gap: clamp(56px, 12vh, 128px);
  padding: clamp(32px, 5vw, 76px);
  color: var(--paper);
  background: var(--blue);
}
.login-intro .brand, .login-intro .brand .icon { color: inherit; }
.login-display {
  margin-bottom: 32px;
  font-size: clamp(2.75rem, 6.15vw, 6.5rem);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.075em;
}
.login-steps { list-style: none; margin: 0; padding: 0; max-width: 340px; }
.login-steps li { display: flex; gap: 20px; border-top: 1px solid rgb(255 255 255 / 42%); padding-block: 12px; }
.login-steps li:last-child { border-bottom: 1px solid rgb(255 255 255 / 42%); }
.login-steps span { font-variant-numeric: tabular-nums; }
.login-mark { position: absolute; z-index: -1; width: 72%; top: 12%; right: -24%; opacity: .22; }
.login-panel { display: grid; align-items: center; padding: var(--gutter); background: var(--paper); }
.login form { width: min(100%, 384px); margin-inline: auto; gap: 20px; }
.login h1 { font-size: clamp(2rem, 3.5vw, 3rem); margin-bottom: 8px; }
.login-submit { justify-self: stretch; justify-content: space-between; }
#toast {
  position: fixed;
  z-index: 20;
  bottom: 16px;
  right: 16px;
  max-width: min(420px, calc(100% - 32px));
  padding: 14px 18px;
  background: var(--ink);
  color: var(--paper);
  overflow-wrap: anywhere;
}
#toast:empty { padding: 0; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; overflow: visible; border: 0; }
  .sidebar-header { min-height: 64px; padding-inline: var(--gutter); }
  .menu-button { display: inline-flex; }
  .sidebar:not(.menu-open) nav { display: none; }
  nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 8px; padding-inline: var(--gutter); border-bottom: 1px solid var(--rule); }
  .nav-group { align-content: start; }
  .topbar { min-height: 64px; }
  .workspace-body { padding-top: 28px; }
}
@media (max-width: 620px) {
  :root { --gutter: 16px; }
  .heading { align-items: start; margin-bottom: 20px; }
  .metrics { margin-bottom: 24px; }
  .metric { padding: 12px 8px; }
  .metric dt { font-size: .8125rem; }
  .account-mark { display: none; }
  .request-card { grid-template-columns: minmax(0, 1fr); }
  .request-number { display: flex; align-items: baseline; gap: 8px; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .request-number strong { margin: 0; font-size: 1.25rem; }
  .login { grid-template-columns: minmax(0, 1fr); align-content: start; background: var(--paper); }
  .login-intro { padding: 20px 24px 28px; gap: 24px; }
  .login-display { margin: 0; font-size: clamp(2.25rem, 9vw, 3.25rem); }
  .login-display br, .login-steps { display: none; }
  .login-panel { padding: 28px 24px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* Test records and participants (17.11.2026): a small amber tag next to the number or role. */
.test-mark { display: inline-block; margin-left: 4px; padding: 0 4px; border: 1px solid #b7791f; border-radius: 3px; color: #8a5a12; background: #fff8e6; font-size: 10px; font-weight: 600; line-height: 14px; letter-spacing: .02em; text-transform: uppercase; vertical-align: middle; }
.records td.numeric .test-mark { display: block; width: fit-content; margin: 2px 0 0 auto; }
.record-test-filter { flex: none; width: auto; min-height: 32px; padding: 3px 6px; font-size: 13px; }
.test-option { display: grid; }
.test-option small { margin: -8px 0 0 30px; color: var(--muted); font-size: 12px; }
.request-import { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--rule); }
.import-table { max-height: 45vh; overflow: auto; }
.import-skipped { max-height: 25vh; overflow: auto; }
