:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #8b98ab;
  --line: #e5e9f0;
  --line-2: #eef1f6;
  --accent: #35a7a5;
  --accent-dark: #1f7f7e;
  --accent-soft: #e2f5f4;
  --ok: #0f9d58;
  --ok-soft: #e7f6ed;
  --warn: #b45309;
  --warn-soft: #fdf1df;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --nav: #0b1524;
  --nav-2: #16243a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 28px -18px rgba(15, 23, 42, 0.28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  height: 100vh;
}

/* ---------- sidebar ---------- */

.sidebar {
  background: var(--nav);
  color: #c3cede;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(160deg, #f59e0b, #d97706);
  color: #1b1205;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 15px;
  letter-spacing: -0.5px;
}

.brand-text { line-height: 1.15; min-width: 0; }
.brand-text b { display: block; color: #fff; font-size: 14px; letter-spacing: 0.2px; }
.brand-text span {
  display: block;
  font-size: 11px;
  color: #7e8da3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 158px;
}

.nav-group { padding: 14px 10px 4px; }
.nav-group > .caption {
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #5f7189;
  padding: 0 10px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #b9c6d8;
  cursor: pointer;
  position: relative;
  font-size: 13.5px;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav-item.active { background: var(--nav-2); color: #fff; }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: #f59e0b;
}

.nav-item .ico { width: 18px; text-align: center; opacity: 0.95; font-size: 14px; }
.nav-item .pill {
  margin-left: auto;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: #dbe4f0;
  border-radius: 99px;
  padding: 1px 7px;
}
.nav-item .pill.hot { background: rgba(245, 158, 11, 0.22); color: #fbbf24; }

.nav-scroll { overflow-y: auto; flex: 1; padding-bottom: 12px; }
.nav-scroll::-webkit-scrollbar { width: 8px; }
.nav-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.09); border-radius: 8px; }

.sidebar-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 12px 14px;
  font-size: 12px;
  color: #7e8da3;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #22334c; color: #cdd9ea;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
}

/* ---------- topbar ---------- */

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar {
  height: 58px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  flex: none;
}

.crumbs { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13px; }
.crumbs b { color: var(--ink); font-weight: 600; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.select {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 30px 7px 11px;
  font-size: 13px;
  cursor: pointer;
  max-width: 300px;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b98ab'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

.icon-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 14px;
  color: var(--ink-2);
}
.icon-btn:hover { background: #f8fafc; }

/* ---------- content ---------- */

.content { overflow-y: auto; padding: 22px 26px 60px; }
.content::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-thumb { background: #d7dde6; border-radius: 8px; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.page-head h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: -0.2px; }
.page-head p { margin: 0; color: var(--ink-3); font-size: 13px; max-width: 720px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }

.btn {
  border: 1px solid #c7d7fe;
  background: #eef4ff;
  border-radius: 8px;
  padding: 8px 13px;
  font-size: 13px;
  cursor: pointer;
  color: #1e3a8a;
  font-weight: 500;
  white-space: nowrap;
}
.btn:hover { background: #dbe7ff; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.ghost { background: #ecfdf3; border-color: #b7f0cd; color: #047857; }
.btn.ghost:hover { background: #d1fae5; }
[data-edit-block].btn { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
[data-edit-block].btn:hover { background: #ffedd5; }
[data-save-block].btn, [data-save-contract].btn { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
[data-save-block].btn:hover, [data-save-contract].btn:hover { background: #1d4ed8; }

/* ---------- cards / grid ---------- */

.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.split { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.grid.split-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0;
}

.card.tight { padding: 0; overflow: hidden; }

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.card.tight .card-head { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.card-head h2 { font-size: 14px; margin: 0; font-weight: 650; letter-spacing: -0.1px; }
.card-head .sub { font-size: 12px; color: var(--ink-3); }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- kpi ---------- */

.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); }
.kpi .value { font-size: 25px; font-weight: 680; letter-spacing: -0.6px; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 13px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.kpi .foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }

.delta { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 99px; }
.delta.up { background: var(--ok-soft); color: var(--ok); }
.delta.down { background: var(--danger-soft); color: var(--danger); }
.delta.flat { background: #eef1f6; color: var(--ink-2); }

/* ---------- table ---------- */

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: #fbfcfe;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover { background: #fafbfd; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .muted { color: var(--ink-3); }
.table.clickable tbody tr { cursor: pointer; }

.table-wrap { overflow-x: auto; }

/* ---------- badge ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--accent-soft); color: var(--accent); }
.badge.neutral { background: #eef1f6; color: var(--ink-2); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- progress ---------- */

.bar { height: 6px; border-radius: 99px; background: #edf0f5; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.bar.ok > span { background: var(--ok); }
.bar.warn > span { background: #f59e0b; }
.bar.danger > span { background: var(--danger); }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .bar { flex: 1; }
.bar-row .pct { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; width: 42px; text-align: right; }

/* ---------- stages / stuck ---------- */

.stage {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 150px 120px 130px;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-2);
}
.stage:last-child { border-bottom: 0; }
.stage .marker { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; margin-left: 6px; }
.stage.done .marker { background: var(--ok); }
.stage.active .marker { background: var(--accent); box-shadow: 0 0 0 4px rgba(53, 167, 165, 0.16); }
.stage.stuck .marker { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14); }
.stage .name { font-weight: 600; font-size: 13px; }
.stage .name .hint { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; }
.stage .cell { font-size: 12.5px; color: var(--ink-2); }
.stage .money { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }

.stuck-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--warn-soft);
  border: 1px solid #f6dfb6;
  margin-bottom: 12px;
}
.stuck-summary .big { font-size: 20px; font-weight: 700; color: #8a4b06; font-variant-numeric: tabular-nums; }
.stuck-summary .txt { font-size: 12.5px; color: #7c4a0e; }

/* ---------- chat / MAX ---------- */

.chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding: 4px 2px;
}
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg .who {
  width: 32px; height: 32px; border-radius: 50%;
  background: #eaf0ff; color: #2563eb;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; flex: none;
}
.msg .bubble {
  background: #f6f8fb;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  border-top-left-radius: 4px;
  padding: 9px 12px;
  max-width: 520px;
  font-size: 13px;
}
.msg .bubble .meta { font-size: 11px; color: var(--ink-3); margin-bottom: 3px; }
.msg.out { flex-direction: row-reverse; }
.msg.out .bubble { background: #eef6ff; border-color: #d8e8ff; border-radius: 12px; border-top-right-radius: 4px; max-width: 420px; }
.msg.out .who { background: #e8f1ff; color: #1d4ed8; }
.msg .parsed {
  margin-top: 8px;
  border-top: 1px dashed #d5dbe5;
  padding-top: 8px;
  font-size: 12px;
  color: var(--ink-2);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.msg .parsed b { color: var(--ink); }

/* ---------- misc ---------- */

.big-number { font-size: 30px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.hr { height: 1px; background: var(--line-2); margin: 12px 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }

.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 0; border-bottom: 1px solid var(--line-2);
}
.list-item:last-child { border-bottom: 0; }
.list-item .ico {
  width: 30px; height: 30px; border-radius: 8px;
  background: #f2f5f9; color: var(--ink-2);
  display: grid; place-items: center; font-size: 13px; flex: none;
}
.list-item .body { min-width: 0; }
.list-item .title { font-size: 13px; font-weight: 600; }
.list-item .desc { font-size: 12px; color: var(--ink-3); }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--ink-2);
  background: #fff;
}
.chip.on { background: var(--accent-soft); border-color: #bfe6e5; color: var(--accent); }

.day-grid { display: grid; grid-template-columns: repeat(15, 1fr); gap: 4px; }
.day {
  height: 26px; border-radius: 5px; background: #eef1f6;
  font-size: 10px; color: var(--ink-3);
  display: grid; place-items: center;
}
.day.work { background: #dbeafe; color: #1e40af; }
.day.rest { background: #f1f5f9; color: #94a3b8; }
.day.travel { background: #fef3c7; color: #92400e; }
.day.off { background: var(--danger-soft); color: var(--danger); }

/* ---------- формы ---------- */

.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink-2); min-width: 0; }
.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
}
.input:focus { outline: 2px solid #bfe6e5; border-color: var(--accent); }

/* ---------- фотоотчёт ---------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.photo {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #d7dde5;
  border: 1px solid var(--line);
}

.photo-img { position: absolute; inset: 0; }

.photo-wm {
  position: absolute;
  left: 8px; right: 8px; bottom: 8px;
  color: #fff;
  font-size: 10px;
  line-height: 1.35;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  background: rgba(15, 23, 42, 0.42);
  border-radius: 6px;
  padding: 4px 6px;
  backdrop-filter: blur(1px);
}

.photo-tag {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
}

.footer-note { margin-top: 22px; font-size: 12px; color: var(--ink-3); }


/* предпросмотр документа */
.doc-preview {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px 26px;
  font-family: 'Times New Roman', serif;
  color: #111;
  text-align: center;
  margin-top: 8px;
}
.dp-org { font-size: 17px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.dp-sub { font-size: 13px; margin-top: 2px; }
.dp-index { margin: 22px auto 18px; width: 90px; border-bottom: 1px solid #111; font-size: 13px; }
.dp-index span { display: block; font-size: 10px; border: 0; }
.dp-doc { font-weight: 700; font-size: 15px; }
.dp-object { font-size: 15px; font-weight: 700; margin-top: 6px; }
.dp-code { font-size: 14px; margin-top: 6px; }
.dp-line { font-size: 12px; margin-top: 4px; }
.dp-tom { font-size: 14px; margin-top: 18px; }
.dp-year { font-size: 12px; margin-top: 6px; }
.doc-preview-wide { text-align: left; font-family: inherit; padding: 16px 20px; }
.dp-row { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.dp-row:last-child { border-bottom: 0; }
.dp-name { width: 150px; color: var(--ink-3); shrink: 0; }
.dp-value { flex: 1; }


/* рамка предпросмотра A4 */
.a4-frame {
  background: #e9edf3;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  overflow: auto;
  max-height: 80vh;
}
.a4-frame iframe {
  width: 210mm;
  height: 297mm;
  border: 0;
  display: block;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}


/* сворачиваемые шаги */
.step-head { cursor: pointer; user-select: none; }
.step-head:hover h2 { color: var(--accent); }
.step-sign {
  margin-left: auto;
  width: 34px;
  text-align: center;
  font-size: 27px;
  font-weight: 800;
  color: #35a7a5;
  line-height: 1;
}
.step-head:hover .step-sign { color: #1f7f7e; }


/* страница предпросмотра прямо в окне */
.a4-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
}
.a4-wrap .a4-page {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
  border: 1px solid var(--line);
}

@media print {
  .sidebar, .topbar, .page-head, .card:not(.preview-card), .hr { display: none !important; }
  body { background: #fff; }
  .main, .content { padding: 0 !important; margin: 0 !important; }
  .card.preview-card { border: 0; box-shadow: none; padding: 0; }
  .a4-wrap { padding: 0; }
  .a4-wrap .a4-page { box-shadow: none; border: 0; }
}


/* подсказки поиска листов */
.search-matches {
  display: none;
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
  max-height: 240px;
  overflow: auto;
}
.search-matches .match { padding: 7px 10px; font-size: 13px; cursor: pointer; }
.search-matches .match:hover { background: var(--accent-soft); }
.search-matches .match.muted { color: var(--ink-3); cursor: default; }


/* группы участников */
.pgroup {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px 6px;
  margin-bottom: 10px;
  background: #fbfcfe;
}
.pgroup-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  margin-bottom: 8px;
}


/* подсветка неверных дат */
.input.invalid {
  border-color: #d92d20 !important;
  background: #fef3f2 !important;
  color: #b42318 !important;
}
.danger-text { color: #b42318; }


/* предпросмотр PDF */
.pdf-frame {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #e9edf3;
}
.pdf-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pdf-page {
  display: block;
  max-width: 100%;
  max-height: 86vh;
  object-fit: contain;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.18);
}
.pdf-frame iframe {
  width: 100%;
  height: 86vh;
  border: 0;
  display: block;
  background: #e9edf3;
}


/* пометка «на контроль» */
.note-flag {
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 99px;
  padding: 2px 8px;
}


/* набор муфт */
.mufta-row {
  display: grid;
  grid-template-columns: 92px 132px minmax(200px, 340px) 34px;
  gap: 8px;
  margin-bottom: 6px;
  align-items: center;
  max-width: 640px;
}
.mufta-row .input { height: 34px; }
.mufta-row select.input { min-width: 0; }
.btn.ghost { background: #ecfdf3; border-color: #b7f0cd; color: #047857; }


/* реестр выпусков */
.reg-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.reg-table th, .reg-table td {
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}
.reg-table th { background: var(--accent-soft); font-weight: 600; }


/* повторная сдача */
.dup-flag {
  font-size: 10px;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  border-radius: 99px;
  padding: 1px 6px;
  margin-left: 4px;
}
.dup-row { background: #fffaf0; }


/* экран входа */
#login-screen {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.login-box {
  background: #fff;
  border-radius: 14px;
  padding: 26px 28px;
  width: 320px;
  display: grid;
  gap: 10px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  text-align: center;
}
.login-box .logo { margin: 0 auto 6px; }
.login-box h2 { margin: 0; font-size: 18px; }
.login-box .input { text-align: left; }


/* Кнопки сохранения — как основная кнопка сборки */
.btn.ghost[data-save-block],
.btn.ghost[data-save-contract],
button.btn[data-save-block],
button.btn[data-save-contract] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.btn.ghost[data-save-block]:hover,
.btn.ghost[data-save-contract]:hover,
button.btn[data-save-block]:hover,
button.btn[data-save-contract]:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}


/* Проверка ИД: индикаторы и окна */
.rv-lights { display: inline-flex; gap: 12px; align-items: center; margin-left: auto; margin-right: 10px; }
.rv-light { display: inline-flex; gap: 5px; align-items: center; font-size: 11px; color: var(--muted); }
.rv-light i { width: 9px; height: 9px; border-radius: 50%; background: #d1d5db; display: inline-block; }
.rv-light.on { color: var(--ink); font-weight: 600; }
.rv-light.on.rv-check i { background: #f59e0b; animation: rvPulse 1.6s infinite; }
.rv-light.on.rv-remarks i { background: #ef4444; animation: rvPulse 1.6s infinite; }
.rv-light.on.rv-done i { background: #22c55e; animation: rvPulse 1.6s infinite; }
@keyframes rvPulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.25); }
  70% { box-shadow: 0 0 0 6px rgba(0, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}
.rv-panel { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; background: #fff; }
.rv-title { font-size: 12px; color: var(--muted); }


/* Проверка ИД: плашки статусов */
.rv-statuses { display: inline-flex; gap: 8px; align-items: center; margin-left: auto; margin-right: 12px; }
.rv-status {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 150px; height: 44px; padding: 0 16px;
  border: 1px solid; border-radius: 10px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.2px; user-select: none;
  opacity: 0.55;
}
.rv-status.rv-check { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.rv-status.rv-remarks { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
.rv-status.rv-done { background: #dcfce7; border-color: #22c55e; color: #166534; }
.rv-status.on { opacity: 1; animation: rvGlow 1.8s infinite; }
.rv-status.on.rv-check { background: #f59e0b; border-color: #d97706; color: #1f2937; }
.rv-status.on.rv-remarks { background: #ef4444; border-color: #dc2626; color: #fff; }
.rv-status.on.rv-done { background: #22c55e; border-color: #16a34a; color: #fff; }
@keyframes rvGlow {
  0% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.28); }
  70% { box-shadow: 0 0 0 9px rgba(0, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

/* одинаковая высота свёрнутых карточек шагов */
.card-head.step-head { min-height: 34px; align-items: center; margin-bottom: 0; }


/* компактные карточки: всё свёрнутое помещается на один экран */
.card { padding: 10px 16px; }
.preview-card .card-head { margin-bottom: 6px; }
