/* Стили в духе текущего gold: жёлтый #ffce00, текст #212529, фон #f5f5f5. Под планшет 768-1366 px. */
@font-face { font-family: 'Exo 2'; font-display: swap; font-weight: 400; font-style: normal;
  src: url('fonts/exo/exo-2-v26-cyrillic_latin-regular.woff2') format('woff2'), url('fonts/exo/exo-2-v26-cyrillic_latin-regular.woff') format('woff'); }
@font-face { font-family: 'Gotham Pro'; font-display: swap; font-weight: 400; font-style: normal;
  src: url('fonts/GothamPro.woff2') format('woff2'), url('fonts/GothamPro.woff') format('woff'); }

:root {
  --yellow: #ffce00; --yellow-dark: #e6b900; --text: #212529; --bg: #f5f5f5; --white: #fff;
  --line: #e8e8e8; --grey: #8f8f8f; --red: #ff0004; --green: #00874f; --orange: #f56600;
  --touch: 48px; --radius: 4px;
  --shadow: 0 4px 24px rgba(79, 105, 118, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.45 'Exo 2', Arial, sans-serif; }
h1, h2 { font-family: 'Gotham Pro', 'Exo 2', Arial, sans-serif; font-weight: 400; margin: 0; }
h1 { font-size: 28px; } h2 { font-size: 20px; margin-bottom: 14px; }
a { color: #1c6fc0; }
.muted { color: var(--grey); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ico { flex: none; }

/* верхнее меню */
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px; min-height: 64px; max-width: 1366px; margin: 0 auto; }
.menu { display: flex; gap: 4px; }
.menu__link { display: inline-flex; align-items: center; min-height: var(--touch); padding: 0 18px; color: var(--text); text-decoration: none; font-family: 'Gotham Pro', 'Exo 2', sans-serif; border-bottom: 4px solid transparent; }
.menu__link.is-active { border-bottom-color: var(--yellow); }
.topbar__user { display: flex; align-items: center; gap: 10px; }
.topbar__name { display: inline-flex; align-items: center; gap: 8px; }
.topbar__user form { margin: 0; }

.page { max-width: 1366px; margin: 0 auto; padding: 24px 20px 48px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head--small { margin-bottom: 8px; }
.card { background: var(--white); box-shadow: var(--shadow); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .card { margin-top: 20px; }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--touch); padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--radius); background: var(--white); color: var(--text); cursor: pointer;
  font: 400 15px 'Gotham Pro', 'Exo 2', sans-serif; text-transform: uppercase; letter-spacing: .03em; text-decoration: none; touch-action: manipulation; }
.btn--primary { background: var(--yellow); border-color: var(--yellow); }
.btn--primary:active { background: var(--yellow-dark); }
.btn--dark { background: var(--text); color: var(--white); }
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--small { min-height: 44px; padding: 0 14px; font-size: 13px; }
.btn--block { width: 100%; }
.btn:focus-visible, .input:focus-visible { outline: 3px solid rgba(34, 139, 230, .55); outline-offset: 1px; }

/* формы */
.form { display: flex; flex-direction: column; gap: 18px; }
.form--wide { max-width: 720px; }
.form__actions, .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--grow { flex: 1 1 220px; }
.field__label { font-size: 14px; color: var(--grey); }
.field__error { color: var(--red); font-size: 14px; }
.input { width: 100%; min-height: var(--touch); padding: 10px 14px; font: inherit; font-size: 18px; color: var(--text);
  background: var(--white); border: 1px solid #cfcfcf; border-radius: var(--radius); }
textarea.input { min-height: 110px; resize: vertical; }
.input--error { border-color: var(--red); }
.check { display: flex; align-items: center; gap: 12px; min-height: var(--touch); cursor: pointer; }
.check input { width: 26px; height: 26px; accent-color: var(--text); flex: none; }
.inline-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.inline-form--row { align-items: center; margin-bottom: 10px; }
.inline-form--row .input { flex: 1 1 220px; width: auto; }
.filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.filters .field { flex: 0 1 200px; }
.filters .field--grow { flex: 1 1 260px; }
.filters__btns { display: flex; gap: 8px; }
.login { max-width: 440px; margin: 8vh auto 0; }
.login__title { margin-bottom: 18px; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.alert--error { background: #fde8e8; color: #9b1c1c; }
.alert--warn { background: #fff4d6; color: #7a5b00; margin-top: 12px; }

/* таблица: шапка жёлтая */
.table { width: 100%; border-collapse: collapse; background: var(--white); box-shadow: var(--shadow); }
.table th { background: var(--yellow); color: var(--text); text-align: left; font-weight: 400; font-family: 'Gotham Pro', 'Exo 2', sans-serif; font-size: 14px; padding: 12px 10px; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td a:not(.btn) { display: inline-block; padding: 8px 0; }

.badge { display: inline-block; padding: 4px 12px; border-radius: 14px; font-size: 14px; background: #eee; white-space: nowrap; }
.badge--new { background: #e3f0fd; color: #14548f; }
.badge--sending { background: #fff4d6; color: #7a5b00; }
.badge--not_sent, .badge--send_failed { background: #fde8e8; color: #9b1c1c; }
.badge--in_work { background: #fff4d6; color: #7a5b00; }
.badge--done { background: #dcf3e8; color: var(--green); }
.badge--done_no_report { background: #ffe9d6; color: var(--orange); }

.dl { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; margin: 0; }
.dl dt { color: var(--grey); } .dl dd { margin: 0; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs__link { display: inline-flex; align-items: center; min-height: var(--touch); padding: 0 18px; color: var(--text); text-decoration: none; border-bottom: 4px solid transparent; }
.tabs__link.is-active { border-bottom-color: var(--yellow); }
.list { list-style: none; margin: 0 0 14px; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.list form { margin: 0; }

/* планшет в книжной ориентации и узкие экраны: таблица -> карточки */
@media (max-width: 1100px), (orientation: portrait) {
  .grid2 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 140px 1fr; }
  .topbar__name span { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* таблица администратора требует ~1256 px: карточки до 1280 px (iPad 11"/13" в альбомной не прокручивается вбок) */
@media (max-width: 1280px), (orientation: portrait) {
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table { background: transparent; box-shadow: none; }
  .table thead { display: none; }
  .table tr { background: var(--white); box-shadow: var(--shadow); border-radius: var(--radius); margin-bottom: 14px; padding: 8px 14px; border-left: 6px solid var(--yellow); }
  .table td { display: flex; justify-content: space-between; align-items: center; gap: 16px; text-align: right; border-bottom: 1px solid var(--line); padding: 8px 0; min-height: 44px; }
  .table td:last-child { border-bottom: 0; }
  .table td::before { content: attr(data-label); color: var(--grey); font-size: 14px; text-align: left; flex: none; }
  .table td.cell-main { font-size: 19px; }
}
@media (max-width: 600px) { .btn span { white-space: normal; } .page { padding: 16px 12px 40px; } }

/* ссылки в таблицах и списках — область касания не меньше 44 px */
.table td a:not(.btn), .list a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }

/* форма запроса */
.reqform { max-width: 1000px; }
.sections { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px; background: var(--bg); padding: 6px 0; margin: 0 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.sections__link { display: inline-flex; align-items: center; min-height: var(--touch); padding: 0 18px; color: var(--text); text-decoration: none; border-bottom: 4px solid transparent; white-space: nowrap; }
.sections__link.is-active { border-bottom-color: var(--yellow); background: var(--white); }
.sections__send { margin-left: auto; min-height: 44px; }
.reqform .card { scroll-margin-top: 72px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.fgrid .field { grid-column: span 2; }
.fgrid .field--half { grid-column: span 1; }
.field[hidden] { display: none; }
.seg { display: inline-flex; border: 1px solid #cfcfcf; border-radius: var(--radius); overflow: hidden; width: max-content; }
.seg__item { position: relative; cursor: pointer; }
.seg__item input { position: absolute; opacity: 0; inset: 0; }
.seg__item span { display: flex; align-items: center; justify-content: center; min-width: 96px; min-height: var(--touch); padding: 0 18px; background: var(--white); }
.seg__item input:checked + span { background: var(--yellow); }
.seg__item input:focus-visible + span { outline: 3px solid rgba(34, 139, 230, .55); outline-offset: -3px; }
.input:disabled { background: #eee; color: var(--grey); }
.tiles { display: flex; gap: 14px; flex-wrap: wrap; }
.tile { flex: 1 1 220px; min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px; text-align: center; cursor: pointer; border: 2px dashed #cfcfcf; border-radius: var(--radius); background: #fafafa; }
.tile .ico { width: 38px; height: 38px; }
.tile b { font-weight: 400; font-family: 'Gotham Pro', 'Exo 2', sans-serif; }
.tile small { color: var(--grey); }
.tile:active { border-color: var(--yellow); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.form__actions--end { justify-content: flex-end; }
@media (max-width: 700px) { .fgrid { grid-template-columns: 1fr; } .fgrid .field, .fgrid .field--half { grid-column: span 1; } .sections__send { display: none; } }

/* карточка с отчётом */
.rview { display: block; }
.rnav { position: sticky; top: 0; z-index: 20; display: flex; gap: 4px; overflow-x: auto; background: var(--bg); padding: 6px 0; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.rnav__link { display: inline-flex; align-items: center; min-height: var(--touch); padding: 0 16px; color: var(--text); text-decoration: none; white-space: nowrap; border-bottom: 4px solid transparent; }
.rnav__link.is-active { border-bottom-color: var(--yellow); background: var(--white); }
.rnav__link.is-empty { color: var(--grey); }
.rmain > * { scroll-margin-top: 72px; }
.rsec { background: var(--white); box-shadow: var(--shadow); border-radius: var(--radius); margin-top: 20px; }
.rsec__head { list-style: none; cursor: pointer; background: var(--yellow); padding: 0 20px; min-height: var(--touch); display: flex; align-items: center; font-family: 'Gotham Pro', 'Exo 2', sans-serif; font-size: 18px; border-radius: var(--radius) var(--radius) 0 0; }
.rsec__head::-webkit-details-marker { display: none; }
.rsec__head::after { content: '+'; margin-left: auto; font-size: 24px; }
.rsec[open] > .rsec__head::after { content: '\2212'; }
.rsec:not([open]) > .rsec__head { border-radius: var(--radius); background: #f0e3a0; }
.kv { width: 100%; border-collapse: collapse; }
.kv th, .kv td { padding: 12px 20px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.kv th { width: 34%; font-weight: 400; color: var(--grey); }
.kv td { white-space: pre-wrap; overflow-wrap: anywhere; }
.pad { padding: 16px 20px; margin: 0; }
.pdfv__bar { position: sticky; top: 64px; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 20px; background: #f7f7f7; border-bottom: 1px solid var(--line); }
.pdfv__pages { padding: 12px; background: #d9d9d9; display: flex; flex-direction: column; gap: 12px; }
.pdfv__page { display: block; width: 100%; height: auto; min-height: 60vw; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.25); }
.pdfv__page.is-loaded { min-height: 0; }
@media (min-width: 1100px) and (orientation: landscape) {
  .rview { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 24px; align-items: start; }
  .rnav { grid-column: 2; grid-row: 1; top: 12px; flex-direction: column; overflow: visible; background: var(--white); box-shadow: var(--shadow); padding: 8px; border: 0; margin: 0; }
  .rnav__link { border-bottom: 0; border-left: 4px solid transparent; }
  .rnav__link.is-active { border-left-color: var(--yellow); }
  .rmain { grid-column: 1; grid-row: 1; }
  .pdfv__bar { top: 0; }
}

/* новый (непросмотренный) отчёт у инициатора */
.counter { display: inline-block; min-width: 24px; padding: 0 7px; margin-left: 6px; border-radius: 12px; background: var(--red); color: #fff; font-size: 14px; line-height: 24px; text-align: center; }
.badge--fresh { background: var(--yellow); font-weight: 700; }
.table tr.is-new-report td { font-weight: 700; background: #fffbe6; }
@media (max-width: 1280px), (orientation: portrait) { .table tr.is-new-report { border-left-color: var(--red); } .table tr.is-new-report td { background: transparent; } }
.alert[hidden] { display: none; }
