/* Один файл, без фреймворков и внешних ресурсов: заводы открывают сайт из закрытых сетей. */
:root {
  --bg: #f4f6f8;
  --card: #fff;
  --ink: #1d2733;
  --muted: #667585;
  --line: #d8dfe6;
  --accent: #2f6f9f;
  --accent-ink: #fff;
  --good: #2e7d4f;
  --warn: #b7791f;
  --err: #b42318;
  --info: #2f6f9f;
  --radius: 6px;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0; line-height: 1.25; }
h1 small { font-size: .9rem; color: var(--muted); font-weight: 400; margin-left: .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 1.1rem 0 .4rem; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
code { background: #eef2f6; padding: .1em .35em; border-radius: 3px; }

.top { background: #1f3a52; color: #fff; }
.top-in { display: flex; align-items: center; justify-content: space-between; min-height: 52px; gap: 16px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .02em; }
.brand span { font-weight: 400; opacity: .75; margin-left: .4rem; }
.top-nav { display: flex; align-items: center; gap: 16px; font-size: .9rem; }
.top-nav a { color: #fff; }
.top-nav .who { opacity: .75; }
main.wrap { padding-top: 22px; padding-bottom: 40px; }
.foot { color: var(--muted); font-size: .85rem; padding-bottom: 28px; }

.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 6px 0 14px; flex-wrap: wrap; }
.lead { color: var(--muted); margin: 0 0 16px; max-width: 760px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.card.hl { border-color: var(--accent); background: #f2f8fc; }
.narrow { max-width: 520px; margin: 40px auto; }
.muted { color: var(--muted); }
.ok { color: var(--good); }

.steps { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.steps a { padding: 8px 12px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; font-size: .93rem; }
.steps a.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); vertical-align: middle; }

.btn, button.btn {
  display: inline-block; padding: 8px 16px; border-radius: var(--radius); border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }
button.link.danger { color: var(--err); }
form.inline { display: inline; }
.top-nav button.link { color: #fff; }

.alert { padding: 10px 14px; border-radius: var(--radius); border: 1px solid; margin: 0 0 14px; }
.alert.err { background: #fdecea; border-color: #f3b8b3; color: #7a1b13; }
.alert.warn { background: #fff6e0; border-color: #ecd08a; color: #6b4a07; }
.alert.info { background: #eaf3fa; border-color: #b9d6ea; color: #1d4766; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .8rem; background: #e8edf2; color: var(--ink); }
.badge.good { background: #dff2e6; color: #1d5a37; }
.badge.warn { background: #fdecc8; color: #7a5208; }
.badge.info { background: #dcebf7; color: #1d4766; }
.st-draft { background: #e8edf2; }
.st-submitted, .st-review { background: #fdecc8; color: #7a5208; }
.st-building { background: #dcebf7; color: #1d4766; }
.st-ready, .st-delivered { background: #dff2e6; color: #1d5a37; }

progress { width: 160px; height: 10px; vertical-align: middle; accent-color: var(--accent); }

.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: #f0f3f6; font-weight: 600; white-space: nowrap; }
.narrowtbl { width: auto; min-width: 360px; }
.scroll { overflow-x: auto; }

.gaps { list-style: none; margin: 0; padding: 0; }
.gap { padding: 5px 0 5px 22px; position: relative; }
.gap::before { content: ""; position: absolute; left: 4px; top: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--warn); }
.gap.required::before, .gap.invalid::before { background: var(--err); }
.gap.recommended::before { background: #b8c4d0; }
details summary { cursor: pointer; color: var(--muted); margin-top: 10px; }

.kv { display: grid; grid-template-columns: 240px 1fr; gap: 4px 16px; margin: 0 0 10px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.actions, .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin: 12px 0 6px; }
select { font: inherit; padding: 7px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* форма анкеты */
.sec .group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px 6px; margin-bottom: 16px; }
.sec .group h2 { margin-bottom: 10px; }
.sec fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.fields { display: block; }
.field { margin-bottom: 14px; }
.field[hidden] { display: none; }
.field .lbl, .field legend { display: block; font-weight: 600; font-size: .93rem; margin-bottom: 4px; padding: 0; }
.field fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.field.short input[type=text], .field.short input[type=number], .field.short input[type=tel], .field.short input[type=date] { max-width: 220px; }
.star { color: var(--err); }
.hint { margin: 4px 0 0; color: var(--muted); font-size: .86rem; font-style: italic; }
input[type=text], input[type=number], input[type=tel], input[type=email], input[type=date], input[type=password], textarea {
  width: 100%; padding: 8px 10px; font: inherit; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid #9ec5e3; border-color: var(--accent); }
.opts { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.opt { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font-weight: 400; }
.opt.small { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.other-text { width: 200px !important; }
.clear-radio { font-size: .82rem; color: var(--muted); }
.field.req > label .lbl, .field.req > fieldset legend { }
.save { font-size: .85rem; color: var(--muted); }
.save.saving { color: var(--warn); }
.save.saved { color: var(--good); }
.save.error { color: var(--err); font-weight: 600; }

/* камеры */
.cam { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; background: #fafbfc; }
.cam-head { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: .85rem; }
.cam-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
.cam-grid .cell { display: block; margin: 0; border: 0; padding: 0; min-width: 0; }
.cam-grid .cell.wide { grid-column: span 2; }
.cam-grid .lbl, .cam-grid legend { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 3px; padding: 0; }
.pwd-state { display: block; font-size: .8rem; margin-top: 3px; }
.pwd-state.set { color: var(--good); }
.pwd-state.unset { color: var(--muted); }
.pager { display: flex; justify-content: space-between; margin-top: 8px; }
.upload { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.full { width: 100%; }

@media (max-width: 720px) {
  .cam-grid { grid-template-columns: 1fr; }
  .cam-grid .cell.wide { grid-column: auto; }
  .kv { grid-template-columns: 1fr; }
}
