/* Доводка вёрстки концепта под серверный рендер варианта 2.
   Базовая система цвета и поверхностей берётся из styles.css и workflow.css концепта;
   здесь — только то, чего в концепте не было: формы аудитора, очередь, таблицы. */

.shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex: none; padding: 1.1rem 1rem; display: flex; flex-direction: column; gap: 1rem; }
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
main { padding: 1.2rem 1.6rem 2rem; flex: 1; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 0.7rem 1.6rem; border-bottom: 1px solid var(--line, #e3e6e2); }
.app-footer { display: flex; justify-content: space-between; padding: 0.8rem 1.6rem; font-size: 0.82rem; color: var(--ink-2, #68746e); }
.nav-item { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem .7rem; border-radius: 8px; text-decoration: none; color: inherit; }
.nav-item.active, .nav-item:hover { background: rgba(36, 99, 75, .09); }
.nav-item .count { background: #92651f; color: #fff; border-radius: 999px; font-size: .75rem; padding: 0 .4rem; }
.sidebar-bottom { margin-top: auto; display: grid; gap: .8rem; }
.auditor-form { display: grid; gap: .35rem; font-size: .85rem; }
.auditor-form input { padding: .35rem .5rem; border: 1px solid var(--line, #d9ded9); border-radius: 8px; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; }
.eyebrow { font-size: .72rem; letter-spacing: .08em; color: var(--ink-2, #68746e); }
.panel { background: #fff; border: 1px solid var(--line, #e3e6e2); border-radius: 14px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.panel-subtitle, .hint, .muted { color: var(--ink-2, #68746e); font-size: .88rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.stat { background: #fff; border: 1px solid var(--line, #e3e6e2); border-radius: 14px; padding: .8rem .9rem; display: grid; gap: .2rem; text-decoration: none; color: inherit; }
.stat.accent { border-color: #24634b; }
.stat-number { font-size: 1.7rem; font-weight: 650; }
.stat-number small { font-size: .9rem; font-weight: 400; color: var(--ink-2, #68746e); }
.stat-label, .stat-foot { font-size: .8rem; color: var(--ink-2, #68746e); }

.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-bottom: .8rem; }
.filters label, .stack label { display: grid; gap: .25rem; font-size: .85rem; }
.filters input, .filters select, .stack input, .stack select, .stack textarea {
  padding: .4rem .55rem; border: 1px solid var(--line, #d9ded9); border-radius: 8px; font: inherit; }
.stack { display: grid; gap: .5rem; }
.row { display: flex; gap: .6rem; }
.check { display: flex; align-items: center; gap: .45rem; font-size: .9rem; }

.button { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .8rem; border-radius: 8px;
  border: 1px solid var(--line, #d9ded9); background: #fff; color: inherit; text-decoration: none; cursor: pointer; font: inherit; }
.button.primary { background: #24634b; border-color: #24634b; color: #fff; }
.button.small { padding: .3rem .6rem; font-size: .85rem; }
.button.ghost { border-color: transparent; background: transparent; }
form.inline { display: inline-flex; gap: .35rem; align-items: center; }

.queue { display: grid; }
.qrow { display: grid; grid-template-columns: 180px 1fr 160px 120px 20px; gap: .6rem; align-items: center;
  padding: .6rem .4rem; border-top: 1px solid var(--line, #eceee9); text-decoration: none; color: inherit; }
.qrow:hover { background: #f7f9f6; }
.qrow .no { font-weight: 600; display: grid; }
.qrow .no small { font-weight: 400; color: var(--ink-2, #68746e); }
.qrow.state-completed { opacity: .72; }
.pill { border-radius: 999px; padding: .1rem .5rem; font-size: .78rem; display: inline-block; }
.p-critical { background: #fbe9e7; color: #b5483d; } .p-major { background: #fdf3e1; color: #92651f; }
.p-minor { background: #eef2f4; color: #6b7d8a; } .p-ok { background: #e6f4ea; color: #2e7d4f; }
.p-warn { background: #fdf3e1; color: #92651f; } .p-blue { background: #e7eef8; color: #2d5e8f; }
.notice { border-radius: 12px; padding: .7rem .9rem; margin-bottom: .9rem; }
.notice.good { background: #e6f4ea; } .notice.warn { background: #fdf3e1; } .notice.bad { background: #fbe9e7; }

.review-layout { display: grid; grid-template-columns: minmax(360px, 5fr) 6fr; gap: 1rem; align-items: start; }
.findings-panel { display: grid; gap: .7rem; }
.finding-item { background: #fff; border: 1px solid var(--line, #e3e6e2); border-left: 4px solid #6b7d8a; border-radius: 12px; padding: .8rem .9rem; }
.finding-item.sev-critical { border-left-color: #b5483d; } .finding-item.sev-major { border-left-color: #92651f; }
.finding-toggle { display: flex; gap: .6rem; align-items: flex-start; }
.finding-number { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #eef2f4; display: grid; place-items: center; font-size: .85rem; }
.finding-number.decided { background: #e6f4ea; color: #2e7d4f; }
.finding-title { display: grid; gap: .25rem; }
.finding-title-top { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; font-size: .8rem; }
.finding-body { margin-top: .6rem; display: grid; gap: .5rem; }
.quote { display: grid; gap: .2rem; background: #fffefa; border: 1px solid #efe9db; border-radius: 10px; padding: .5rem .6rem; text-decoration: none; color: inherit; }
.quote-label { font-size: .75rem; color: var(--ink-2, #68746e); }
.finding-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.verdict { font-size: .82rem; color: var(--ink-2, #68746e); }
.tech, .defer summary, .history-box summary, .manual-form summary { font-size: .85rem; cursor: pointer; }
.clarify-box { background: #fdf3e1; border-radius: 10px; padding: .6rem .7rem; display: grid; gap: .4rem; }
.blockers { margin: .3rem 0 0 1rem; color: #92651f; font-size: .9rem; }
.completion-box h3 { margin-top: 0; }
.history { display: grid; gap: .3rem; margin: .5rem 0 0; padding-left: 1rem; font-size: .86rem; }
.history-at { color: var(--ink-2, #68746e); margin-right: .4rem; }
.history-who { color: var(--ink-2, #68746e); margin-left: .4rem; }

.document-panel { background: #fff; border: 1px solid var(--line, #e3e6e2); border-radius: 14px; position: sticky; top: .8rem; }
.document-toolbar { display: flex; justify-content: space-between; align-items: center; padding: .5rem .8rem; border-bottom: 1px solid var(--line, #eceee9); }
.doc-tabs { display: flex; gap: .3rem; }
.doc-tab { padding: .25rem .6rem; border-radius: 8px; text-decoration: none; color: inherit; font-size: .88rem; }
.doc-tab.active { background: rgba(36, 99, 75, .1); }
.document-paper { background: #fffefa; max-height: 78vh; overflow: auto; padding: 1rem 1.2rem; font-family: Georgia, serif; line-height: 1.55; }
.document-paper mark { background: #fff0b3; } .document-paper mark.active { background: #ffd166; }
.document-info { padding: .8rem 1rem; display: grid; gap: .6rem; }
.field-review { display: flex; justify-content: space-between; gap: .8rem; align-items: center; border-bottom: 1px solid #f0f2ee; padding-bottom: .5rem; }
.field-caption { display: block; font-size: .78rem; color: var(--ink-2, #68746e); }
.field-mark { display: inline-block; margin-left: .4rem; font-size: .8rem; color: #2e7d4f; }
.field-mark.wrong { color: #b5483d; }
.field-actions { display: flex; gap: .3rem; flex-wrap: wrap; }

.grid { width: 100%; border-collapse: collapse; font-size: .9rem; }
.grid th, .grid td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid #f0f2ee; vertical-align: top; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.batch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .8rem; }
.batch-numbers { display: flex; gap: 1.2rem; margin: .5rem 0; }
.batch-progress { height: 6px; background: #eef2f4; border-radius: 999px; overflow: hidden; }
.batch-progress span { display: block; height: 100%; background: #24634b; }
.report-row { display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.question-card { display: grid; gap: .6rem; }
.question-top { display: flex; justify-content: space-between; gap: 1rem; }
.question-bottom { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.empty { text-align: center; padding: 1.5rem; color: var(--ink-2, #68746e); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: .5rem; top: .5rem; background: #fff; padding: .4rem; }

@media (max-width: 1000px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; }
  .review-layout { grid-template-columns: 1fr; }
  .document-panel { position: static; }
  .qrow { grid-template-columns: 1fr; gap: .2rem; }
}

/* Документ как в оригинале: листы рисуют себя сами, «бумага» вокруг не нужна. */
.document-paper.sheets { background: transparent; border: 0; box-shadow: none; padding: 10px 12px 24px; }
.document-toolbar .doc-modes { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.document-toolbar .doc-modes a { font-size: 12px; }

/* Рассмотренные замечания сворачиваются, активное — раскрыто; заголовок — ссылка на карточку. */
.finding-toggle { text-decoration: none; color: inherit; display: flex; gap: 10px; align-items: flex-start; }
.finding-toggle:hover .finding-title strong { text-decoration: underline; }
.finding-item.done:not(.expanded) .finding-body { display: none; }
.finding-item.done:not(.expanded) .finding-toggle { opacity: .72; }
.finding-item.deferred .finding-number { background: #f4e7c3; }
.privacy-note a { color: inherit; }

/* Панель стенда испытаний — над шапкой кабинета, только когда задан web.trial_url */
.trial-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 16px;
  background: #fff7e0; border-bottom: 1px solid #ecd9a0; font-size: 13px; }
.trial-bar .trial-label { font-weight: 600; color: #7a5a00; margin-right: 6px; letter-spacing: .04em; text-transform: uppercase; font-size: 11px; }
.trial-bar form.inline { display: inline; margin: 0; }
.trial-btn { display: inline-block; padding: 4px 10px; border: 1px solid #d9c27a; border-radius: 999px;
  background: #fff; color: #3a3a3a; text-decoration: none; font: inherit; cursor: pointer; }
.trial-btn.ok { background: #1f6f4a; border-color: #1f6f4a; color: #fff; }
.trial-btn.warn { border-color: #c96a3a; color: #8a3a12; }
.trial-btn.ghost { background: transparent; }

/* Flex-контейнер не должен растягиваться по минимальной ширине формы. */
.workspace > main { width:100%; min-width:0; }
.review-layout .stack,.review-layout .stack label { min-width:0; }
.review-layout .stack input,.review-layout .stack textarea,.review-layout .stack select { min-width:0; max-width:100%; }
.review-layout .button { white-space:normal; }
@media(max-width:1000px) {
  .workspace .review-layout { grid-template-columns:minmax(0,1fr); }
  .workspace > main { padding:22px 16px 16px; }
  .notice form.inline { flex-wrap:wrap; }
  .notice input { max-width:100%; }
  .review-heading h1 { overflow-wrap:anywhere; }
}
