:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #15202b;
  --muted: #6b7280;
  --line: #dde3ea;
  --primary: #1f6feb;
  --primary-dark: #1859bd;
  --danger: #c2410c;
  --ok: #15803d;
  --warn: #b45309;
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button {
  cursor: pointer;
  border: 0;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}
.sidebar {
  background: #111827;
  color: white;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  display: grid;
  place-items: center;
  font-weight: 900;
}
.nav {
  display: grid;
  gap: 8px;
}
.nav button {
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
}
.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.sidebar-footer {
  margin-top: auto;
  color: #9ca3af;
  font-size: 13px;
  line-height: 1.5;
}
.main {
  padding: 28px;
  overflow: auto;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.drawer-topbar { margin-bottom: 14px; }
.eyebrow {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 6px;
}
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 32px; margin-bottom: 6px; letter-spacing: -0.04em; }
h2 { font-size: 22px; margin-bottom: 16px; letter-spacing: -0.03em; }
h3 { font-size: 17px; margin-bottom: 6px; }
.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.btn {
  padding: 11px 15px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(31, 111, 235, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn.secondary:hover { background: #f8fafc; }
.btn.ghost {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.btn.danger {
  background: #fff7ed;
  color: var(--danger);
  box-shadow: none;
  border: 1px solid #fed7aa;
}
.btn.small {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
}
.grid-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.grid-stats.three { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
.stat-card, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat-card { padding: 18px; }
.stat-label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.stat-value { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; }
.card { padding: 18px; }
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.input, .select, .textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}
.search { min-width: 290px; }
.table-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  min-width: 900px;
}
th, td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f8fafc;
}
tr:hover td { background: #f8fafc; }
.row-title {
  font-weight: 800;
  margin-bottom: 4px;
}
.row-subtitle {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.row-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.badge.new { background: #eff6ff; color: #1d4ed8; }
.badge.in_work { background: #ecfdf5; color: #047857; }
.badge.paused { background: #fffbeb; color: #b45309; }
.badge.done { background: #f1f5f9; color: #475569; }
.link-btn {
  background: transparent;
  color: var(--primary);
  font-weight: 800;
  padding: 0;
}
.link-btn.danger-text { color: var(--danger); }
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 420px;
}
.login-hero {
  padding: 56px;
  background: radial-gradient(circle at top left, #93c5fd, transparent 32%), linear-gradient(135deg, #111827, #1e3a8a);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-hero h1 {
  max-width: 760px;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 0.95;
}
.login-hero p {
  max-width: 620px;
  color: #dbeafe;
  font-size: 18px;
  line-height: 1.55;
}
.login-panel {
  background: #fff;
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgba(255,255,255,0.2);
}
.form-grid {
  display: grid;
  gap: 12px;
}
.form-row {
  display: grid;
  gap: 6px;
}
.form-row label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.helper {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}
.helper.light { color: #dbeafe; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 30;
}
.modal {
  width: min(820px, 100%);
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.25);
  max-height: 92vh;
  overflow: auto;
}
.modal-header, .modal-footer {
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.modal-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}
.modal-body { padding: 22px; }
.two-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.nested-box {
  padding: 16px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 16px;
  display: grid;
  gap: 12px;
}
.section-title {
  font-weight: 900;
  color: #1e40af;
}
.hidden { display: none !important; }
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  justify-content: flex-end;
  z-index: 20;
}
.drawer {
  width: min(720px, 100%);
  background: #fff;
  min-height: 100vh;
  box-shadow: -20px 0 60px rgba(0,0,0,0.18);
  padding: 24px;
  overflow: auto;
}
.kv {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.kv span:first-child { color: var(--muted); }
.empty {
  padding: 50px 20px;
  text-align: center;
  color: var(--muted);
}
.empty.compact {
  padding: 28px 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #f8fafc;
}
.notice {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 14px;
  padding: 12px 14px;
  line-height: 1.5;
}
.tab-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.tab-nav button {
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  padding: 12px 10px;
  border-bottom: 3px solid transparent;
}
.tab-nav button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-nav span {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eff6ff;
  margin-left: 4px;
  color: #1d4ed8;
  font-size: 12px;
}
.drawer-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.contract-list {
  display: grid;
  gap: 12px;
}
.file-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  display: grid;
  gap: 12px;
}
.file-card-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.file-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #eff6ff;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.file-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.file-note {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.mini-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.todo-grid {
  display: grid;
  gap: 12px;
}
.todo-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.todo-item.done-step {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.todo-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 900;
  flex: 0 0 auto;
}
.todo-item.done-step .todo-num {
  background: #dcfce7;
  color: #15803d;
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .grid-stats, .grid-stats.three { grid-template-columns: repeat(2, 1fr); }
  .login-screen { grid-template-columns: 1fr; }
  .login-hero { padding: 32px; min-height: 40vh; }
  .login-panel { padding: 28px; }
}
@media (max-width: 640px) {
  .main { padding: 18px; }
  .topbar, .drawer-section-head { flex-direction: column; }
  .grid-stats, .grid-stats.three, .two-cols { grid-template-columns: 1fr; }
  .search { min-width: 0; }
  .kv { grid-template-columns: 1fr; }
  .drawer { padding: 18px; }
  .file-card-main { flex-direction: column; }
  .file-actions { justify-content: flex-start; }
}

/* MVP 03 additions */
.badge.preparing { background: #eef2ff; color: #4338ca; }
.link-title {
  display: block;
  color: var(--text);
  text-align: left;
  background: transparent;
  padding: 0;
}
.link-title:hover { color: var(--primary); }
.count-link {
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 900;
  display: inline-grid;
  place-items: center;
}
.count-link:hover { background: #dbeafe; }
.action-cell { white-space: nowrap; }
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  display: inline-grid;
  place-items: center;
  margin-left: 4px;
  box-shadow: none;
}
.icon-btn:hover { background: #f8fafc; }
.danger-icon { color: var(--danger); }
.status-card { margin-bottom: 22px; }
.status-help-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}
.status-help-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  background: #fff;
}
.status-help-card p {
  margin: 10px 0 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.status-help-card small {
  color: var(--muted);
  line-height: 1.45;
  display: block;
}
.status-inline-help { margin: 8px 0 0; }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.small-stat {
  font-size: 18px;
  line-height: 1.15;
}
.project-card { background: #fff; }
.version-box {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.version-title {
  font-weight: 900;
  margin-bottom: 10px;
}
.version-list {
  display: grid;
  gap: 10px;
}
.version-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 14px;
  padding: 12px;
}
.compact-actions {
  align-items: flex-start;
  flex: 0 0 auto;
}
@media (max-width: 1180px) {
  .status-help-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .status-help-grid { grid-template-columns: 1fr; }
  .version-item { flex-direction: column; }
}

/* MVP 04 additions */
.compact-status-info {
  display: grid;
  gap: 8px;
  padding: 0 0 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.status-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.badge.contract-no_file { background: #fef2f2; color: #b91c1c; }
.badge.contract-draft { background: #f8fafc; color: #475569; }
.badge.contract-one_side { background: #fffbeb; color: #b45309; }
.badge.contract-signed { background: #ecfdf5; color: #047857; }
.badge.contract-correction { background: #fff7ed; color: #c2410c; }
.badge.contract-on_approval { background: #eef2ff; color: #4338ca; }
.badge.contract-expired { background: #fef2f2; color: #991b1b; }
.badge.contract-terminated { background: #f1f5f9; color: #334155; }
.details-row td {
  background: #f8fafc !important;
  padding: 16px;
}
.project-history-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
}
a.icon-btn { color: inherit; }
.toolbar { margin-bottom: 14px; }
.card > .toolbar:first-child { margin-top: 0; }

/* MVP 05 additions */
.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
  gap: 18px;
}
.profile-card {
  align-self: start;
}
.avatar-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 18px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.avatar-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #111827;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 900;
}
.role-badge {
  background: #ecfeff;
  color: #0e7490;
  margin-top: 8px;
}
.inline-footer {
  padding: 0;
  margin-top: 4px;
  border-top: 0;
  justify-content: flex-start;
}
@media (max-width: 980px) {
  .profile-grid { grid-template-columns: 1fr; }
}

/* MVP 06 additions */
.wide-table {
  min-width: 1900px;
}
.invoices-table th,
.invoices-table td {
  font-size: 13px;
}
.three-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.invoice-modal {
  width: min(980px, 100%);
}
.badge.payment-not_paid { background: #fef2f2; color: #b91c1c; }
.badge.payment-partial { background: #fffbeb; color: #b45309; }
.badge.payment-paid { background: #ecfdf5; color: #047857; }
.badge.payment-waiting { background: #eef2ff; color: #4338ca; }
.badge.payment-hold { background: #fff7ed; color: #c2410c; }
.badge.payment-canceled { background: #f1f5f9; color: #334155; }
.badge.onec-no_upd { background: #f8fafc; color: #64748b; }
.badge.onec-not_entered { background: #fff7ed; color: #c2410c; }
.badge.onec-entered { background: #ecfdf5; color: #047857; }
.badge.onec-correction { background: #fef2f2; color: #b91c1c; }
.badge.onec-partial { background: #fffbeb; color: #b45309; }
.future-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
@media (max-width: 640px) {
  .three-cols { grid-template-columns: 1fr; }
}

/* MVP 06.1 fix */
.storage-warning {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  border-radius: 14px;
  line-height: 1.45;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.storage-warning .link-btn {
  color: #9a3412;
  text-decoration: underline;
}

/* MVP 06.2: inline editing in invoice registry */
.table-date {
  min-width: 138px;
  padding: 8px 10px;
  border-radius: 10px;
}
.table-select {
  min-width: 150px;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 700;
}
.payment-select.payment-not_paid,
.onec-select.onec-not_entered { background: #fff7ed; color: #c2410c; }
.payment-select.payment-partial,
.onec-select.onec-partial { background: #fffbeb; color: #b45309; }
.payment-select.payment-paid,
.onec-select.onec-entered { background: #ecfdf5; color: #047857; }
.payment-select.payment-waiting { background: #eef2ff; color: #4338ca; }
.payment-select.payment-hold { background: #fff7ed; color: #c2410c; }
.payment-select.payment-canceled { background: #f1f5f9; color: #334155; }

.large-modal {
  width: min(1180px, calc(100vw - 28px));
}
.requests-table,
.specifications-table {
  min-width: 2200px;
}
.requests-table th,
.requests-table td,
.specifications-table th,
.specifications-table td {
  font-size: 13px;
  max-width: 260px;
}
.three-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.badge.request-draft,
.badge.procurement-not_started,
.badge.jvk-not_required { background: #f1f5f9; color: #475569; }
.badge.request-sent,
.badge.procurement-requested,
.badge.jvk-needed { background: #eff6ff; color: #1d4ed8; }
.badge.request-in_work,
.badge.procurement-invoice,
.badge.procurement-ordered,
.badge.jvk-in_progress { background: #fff7ed; color: #c2410c; }
.badge.request-partial,
.badge.procurement-partial { background: #fffbeb; color: #b45309; }
.badge.request-delivered,
.badge.procurement-bought,
.badge.procurement-delivered,
.badge.jvk-ready { background: #ecfdf5; color: #047857; }
.badge.request-question,
.badge.jvk-issue { background: #fef2f2; color: #b91c1c; }
.badge.request-canceled,
.badge.procurement-canceled { background: #f3f4f6; color: #6b7280; }
@media (max-width: 900px) {
  .three-cols { grid-template-columns: 1fr; }
}

/* MVP 08 additions */
.object-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: none;
  text-align: center;
  white-space: normal;
  max-width: 220px;
}
.object-chip:hover {
  filter: brightness(0.97);
}
.object-chip.muted-chip {
  background: #f1f5f9;
  color: #64748b;
}
.invoices-table {
  table-layout: fixed;
  min-width: 2560px;
}
.invoices-table th,
.invoices-table td {
  vertical-align: middle;
  text-align: center;
  white-space: normal;
  word-break: break-word;
}
.invoices-table .row-title,
.invoices-table .row-subtitle {
  text-align: center;
}
.invoices-table .table-date,
.invoices-table .table-select {
  margin: 0 auto;
}
.requests-table {
  min-width: 2500px;
}
.requests-table th,
.requests-table td {
  vertical-align: middle;
}
.free-table-input,
.free-table-select,
.free-table-textarea {
  min-width: 130px;
  padding: 8px 9px;
  border-radius: 10px;
  font-size: 13px;
}
.free-table-textarea {
  min-width: 190px;
  resize: vertical;
}
.free-table-select {
  min-width: 150px;
}
.free-table-input.small-input {
  min-width: 92px;
}
.free-table-input.date-input {
  min-width: 126px;
}
.free-table-input.strong-input {
  font-weight: 800;
  min-width: 200px;
}
.request-status-select.request-draft { background: #f1f5f9; color: #475569; }
.request-status-select.request-sent { background: #eff6ff; color: #1d4ed8; }
.request-status-select.request-in_work { background: #fff7ed; color: #c2410c; }
.request-status-select.request-partial { background: #fffbeb; color: #b45309; }
.request-status-select.request-delivered { background: #ecfdf5; color: #047857; }
.request-status-select.request-question { background: #fef2f2; color: #b91c1c; }
.request-status-select.request-canceled { background: #f3f4f6; color: #6b7280; }

/* MVP 09: заявки → счет → реестр */
.scenario-card {
  margin-bottom: 16px;
}
.scenario-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}
.scenario-steps > div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
}
.scenario-steps strong {
  display: block;
  margin-bottom: 5px;
}
.scenario-steps span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.requests-flow-table {
  min-width: 3150px;
  table-layout: fixed;
}
.requests-flow-table th,
.requests-flow-table td {
  vertical-align: middle;
}
.requests-flow-table .row-number-cell {
  text-align: center;
  font-size: 16px;
}
.request-object-chip {
  margin-bottom: 8px;
}
.request-object-chip .object-chip {
  max-width: 200px;
  width: 100%;
}
.requests-flow-table .free-table-input,
.requests-flow-table .free-table-select,
.requests-flow-table .free-table-textarea {
  width: 100%;
  min-width: 0;
}
.requests-flow-table .strong-input {
  min-width: 0;
}
.invoice-request-cell {
  text-align: center;
}
.invoice-request-cell .small-link {
  display: block;
  margin: 6px auto 0;
  font-size: 12px;
}
.invoice-chip-link {
  margin: 0 auto 5px;
}
.request-actions {
  white-space: normal;
  display: flex;
  gap: 5px;
  justify-content: center;
  align-items: center;
}
.success-icon {
  color: #047857;
  border-color: #bbf7d0;
  background: #ecfdf5;
}
.danger-text {
  color: var(--danger);
}
.request-summary-card {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
}
.warning-notice {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}
.pdf-text-sample {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
}
.pdf-text-sample pre {
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 12px;
  margin: 10px 0 0;
}
.file-card.compact,
.linked-requests {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  background: #f8fafc;
  margin-bottom: 12px;
}
.badge.request-confirmed,
.request-status-select.request-confirmed { background: #ecfeff; color: #0e7490; }
.badge.request-invoice_uploaded,
.request-status-select.request-invoice_uploaded { background: #ecfdf5; color: #047857; }
.badge.request-manual_match,
.request-status-select.request-manual_match { background: #fff7ed; color: #c2410c; }
.small-link { font-size: 12px; }
@media (max-width: 1180px) {
  .scenario-steps { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}
@media (max-width: 640px) {
  .scenario-steps { grid-template-columns: 1fr; }
  .request-summary-card { flex-direction: column; align-items: flex-start; }
}

/* MVP 10: заявка как компактный лист + ручное сопоставление счета */
.compact-requests-wrap {
  max-width: 100%;
}
.compact-requests-table.requests-flow-table {
  min-width: 1780px;
  table-layout: fixed;
}
.compact-requests-table th,
.compact-requests-table td {
  padding: 7px 6px;
  font-size: 11px;
  vertical-align: middle;
}
.compact-requests-table th {
  line-height: 1.15;
}
.compact-requests-table .free-table-input,
.compact-requests-table .free-table-select,
.compact-requests-table .free-table-textarea {
  min-width: 0;
  width: 100%;
  padding: 6px 7px;
  border-radius: 8px;
  font-size: 11px;
}
.compact-requests-table .free-table-textarea {
  resize: vertical;
  min-height: 34px;
}
.compact-requests-table .btn.small {
  padding: 6px 7px;
  font-size: 11px;
}
.compact-requests-table .icon-btn {
  width: 28px;
  height: 28px;
  font-size: 13px;
}
.req-col-number { width: 42px; }
.req-col-object { width: 145px; }
.req-col-section { width: 115px; }
.req-col-project { width: 105px; }
.req-col-requester { width: 100px; }
.req-col-name { width: 185px; }
.req-col-qty { width: 66px; }
.req-col-unit { width: 64px; }
.req-col-date { width: 92px; }
.req-col-supplier { width: 115px; }
.req-col-invoice { width: 128px; }
.req-col-upd { width: 94px; }
.req-col-cert { width: 94px; }
.req-col-small { width: 66px; }
.req-col-note { width: 128px; }
.req-col-status { width: 118px; }
.req-col-actions { width: 92px; }
.request-object-select-cell .object-select-only {
  font-weight: 800;
}
.unit-input {
  text-align: center;
}
.extra-large-modal {
  width: min(1440px, calc(100vw - 22px));
}
.manual-items-head {
  margin-top: 8px;
}
.manual-items-head h3 {
  margin-bottom: 4px;
}
.manual-items-wrap {
  max-height: 480px;
  overflow: auto;
  border-radius: 14px;
}
.manual-items-table {
  min-width: 1260px;
  table-layout: fixed;
}
.manual-items-table th,
.manual-items-table td,
.invoice-items-table th,
.invoice-items-table td {
  padding: 8px;
  font-size: 12px;
  vertical-align: middle;
}
.manual-items-table th:nth-child(1) { width: 46px; }
.manual-items-table th:nth-child(2) { width: 360px; }
.manual-items-table th:nth-child(3) { width: 90px; }
.manual-items-table th:nth-child(4) { width: 90px; }
.manual-items-table th:nth-child(5) { width: 120px; }
.manual-items-table th:nth-child(6) { width: 120px; }
.manual-items-table th:nth-child(7) { width: 180px; }
.manual-items-table th:nth-child(8) { width: 250px; }
.manual-items-table .input,
.manual-items-table .select {
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 12px;
}
.manual-item-unit,
.manual-item-qty,
.manual-item-price,
.manual-item-amount {
  text-align: center;
}
.no-object-summary {
  display: block;
}
.invoice-items-wrap {
  margin-bottom: 14px;
}
.invoice-items-table {
  min-width: 980px;
  table-layout: fixed;
}
.invoice-items-table th:nth-child(2) { width: 360px; }
@media (min-width: 1500px) {
  .compact-requests-table.requests-flow-table { min-width: 100%; }
}

/* MVP 11: быстрый ввод заявок и компактные позиции счета */
.bottom-table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.compact-scenario {
  margin-bottom: 12px;
}
.compact-scenario .scenario-steps > div {
  padding: 10px;
}
.compact-requests-table.requests-flow-table {
  min-width: 1640px;
}
.req-col-number { width: 36px; }
.req-col-object { width: 128px; }
.req-col-section { width: 102px; }
.req-col-project { width: 92px; }
.req-col-requester { width: 86px; }
.req-col-name { width: 150px; }
.req-col-qty { width: 62px; }
.req-col-unit { width: 58px; }
.req-col-date { width: 88px; }
.req-col-supplier { width: 112px; }
.req-col-invoice { width: 128px; }
.req-col-upd { width: 88px; }
.req-col-cert { width: 88px; }
.req-col-small { width: 70px; }
.req-col-note { width: 106px; }
.req-col-status { width: 106px; }
.req-col-actions { width: 82px; }
.req-object-only {
  font-weight: 700;
}
.invoice-file-single {
  display: inline-block;
  max-width: 105px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.invoice-request-cell .icon-btn {
  margin-left: 4px;
}
.compact-requests-table .date-input {
  text-align: center;
}
.compact-manual-items-wrap {
  max-height: 520px;
}
.compact-manual-items-table.manual-items-table {
  min-width: 1180px;
}
.compact-manual-items-table th,
.compact-manual-items-table td {
  padding: 6px;
  font-size: 11px;
}
.manual-col-number { width: 42px; }
.manual-col-name { width: 390px; }
.manual-col-unit { width: 70px; }
.manual-col-qty { width: 82px; }
.manual-col-price { width: 106px; }
.manual-col-amount { width: 106px; }
.manual-col-match { width: 230px; }
.manual-col-note { width: 140px; }
.compact-manual-items-table .input,
.compact-manual-items-table .select {
  width: 100%;
  min-width: 0;
  padding: 6px 7px;
  font-size: 11px;
}
.compact-manual-items-table .manual-item-amount[readonly],
input[readonly][name="amount"] {
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
}
@media (min-width: 1500px) {
  .compact-requests-table.requests-flow-table {
    min-width: 100%;
  }
}

/* MVP 12: роли в заявках и контроль отгрузки */
.role-switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}
.segmented-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.segmented-control button {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #475569;
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
}
.segmented-control button.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}
.request-role-steps div {
  min-height: 74px;
}
.role-requests-table.compact-requests-table.requests-flow-table {
  min-width: 1460px;
}
.role-requests-table .req-col-object { width: 130px; }
.role-requests-table .req-col-section { width: 106px; }
.role-requests-table .req-col-name { width: 180px; }
.role-requests-table .req-col-invoice { width: 145px; }
.role-requests-table .req-col-status { width: 112px; }
.role-requests-table .req-col-actions { width: 92px; }
.role-requests-table select:disabled,
.role-requests-table input:disabled,
.role-requests-table textarea:disabled {
  background: #f8fafc;
  color: #64748b;
  border-color: #e2e8f0;
  cursor: not-allowed;
  opacity: 1;
}
.role-requests-table .sent-readonly {
  background: #f1f5f9 !important;
  color: #334155 !important;
  font-weight: 800;
}
.editing-row td {
  background: #fffbeb;
}
.qty-mismatch-cell {
  background: #fff1f2 !important;
  box-shadow: inset 3px 0 0 #fb7185;
}
.request-qty-mismatch-row td:first-child {
  box-shadow: inset 4px 0 0 #fb7185;
}
.qty-mismatch-cell .input {
  border-color: #fb7185;
  color: #be123c;
}
@media (min-width: 1500px) {
  .role-requests-table.compact-requests-table.requests-flow-table { min-width: 100%; }
}
@media (max-width: 900px) {
  .role-switch-card { align-items: flex-start; flex-direction: column; }
}

/* MVP 13: быстрый ввод заявок и подтверждение счетов */
.new-request-row td {
  background: #f8fbff;
}
.editing-row td {
  background: #fff7ed !important;
}
.request-qty-mismatch-row td:first-child {
  box-shadow: none !important;
}
.qty-mismatch-cell {
  background: #fff1f2 !important;
  box-shadow: inset 0 0 0 2px #fb7185;
}
.qty-mismatch-cell .input {
  border-color: #fb7185;
  color: #be123c;
}
.badge.request-paid,
.request-status-select.request-paid {
  background: #ecfdf5;
  color: #047857;
}
.request-row-canceled td {
  color: #94a3b8;
  background: #f8fafc;
}
.role-requests-table .req-col-invoice { width: 165px; }
.role-requests-table .req-col-actions { width: 96px; }
.manual-items-head h3 {
  margin-top: 0;
}

/* MVP 14 */
.req-col-invoice-edit { width: 54px; }
.invoice-edit-cell { text-align: center; min-width: 50px; }
.invoice-edit-actions { display: inline-flex; gap: 4px; align-items: center; justify-content: center; }
.qty-mismatch-cell { background: #fff7ed; }
.qty-mismatch-cell .sent-readonly { background: #ffedd5 !important; border: 0 !important; box-shadow: none !important; }
.money-input { text-align: right; white-space: nowrap; }
.manual-items-actions { justify-content: flex-start; padding-top: 10px; }
.manual-row-number { font-weight: 700; color: #475569; text-align: center; }
.compact-manual-items-table .manual-col-name { width: 34%; }
.compact-manual-items-table .manual-col-unit { width: 70px; }
.compact-manual-items-table .manual-col-qty { width: 90px; }
.compact-manual-items-table .manual-col-price { width: 130px; }
.compact-manual-items-table .manual-col-amount { width: 140px; }
.compact-manual-items-table .manual-col-match { width: 260px; }
.compact-manual-items-table .manual-col-note { width: 150px; }
.counterparties-table th,
.counterparties-table td { vertical-align: middle; }
.counterparties-table .input,
.counterparties-table .select,
.counterparties-table .textarea { min-width: 120px; }
.counterparties-table td:first-child .input { min-width: 220px; font-weight: 700; }
.request-row .invoice-request-cell .link-btn { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }

/* MVP 15 */
.mvp15-requests-table th.role-col-active,
.mvp15-requests-table td.role-col-active {
  background: rgba(59, 130, 246, 0.055);
}
.mvp15-requests-table th.role-col-inactive,
.mvp15-requests-table td.role-col-inactive {
  background: rgba(100, 116, 139, 0.055);
}
.mvp15-requests-table th.role-col-neutral,
.mvp15-requests-table td.role-col-neutral {
  background: transparent;
}
.mvp15-requests-table th.role-col-active {
  box-shadow: inset 0 -2px 0 rgba(37, 99, 235, 0.22);
}
.mvp15-requests-table th.role-col-inactive {
  box-shadow: inset 0 -2px 0 rgba(100, 116, 139, 0.14);
}
.mvp15-requests-table .qty-mismatch-cell,
.mvp15-requests-table td.qty-mismatch-cell,
.mvp15-requests-table .qty-mismatch-cell .sent-readonly {
  background: #fff7ed !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}
.request-qty-mismatch-row,
.request-qty-mismatch-row td:first-child {
  background: inherit !important;
  border-left: 0 !important;
}
.manual-match-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}
.request-match-drawer {
  position: sticky;
  top: 12px;
  border: 1px solid #dbe4f0;
  background: #ffffff;
  border-radius: 16px;
  padding: 12px;
  max-height: 560px;
  overflow: auto;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}
.request-match-drawer.hidden {
  display: none;
}
.drawer-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}
.request-match-list {
  display: grid;
  gap: 6px;
}
.request-match-item {
  display: grid;
  grid-template-columns: 44px 86px minmax(0, 1fr) 42px 54px;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px;
  font-size: 12px;
  cursor: pointer;
}
.request-match-item:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.manual-row-picking td {
  background: #eff6ff !important;
}
.match-picker-btn {
  padding: 6px 8px;
  min-height: 28px;
  font-size: 11px;
}
.manual-col-picker { width: 92px; }
.compact-invoices-wrap {
  overflow-x: auto;
}
.mvp15-invoices-table {
  table-layout: fixed;
  min-width: 1695px;
  font-size: 11px;
}
.mvp15-invoices-table th,
.mvp15-invoices-table td {
  padding: 6px 5px;
  vertical-align: middle;
  text-align: center;
  line-height: 1.22;
}
.mvp15-invoices-table .object-chip {
  font-size: 10px;
  padding: 4px 6px;
  min-height: 22px;
  max-width: 128px;
}
.mvp15-invoices-table .table-date,
.mvp15-invoices-table .table-select {
  min-width: 0;
  width: 100%;
  font-size: 11px;
  padding: 6px 5px;
}
.mvp15-invoices-table .row-title {
  font-size: 11px;
  max-width: 142px;
}
.invoice-has-canceled-request td {
  background: #fff7ed !important;
}
.warning-text {
  color: #c2410c;
  font-weight: 800;
}
.editable-counterparties-table {
  min-width: 1600px;
}
.editable-counterparties-table input:disabled,
.editable-counterparties-table textarea:disabled,
.editable-counterparties-table select:disabled {
  background: #f8fafc;
  color: #64748b;
  opacity: 1;
}
@media (max-width: 1300px) {
  .manual-match-layout {
    grid-template-columns: 1fr;
  }
  .request-match-drawer {
    position: relative;
    max-height: 360px;
  }
}

/* MVP 16 refinements */
.mvp16-requests-table { font-size: 12px; }
.mvp16-requests-table th,
.mvp16-requests-table td { vertical-align: middle; }
.mvp16-requests-table .req-col-requester { width: 120px; }
.requester-input { min-width: 100px; }
.role-col-active { background: rgba(59, 130, 246, 0.055); }
.role-col-inactive { background: rgba(107, 114, 128, 0.06); }
.role-col-pto { background: rgba(148, 163, 184, 0.035); }
.role-col-neutral { background: transparent; }
.mvp16-requests-table th.role-col-active { background: rgba(59, 130, 246, 0.11); }
.mvp16-requests-table th.role-col-inactive { background: rgba(107, 114, 128, 0.11); }
.mvp16-requests-table th.role-col-pto { background: rgba(99, 102, 241, 0.07); }
.request-role-tabs { min-width: 280px; }
.request-role-pto .req-col-object { width: 120px; }
.request-role-pto .req-col-section { width: 120px; }
.request-role-pto .req-col-name { width: 230px; }
.request-role-pto .req-col-invoice { width: 150px; }
.manual-items-fullwidth-wrap { width: 100%; max-width: none; }
.manual-items-fullwidth-table { width: 100%; table-layout: fixed; }
.manual-items-fullwidth-table .manual-col-name { width: 34%; }
.manual-items-fullwidth-table .manual-col-unit { width: 7%; }
.manual-items-fullwidth-table .manual-col-qty { width: 8%; }
.manual-items-fullwidth-table .manual-col-price { width: 10%; }
.manual-items-fullwidth-table .manual-col-amount { width: 10%; }
.manual-items-fullwidth-table .manual-col-match { width: 16%; }
.manual-items-fullwidth-table .manual-col-picker { width: 8%; }
.manual-items-fullwidth-table .manual-col-note { width: 10%; }
.local-picker-modal { z-index: 9999; }
.request-picker-window { width: min(980px, calc(100vw - 56px)); max-height: min(760px, calc(100vh - 56px)); overflow: hidden; display: flex; flex-direction: column; }
.request-picker-table-head,
.request-match-modal-row { display: grid; grid-template-columns: 70px 1.2fr 2fr 80px 90px; gap: 8px; align-items: center; }
.request-picker-table-head { padding: 10px 12px; font-size: 12px; font-weight: 800; color: var(--muted); border-bottom: 1px solid var(--border); }
.request-picker-list { overflow: auto; padding: 8px; }
.request-match-modal-row { width: 100%; text-align: left; border: 1px solid var(--border); background: #fff; border-radius: 10px; margin-bottom: 6px; padding: 10px 12px; cursor: pointer; }
.request-match-modal-row:hover { background: #f8fafc; border-color: #bfdbfe; }
.paid-date-missing { background: rgba(239, 68, 68, 0.12) !important; }
.mvp16-invoices-wrap { max-width: 100%; }
.mvp16-invoices-table { table-layout: fixed; font-size: 11.5px; min-width: 1490px; }
.mvp16-invoices-table th,
.mvp16-invoices-table td { padding: 6px 5px; text-align: center; vertical-align: middle; }
.mvp16-invoices-table .input,
.mvp16-invoices-table .select { font-size: 11.5px; padding: 6px 5px; }
.mvp16-invoices-table .row-title { font-size: 11.5px; }
.counterparties-table input.search { min-width: 260px; }
.qty-mismatch-cell { background: rgba(245, 158, 11, 0.14) !important; }
.qty-mismatch-cell .input { background: transparent; border-color: transparent; box-shadow: none; }

/* MVP 17 */
.quality-docs-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 168px;
}
.quality-doc-icons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}
.quality-doc-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s ease;
}
.quality-doc-icon:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.quality-doc-icon.is-loaded {
  background: #dcfce7;
  border-color: #22c55e;
  color: #166534;
  box-shadow: inset 0 -2px 0 rgba(34, 197, 94, 0.25);
}
.quality-doc-icon.has-meta:not(.is-loaded) {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}
.quality-doc-expand {
  width: 28px;
  height: 28px;
}
.quality-doc-row td {
  background: #f8fafc !important;
}
.quality-doc-details {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}
.quality-doc-details .mini-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}
.quality-doc-details-table {
  min-width: 900px;
}
.quality-doc-details-table th,
.quality-doc-details-table td {
  vertical-align: middle;
  text-align: center;
}
.quality-doc-details-table td:first-child,
.quality-doc-details-table th:first-child {
  text-align: left;
}
.quality-doc-modal .modal-body {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.quality-doc-modal .form-row.full {
  grid-column: 1 / -1;
}
.mvp16-requests-table .req-col-cert,
.role-requests-table .req-col-cert {
  width: 190px;
}
.qty-mismatch-cell,
.mvp15-requests-table .qty-mismatch-cell,
.mvp16-requests-table .qty-mismatch-cell,
.requests-table .qty-mismatch-cell {
  background: rgba(245, 158, 11, 0.14) !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}
.qty-mismatch-cell .input,
.qty-mismatch-cell .sent-readonly,
.mvp16-requests-table .qty-mismatch-cell .input,
.mvp16-requests-table .qty-mismatch-cell .sent-readonly {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  outline: 0 !important;
  color: inherit !important;
}
.request-qty-mismatch-row,
.request-qty-mismatch-row td,
.request-qty-mismatch-row td:first-child {
  border: 0 !important;
  box-shadow: none !important;
}
@media (max-width: 900px) {
  .quality-doc-modal .modal-body {
    grid-template-columns: 1fr;
  }
  .quality-doc-details .mini-section-head {
    flex-direction: column;
  }
}

/* MVP 18 fixes */
.sidebar nav {
  display: grid;
  gap: 8px;
}
.sidebar nav button {
  width: 100%;
  display: block;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  white-space: normal;
  line-height: 1.25;
}
.sidebar nav button.active,
.sidebar nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.qty-mismatch-cell,
.mvp15-requests-table .qty-mismatch-cell,
.mvp16-requests-table .qty-mismatch-cell,
.requests-table .qty-mismatch-cell {
  background: rgba(245, 158, 11, 0.12) !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}
.qty-mismatch-cell .input,
.qty-mismatch-cell .sent-readonly,
.mvp16-requests-table .qty-mismatch-cell .input,
.mvp16-requests-table .qty-mismatch-cell .sent-readonly {
  background: transparent !important;
  border-color: transparent !important;
  outline: 0 !important;
  box-shadow: none !important;
}
.quality-doc-icon.is-complete {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}
.quality-doc-icon.is-file-only {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fdba74;
}
.quality-doc-icon.is-meta-only {
  background: #fef3c7;
  color: #92400e;
  border-color: #facc15;
}
.quality-doc-icon.is-empty {
  background: #f8fafc;
  color: #64748b;
  border-color: #cbd5e1;
}
.quality-expanded-main td,
.quality-doc-row td {
  background: #eef6ff !important;
}
.quality-doc-details {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.quality-doc-details-table tr.doc-file-only-row td {
  background: #fff7ed;
}
.quality-doc-details-table tr.doc-meta-only-row td {
  background: #fefce8;
}
.quality-doc-details-table tr.doc-complete-row td {
  background: #f0fdf4;
}
.stacked-cell {
  display: grid;
  gap: 6px;
}
.stacked-cell .input {
  min-width: 160px;
}

/* MVP 19 */
.manual-items-fullwidth-table.mvp19-manual-items-table { width: 100%; min-width: 1420px; table-layout: fixed; }
.manual-items-fullwidth-table.mvp19-manual-items-table .manual-col-name { width: 28%; }
.manual-items-fullwidth-table.mvp19-manual-items-table .manual-col-unit { width: 6%; }
.manual-items-fullwidth-table.mvp19-manual-items-table .manual-col-qty { width: 7%; }
.manual-items-fullwidth-table.mvp19-manual-items-table .manual-col-price { width: 9%; }
.manual-items-fullwidth-table.mvp19-manual-items-table .manual-col-amount { width: 9%; }
.manual-items-fullwidth-table.mvp19-manual-items-table .manual-col-match { width: 14%; }
.manual-items-fullwidth-table.mvp19-manual-items-table .manual-col-matched-qty { width: 7%; }
.manual-items-fullwidth-table.mvp19-manual-items-table .manual-col-picker { width: 7%; }
.manual-items-fullwidth-table.mvp19-manual-items-table .manual-col-note { width: 9%; }
.manual-items-fullwidth-table.mvp19-manual-items-table .manual-col-remove { width: 42px; }
.manual-item-match-qty[readonly] { text-align: center; background: #f8fafc; }
.manual-remove-row { width: 26px; height: 26px; }
.requests-table .qty-mismatch-cell,
.mvp16-requests-table .qty-mismatch-cell,
.role-requests-table .qty-mismatch-cell,
td.qty-mismatch-cell {
  background: rgba(245, 158, 11, 0.11) !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}
.requests-table .qty-mismatch-cell input,
.requests-table .qty-mismatch-cell .input,
.requests-table .qty-mismatch-cell .sent-readonly,
td.qty-mismatch-cell input,
td.qty-mismatch-cell .input,
td.qty-mismatch-cell .sent-readonly {
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  color: inherit !important;
}
.request-row .badge { justify-content: center; min-width: 96px; }
.wide-table th,
.manual-items-table th,
.quality-doc-details-table th,
.invoice-items-table th { cursor: pointer; position: relative; }
.wide-table th:hover,
.manual-items-table th:hover,
.quality-doc-details-table th:hover,
.invoice-items-table th:hover { background-image: linear-gradient(rgba(37, 99, 235, 0.05), rgba(37, 99, 235, 0.05)); }
.wide-table th::after,
.manual-items-table th::after,
.quality-doc-details-table th::after,
.invoice-items-table th::after { content: '⌄'; font-size: 10px; color: #94a3b8; margin-left: 5px; }
.column-filter-popup {
  position: fixed;
  z-index: 20000;
  width: 280px;
  padding: 12px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}
.column-filter-popup strong { display: block; margin-bottom: 8px; font-size: 13px; }
.column-filter-popup .input { width: 100%; margin-bottom: 10px; }
.column-filter-actions { display: flex; justify-content: flex-end; gap: 8px; }
.column-filter-actions .btn { padding: 8px 10px; font-size: 12px; }

/* MVP 20 */
.mvp16-requests-table .req-col-requester,
.role-requests-table .req-col-requester { width: 82px !important; }
.mvp16-requests-table .req-col-object,
.role-requests-table .req-col-object { width: 110px !important; }
.mvp16-requests-table .req-col-section,
.role-requests-table .req-col-section { width: 92px !important; }
.mvp16-requests-table .req-col-name,
.role-requests-table .req-col-name { width: 240px !important; }
.nomenclature-textarea {
  min-height: 48px;
  resize: vertical;
  white-space: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.executor-cell .executor-value {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}
.manual-items-table td.manual-match-ok,
.manual-items-table td.manual-match-ok input {
  background: #ecfdf5 !important;
}
.manual-items-table td.manual-match-ok {
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.12);
}

/* MVP 21 */
.mvp16-requests-table .req-col-requester,
.role-requests-table .req-col-requester { width: 74px !important; }
.mvp16-requests-table .req-col-object,
.role-requests-table .req-col-object { width: 96px !important; }
.mvp16-requests-table .req-col-section,
.role-requests-table .req-col-section { width: 84px !important; }
.mvp16-requests-table .req-col-name,
.role-requests-table .req-col-name { width: 250px !important; }
.nomenclature-textarea {
  min-height: 34px !important;
  height: auto;
  resize: none !important;
  overflow: hidden;
  white-space: pre-wrap;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.pending-invoice-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
}
.pending-invoice-actions .btn.small {
  padding: 5px 7px;
  font-size: 11px;
}

/* MVP 22 */
.mvp22-requests-table th {
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
  line-height: 1.15;
  word-break: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
  padding: 8px 6px;
}
.mvp22-requests-table th span { display:block; max-width:100%; }
.mvp22-requests-table .req-col-requester { width: 86px; }
.mvp22-requests-table .req-col-object { width: 106px; }
.mvp22-requests-table .req-col-section { width: 102px; }
.mvp22-requests-table .req-col-name { width: 245px; }
.mvp22-requests-table .nomenclature-textarea {
  min-height: 34px;
  height: auto;
  overflow: hidden;
  resize: none;
  white-space: pre-wrap;
  line-height: 1.25;
}
.mvp22-manual-items-table {
  width: 100%;
  table-layout: fixed;
  font-size: 12px;
}
.manual-items-fit-wrap {
  overflow-x: visible;
}
.mvp22-manual-items-table th,
.mvp22-manual-items-table td {
  padding: 5px 4px;
}
.mvp22-manual-items-table .manual-col-number { width: 34px; }
.mvp22-manual-items-table .manual-col-name { width: 23%; }
.mvp22-manual-items-table .manual-col-unit { width: 45px; }
.mvp22-manual-items-table .manual-col-qty { width: 58px; }
.mvp22-manual-items-table .manual-col-price { width: 82px; }
.mvp22-manual-items-table .manual-col-amount { width: 86px; }
.mvp22-manual-items-table .manual-col-match { width: 150px; }
.mvp22-manual-items-table .manual-col-matched-qty { width: 72px; }
.mvp22-manual-items-table .manual-col-picker { width: 68px; }
.mvp22-manual-items-table .manual-col-note { width: 72px; }
.mvp22-manual-items-table .manual-col-remove { width: 34px; }
.mvp22-manual-items-table .input,
.mvp22-manual-items-table .select {
  min-width: 0;
  width: 100%;
  font-size: 12px;
  padding: 6px 5px;
}
.mvp22-picker-modal {
  background: rgba(15, 23, 42, 0.44) !important;
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
}
.mvp22-picker-modal .request-picker-window {
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  border: 1px solid #dbe3ef;
}
.invoice-upd-items-wrap { overflow-x: auto; }
.invoice-upd-items-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}
.invoice-upd-items-table th,
.invoice-upd-items-table td {
  border: 1px solid #e5edf7;
  padding: 6px;
  vertical-align: middle;
}
.invoice-upd-items-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
  text-align: center;
}
.invoice-upd-items-table td:nth-child(2),
.invoice-upd-items-table td:nth-child(8) { width: 210px; }
.invoice-upd-items-table .input {
  width: 100%;
  min-width: 0;
  padding: 6px 5px;
  font-size: 12px;
}
.invoice-upd-items-table .match-col,
.invoice-upd-items-table td:nth-child(7) {
  width: 40px;
  text-align: center;
  background: #f0fdf4;
}
.upd-copy-btn { background: #dcfce7; }
.upd-row-matched td { background: #f0fdf4; }
.upd-total-ok { background: #dcfce7; font-weight: 800; }
.payment-received { background: #dcfce7; border-color: #86efac; color: #166534; }
.badge.request-received { background: #dcfce7; color: #166534; }
.badge.request-partial_received { background: #fef3c7; color: #92400e; }

/* MVP 23 */
.v23-upd-wrap { overflow-x: auto; }
.v23-upd-table { min-width: 1320px; table-layout: fixed; }
.v23-upd-table th, .v23-upd-table td { vertical-align: middle; }
.v23-upd-table .invoice-zone { background: #f8fafc; }
.v23-upd-table .upd-zone { background: #eff6ff; }
.v23-upd-table .upd-total-zone { background: #ecfdf5; }
.v23-upd-table .match-col { width: 44px; text-align: center; background: #fff7ed; }
.v23-upd-table th.invoice-zone:nth-child(1), .v23-upd-table td.invoice-zone:nth-child(1) { width: 36px; }
.v23-upd-table .invoice-item-name { min-width: 220px; white-space: normal; line-height: 1.25; }
.v23-upd-table .input { min-height: 30px; padding: 5px 6px; font-size: 12px; }
.v23-upd-table .upd-item-name { min-width: 190px; }
.v23-upd-table .upd-item-unit { width: 52px; }
.v23-upd-table .upd-item-qty { width: 64px; }
.v23-upd-table .upd-item-price, .v23-upd-table .upd-item-amount { width: 92px; }
.upd-switcher { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0 12px; padding: 10px; border: 1px solid #dbeafe; border-radius: 12px; background: #f8fbff; }
.upd-switch-btn { border: 1px solid #cbd5e1; background: #fff; color: #334155; border-radius: 999px; padding: 6px 10px; cursor: pointer; font-size: 12px; }
.upd-switch-btn.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.upd-file-badge { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 999px; background: #dbeafe; color: #1d4ed8; font-weight: 700; font-size: 12px; border: 1px solid #93c5fd; }
.upd-file-link { display: inline-flex; margin: 2px; text-decoration: none; }
.upd-file-link:hover .upd-file-badge { background: #bfdbfe; }
.upd-file-link.disabled .upd-file-badge { background: #f1f5f9; color: #64748b; border-color: #cbd5e1; }
.upd-badge-list { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.upd-total-ok { background: #bbf7d0 !important; font-weight: 700; }
.upd-row-matched td.upd-total-zone { background: #dcfce7; }

/* MVP 24 */
:root {
  font-family: "Inter", "Segoe UI", Roboto, Arial, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
body,
button,
input,
textarea,
select {
  font-family: "Inter", "Segoe UI", Roboto, Arial, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
body { font-size: 14px; letter-spacing: -0.01em; }

.mvp24-picker-modal {
  padding: 28px;
  background: rgba(15, 23, 42, 0.48) !important;
  backdrop-filter: blur(3px);
}
.mvp24-request-picker-window {
  width: min(1040px, calc(100vw - 56px));
  max-height: min(800px, calc(100vh - 56px));
  border-radius: 24px !important;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.28);
  border: 1px solid #dbe3ef;
}
.mvp24-request-picker-window .modal-head {
  padding: 4px 2px 12px;
}
.request-picker-search { margin-bottom: 10px; }
.request-picker-search .input { width: 100%; }
.mvp24-request-picker-window .request-picker-table-head {
  border-radius: 14px 14px 0 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-bottom: 0;
}
.mvp24-request-picker-window .request-picker-list {
  max-height: min(520px, calc(100vh - 260px));
  overflow: auto;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 0 0 16px 16px;
  background: #f8fafc;
}
.mvp24-request-picker-window .request-match-modal-row {
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.v24-upd-wrap { max-width: 100%; overflow-x: auto; }
.v24-upd-table {
  min-width: 1180px;
  width: 100%;
  table-layout: fixed;
  font-size: 11.5px;
}
.v24-upd-table .upd-col-num { width: 38px; }
.v24-upd-table .upd-col-name { width: 190px; }
.v24-upd-table .upd-col-unit { width: 54px; }
.v24-upd-table .upd-col-qty { width: 62px; }
.v24-upd-table .upd-col-price { width: 82px; }
.v24-upd-table .upd-col-amount { width: 88px; }
.v24-upd-table .upd-col-match { width: 42px; }
.v24-upd-table .upd-col-total-qty { width: 74px; }
.v24-upd-table .upd-col-total-amount { width: 92px; }
.v24-upd-table th,
.v24-upd-table td {
  padding: 5px 4px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.v24-upd-table .invoice-zone { background: #f8fafc; }
.v24-upd-table .upd-zone { background: #eef6ff; }
.v24-upd-table .upd-total-zone { background: #ecfdf5; }
.v24-upd-table .invoice-item-name { font-weight: 700; }
.v24-upd-table .input {
  padding: 5px 4px;
  font-size: 11.5px;
}

.requests-filter-toolbar { align-items: flex-start; }
.status-filter-panel {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
}
.status-filter-title {
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 8px;
}
.status-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.status-filter-btn,
.status-filter-reset {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  opacity: 0.62;
  transition: 0.15s ease;
}
.status-filter-btn.active {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.15), 0 8px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
.status-filter-btn:hover,
.status-filter-reset:hover { opacity: 1; }
.status-filter-reset {
  background: #f8fafc;
  color: #334155;
  border-color: #cbd5e1;
}
.status-filter-btn.request-draft { background: #f1f5f9; color: #475569; }
.status-filter-btn.request-confirmed { background: #eff6ff; color: #1d4ed8; }
.status-filter-btn.request-invoice_uploaded { background: #fff7ed; color: #c2410c; }
.status-filter-btn.request-paid { background: #ecfdf5; color: #047857; }
.status-filter-btn.request-received { background: #dcfce7; color: #166534; }
.status-filter-btn.request-partial_received { background: #fef3c7; color: #92400e; }
.status-filter-btn.request-question { background: #fef2f2; color: #b91c1c; }
.status-filter-btn.request-canceled { background: #f3f4f6; color: #6b7280; }
.status-filter-btn.request-sent { background: #eff6ff; color: #1d4ed8; }
.status-filter-btn.request-partial { background: #fffbeb; color: #b45309; }
.status-filter-btn.request-delivered { background: #ecfdf5; color: #047857; }

/* финальное снятие любых старых красных рамок с ячейки отправлено */
.qty-mismatch-cell,
.requests-table .qty-mismatch-cell,
.role-requests-table .qty-mismatch-cell,
td.qty-mismatch-cell {
  background: rgba(245, 158, 11, 0.14) !important;
  box-shadow: none !important;
  border: 0 !important;
}
.qty-mismatch-cell .input,
.qty-mismatch-cell .sent-readonly,
td.qty-mismatch-cell input,
td.qty-mismatch-cell .input,
td.qty-mismatch-cell .sent-readonly {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #92400e !important;
}

/* MVP 25 */
.qty-mismatch-cell,
.requests-table .qty-mismatch-cell,
.role-requests-table .qty-mismatch-cell,
td.qty-mismatch-cell {
  background: rgba(245, 158, 11, 0.12) !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}
.qty-mismatch-cell *,
.qty-mismatch-cell input,
.qty-mismatch-cell .input,
.qty-mismatch-cell .sent-readonly,
td.qty-mismatch-cell input,
td.qty-mismatch-cell .input,
td.qty-mismatch-cell .sent-readonly {
  background: transparent !important;
  border: 0 !important;
  border-color: transparent !important;
  outline: 0 !important;
  box-shadow: none !important;
  color: #92400e !important;
}
.invoice-expanded-row td {
  background: #f8fbff !important;
  box-shadow: inset 0 -1px 0 #bfdbfe;
}
.invoice-details-row td {
  background: #f8fbff !important;
  padding: 10px 12px !important;
}
.v25-invoice-details-card {
  border: 1px solid #bfdbfe;
  border-radius: 18px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}
.invoice-details-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}
.v25-upd-wrap {
  overflow-x: visible;
}
.v25-upd-table {
  min-width: 0 !important;
  width: 100% !important;
  table-layout: fixed;
  font-size: 11px;
}
.v25-upd-table .upd-col-num { width: 34px; }
.v25-upd-table .upd-col-name { width: 16%; }
.v25-upd-table .upd-col-unit { width: 46px; }
.v25-upd-table .upd-col-qty { width: 58px; }
.v25-upd-table .upd-col-price { width: 72px; }
.v25-upd-table .upd-col-amount { width: 76px; }
.v25-upd-table .upd-col-match { width: 38px; }
.v25-upd-table .upd-col-total-qty { width: 62px; }
.v25-upd-table .upd-col-total-amount { width: 82px; }
.v25-upd-table th,
.v25-upd-table td {
  padding: 4px 3px !important;
  line-height: 1.2;
  vertical-align: middle;
  word-break: break-word;
}
.v25-upd-table .input {
  min-width: 0 !important;
  width: 100% !important;
  padding: 4px 3px !important;
  font-size: 11px !important;
}
.v25-upd-table .invoice-item-name {
  min-width: 0 !important;
  white-space: normal;
}
.v25-upd-file-list {
  margin-top: 10px;
}
.compact-version-item {
  padding: 8px 10px;
}
.payment-status-control {
  position: relative;
  display: inline-flex;
  justify-content: center;
  width: 100%;
  min-width: 118px;
}
.payment-status-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.payment-status-button:disabled {
  cursor: not-allowed;
  opacity: 0.88;
}
.payment-status-caret {
  font-size: 12px;
  opacity: 0.8;
}
.payment-status-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  min-width: 190px;
  padding: 8px;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
  display: grid;
  gap: 5px;
}
.payment-status-option {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}
.payment-status-option.active {
  box-shadow: inset 0 0 0 2px rgba(31, 111, 235, 0.16);
}
.payment-status-option .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}
.payment-not_paid { background: #f8fafc; border-color: #cbd5e1; color: #475569; }
.payment-partial { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.payment-paid { background: #ecfdf5; border-color: #bbf7d0; color: #047857; }
.payment-waiting { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; }
.payment-hold { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.payment-canceled { background: #f1f5f9; border-color: #cbd5e1; color: #334155; }
.payment-received { background: #dcfce7; border-color: #86efac; color: #166534; }

/* MVP 26 */
.payment-status-menu-floating {
  z-index: 5000 !important;
  max-height: min(420px, calc(100vh - 32px));
  overflow: auto;
}
.table-wrap,
.invoices-table-wrap {
  overflow: auto;
}
.invoice-details-toolbar-v26 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 10px;
  margin-bottom: 8px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
}
.invoice-details-main-actions-v26,
.invoice-details-upd-actions-v26,
.upd-inline-actions-v26 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.compact-upd-switcher {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.v26-invoice-details-card {
  padding-top: 10px;
}
.v26-upd-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.v26-upd-table {
  min-width: 1180px !important;
  table-layout: fixed !important;
}
.v26-upd-table th,
.v26-upd-table td {
  padding: 5px 4px !important;
  font-size: 11px !important;
  vertical-align: middle;
}
.v26-upd-table .upd-col-num { width: 34px; }
.v26-upd-table .upd-col-name { width: 185px; }
.v26-upd-table .upd-col-unit { width: 48px; }
.v26-upd-table .upd-col-qty { width: 58px; }
.v26-upd-table .upd-col-price { width: 76px; }
.v26-upd-table .upd-col-amount { width: 82px; }
.v26-upd-table .upd-col-match { width: 42px; }
.v26-upd-table .upd-col-total-qty { width: 68px; }
.v26-upd-table .upd-col-total-amount { width: 92px; }
.v26-upd-table input.input {
  font-size: 11px !important;
  padding: 4px 5px !important;
}
.specification-toolbar-v26 {
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.spec-role-switch {
  flex: 0 0 auto;
}
.v26-spec-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.v26-spec-table {
  min-width: 1700px;
  table-layout: fixed;
}
.v26-spec-table th {
  white-space: normal;
  line-height: 1.15;
  font-size: 11px;
}
.v26-spec-table th,
.v26-spec-table td {
  padding: 5px 4px;
  vertical-align: middle;
}
.spec-role-active {
  background: rgba(219, 234, 254, 0.62) !important;
}
.spec-role-locked {
  background: rgba(241, 245, 249, 0.72) !important;
}
.v26-spec-table .input,
.v26-spec-table .select,
.v26-spec-table .textarea {
  width: 100%;
  min-width: 0;
  font-size: 11px;
  padding: 5px 6px;
}
.v26-spec-table .spec-mini { width: 54px; }
.v26-spec-table .spec-qty { width: 78px; }
.v26-spec-table .spec-unit { width: 46px; }
.v26-spec-table .spec-name { min-height: 34px; resize: vertical; }
.v26-spec-table .spec-notes { min-height: 34px; resize: vertical; }
.v26-spec-table .important-spec-input {
  border-color: #bfdbfe;
  background: #eff6ff;
  font-weight: 800;
}

/* MVP 27 */
.mvp27-requests-table .object-color-cell,
.mvp27-requests-table .section-color-cell {
  transition: background .15s ease;
}
.mvp27-requests-table .object-color-cell select,
.mvp27-requests-table .section-color-cell select,
.v27-spec-table .spec-object-select,
.v27-spec-table .spec-section-select {
  font-weight: 650;
}
.mvp27-requests-table .req-col-cert { width: 150px !important; }
.mvp27-picker-window {
  max-width: min(980px, calc(100vw - 48px));
}
.mvp27-picker-head,
.mvp27-picker-row {
  grid-template-columns: 56px minmax(130px, 1fr) minmax(120px, 1fr) minmax(220px, 2fr) 64px 76px;
}
.mvp27-picker-row .picker-object-chip,
.mvp27-picker-row .picker-section-chip {
  border-radius: 10px;
  padding: 7px 9px;
  border: 1px solid rgba(15, 23, 42, .08);
}
.v27-spec-table-wrap {
  overflow: auto;
}
.v27-spec-table th:nth-child(3),
.v27-spec-table td:nth-child(3) {
  min-width: 130px;
}
.spec-file-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 130px;
}
.spec-file-cell .link-pill {
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(14, 165, 233, .10);
  color: #075985;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}
.hidden-file-input { display: none !important; }
.spec-quality-cell .quality-doc-icon {
  width: 26px;
  height: 24px;
  font-size: 10px;
}
.v27-spec-table .spec-object-select,
.v27-spec-table .spec-section-select {
  min-width: 112px;
}
.v27-spec-table .quality-doc-row td {
  background: #fff7ed;
}

/* MVP 28 */
.mvp28-requests-table td.object-color-cell,
.mvp28-requests-table td.section-color-cell {
  background: transparent !important;
}
.mvp28-requests-table .request-color-select {
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .04);
}
.simple-spec-table-wrap { max-width: 900px; }
.simple-spec-table { min-width: 720px; table-layout: fixed; }
.simple-spec-table th:nth-child(1) { width: 58%; }
.simple-spec-table th:nth-child(2) { width: 14%; }
.simple-spec-table th:nth-child(3) { width: 18%; }
.simple-spec-table th:nth-child(4) { width: 10%; }
.spec-simple-name { width: 100%; min-height: 38px; resize: none; overflow: hidden; }
.spec-simple-unit, .spec-simple-qty { width: 100%; min-width: 0; }
.specification-toolbar-simple { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.roadmap-personal-layout { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 18px; align-items: start; }
.personal-plan-card, .personal-plan-list { min-width: 0; }
.plan-progress { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.plan-progress strong { font-size: 28px; }
.plan-progress span { color: #64748b; font-weight: 700; }
.plan-add-form { display: grid; gap: 12px; }
.personal-plan-list { display: grid; gap: 10px; }
.plan-task { display: grid; grid-template-columns: 34px 1fr 34px; gap: 12px; align-items: start; padding: 12px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; }
.plan-task.is-done { background: #f0fdf4; border-color: #bbf7d0; }
.plan-task.is-done .plan-task-body strong { text-decoration: line-through; color: #166534; }
.plan-task-body p { margin: 6px 0; color: #475569; }
.plan-check { width: 30px; height: 30px; border-radius: 999px; border: 1px solid #cbd5e1; background: #fff; color: #16a34a; font-weight: 900; cursor: pointer; }
.plan-task.is-done .plan-check { background: #22c55e; color: #fff; border-color: #22c55e; }
@media (max-width: 900px) { .roadmap-personal-layout { grid-template-columns: 1fr; } }

/* MVP 29 */
.sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.journal-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.tab-btn { border: 1px solid var(--border, #d8e0ea); background: #f8fafc; border-radius: 12px; padding: 9px 12px; cursor: pointer; font-weight: 600; }
.tab-btn.active { background: #e0f2fe; border-color: #7dd3fc; color: #075985; }
.journal-placeholder { display: flex; gap: 18px; align-items: flex-start; padding: 24px; border: 1px dashed #bfd2e5; background: #f8fbff; border-radius: 18px; }
.placeholder-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: #e0f2fe; font-size: 24px; }
.toolbar-label { font-size: 13px; color: #64748b; font-weight: 700; }
.orders-table th, .orders-table td { vertical-align: middle; }
.orders-table th:nth-child(1) { width: 190px; }
.orders-table th:nth-child(2) { width: 120px; }
.orders-table th:nth-child(3) { width: 100px; }
.orders-table th:nth-child(4) { width: 170px; }
.orders-table th:nth-child(6) { width: 150px; }
.file-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; border: 1px solid #0f766e; background: #0f766e; color: white; border-radius: 12px; padding: 0 14px; cursor: pointer; font-weight: 700; }
.file-btn input { display: none; }
.spec-import-toolbar { align-items: center; gap: 10px; }
.spec-import-notice { margin: 10px 0 14px; }
.mvp29-spec-table th { white-space: normal; line-height: 1.15; }
.mvp29-spec-table th:nth-child(1), .mvp29-spec-table td:nth-child(1) { width: 95px; text-align: center; }
.mvp29-spec-table th:nth-child(2), .mvp29-spec-table td:nth-child(2) { width: 130px; }
.mvp29-spec-table th:nth-child(3), .mvp29-spec-table td:nth-child(3) { min-width: 460px; }
.mvp29-spec-table th:nth-child(4), .mvp29-spec-table td:nth-child(4) { width: 85px; text-align: center; }
.mvp29-spec-table th:nth-child(5), .mvp29-spec-table td:nth-child(5) { width: 110px; text-align: center; }
.spec-simple-name { min-height: 38px; height: auto; resize: vertical; white-space: pre-wrap; overflow: hidden; }
.spec-system-number, .spec-project-position, .spec-simple-unit, .spec-simple-qty { min-width: 0; }

/* MVP 30 — specification table refinements */
.mvp30-spec-wrap { max-width: none; width: 100%; overflow-x: auto; }
.mvp30-spec-table { min-width: 980px; width: 100%; table-layout: fixed; }
.mvp30-spec-table th { white-space: normal; line-height: 1.15; vertical-align: middle; }
.mvp30-spec-table th,
.mvp30-spec-table td { vertical-align: top; }
.mvp30-spec-table .spec-col-num { width: 72px; }
.mvp30-spec-table .spec-col-project { width: 110px; }
.mvp30-spec-table .spec-col-name { width: auto; }
.mvp30-spec-table .spec-col-unit { width: 82px; }
.mvp30-spec-table .spec-col-qty { width: 120px; }
.mvp30-spec-table .spec-col-actions { width: 56px; }
.mvp30-spec-table .input,
.mvp30-spec-table .textarea { width: 100%; font-size: 13px; }
.mvp30-spec-table .spec-simple-name { min-height: 38px; resize: none; overflow: hidden; white-space: pre-wrap; line-height: 1.3; }
.mvp30-spec-table .spec-system-number,
.mvp30-spec-table .spec-simple-unit,
.mvp30-spec-table .spec-simple-qty { text-align: center; }
.table-bottom-actions { display: flex; justify-content: flex-start; margin-top: 12px; }

/* MVP 31 — спецификация */
.spec-header-actions { flex-wrap: wrap; gap: 8px; }
.mvp31-spec-toolbar { align-items: center; gap: 10px; flex-wrap: wrap; }
.mvp31-spec-search { flex: 0 1 50%; min-width: 360px; max-width: 680px; }
.spec-object-filter { position: relative; display: inline-flex; }
.dropdown-filter-trigger { white-space: nowrap; }
.spec-object-menu { position: absolute; z-index: 80; top: calc(100% + 8px); right: 0; min-width: 280px; max-height: 360px; overflow: auto; background: #fff; border: 1px solid rgba(15,23,42,.12); border-radius: 16px; box-shadow: 0 20px 50px rgba(15,23,42,.18); padding: 8px; }
.dropdown-filter-option { display: block; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 12px; padding: 9px 10px; font: inherit; cursor: pointer; color: #0f172a; }
.dropdown-filter-option:hover { background: #f1f5f9; }
.dropdown-filter-option.active { background: #dbeafe; font-weight: 700; }
.spec-section-default-box { display: inline-flex; align-items: center; gap: 8px; color: #64748b; font-size: 13px; white-space: nowrap; }
.spec-section-default-select { min-width: 190px; }
.spec-import-btn { white-space: nowrap; }
.mvp31-spec-wrap { overflow-x: auto; }
.mvp31-spec-table { table-layout: fixed; min-width: 980px; width: 100%; }
.mvp31-spec-table th { white-space: normal; line-height: 1.15; vertical-align: middle; }
.mvp31-spec-table td { vertical-align: top; }
.mvp31-spec-table .spec-col-section { width: 150px; }
.mvp31-spec-table .spec-col-num { width: 62px; }
.mvp31-spec-table .spec-col-project { width: 90px; }
.mvp31-spec-table .spec-col-name { width: auto; min-width: 460px; }
.mvp31-spec-table .spec-col-unit { width: 82px; }
.mvp31-spec-table .spec-col-qty { width: 120px; }
.mvp31-spec-table .spec-col-actions { width: 52px; }
.mvp31-spec-table input,
.mvp31-spec-table select,
.mvp31-spec-table textarea { width: 100%; min-width: 0; }
.mvp31-spec-table .spec-name { resize: none; overflow: hidden; min-height: 38px; line-height: 1.25; white-space: pre-wrap; }
.mvp31-spec-table .spec-section-cell-select { font-weight: 600; }
.mvp31-spec-table.spec-readonly-mode input:disabled,
.mvp31-spec-table.spec-readonly-mode textarea:disabled,
.mvp31-spec-table.spec-readonly-mode select:disabled { opacity: 1; background: #f8fafc; color: #334155; cursor: default; }
.mvp31-spec-table.spec-edit-mode td { background: rgba(219,234,254,.22); }
.spec-bottom-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
@media (max-width: 1200px) { .mvp31-spec-search { flex-basis: 100%; max-width: none; } .spec-section-default-box { width: 100%; } }

/* MVP 32: specification layout */
.mvp32-spec-toolbar { gap: 8px; align-items: center; }
.spec-subsection-default-select { min-width: 180px; }
.mvp32-spec-wrap { overflow-x: auto; }
.mvp32-spec-table { table-layout: fixed; min-width: 1540px; width: 100%; }
.mvp32-spec-table th { white-space: normal; line-height: 1.12; vertical-align: middle; padding: 8px 6px; font-size: 12px; }
.mvp32-spec-table td { vertical-align: top; padding: 6px; }
.mvp32-spec-table .spec-col-section { width: 104px; }
.mvp32-spec-table .spec-col-num { width: 48px; }
.mvp32-spec-table .spec-col-project { width: 62px; }
.mvp32-spec-table .spec-col-subsection { width: 132px; }
.mvp32-spec-table .spec-col-name { width: 430px; }
.mvp32-spec-table .spec-col-unit { width: 64px; }
.mvp32-spec-table .spec-col-qty { width: 84px; }
.mvp32-spec-table .spec-col-sent { width: 82px; }
.mvp32-spec-table .spec-col-file { width: 128px; }
.mvp32-spec-table .spec-col-date { width: 110px; }
.mvp32-spec-table .spec-col-status { width: 118px; }
.mvp32-spec-table .spec-col-quality { width: 178px; }
.mvp32-spec-table .spec-col-actions { width: 48px; }
.mvp32-spec-table input,
.mvp32-spec-table select,
.mvp32-spec-table textarea { width: 100%; min-width: 0; }
.mvp32-spec-table .spec-name { resize: none; overflow: hidden; min-height: 36px; line-height: 1.25; white-space: pre-wrap; }
.mvp32-spec-table .spec-system-number { text-align: center; padding-left: 4px; padding-right: 4px; }
.mvp32-spec-table .spec-project-position,
.mvp32-spec-table .spec-simple-unit,
.mvp32-spec-table .spec-simple-qty { text-align: center; padding-left: 4px; padding-right: 4px; }
.mvp32-spec-table .spec-section-colored,
.mvp32-spec-table .spec-subsection-colored { background-clip: padding-box; }
.mvp32-file-cell { display: flex; gap: 4px; align-items: center; justify-content: center; flex-wrap: nowrap; }
.mvp32-file-cell .icon-btn { width: 26px; height: 26px; min-width: 26px; }
.compact-link-pill { padding: 5px 8px; max-width: 54px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mvp32-spec-table .quality-doc-icons { gap: 3px; justify-content: center; }
.mvp32-spec-table .quality-doc-icon { width: 28px; min-width: 28px; height: 26px; padding: 0 2px; font-size: 10px; }
.mvp32-spec-table .quality-doc-expand { width: 26px; height: 26px; min-width: 26px; }
.spec-quality-details-row td { background: #f8fafc; }
.spec-readonly-mode .mvp32-file-cell button,
.spec-readonly-mode .quality-doc-icon,
.spec-readonly-mode .quality-doc-expand { opacity: 1; }
.badge.procurement-not_started { background:#f1f5f9; color:#475569; }
.badge.procurement-requested { background:#dbeafe; color:#1d4ed8; }
.badge.procurement-invoice { background:#fef3c7; color:#92400e; }
.badge.procurement-ordered { background:#ede9fe; color:#6d28d9; }
.badge.procurement-partial { background:#ffedd5; color:#9a3412; }
.badge.procurement-bought { background:#dcfce7; color:#166534; }
.badge.procurement-delivered { background:#ccfbf1; color:#0f766e; }
.badge.procurement-canceled { background:#fee2e2; color:#b91c1c; }
@media (max-width: 1280px) {
  .mvp32-spec-table { min-width: 1540px; }
}

/* MVP 33 */
.app-shell.preview-r1366 { max-width: 1366px; margin: 0 auto; box-shadow: 0 0 0 1px rgba(15,23,42,.08); }
.app-shell.preview-r1440 { max-width: 1440px; margin: 0 auto; box-shadow: 0 0 0 1px rgba(15,23,42,.08); }
.app-shell.preview-r1536 { max-width: 1536px; margin: 0 auto; box-shadow: 0 0 0 1px rgba(15,23,42,.08); }
.app-shell.preview-r1920 { max-width: 1920px; margin: 0 auto; box-shadow: 0 0 0 1px rgba(15,23,42,.08); }
.app-shell.preview-r2560 { max-width: 2560px; margin: 0 auto; box-shadow: 0 0 0 1px rgba(15,23,42,.08); }
.resolution-control { display: grid; gap: 6px; margin-bottom: 14px; }
.resolution-control label { color: #cbd5e1; font-size: 12px; font-weight: 700; }
.resolution-control .select { width: 100%; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #fff; }
.resolution-control .select option { color: #111827; }
.mvp33-spec-toolbar { align-items: center; }
.mvp33-spec-card.editing-spec-mode { box-shadow: inset 0 0 0 2px rgba(31,111,235,.22), var(--shadow); }
.active-edit-btn { background: #1d4ed8 !important; color: #fff !important; }
.spec-subsection-manager { margin: 10px 0 14px; padding: 14px; border: 1px solid rgba(148,163,184,.28); background: #f8fafc; border-radius: 16px; }
.spec-subsection-list { display: grid; gap: 8px; margin-top: 10px; }
.spec-subsection-manager-row { display: grid; grid-template-columns: 18px minmax(200px, 1fr) 48px 32px; gap: 8px; align-items: center; }
.color-dot { width: 14px; height: 14px; border-radius: 999px; border: 1px solid rgba(15,23,42,.12); }
.color-input { width: 44px; height: 36px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.spec-subsection-add { display: flex; gap: 8px; margin-top: 12px; }
.mvp33-spec-table { min-width: 1630px; }
.mvp33-spec-table .spec-col-section { width: 88px; }
.mvp33-spec-table .spec-col-num { width: 44px; }
.mvp33-spec-table .spec-col-project { width: 58px; }
.mvp33-spec-table .spec-col-subsection { width: 118px; }
.mvp33-spec-table .spec-col-name { width: 420px; }
.mvp33-spec-table .spec-section-colored,
.mvp33-spec-table .spec-subsection-colored { background: transparent !important; }
.color-cell-select { border-radius: 10px; }
.mvp33-invoice-cell .compact-link-pill { max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spec-invoice-items-table { min-width: 1180px; table-layout: fixed; }
.spec-invoice-items-table th:nth-child(1) { width: 42px; }
.spec-invoice-items-table th:nth-child(2) { width: 370px; }
.spec-invoice-items-table th:nth-child(3) { width: 70px; }
.spec-invoice-items-table th:nth-child(4) { width: 90px; }
.spec-invoice-items-table th:nth-child(5) { width: 120px; }
.spec-invoice-items-table th:nth-child(6) { width: 120px; }
.spec-invoice-items-table th:nth-child(7) { width: 320px; }
.spec-invoice-items-table th:nth-child(8) { width: 44px; }
@media (max-width: 900px) {
  .spec-subsection-manager-row { grid-template-columns: 18px 1fr 48px 32px; }
  .spec-subsection-add { flex-direction: column; }
}


/* MVP 34 */
.mvp33-spec-table th,
.mvp34-spec-table th { text-align: center; vertical-align: middle; }
.mvp33-spec-table .spec-col-section { width: 82px; }
.mvp33-spec-table .spec-col-num { width: 42px; }
.mvp33-spec-table .spec-col-project { width: 52px; }
.mvp33-spec-table .spec-col-subsection { width: 116px; }
.mvp33-spec-table .spec-col-name { width: 430px; }
.mvp33-spec-table .spec-section-colored,
.mvp33-spec-table .spec-subsection-colored { background: transparent !important; }
.mvp33-spec-table .spec-section-colored select,
.mvp33-spec-table .spec-subsection-colored select { background-clip: padding-box; }
.mvp33-spec-card.editing-spec-mode,
.spec-card-mvp31.editing-spec-mode,
.spec-card-mvp32.editing-spec-mode { box-shadow: inset 0 0 0 2px rgba(37,99,235,.28), var(--shadow); background: linear-gradient(0deg, rgba(219,234,254,.25), rgba(255,255,255,1)); }
.spec-subsection-manager-row.mvp34-subsection-row { grid-template-columns: 18px minmax(200px, 1fr) 48px 36px 32px; }
.mvp34-subsection-add { flex-wrap: wrap; align-items: center; }
.mvp32-spec-table .spec-name,
.mvp33-spec-table .spec-name { min-height: 36px; height: auto; overflow: hidden; resize: none; white-space: pre-wrap; }

/* MVP 35 — заявки на 2560, закрытие меню статуса и мелкие правки */
.app-shell.preview-r2560 .mvp28-requests-table,
.mvp28-requests-table {
  table-layout: fixed;
}
.app-shell.preview-r2560 .requests-table,
.app-shell.preview-r2560 .mvp28-requests-table {
  width: 100%;
  min-width: 2120px !important;
  font-size: 11px;
}
.app-shell.preview-r2560 .mvp28-requests-table th,
.app-shell.preview-r2560 .mvp28-requests-table td {
  padding: 5px 4px;
  font-size: 11px;
}
.app-shell.preview-r2560 .mvp28-requests-table .req-col-number { width: 42px !important; }
.app-shell.preview-r2560 .mvp28-requests-table .req-col-requester { width: 84px !important; }
.app-shell.preview-r2560 .mvp28-requests-table .req-col-object { width: 112px !important; }
.app-shell.preview-r2560 .mvp28-requests-table .req-col-section { width: 92px !important; }
.app-shell.preview-r2560 .mvp28-requests-table .req-col-name { width: 300px !important; }
.app-shell.preview-r2560 .mvp28-requests-table .req-col-qty { width: 64px !important; }
.app-shell.preview-r2560 .mvp28-requests-table .req-col-unit { width: 48px !important; }
.app-shell.preview-r2560 .mvp28-requests-table .req-col-date { width: 94px !important; }
.app-shell.preview-r2560 .mvp28-requests-table .req-col-supplier { width: 126px !important; }
.app-shell.preview-r2560 .mvp28-requests-table .req-col-invoice { width: 150px !important; }
.app-shell.preview-r2560 .mvp28-requests-table .req-col-invoice-edit { width: 44px !important; }
.app-shell.preview-r2560 .mvp28-requests-table .req-col-upd { width: 88px !important; }
.app-shell.preview-r2560 .mvp28-requests-table .req-col-cert { width: 174px !important; }
.app-shell.preview-r2560 .mvp28-requests-table .req-col-small { width: 62px !important; }
.app-shell.preview-r2560 .mvp28-requests-table .req-col-note { width: 110px !important; }
.app-shell.preview-r2560 .mvp28-requests-table .req-col-status { width: 102px !important; }
.app-shell.preview-r2560 .mvp28-requests-table .req-col-actions { width: 60px !important; }
.app-shell.preview-r2560 .mvp28-requests-table .free-table-input,
.app-shell.preview-r2560 .mvp28-requests-table .free-table-select,
.app-shell.preview-r2560 .mvp28-requests-table .free-table-textarea,
.app-shell.preview-r2560 .mvp28-requests-table .input,
.app-shell.preview-r2560 .mvp28-requests-table .select,
.app-shell.preview-r2560 .mvp28-requests-table .textarea {
  min-width: 0 !important;
  width: 100% !important;
  padding: 5px 4px;
  font-size: 11px;
}
.app-shell.preview-r2560 .mvp28-requests-table .nomenclature-textarea {
  min-height: 30px !important;
  line-height: 1.2;
}
.app-shell.preview-r2560 .quality-doc-icons,
.app-shell.preview-r2560 .spec-quality-icons {
  gap: 2px;
}
.app-shell.preview-r2560 .quality-doc-icon,
.app-shell.preview-r2560 .spec-quality-icon {
  min-width: 24px;
  height: 24px;
  padding: 2px 3px;
  font-size: 10px;
}
.paid-date-missing {
  background: #fee2e2 !important;
  border-color: #fecaca !important;
}
.payment-status-menu-floating {
  z-index: 60000 !important;
}

/* MVP 36 — fixed sidebar, spec widths and readable project data */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  align-self: start;
}
.main {
  min-width: 0;
}
@media (max-width: 760px) {
  .sidebar { position: static; height: auto; }
}
.mvp32-spec-table .spec-col-unit,
.mvp33-spec-table .spec-col-unit,
.mvp34-spec-table .spec-col-unit { width: 54px !important; }
.mvp32-spec-table .spec-col-qty,
.mvp33-spec-table .spec-col-qty,
.mvp34-spec-table .spec-col-qty { width: 72px !important; }
.mvp32-spec-table .spec-col-sent,
.mvp33-spec-table .spec-col-sent,
.mvp34-spec-table .spec-col-sent { width: 68px !important; }
.mvp32-spec-table .spec-col-file:nth-of-type(9),
.mvp33-spec-table .spec-col-file:nth-of-type(9),
.mvp34-spec-table .spec-col-file:nth-of-type(9) { width: 210px !important; }
.mvp32-spec-table .spec-col-name,
.mvp33-spec-table .spec-col-name,
.mvp34-spec-table .spec-col-name { width: 500px !important; }
.spec-name-readonly {
  min-height: 36px;
  white-space: pre-wrap;
  line-height: 1.25;
  padding: 7px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
}
.spec-name-readonly strong { font-weight: 800; }

/* MVP 37 — specification matching, UPD grid, multi-select */
.payment-partially_received,
.payment-status-btn.payment-partially_received,
.payment-status-option.payment-partially_received { background: #ffedd5 !important; color: #9a3412 !important; border-color: #fed7aa !important; }
.spec-picker-window {
  width: min(1180px, calc(100vw - 48px));
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .24);
}
.spec-picker-search { max-width: 520px; }
.spec-picker-table-head,
.spec-match-picker-row {
  display: grid;
  grid-template-columns: 60px 80px 140px 130px 140px minmax(280px, 1fr) 60px 80px;
  gap: 8px;
  align-items: center;
}
.spec-picker-table-head {
  padding: 8px 10px;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.spec-match-picker-list {
  max-height: 520px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.spec-match-picker-row {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.spec-match-picker-row:hover { background: #eff6ff; border-color: #bfdbfe; }
.spec-match-select-btn {
  width: 100%;
  min-height: 34px;
  justify-content: flex-start;
  text-align: left;
  overflow: hidden;
}
.spec-match-label {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mvp37-upd-table input { min-width: 0; }
.mvp37-upd-table .upd-item-name { width: 230px; }
.mvp37-upd-table .upd-item-unit { width: 58px; text-align: center; }
.mvp37-upd-table .upd-item-qty { width: 72px; text-align: center; }
.mvp37-upd-table .upd-item-price,
.mvp37-upd-table .upd-item-amount { width: 100px; text-align: right; }
.spec-row-selected td { background: #f0f9ff !important; }
.spec-row-actions { min-width: 86px; }
.spec-select-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #475569;
  margin-right: 4px;
}
.spec-subsection-select,
.spec-section-cell-select {
  min-height: 34px;
  line-height: 1.15;
}
.app-shell.preview-r2560 .requests-table-wrap { overflow-x: auto; }
.app-shell.preview-r2560 .role-requests-table { min-width: 2320px; }

/* MVP 38 */
.spec-invoice-items-table td,
.spec-invoice-items-table th,
.manual-items-table td,
.manual-items-table th,
.mvp33-spec-table td,
.mvp33-spec-table th {
  vertical-align: middle;
}
.spec-invoice-items-table .spec-match-select-btn,
.manual-items-table .manual-item-match {
  min-height: 40px;
  height: auto;
  white-space: normal;
}
.spec-match-select-btn.mvp38-match-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 14px;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  overflow: visible;
}
.spec-match-select-btn .spec-match-label {
  max-width: none;
  white-space: normal;
  overflow: visible;
  text-overflow: initial;
  line-height: 1.25;
}
.match-round-icon,
.match-round-picker-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-weight: 900;
}
.match-round-icon {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.match-round-picker-btn {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.match-round-picker-btn:hover { background: #dbeafe; }
.mvp38-spec-picker-backdrop {
  background: rgba(15, 23, 42, .38);
}
.mvp38-spec-picker-window {
  position: relative;
  width: min(1180px, calc(100vw - 48px));
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .25);
}
.mvp38-modal-close {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 2;
  background: #f8fafc;
}
.mvp38-source-row-card {
  margin: 8px 0 12px;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  border-radius: 16px;
  display: grid;
  gap: 4px;
  color: #1e293b;
}
.spec-match-picker-row,
.request-match-modal-row {
  display: grid;
  align-items: center;
  gap: 8px;
  line-height: 1.25;
  min-height: 40px;
}
.spec-match-picker-row {
  grid-template-columns: 52px 70px 140px 130px 130px minmax(260px, 1fr) 56px 72px;
}
.spec-picker-table-head {
  grid-template-columns: 52px 70px 140px 130px 130px minmax(260px, 1fr) 56px 72px;
  align-items: center;
}
.spec-match-picker-row span,
.spec-picker-table-head span {
  min-width: 0;
  white-space: normal;
  word-break: break-word;
}
.spec-match-picker-list {
  max-height: min(58vh, 560px);
  overflow: auto;
  padding-right: 4px;
}
.mvp33-spec-table td,
.mvp33-spec-table th {
  vertical-align: middle !important;
}
.mvp33-spec-table .input,
.mvp33-spec-table .select {
  min-height: 36px;
}
.mvp33-spec-table .spec-name-readonly {
  line-height: 1.32;
  display: block;
  padding: 4px 0;
}
.mvp33-spec-table .spec-name {
  overflow: hidden;
  resize: none;
  min-height: 38px;
  line-height: 1.32;
}
.mvp38-spec-row td {
  transition: background-color .12s ease;
}
.spec-subsection-select,
.spec-section-cell-select {
  transition: background-color .12s ease;
}
@media (min-width: 1900px) {
  .spec-invoice-items-table { min-width: 0; width: 100%; }
  .spec-invoice-items-table th:nth-child(2) { width: 34%; }
  .spec-invoice-items-table th:nth-child(7) { width: 30%; }
}


/* MVP 39: final matching button and version polish */
.spec-match-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}
.spec-round-picker-btn,
.match-round-picker-btn {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
  box-shadow: 0 4px 10px rgba(37, 99, 235, .08) !important;
}
.spec-round-picker-btn:hover,
.match-round-picker-btn:hover {
  background: #dbeafe !important;
}
.spec-match-cell .spec-match-label {
  display: block;
  min-width: 0;
  white-space: normal;
  line-height: 1.25;
}
.spec-match-select-btn.mvp38-match-pill {
  border-radius: 999px;
}

/* MVP 39 — specification edit and invoice matching polish */
.mvp39-spec-row td,
.mvp33-spec-table td {
  vertical-align: middle !important;
}
.mvp39-spec-actions {
  min-width: 86px;
  white-space: nowrap;
}
.spec-row-select-round {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
  margin-right: 6px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(37, 99, 235, .08);
}
.spec-row-select-round.is-selected {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}
.spec-row-select-round:hover {
  filter: brightness(.98);
}
.spec-match-td {
  cursor: pointer;
  min-width: 0;
}
.spec-match-td:hover .spec-match-cell {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.mvp39-spec-match-cell {
  align-items: stretch;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}
.mvp39-spec-match-cell .spec-match-label {
  max-width: none;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  word-break: break-word;
  line-height: 1.28;
}
.mvp39-spec-picker-window {
  width: min(1320px, calc(100vw - 48px));
}
.mvp39-spec-picker-head,
.mvp39-spec-match-row {
  grid-template-columns: 52px 70px 130px 120px 130px minmax(300px, 1fr) 56px 72px 120px !important;
}
.mvp39-spec-match-row {
  min-height: 44px;
  height: auto;
  align-items: center;
}
.mvp39-spec-match-row span {
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
}
.mvp39-spec-match-row.already-matched {
  background: #ecfdf5;
  border-color: #86efac;
}
.mvp39-spec-match-row.current-match {
  background: #dbeafe;
  border-color: #93c5fd;
}
.mvp39-picker-name {
  display: block;
  white-space: normal !important;
  word-break: break-word;
}
.spec-invoice-items-table .spec-inv-item-name,
.spec-invoice-items-table .spec-match-label {
  white-space: normal;
  line-height: 1.28;
}
.spec-invoice-items-table td,
.spec-invoice-items-table th {
  vertical-align: middle !important;
}
.spec-section-cell-select,
.spec-subsection-select,
.spec-row-select-round {
  min-height: 36px;
  height: 36px;
}

/* MVP 40 — specification alignment, stable row selection, UPD grid layout */
.mvp33-spec-table td,
.mvp33-spec-table th,
.mvp39-spec-row td,
.mvp40-spec-match-row {
  vertical-align: middle !important;
}
.spec-section-cell-select,
.spec-subsection-select {
  display: block;
  width: 100%;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  line-height: 1.15 !important;
  padding: 6px 8px !important;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}
.spec-row-select-round {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  line-height: 1 !important;
  vertical-align: middle;
  flex: 0 0 36px;
}
.mvp39-spec-actions {
  height: 42px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.mvp39-spec-row {
  height: auto;
}
.mvp39-spec-row td {
  height: auto;
}
.spec-name-readonly strong {
  font-weight: 900;
  color: #0f172a;
}
.mvp40-upd-view-only {
  justify-content: center;
  flex-wrap: wrap;
  min-width: 118px;
}
.mvp40-upd-view-only .micro-note {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 10px;
  line-height: 1.1;
}
.mvp40-spec-match-row {
  height: auto !important;
  min-height: 46px;
  align-items: stretch !important;
}
.mvp40-spec-match-row > span {
  display: flex;
  align-items: center;
  min-height: 34px;
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.mvp40-spec-match-row .mvp39-picker-name {
  display: flex !important;
  align-items: center;
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.mvp40-spec-match-row.already-matched {
  background: #ecfdf5 !important;
  border-color: #86efac !important;
}
.mvp40-spec-match-row.current-match {
  background: #dbeafe !important;
  border-color: #93c5fd !important;
}
.mvp40-upd-wrap {
  overflow-x: auto;
  max-width: 100%;
}
.mvp40-upd-table {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 1280px !important;
}
.mvp40-upd-table th,
.mvp40-upd-table td {
  vertical-align: middle !important;
  padding: 5px 5px !important;
  font-size: 11px !important;
}
.mvp40-upd-table .c-num { width: 36px; }
.mvp40-upd-table .c-inv-name { width: 250px; }
.mvp40-upd-table .c-unit { width: 52px; }
.mvp40-upd-table .c-qty { width: 64px; }
.mvp40-upd-table .c-price { width: 86px; }
.mvp40-upd-table .c-sum { width: 92px; }
.mvp40-upd-table .c-match { width: 42px; }
.mvp40-upd-table .c-upd-name { width: 210px; }
.mvp40-upd-table .c-total-qty { width: 76px; }
.mvp40-upd-table .c-total-sum { width: 96px; }
.mvp40-upd-table .invoice-item-name {
  white-space: normal;
  line-height: 1.2;
}
.mvp40-upd-table .input {
  width: 100% !important;
  min-width: 0 !important;
  font-size: 11px !important;
  padding: 5px 5px !important;
  min-height: 30px !important;
}
.mvp40-upd-table .upd-item-name { width: 100% !important; }
.mvp40-upd-table .upd-item-unit,
.mvp40-upd-table .upd-item-qty { text-align: center; }
.mvp40-upd-table .upd-item-price,
.mvp40-upd-table .upd-item-amount { text-align: right; }


/* MVP 41 — small UI stability fixes */
.mvp41-spec-row td,
.mvp41-spec-row .action-cell,
.mvp41-spec-row .spec-section-colored,
.mvp41-spec-row .spec-subsection-colored {
  vertical-align: middle !important;
  align-items: center;
}

.mvp41-colored-select,
.mvp41-spec-row .spec-section-cell-select,
.mvp41-spec-row .spec-subsection-select {
  height: 34px;
  min-height: 34px;
  display: flex;
  align-items: center;
  line-height: 1.15;
  padding-top: 0;
  padding-bottom: 0;
  text-align: center;
  text-align-last: center;
}

.mvp41-spec-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  height: 100%;
  min-height: 44px;
}

.spec-row-select-round.mvp41-spec-select-round {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 15px;
  transform: none !important;
  vertical-align: middle;
}

.mvp41-spec-name-editor {
  min-height: 34px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #d8e0ec;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.35;
  outline: none;
}

.mvp41-spec-name-editor:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

.mvp41-spec-name-editor strong,
.spec-name-readonly strong {
  font-weight: 800;
}

.mvp41-spec-match-row {
  align-items: stretch !important;
  min-height: 42px;
  height: auto !important;
}

.mvp41-spec-match-row > span {
  display: flex;
  align-items: center;
  min-height: 38px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.mvp41-spec-match-row .mvp41-picker-name {
  align-items: center;
  white-space: normal !important;
  overflow-wrap: anywhere;
  line-height: 1.32;
}

.mvp41-spec-match-row.already-matched {
  background: #eefdf3 !important;
}

.invoice-upd-items-table.mvp40-upd-table col.c-num { width: 42px; }
.invoice-upd-items-table.mvp40-upd-table col.c-inv-name { width: 270px; }
.invoice-upd-items-table.mvp40-upd-table col.c-unit { width: 72px; }
.invoice-upd-items-table.mvp40-upd-table col.c-qty { width: 82px; }
.invoice-upd-items-table.mvp40-upd-table col.c-price { width: 118px; }
.invoice-upd-items-table.mvp40-upd-table col.c-sum { width: 126px; }
.invoice-upd-items-table.mvp40-upd-table col.c-match { width: 48px; }
.invoice-upd-items-table.mvp40-upd-table col.c-upd-name { width: 270px; }
.invoice-upd-items-table.mvp40-upd-table col.c-total-qty { width: 92px; }
.invoice-upd-items-table.mvp40-upd-table col.c-total-sum { width: 130px; }
.invoice-upd-items-table.mvp40-upd-table th,
.invoice-upd-items-table.mvp40-upd-table td {
  vertical-align: middle;
}

/* Rebuild 01 — stabilized specification editing */
.rebuild01-spec-row > td {
  vertical-align: middle !important;
}
.rebuild01-actions-cell {
  vertical-align: middle !important;
  text-align: center;
}
.rebuild01-spec-action-stack {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  height: 100%;
  width: 100%;
}
.rebuild01-spec-select-round {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  border-radius: 999px;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
  transform: none !important;
  vertical-align: middle !important;
}
.rebuild01-spec-name-editor strong,
.rebuild01-spec-row .spec-name-readonly strong {
  font-weight: 900 !important;
  color: #0f172a;
}
.rebuild01-spec-name-editor {
  display: block;
  min-height: 36px;
  line-height: 1.35;
}


/* Rebuild 02 — stable row height in specification invoice matching picker */
.spec-match-picker-list {
  gap: 8px !important;
}

.spec-match-picker-row,
.mvp39-spec-match-row,
.mvp40-spec-match-row,
.mvp41-spec-match-row {
  height: auto !important;
  min-height: 56px !important;
  align-items: stretch !important;
  padding: 10px 12px !important;
  line-height: 1.32 !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

.spec-match-picker-row > span,
.mvp39-spec-match-row > span,
.mvp40-spec-match-row > span,
.mvp41-spec-match-row > span {
  display: flex !important;
  align-items: center !important;
  min-height: 40px !important;
  height: auto !important;
  line-height: 1.32 !important;
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  box-sizing: border-box !important;
}

.spec-match-picker-row .mvp39-picker-name,
.spec-match-picker-row .mvp41-picker-name {
  min-height: 40px !important;
  height: auto !important;
  align-items: center !important;
  line-height: 1.32 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.spec-match-picker-row .badge {
  white-space: normal !important;
  line-height: 1.2 !important;
  text-align: center;
}

.spec-picker-table-head,
.mvp39-spec-picker-head {
  align-items: center !important;
}


/* Rebuild 03 — robust row height for specification invoice confirmation */
.spec-invoice-items-table tbody tr {
  height: auto !important;
}

.spec-invoice-items-table td,
.spec-invoice-items-table th {
  height: auto !important;
  min-height: 48px !important;
  overflow: visible !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
}

.spec-invoice-items-table .spec-match-td {
  cursor: pointer;
  height: auto !important;
  min-height: 56px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  overflow: visible !important;
}

.spec-invoice-items-table .spec-match-cell,
.spec-invoice-items-table .mvp39-spec-match-cell {
  display: flex !important;
  align-items: center !important;
  min-height: 44px !important;
  height: auto !important;
  padding: 8px 10px !important;
  white-space: normal !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

.spec-invoice-items-table .spec-match-label {
  display: block !important;
  max-width: none !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  line-height: 1.35 !important;
}

.spec-match-picker-list {
  display: block !important;
}

.spec-match-picker-row,
.mvp39-spec-match-row,
.mvp40-spec-match-row,
.mvp41-spec-match-row {
  display: grid !important;
  grid-auto-rows: minmax(min-content, auto) !important;
  margin-bottom: 8px !important;
  min-height: max-content !important;
  contain: layout style !important;
}

.spec-match-picker-row:last-child,
.mvp39-spec-match-row:last-child,
.mvp40-spec-match-row:last-child,
.mvp41-spec-match-row:last-child {
  margin-bottom: 0 !important;
}

.spec-match-picker-row > span,
.mvp39-spec-match-row > span,
.mvp40-spec-match-row > span,
.mvp41-spec-match-row > span {
  align-self: stretch !important;
}

/* Rebuild 05 — controls for adding missing specification rows from invoice matching. */
.rebuild05-source-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.rebuild05-source-row-text {
  min-width: 0;
}
.rebuild05-add-missing-spec-btn {
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 900px) {
  .rebuild05-source-row-card {
    align-items: stretch;
    flex-direction: column;
  }
  .rebuild05-add-missing-spec-btn {
    width: 100%;
  }
}


/* Rebuild 06 — wider specification invoice confirmation and quantity equality controls. */
.rebuild06-extra-wide-modal {
  width: min(1760px, calc(100vw - 12px));
}
.rebuild06-extra-wide-modal .modal-body {
  padding-left: 18px;
  padding-right: 18px;
}
.rebuild06-invoice-items-wrap {
  max-height: 56vh;
}
.rebuild06-spec-invoice-items-table {
  min-width: 1580px !important;
  table-layout: fixed;
}
.rebuild06-spec-invoice-items-table th:nth-child(1) { width: 42px; }
.rebuild06-spec-invoice-items-table th:nth-child(2) { width: 390px; }
.rebuild06-spec-invoice-items-table th:nth-child(3) { width: 88px; }
.rebuild06-spec-invoice-items-table th:nth-child(4) { width: 96px; }
.rebuild06-spec-invoice-items-table th:nth-child(5) { width: 138px; }
.rebuild06-spec-invoice-items-table th:nth-child(6) { width: 170px; }
.rebuild06-spec-invoice-items-table th:nth-child(7) { width: 118px; }
.rebuild06-spec-invoice-items-table th:nth-child(8) { width: 124px; }
.rebuild06-spec-invoice-items-table th:nth-child(9) { width: 360px; }
.rebuild06-spec-invoice-items-table th:nth-child(10) { width: 44px; }
.rebuild06-spec-invoice-items-table .spec-qty-cell {
  font-weight: 800;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
}
.rebuild06-spec-invoice-items-table .spec-equality-cell {
  text-align: center;
  vertical-align: middle !important;
}
.spec-qty-equal-btn {
  width: 100%;
  min-height: 34px;
  white-space: normal;
  line-height: 1.15;
}
.spec-qty-equal-btn.is-equal {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
.spec-qty-note {
  margin-top: 5px;
  min-height: 14px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.spec-quantity-equal-row {
  background: #f0fdf4 !important;
}
.spec-quantity-equal-row td {
  border-bottom-color: #bbf7d0 !important;
}
.spec-quantity-diff-row {
  background: #fff7ed !important;
}
.spec-quantity-diff-row .spec-qty-cell {
  color: #9a3412;
}
@media (max-width: 1200px) {
  .rebuild06-extra-wide-modal { width: calc(100vw - 8px); }
  .rebuild06-spec-invoice-items-table { min-width: 1500px !important; }
}

/* Rebuild 08 — specification status filters and request invoice inline actions. */
.status-filter-btn.procurement-not_started { background: #f1f5f9; color: #475569; }
.status-filter-btn.procurement-requested { background: #eff6ff; color: #1d4ed8; }
.status-filter-btn.procurement-invoice,
.status-filter-btn.procurement-ordered { background: #fff7ed; color: #c2410c; }
.status-filter-btn.procurement-partial { background: #fffbeb; color: #b45309; }
.status-filter-btn.procurement-bought,
.status-filter-btn.procurement-delivered { background: #ecfdf5; color: #047857; }
.status-filter-btn.procurement-canceled { background: #f3f4f6; color: #6b7280; }
.spec-status-filter-panel { margin: 10px 0 12px; }
.spec-main-row.spec-delivered-row > td {
  background: #ecfdf5 !important;
  border-bottom-color: #bbf7d0 !important;
}
.spec-main-row.spec-delivered-row .input,
.spec-main-row.spec-delivered-row .select,
.spec-main-row.spec-delivered-row .textarea,
.spec-main-row.spec-delivered-row .spec-name-readonly,
.spec-main-row.spec-delivered-row .spec-name-editor,
.spec-main-row.spec-delivered-row .rebuild01-spec-name-editor {
  background: #f0fdf4 !important;
  border-color: #bbf7d0 !important;
}
.spec-main-row.spec-delivered-row .badge.procurement-delivered {
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .18);
}
.request-invoice-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.request-invoice-inline-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.request-invoice-inline-actions .icon-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
}
.requests-table col.rebuild08-req-col-invoice { width: 210px; }

/* Rebuild 07 — invoice registry UPD bulk match controls. */
.invoice-upd-bulk-head-rebuild07 {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0 10px;
}
.invoice-upd-bulk-head-rebuild07 h4 {
  margin: 0 0 4px;
}
.invoice-upd-bulk-head-rebuild07 .helper {
  max-width: 920px;
}
.rebuild07-copy-all-upd-btn {
  white-space: nowrap;
  margin-top: 2px;
}
.rebuild07-invoice-details-toolbar .invoice-details-upd-actions-v26 {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.rebuild07-active-upd-label {
  font-weight: 700;
}
.rebuild07-compact-upd-switcher {
  margin: 0;
}
.rebuild07-upd-table .invoice-item-name .row-subtitle {
  margin-top: 4px;
}
@media (max-width: 900px) {
  .invoice-upd-bulk-head-rebuild07 {
    flex-direction: column;
    align-items: stretch;
  }
  .rebuild07-copy-all-upd-btn {
    width: 100%;
  }
}

/* Rebuild 09 — contracts hierarchy, role switcher, menu notifications, ID registry. */
.sidebar-nav-btn {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sidebar-notice-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.sidebar-role-switch-rebuild09 {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}
.sidebar-role-switch-rebuild09 label {
  display: block;
  margin-bottom: 7px;
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sidebar-role-switch-rebuild09 small {
  display: block;
  margin-top: 7px;
  color: #9ca3af;
  line-height: 1.35;
}
.sidebar-role-tabs-rebuild09 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}
.sidebar-role-tabs-rebuild09 button {
  width: 100%;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  text-align: left;
  font-weight: 700;
}
.sidebar-role-tabs-rebuild09 button.active,
.sidebar-role-tabs-rebuild09 button:hover {
  background: #2563eb;
  color: #fff;
}
.rebuild09-contracts-table th:nth-child(1) { min-width: 300px; }
.rebuild09-contracts-table th:nth-child(2) { width: 170px; }
.contract-additional-row td:first-child {
  background: #f8fafc;
}
.contract-additional-title {
  padding-left: 18px;
}
.contract-branch-mark {
  display: inline-block;
  margin-right: 8px;
  color: #64748b;
  font-weight: 900;
}
.badge.contract-type-main {
  background: #eff6ff;
  color: #1d4ed8;
}
.badge.contract-type-additional {
  background: #f5f3ff;
  color: #6d28d9;
}
.id-registry-card-rebuild09 .toolbar {
  margin-bottom: 16px;
}
.id-registry-empty-rebuild09 {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  text-align: left;
}


/* Rebuild 12 */
.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}
.sync-ok { background: #dcfce7; color: #166534; }
.sync-pending { background: #fef3c7; color: #92400e; }
.sync-error, .sync-local { background: #fee2e2; color: #991b1b; }

/* Rebuild 14 — Supabase diagnostics */
.supabase-diagnostic-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #dbe4ef;
  background: #f8fafc;
  color: #334155;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}
.supabase-diagnostic-panel strong {
  display: block;
  margin-bottom: 4px;
  color: #0f172a;
}
.supabase-diagnostic-panel span {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}
.supabase-diagnostic-panel.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.supabase-diagnostic-panel.pending {
  border-color: #fde68a;
  background: #fffbeb;
}
.supabase-diagnostic-panel.error {
  border-color: #fecaca;
  background: #fef2f2;
}
.supabase-diagnostic-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 340px;
}
.supabase-diagnostic-actions .link-btn {
  white-space: nowrap;
}
@media (max-width: 900px) {
  .supabase-diagnostic-panel {
    flex-direction: column;
  }
  .supabase-diagnostic-actions {
    justify-content: flex-start;
    min-width: 0;
  }
}
/* Rebuild 15 */
.supabase-diagnostic-actions .danger-link {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, .28);
  background: #fff7f7;
}


/* Rebuild 17 — local mode and ID registry */
.id-registry-card-rebuild17 { overflow: visible; }
.id-registry-toolbar-rebuild17 {
  margin-bottom: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.id-registry-code-editor {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin: 0 0 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
}
.id-registry-code-editor.disabled { opacity: .78; }
.id-registry-code-editor .helper { margin: 0; font-size: 12px; color: #64748b; }
.id-registry-code-input { width: 90px; text-align: center; font-weight: 900; }
.id-registry-table-wrap-rebuild17 { overflow: auto; border-radius: 16px; }
.id-registry-table-rebuild17 { min-width: 1480px; }
.id-registry-table-rebuild17 th { white-space: nowrap; }
.id-registry-table-rebuild17 th:nth-child(1),
.id-registry-table-rebuild17 td.id-registry-col-expand { width: 46px; text-align: center; }
.id-registry-table-rebuild17 th:nth-child(2),
.id-registry-table-rebuild17 td.id-registry-col-number { width: 90px; min-width: 90px; }
.id-registry-table-rebuild17 th:nth-child(3),
.id-registry-table-rebuild17 td.id-registry-col-section { min-width: 150px; }
.id-registry-table-rebuild17 th:nth-child(4),
.id-registry-table-rebuild17 td.id-registry-col-workName { min-width: 290px; }
.id-registry-table-rebuild17 th:nth-child(5),
.id-registry-table-rebuild17 td.id-registry-col-idNumber { min-width: 170px; }
.id-registry-table-rebuild17 th:nth-child(6),
.id-registry-table-rebuild17 th:nth-child(7),
.id-registry-table-rebuild17 td.id-registry-col-dnr,
.id-registry-table-rebuild17 td.id-registry-col-dor { width: 150px; min-width: 150px; }
.id-registry-table-rebuild17 th:nth-child(8),
.id-registry-table-rebuild17 td.id-registry-col-note { min-width: 240px; }
.id-registry-table-rebuild17 th:nth-child(9),
.id-registry-table-rebuild17 th:nth-child(10),
.id-registry-table-rebuild17 th:nth-child(11),
.id-registry-table-rebuild17 td.id-registry-col-smrStatus,
.id-registry-table-rebuild17 td.id-registry-col-idStatus,
.id-registry-table-rebuild17 td.id-registry-col-aosrStatus { width: 170px; min-width: 170px; }
.id-registry-main-row.expanded td { background: #f8fafc; }
.id-registry-number-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 900;
  border: 1px solid #bfdbfe;
}
.id-registry-expand-btn { font-weight: 900; }
.id-registry-section-select { min-width: 140px; }
.id-registry-date-input { min-width: 132px; }
.id-registry-textarea {
  min-height: 44px;
  resize: vertical;
  line-height: 1.28;
  white-space: pre-wrap;
}
.id-registry-status-control {
  position: relative;
  width: 100%;
  min-width: 145px;
}
.id-registry-status-button {
  min-height: 34px;
  width: 100%;
  font-size: 11.5px;
}
.id-registry-status-menu { min-width: 210px; }
.id-registry-status-option { white-space: normal; }
.idreg-not_started { background: #f8fafc !important; border-color: #cbd5e1 !important; color: #475569 !important; }
.idreg-in_work { background: #eef2ff !important; border-color: #c7d2fe !important; color: #4338ca !important; }
.idreg-no_materials,
.idreg-no_docs { background: #fef2f2 !important; border-color: #fecaca !important; color: #b91c1c !important; }
.idreg-smr_done,
.idreg-ready { background: #ecfdf5 !important; border-color: #bbf7d0 !important; color: #047857 !important; }
.idreg-submitted,
.idreg-submitted_sk { background: #eff6ff !important; border-color: #bfdbfe !important; color: #1d4ed8 !important; }
.idreg-submitted_scan { background: #dcfce7 !important; border-color: #86efac !important; color: #166534 !important; }
.idreg-preparation { background: #fef3c7 !important; border-color: #fde68a !important; color: #92400e !important; }
.idreg-correction { background: #fff7ed !important; border-color: #fed7aa !important; color: #c2410c !important; }
.idreg-certificates_folder { background: #f5f3ff !important; border-color: #ddd6fe !important; color: #6d28d9 !important; }
.id-registry-details-row > td { padding: 0 !important; background: #f8fafc; }
.id-registry-details-card {
  margin: 0;
  padding: 14px 16px;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
}
.details-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}
.details-grid > div {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
}
.details-grid strong { display: block; margin-top: 4px; color: #0f172a; }
.id-registry-details-editors { margin-top: 12px; }
.id-registry-empty-rebuild17 {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  text-align: left;
}
@media (max-width: 900px) {
  .details-grid { grid-template-columns: 1fr 1fr; }
}

/* ==============================
   Rebuild 18 — Реестр ИД: компактная таблица, визуальные границы, файлы
============================== */
.id-registry-card-rebuild18 { overflow: visible; }
.id-registry-table-wrap-rebuild18 {
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}
.id-registry-table-rebuild18 {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1500px;
  table-layout: fixed;
  font-size: 12px;
}
.id-registry-table-rebuild18 thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
  color: #0f172a;
  border-right: 1px solid #93c5fd;
  border-bottom: 2px solid #60a5fa;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  letter-spacing: .025em;
  text-transform: uppercase;
  font-weight: 900;
  padding: 9px 8px;
  vertical-align: middle;
  white-space: normal;
}
.id-registry-table-rebuild18 thead th:first-child { border-top-left-radius: 15px; }
.id-registry-table-rebuild18 thead th:last-child { border-top-right-radius: 15px; }
.id-registry-table-rebuild18 tbody td {
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 5px 6px;
  vertical-align: middle;
  background: #ffffff;
  line-height: 1.2;
}
.id-registry-table-rebuild18 tbody tr:nth-child(4n+1) td { background: #fbfdff; }
.id-registry-table-rebuild18 tbody tr.rebuild18-main-row:hover td { background: #f8fafc; }
.id-registry-table-rebuild18 tbody tr.rebuild18-main-row.expanded td { background: #eff6ff; }
.id-registry-table-rebuild18 .input,
.id-registry-table-rebuild18 .select {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.2;
}
.id-registry-table-rebuild18 .id-registry-textarea.compact {
  min-height: 31px;
  max-height: 54px;
  overflow: auto;
  resize: vertical;
  padding: 5px 8px;
  line-height: 1.22;
}
.id-registry-table-rebuild18 .id-registry-compact-input {
  min-height: 30px;
}
.id-registry-table-rebuild18 .id-registry-col-expand { width: 44px; min-width: 44px; text-align: center; }
.id-registry-table-rebuild18 .id-registry-col-number { width: 142px; min-width: 142px; }
.id-registry-table-rebuild18 .id-registry-col-section { width: 135px; min-width: 135px; }
.id-registry-table-rebuild18 .id-registry-col-workName { width: 260px; min-width: 260px; }
.id-registry-table-rebuild18 .id-registry-col-idNumber { width: 150px; min-width: 150px; }
.id-registry-table-rebuild18 .id-registry-col-dnr,
.id-registry-table-rebuild18 .id-registry-col-dor { width: 76px; min-width: 76px; text-align: center; }
.id-registry-table-rebuild18 .id-registry-col-note { width: 210px; min-width: 210px; }
.id-registry-table-rebuild18 .id-registry-col-smrStatus { width: 138px; min-width: 138px; }
.id-registry-table-rebuild18 .id-registry-col-idStatus,
.id-registry-table-rebuild18 .id-registry-col-aosrStatus { width: 168px; min-width: 168px; }
.id-registry-table-rebuild18 .id-registry-col-ks2Amount { width: 132px; min-width: 132px; }
.id-registry-table-rebuild18 .row-actions-cell { width: 44px; min-width: 44px; text-align: center; }
.id-registry-number-control { position: relative; }
.id-registry-number-chip.id-registry-number-picker {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 11px;
  flex-direction: column;
  gap: 1px;
  cursor: pointer;
  appearance: none;
}
.id-registry-number-chip.id-registry-number-picker span {
  font-weight: 950;
  font-size: 12px;
  line-height: 1.1;
}
.id-registry-number-chip.id-registry-number-picker em {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  font-size: 10px;
  color: #64748b;
  line-height: 1.1;
}
.id-registry-number-chip.id-registry-number-picker.empty {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}
.id-registry-object-menu {
  z-index: 9999;
  width: 280px;
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}
.id-registry-menu-title {
  padding: 6px 8px 8px;
  font-size: 11px;
  font-weight: 900;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.id-registry-object-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 11px;
  padding: 8px 9px;
  text-align: left;
  cursor: pointer;
}
.id-registry-object-option:hover { background: #f8fafc; border-color: #e2e8f0; }
.id-registry-object-option.active { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.id-registry-object-option strong { display: block; font-size: 12px; }
.id-registry-object-option small { display: block; margin-top: 2px; color: #64748b; }
.id-registry-date-indicator {
  width: 100%;
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-weight: 900;
  cursor: pointer;
}
.id-registry-date-indicator span {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #e2e8f0;
  font-size: 10px;
}
.id-registry-date-indicator small { font-size: 10px; font-weight: 800; }
.id-registry-date-indicator.filled {
  border-color: #86efac;
  background: #ecfdf5;
  color: #166534;
}
.id-registry-date-indicator.filled span { background: #22c55e; color: #ffffff; }
.id-registry-status-file-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 5px;
}
.id-registry-status-file-wrap .id-registry-status-control { min-width: 0; }
.id-registry-status-file-wrap .id-registry-status-button {
  min-height: 30px;
  padding: 5px 7px;
  font-size: 11px;
}
.id-registry-file-open-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
}
.id-registry-file-open-btn.disabled { opacity: .45; cursor: not-allowed; }
.id-registry-ks2-input { text-align: right; font-weight: 800; }
.rebuild18-details-card {
  padding: 12px 14px;
  background: linear-gradient(180deg, #eff6ff, #ffffff);
}
.id-registry-update-grid {
  grid-template-columns: minmax(180px, 240px);
  margin-bottom: 12px;
}
.id-registry-details-layout {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.35fr);
  gap: 14px;
}
.id-registry-details-panel {
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
}
.id-registry-details-panel h3 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}
.id-registry-file-list {
  display: grid;
  gap: 8px;
}
.id-registry-file-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
.id-registry-file-row strong { font-size: 12px; color: #0f172a; }
.id-registry-file-row .row-subtitle {
  margin-top: 2px;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.id-registry-toolbar-rebuild18 {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 10px;
}
@media (max-width: 1100px) {
  .id-registry-details-layout { grid-template-columns: 1fr; }
  .id-registry-file-row { grid-template-columns: 1fr; }
}

/* ==============================
   Rebuild 19 — Реестр ИД: компактность, ширины столбцов, раскрытие по колонкам
============================== */
.id-registry-table-rebuild19 {
  min-width: 1420px;
  table-layout: fixed;
  font-size: 11.5px;
}
.id-registry-table-rebuild19 col.col-expand { width: 38px; }
.id-registry-table-rebuild19 col.col-number { width: 132px; }
.id-registry-table-rebuild19 col.col-section { width: 132px; }
.id-registry-table-rebuild19 col.col-work { width: 280px; }
.id-registry-table-rebuild19 col.col-idnumber { width: 150px; }
.id-registry-table-rebuild19 col.col-date { width: 44px; }
.id-registry-table-rebuild19 col.col-note { width: 210px; }
.id-registry-table-rebuild19 col.col-smr { width: 136px; }
.id-registry-table-rebuild19 col.col-idstatus { width: 166px; }
.id-registry-table-rebuild19 col.col-aosrstatus { width: 174px; }
.id-registry-table-rebuild19 col.col-ks2 { width: 130px; }
.id-registry-table-rebuild19 col.col-actions { width: 40px; }
.id-registry-table-rebuild19 thead th {
  text-align: center;
  vertical-align: middle;
  background: linear-gradient(180deg, #1e3a8a 0%, #1d4ed8 100%);
  color: #ffffff;
  border-right-color: rgba(255,255,255,.22);
  border-bottom-color: #1e40af;
  font-family: "Segoe UI Semibold", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  line-height: 1.15;
  padding: 8px 6px;
  letter-spacing: .035em;
}
.id-registry-table-rebuild19 tbody td {
  padding: 3px 5px;
  height: 34px;
  vertical-align: middle;
}
.id-registry-table-rebuild19 .input,
.id-registry-table-rebuild19 .select {
  min-height: 26px;
  height: 26px;
  padding: 3px 6px;
  font-size: 11.5px;
  border-radius: 7px;
}
.id-registry-table-rebuild19 .id-registry-textarea.compact {
  min-height: 26px;
  height: 26px;
  max-height: 44px;
  padding: 3px 6px;
  resize: none;
  overflow: hidden;
}
.id-registry-table-rebuild19 .id-registry-number-chip.id-registry-number-picker {
  min-height: 28px;
  height: 28px;
  padding: 3px 7px;
  border-radius: 9px;
}
.id-registry-table-rebuild19 .id-registry-number-chip.id-registry-number-picker span { font-size: 11.5px; }
.id-registry-table-rebuild19 .id-registry-number-chip.id-registry-number-picker em { font-size: 9px; }
.id-registry-date-indicator.rebuild19-date-indicator {
  width: 24px;
  min-width: 24px;
  max-width: 24px;
  min-height: 24px;
  height: 24px;
  padding: 0;
  margin: 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
}
.id-registry-date-indicator.rebuild19-date-indicator span {
  width: 16px;
  height: 16px;
  font-size: 10px;
}
.id-registry-table-rebuild19 .id-registry-col-dnr,
.id-registry-table-rebuild19 .id-registry-col-dor { text-align: center; padding-left: 2px; padding-right: 2px; }
.id-registry-table-rebuild19 .id-registry-status-file-wrap {
  grid-template-columns: minmax(0, 1fr) 26px;
  gap: 4px;
}
.id-registry-table-rebuild19 .id-registry-status-file-wrap .id-registry-status-button {
  min-height: 26px;
  height: 26px;
  padding: 3px 6px;
  font-size: 10.5px;
}
.id-registry-table-rebuild19 .id-registry-file-open-btn {
  width: 26px;
  height: 26px;
  min-width: 26px;
}
.id-registry-table-rebuild19 .id-registry-ks2-input {
  min-height: 26px;
  height: 26px;
  font-size: 11px;
}
.id-registry-toolbar-rebuild19 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  margin-bottom: 8px;
}
.id-registry-toolbar-rebuild19 .search { min-width: 260px; flex: 1 1 320px; }
.id-registry-code-inline {
  display: inline-grid;
  grid-template-columns: auto 78px auto;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  border-radius: 12px;
  color: #1e3a8a;
}
.id-registry-code-inline span {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.id-registry-code-inline small {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
  font-size: 11px;
}
.id-registry-code-inline.disabled { background: #f8fafc; color: #64748b; border-color: #e2e8f0; }
.id-registry-code-inline.disabled strong { font-size: 13px; }
.rebuild19-details-card {
  padding: 10px 12px;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
}
.id-registry-details-topline {
  display: grid;
  grid-template-columns: minmax(130px, 170px) minmax(280px, 380px) minmax(200px, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}
.id-registry-details-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.compact-date-row,
.compact-executor-row,
.id-registry-material-mini { margin: 0; }
.id-registry-native-date { min-height: 34px; }
.id-registry-file-columns-rebuild19 {
  display: grid;
  grid-template-columns: 1fr 1fr .85fr;
  gap: 12px;
  align-items: start;
}
.id-registry-file-column-panel {
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #ffffff;
  padding: 10px;
  min-width: 0;
}
.id-registry-file-column-head {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}
.id-registry-file-column-head h3 {
  margin: 0;
  font-size: 13px;
  color: #0f172a;
  font-weight: 900;
}
.id-registry-executor-select { width: 100%; }
.rebuild19-file-list { gap: 7px; }
.rebuild19-file-list .id-registry-file-row {
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 8px;
  padding: 7px 8px;
}
.rebuild19-file-list .id-registry-file-row strong { font-size: 11.5px; }
.rebuild19-file-list .id-registry-file-row .row-subtitle { max-width: 220px; font-size: 10.5px; }
.accumulative-table-rebuild19 { min-width: 1320px; table-layout: auto; }
.accumulative-table-rebuild19 th {
  text-align: center;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 900;
}
.accumulative-table-rebuild19 td,
.accumulative-table-rebuild19 th {
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 7px 8px;
  vertical-align: middle;
}
.accumulative-table-rebuild19 .money-cell { text-align: right; font-weight: 900; white-space: nowrap; }
.accumulative-table-rebuild19 tfoot td { background: #f8fafc; font-weight: 900; }
@media (max-width: 1200px) {
  .id-registry-details-topline,
  .id-registry-file-columns-rebuild19 { grid-template-columns: 1fr; }
}
.id-registry-table-rebuild19 .id-registry-col-expand { width: 38px; min-width: 38px; }
.id-registry-table-rebuild19 .id-registry-col-number { width: 132px; min-width: 132px; }
.id-registry-table-rebuild19 .id-registry-col-section { width: 132px; min-width: 132px; }
.id-registry-table-rebuild19 .id-registry-col-workName { width: 280px; min-width: 280px; }
.id-registry-table-rebuild19 .id-registry-col-idNumber { width: 150px; min-width: 150px; }
.id-registry-table-rebuild19 .id-registry-col-dnr,
.id-registry-table-rebuild19 .id-registry-col-dor { width: 44px; min-width: 44px; max-width: 44px; }
.id-registry-table-rebuild19 .id-registry-col-note { width: 210px; min-width: 210px; }
.id-registry-table-rebuild19 .id-registry-col-smrStatus { width: 136px; min-width: 136px; }
.id-registry-table-rebuild19 .id-registry-col-idStatus { width: 166px; min-width: 166px; }
.id-registry-table-rebuild19 .id-registry-col-aosrStatus { width: 174px; min-width: 174px; }
.id-registry-table-rebuild19 .id-registry-col-ks2Amount { width: 130px; min-width: 130px; }
.id-registry-table-rebuild19 .row-actions-cell { width: 40px; min-width: 40px; }

/* Rebuild 20 — Реестр ИД: компактная строка, раскладка раскрытия по столбцам, выбор материала */
.id-registry-card-rebuild20 { overflow: visible; }
.compact-id-registry-topbar { margin-bottom: 10px; }
.id-registry-toolbar-rebuild20 {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) 190px minmax(250px, 300px) 88px 92px;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
}
.id-registry-toolbar-rebuild20 .id-registry-search-input { min-width: 220px; width: 100%; }
.id-registry-toolbar-rebuild20 .id-registry-object-filter { min-width: 180px; width: 100%; }
.id-registry-toolbar-rebuild20 .compact-toolbar-btn { min-width: 0; padding-left: 12px; padding-right: 12px; white-space: nowrap; }
.id-registry-toolbar-rebuild20 .id-registry-code-inline {
  min-height: 38px;
  padding: 6px 8px;
  display: grid;
  grid-template-columns: auto 72px;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
}
.id-registry-toolbar-rebuild20 .id-registry-code-inline span { grid-column: 1; font-size: 10px; }
.id-registry-toolbar-rebuild20 .id-registry-code-inline .id-registry-code-input { grid-column: 2; grid-row: 1 / 3; height: 28px; }
.id-registry-toolbar-rebuild20 .id-registry-code-inline small { grid-column: 1; font-size: 10px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.id-registry-toolbar-rebuild20 .id-registry-code-inline.disabled { grid-template-columns: auto auto; }

.id-registry-table-rebuild20 {
  min-width: 1650px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.id-registry-table-rebuild20 col.col-expand { width: 38px; }
.id-registry-table-rebuild20 col.col-number { width: 112px; }
.id-registry-table-rebuild20 col.col-section { width: 124px; }
.id-registry-table-rebuild20 col.col-work { width: 300px; }
.id-registry-table-rebuild20 col.col-idnumber { width: 152px; }
.id-registry-table-rebuild20 col.col-date { width: 44px; }
.id-registry-table-rebuild20 col.col-note { width: 230px; }
.id-registry-table-rebuild20 col.col-smr { width: 136px; }
.id-registry-table-rebuild20 col.col-idstatus { width: 174px; }
.id-registry-table-rebuild20 col.col-aosrstatus { width: 184px; }
.id-registry-table-rebuild20 col.col-ks2 { width: 134px; }
.id-registry-table-rebuild20 col.col-actions { width: 40px; }
.id-registry-table-rebuild20 thead th {
  text-align: center;
  vertical-align: middle;
  padding: 8px 6px;
  font-family: Inter, Arial, sans-serif;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: .035em;
  text-transform: uppercase;
  background: #dbeafe;
  color: #1e3a8a;
  border-right: 1px solid #bfdbfe;
  border-bottom: 1px solid #93c5fd;
}
.id-registry-table-rebuild20 tbody td {
  padding: 5px 6px;
  vertical-align: middle;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}
.id-registry-table-rebuild20 .id-registry-col-expand { width: 38px; min-width: 38px; text-align: center; }
.id-registry-table-rebuild20 .id-registry-col-number { width: 112px; min-width: 112px; }
.id-registry-table-rebuild20 .id-registry-col-section { width: 124px; min-width: 124px; }
.id-registry-table-rebuild20 .id-registry-col-workName { width: 300px; min-width: 300px; }
.id-registry-table-rebuild20 .id-registry-col-idNumber { width: 152px; min-width: 152px; }
.id-registry-table-rebuild20 .id-registry-col-dnr,
.id-registry-table-rebuild20 .id-registry-col-dor { width: 44px; min-width: 44px; max-width: 44px; text-align: center; padding-left: 3px; padding-right: 3px; }
.id-registry-table-rebuild20 .id-registry-col-note { width: 230px; min-width: 230px; }
.id-registry-table-rebuild20 .id-registry-col-smrStatus { width: 136px; min-width: 136px; }
.id-registry-table-rebuild20 .id-registry-col-idStatus { width: 174px; min-width: 174px; }
.id-registry-table-rebuild20 .id-registry-col-aosrStatus { width: 184px; min-width: 184px; }
.id-registry-table-rebuild20 .id-registry-col-ks2Amount { width: 134px; min-width: 134px; }
.id-registry-table-rebuild20 .row-actions-cell { width: 40px; min-width: 40px; text-align: center; }
.id-registry-table-rebuild20 .input,
.id-registry-table-rebuild20 .select {
  min-height: 30px;
  height: 30px;
  padding: 4px 7px;
  font-size: 11.5px;
  line-height: 1.15;
}
.id-registry-table-rebuild20 .id-registry-textarea.compact {
  min-height: 30px;
  height: 30px;
  padding-top: 6px;
  padding-bottom: 5px;
  resize: vertical;
  overflow: hidden;
}
.id-registry-table-rebuild20 .id-registry-number-chip.id-registry-number-picker,
.id-registry-table-rebuild20 .id-registry-number-chip.id-registry-number-picker.rebuild20-number-picker {
  min-height: 30px;
  height: 30px;
  padding: 4px 7px;
  justify-content: center;
  text-align: center;
}
.id-registry-table-rebuild20 .id-registry-number-chip.id-registry-number-picker span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .02em;
}
.id-registry-table-rebuild20 .id-registry-number-chip.id-registry-number-picker em { display: none; }
.id-registry-date-indicator.rebuild19-date-indicator {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  margin: 0 auto;
}
.id-registry-date-indicator.rebuild19-date-indicator span {
  width: 18px;
  height: 18px;
  font-size: 11px;
}
.id-registry-table-rebuild20 .id-registry-status-file-wrap,
.id-registry-table-rebuild20 .rebuild20-status-file-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 5px;
  align-items: center;
}
.id-registry-table-rebuild20 .id-registry-status-file-wrap .id-registry-status-button {
  height: 30px;
  min-height: 30px;
  font-size: 10.5px;
  padding: 4px 7px;
}
.id-registry-file-state-btn {
  width: 34px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}
.id-registry-file-state-btn.none { opacity: .52; cursor: not-allowed; }
.id-registry-file-state-btn.draft { background: #fef3c7; border-color: #fbbf24; color: #92400e; }
.id-registry-file-state-btn.scan { background: #dbeafe; border-color: #60a5fa; color: #1d4ed8; }
.id-registry-file-state-btn.both { background: #dcfce7; border-color: #22c55e; color: #166534; }
.id-registry-file-state-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(15, 23, 42, .12); }

.rebuild20-details-row > td { padding: 0 !important; background: #f8fafc; }
.rebuild20-details-card {
  min-width: 1650px;
  padding: 10px 0;
  border-top: 1px solid #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
}
.id-registry-details-grid-rebuild20 {
  display: grid;
  grid-template-columns: 38px 112px 124px 300px 152px 44px 44px 230px 136px 174px 184px 134px 40px;
  column-gap: 0;
  row-gap: 8px;
  align-items: start;
}
.rebuild20-updated {
  grid-column: 2 / 6;
  padding: 8px 10px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #ffffff;
  min-height: 58px;
}
.rebuild20-dnr { grid-column: 6 / 7; padding: 0 3px; }
.rebuild20-dor { grid-column: 7 / 8; padding: 0 3px; }
.rebuild20-id-panel { grid-column: 10 / 11; padding: 0 4px; }
.rebuild20-aosr-panel { grid-column: 11 / 12; padding: 0 4px; }
.rebuild20-ks2-cell { grid-column: 12 / 13; padding: 0 4px; }
.rebuild20-material-area {
  grid-column: 2 / 13;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
}
.id-registry-detail-date-field {
  margin: 0;
  gap: 4px;
  align-items: center;
}
.id-registry-detail-date-field label {
  text-align: center;
  font-size: 10px;
  font-weight: 900;
  color: #1e3a8a;
}
.id-registry-detail-date-field .id-registry-native-date {
  width: 40px;
  min-width: 40px;
  min-height: 30px;
  height: 30px;
  padding: 0 2px;
  font-size: 0;
  color: transparent;
  cursor: pointer;
}
.id-registry-detail-date-field .id-registry-native-date::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
  margin: 0;
}
.id-registry-detail-date-field .id-registry-native-date:focus {
  width: 142px;
  font-size: 12px;
  color: #0f172a;
  position: relative;
  z-index: 3;
  background: #ffffff;
}
.rebuild20-status-panel,
.rebuild20-ks2-panel {
  border: 1px solid #dbeafe;
  border-radius: 13px;
  background: #ffffff;
  padding: 8px;
  min-height: 220px;
}
.rebuild20-status-panel h3,
.rebuild20-ks2-panel h3 {
  margin: 0 0 7px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #1e3a8a;
  text-align: center;
}
.rebuild20-status-panel .form-row,
.rebuild20-ks2-panel .form-row { margin-bottom: 7px; gap: 4px; }
.rebuild20-status-panel label,
.rebuild20-ks2-panel label { font-size: 10px; font-weight: 800; color: #64748b; }
.rebuild20-status-panel .id-registry-status-button { min-height: 30px; font-size: 10.5px; padding: 4px 7px; }
.rebuild20-file-list { gap: 6px; }
.rebuild20-file-list .id-registry-file-row {
  grid-template-columns: 1fr;
  gap: 5px;
  padding: 7px;
  border-radius: 10px;
}
.rebuild20-file-list .id-registry-file-row strong { font-size: 11px; }
.rebuild20-file-list .id-registry-file-row .row-subtitle { font-size: 10px; max-width: 150px; }
.rebuild20-file-list .file-actions.compact-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.rebuild20-file-list .btn.small { padding: 4px 7px; min-height: 26px; font-size: 10px; }
.rebuild20-ks2-panel .money-input { width: 100%; min-width: 0; text-align: right; }
.id-registry-used-material.empty p { margin: 4px 0 0; }
.used-material-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.used-material-card {
  display: grid;
  grid-template-columns: 2fr .7fr 1fr 1fr;
  gap: 8px;
  align-items: start;
}
.used-material-card > div {
  padding: 8px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.used-material-card .used-material-certs { grid-column: 1 / -1; }
.material-cert-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.material-cert-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}
.material-cert-chip a { color: #1d4ed8; text-decoration: underline; }
.material-cert-text { color: #334155; font-size: 12px; }
.rebuild20-material-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}
.id-registry-material-picker-modal { width: min(1280px, 96vw); max-height: 90vh; }
.material-picker-table-wrap { max-height: 58vh; overflow: auto; }
.material-picker-table { min-width: 1180px; }
.material-picker-table th { text-align: center; background: #dbeafe; color: #1e3a8a; }
.material-picker-table td { vertical-align: top; }
.material-picker-table .material-cert-list { max-width: 260px; }
.material-picker-table .material-cert-chip { border-radius: 10px; }
.accumulative-table-rebuild19 .material-cert-list { max-width: 320px; }

@media (max-width: 1300px) {
  .id-registry-toolbar-rebuild20 { grid-template-columns: 1fr 180px 260px 82px 88px; }
}
@media (max-width: 1100px) {
  .id-registry-toolbar-rebuild20 { grid-template-columns: 1fr 1fr; }
  .id-registry-toolbar-rebuild20 .id-registry-code-inline { grid-column: 1 / -1; }
}

/* Rebuild 21 — Главный лист и задачи */
.main-topbar-rebuild21 {
  align-items: flex-start;
}

.main-dashboard-rebuild21 {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.main-stat-card {
  background: #ffffff;
  border: 1px solid #d9e2ef;
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.main-stat-card span {
  display: block;
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.main-stat-card strong {
  display: block;
  margin-top: 5px;
  font-size: 30px;
  line-height: 1;
  color: #0f172a;
}

.main-stat-card.alert {
  border-color: #fecaca;
  background: #fff7f7;
}

.main-task-card-rebuild21 {
  margin-bottom: 14px;
}

.main-task-filter-line {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px 240px auto;
  gap: 10px;
  align-items: center;
  margin: 12px 0 16px;
}

.task-list-rebuild21 {
  display: grid;
  gap: 12px;
}

.task-card-rebuild21 {
  background: #ffffff;
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);
}

.task-card-rebuild21.overdue {
  border-color: #fecaca;
  background: linear-gradient(0deg, #fffafa, #ffffff);
}

.task-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.task-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 15px;
}

.task-meta-rebuild21 {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
}

.task-assignee-chip,
.count-pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.task-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
}

.task-status-new { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.task-status-work { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.task-status-review { background: #f3e8ff; color: #7e22ce; border-color: #e9d5ff; }
.task-status-done { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.task-status-revision { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

.task-description-preview {
  margin: 10px 0;
  color: #334155;
  line-height: 1.45;
}

.task-grid-mini {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
  font-size: 12px;
  color: #64748b;
  margin-top: 10px;
}

.task-file-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  vertical-align: middle;
}

.task-file-link {
  padding: 2px 7px;
  font-size: 12px;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.task-return-reason,
.task-work-result,
.linked-task-note {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  color: #475569;
}

.task-return-reason {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.main-columns-rebuild21 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.main-columns-rebuild21 .task-card-rebuild21 {
  margin-top: 10px;
  box-shadow: none;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2 {
  margin: 0;
}

.task-process-card-rebuild21 {
  margin-bottom: 24px;
}

.task-process-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.task-process-step {
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  padding: 12px;
  background: #f8fafc;
}

.task-process-step strong {
  display: block;
  margin-bottom: 7px;
  color: #0f172a;
}

.task-process-step span {
  display: block;
  color: #64748b;
  font-size: 13px;
  line-height: 1.4;
}

.task-modal-rebuild21 {
  max-width: 860px;
}

.task-form-grid-rebuild21 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.task-form-grid-rebuild21 .full {
  grid-column: 1 / -1;
}

@media (max-width: 1180px) {
  .main-dashboard-rebuild21,
  .task-process-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .main-columns-rebuild21 {
    grid-template-columns: 1fr;
  }
  .main-task-filter-line {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .main-dashboard-rebuild21,
  .task-process-grid,
  .main-task-filter-line,
  .task-grid-mini,
  .task-form-grid-rebuild21 {
    grid-template-columns: 1fr;
  }
  .task-card-top {
    flex-direction: column;
  }
}

/* ==============================
   Rebuild 23 — общий визуальный стиль + Реестр ИД
============================== */
:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #d7dee8;
  --line-soft: #e8edf4;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
  --radius: 16px;
  --radius-sm: 10px;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}
body {
  background: radial-gradient(circle at 30% -20%, rgba(37, 99, 235, .06), transparent 34%), var(--bg);
  color: var(--text);
  font-feature-settings: "cv02", "cv03", "cv04";
}
.sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #111827 52%, #0b1220 100%);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.06);
}
.logo-mark { background: linear-gradient(135deg, #38bdf8, #2563eb 58%, #4338ca); }
.nav button,
.sidebar nav button {
  border: 1px solid transparent;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}
.nav button.active,
.nav button:hover,
.sidebar nav button.active,
.sidebar nav button:hover {
  background: rgba(255, 255, 255, 0.105);
  border-color: rgba(255, 255, 255, .08);
  transform: translateX(1px);
}
.main { padding: 24px; }
.card {
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}
h1 { color: #0b1220; letter-spacing: -0.035em; }
h2, h3 { color: #111827; }
.eyebrow {
  color: #475569;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.helper { color: #64748b; }
.input,
.select,
.textarea,
textarea.input {
  border-color: #d7dee8;
  background: #ffffff;
  color: #0f172a;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.input:focus,
.select:focus,
.textarea:focus,
textarea.input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .11);
  outline: none;
}
.btn {
  border-radius: 11px;
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .16);
}
.btn.secondary {
  background: #f8fafc;
  color: #1e293b;
  border: 1px solid #d7dee8;
  box-shadow: none;
}
.icon-btn { border: 1px solid transparent; }
.wide-table {
  border-collapse: separate;
  border-spacing: 0;
}
.wide-table th {
  background: #edf3fb;
  color: #243b63;
  border-bottom: 1px solid #cbd7e6;
  font-weight: 850;
}
.wide-table td { border-bottom-color: #e6ecf3; }
.wide-table tbody tr:hover td { background: #f8fbff; }
.badge,
.count-pill,
.status-pill,
.row-subtitle { letter-spacing: -.005em; }

/* Rebuild 23 — Реестр ИД: более компактное и табличное раскрытие */
.id-registry-table-rebuild20 { min-width: 1610px; }
.id-registry-table-rebuild20 col.col-work { width: 286px; }
.id-registry-table-rebuild20 col.col-note { width: 210px; }
.id-registry-table-rebuild20 col.col-idstatus { width: 168px; }
.id-registry-table-rebuild20 col.col-aosrstatus { width: 178px; }
.id-registry-table-rebuild20 thead th {
  background: linear-gradient(180deg, #eaf2ff 0%, #dbeafe 100%);
  color: #1e3a8a;
  border-right: 1px solid #c7d7ee;
  border-bottom: 1px solid #9dbdeb;
}
.rebuild22-details-row > td { background: #f7faff !important; }
.rebuild22-details-card {
  min-width: 1610px;
  padding: 8px 0 10px;
  background: linear-gradient(180deg, #f1f7ff 0%, #f8fafc 100%);
  border-top: 1px solid #b7cff4;
}
.id-registry-details-grid-rebuild22 {
  grid-template-columns: 38px 112px 124px 286px 152px 44px 44px 210px 136px 168px 178px 134px 40px;
  row-gap: 7px;
}
.rebuild22-updated {
  grid-column: 2 / 6;
  min-height: 46px;
  padding: 7px 10px;
  display: grid;
  align-content: center;
  border-color: #d7e4f7;
}
.rebuild22-id-panel { grid-column: 10 / 11; }
.rebuild22-aosr-panel { grid-column: 11 / 12; }
.rebuild22-ks2-cell { grid-column: 12 / 13; }
.rebuild22-material-area {
  grid-column: 2 / 13;
  padding: 9px;
  border-color: #d7dee8;
  box-shadow: 0 4px 12px rgba(15,23,42,.04);
}
.rebuild22-status-panel,
.rebuild22-ks2-panel {
  min-height: 152px;
  padding: 7px;
  border-color: #d7e4f7;
}
.rebuild22-status-panel h3,
.rebuild22-ks2-panel h3 {
  margin-bottom: 6px;
  color: #1e3a8a;
}
.rebuild22-status-panel .compact-executor-row { margin-bottom: 7px; }
.rebuild22-file-list .id-registry-file-row {
  padding: 6px;
  background: #f8fafc;
}
.rebuild22-file-list .id-registry-file-row strong { font-size: 10.8px; }
.rebuild22-file-list .id-registry-file-row .row-subtitle { max-width: 142px; }
.rebuild22-ks2-panel .id-registry-file-row .row-subtitle { max-width: 112px; }
.rebuild22-dnr .id-registry-detail-date-field,
.rebuild22-dor .id-registry-detail-date-field { background: transparent; }

.rebuild22-used-material { width: 100%; }
.used-material-table-wrap {
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  overflow: auto;
  background: #fff;
}
.used-material-table-rebuild22 {
  min-width: 1180px;
  table-layout: fixed;
}
.used-material-table-rebuild22 th {
  text-align: center;
  background: #f1f5fb;
  color: #334155;
  font-size: 11px;
  padding: 7px 6px;
}
.used-material-table-rebuild22 td {
  vertical-align: middle;
  padding: 7px 8px;
  border-right: 1px solid #edf2f7;
}
.used-material-table-rebuild22 th:nth-child(1),
.used-material-table-rebuild22 td:nth-child(1) { width: 110px; }
.used-material-table-rebuild22 th:nth-child(2),
.used-material-table-rebuild22 td:nth-child(2) { width: 330px; }
.used-material-table-rebuild22 th:nth-child(3),
.used-material-table-rebuild22 td:nth-child(3) { width: 140px; text-align: right; }
.used-material-table-rebuild22 th:nth-child(4),
.used-material-table-rebuild22 td:nth-child(4) { width: 125px; }
.used-material-table-rebuild22 th:nth-child(5),
.used-material-table-rebuild22 td:nth-child(5) { width: 165px; }
.used-material-table-rebuild22 th:nth-child(6),
.used-material-table-rebuild22 td:nth-child(6) { width: 230px; }
.used-material-table-rebuild22 th:nth-child(7),
.used-material-table-rebuild22 td:nth-child(7) { width: 42px; text-align: center; }
.used-material-qty-input {
  height: 30px;
  min-height: 30px;
  text-align: right;
  font-weight: 750;
}
.id-registry-material-quality-cell .quality-doc-icons {
  justify-content: flex-start;
  gap: 4px;
}
.id-registry-material-quality-cell .quality-doc-icon {
  width: 30px;
  min-width: 30px;
  height: 28px;
  font-size: 10px;
  border-radius: 9px;
}
.id-registry-material-quality-cell .quality-doc-icon.is-complete { background: #dcfce7; color: #166534; border-color: #86efac; }
.id-registry-material-quality-cell .quality-doc-icon.is-file-only { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.id-registry-material-quality-cell .quality-doc-icon.is-meta-only { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.id-registry-material-quality-cell .quality-doc-icon.is-empty { background: #f8fafc; color: #94a3b8; border-color: #dbe4ef; }
.id-registry-quality-doc-modal { width: min(760px, 94vw); }
.material-picker-table tr.is-selected td { background: #f0fdf4; }
.material-picker-table tr.is-selected td:first-child { box-shadow: inset 3px 0 0 #22c55e; }
.accumulative-table-rebuild22 { min-width: 1360px; }
.accumulative-table-rebuild22 .closed-by-id-cell {
  font-weight: 850;
  color: #166534;
  background: #f0fdf4;
}

@media (max-width: 1100px) {
  .main { padding: 18px; }
  .id-registry-table-wrap-rebuild20 { margin-left: -8px; margin-right: -8px; }
}

/* Rebuild 24 — единый стиль заголовков таблиц и компактные таблицы */
:root {
  --table-head-bg: #e8eef7;
  --table-head-text: #223049;
  --table-border: #d8e1ee;
  --table-row-border: #e5ebf3;
}
.wide-table thead th,
.table thead th,
.requests-table thead th,
.spec-table thead th,
.registry-table thead th,
.invoices-table thead th,
.contracts-table thead th,
.orders-table thead th,
.id-registry-table-rebuild18 thead th,
.accumulative-table-rebuild24 thead th,
.used-material-table-rebuild22 thead th,
.material-picker-table thead th,
.quality-doc-details-table thead th {
  background: var(--table-head-bg) !important;
  color: var(--table-head-text) !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
  font-weight: 800 !important;
  letter-spacing: .015em !important;
  text-align: center !important;
  vertical-align: middle !important;
  border: 1px solid var(--table-border) !important;
  padding: 8px 10px !important;
}
.wide-table tbody td,
.table tbody td,
.requests-table tbody td,
.spec-table tbody td,
.registry-table tbody td,
.invoices-table tbody td,
.contracts-table tbody td,
.orders-table tbody td,
.id-registry-table-rebuild18 tbody td,
.accumulative-table-rebuild24 tbody td,
.used-material-table-rebuild22 tbody td,
.material-picker-table tbody td,
.quality-doc-details-table tbody td {
  border: 1px solid var(--table-row-border) !important;
  vertical-align: middle;
}
.id-registry-toolbar-rebuild24 {
  display: grid !important;
  grid-template-columns: minmax(220px, 1.1fr) minmax(180px, .9fr) minmax(190px, .8fr) auto auto;
  gap: 10px;
  align-items: center;
}
.id-registry-toolbar-rebuild24 .id-registry-search-input,
.id-registry-toolbar-rebuild24 .id-registry-object-filter,
.id-registry-toolbar-rebuild24 .id-registry-code-inline {
  min-width: 0;
  width: 100%;
}
.id-registry-toolbar-rebuild24 .compact-toolbar-btn {
  white-space: nowrap;
  min-height: 38px;
}
.id-registry-main-row .id-registry-number-chip,
.id-registry-main-row .input,
.id-registry-main-row .select {
  min-height: 32px;
}
.accumulative-quality-docs-cell .quality-doc-icons {
  justify-content: center;
  flex-wrap: nowrap;
}
.accumulative-quality-docs-cell .quality-doc-icon {
  width: 30px;
  height: 30px;
  font-size: 11px;
}
@media (max-width: 1200px) {
  .id-registry-toolbar-rebuild24 {
    grid-template-columns: 1fr 1fr;
  }
  .id-registry-toolbar-rebuild24 .compact-toolbar-btn {
    width: 100%;
  }
}

/* Rebuild 25 — Главный: таблица задач, черновики, просмотр и история */
.task-status-draft {
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}
.main-task-filter-line-rebuild25 {
  grid-template-columns: minmax(220px, 1.4fr) minmax(150px, .7fr) minmax(170px, .8fr) minmax(160px, .7fr) auto auto;
  align-items: center;
}
.tasks-table-wrap-rebuild25 {
  max-height: 58vh;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: auto;
}
.tasks-table-rebuild25 {
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
}
.tasks-table-rebuild25 th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: center;
  white-space: nowrap;
}
.tasks-table-rebuild25 td {
  vertical-align: top;
  padding-top: 10px;
  padding-bottom: 10px;
}
.table-sort-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
  text-align: center;
}
.table-sort-btn.active {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.task-title-link {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--brand, #2563eb);
  font-weight: 800;
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.task-subline {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.25;
}
.muted-text { color: var(--muted); }
.danger-text { color: #b91c1c; font-weight: 700; }
.task-type-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #334155;
}
.task-type-chip.linked {
  background: #eef2ff;
  color: #3730a3;
  border-color: #c7d2fe;
}
.task-table-actions,
.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.task-table-actions .btn.small,
.task-actions .btn.small {
  padding: 6px 9px;
  min-height: 30px;
  line-height: 1;
}
.task-row-rebuild25.is-overdue td {
  background: #fff7ed;
}
.task-modal-rebuild25 {
  width: min(980px, calc(100vw - 32px));
}
.task-view-modal-rebuild25,
.task-history-modal-rebuild25 {
  width: min(1050px, calc(100vw - 32px));
}
.task-view-grid-rebuild25 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.task-view-card {
  border: 1px solid var(--line);
  background: var(--surface-2, #f8fafc);
  border-radius: 14px;
  padding: 12px;
}
.task-view-card.full {
  grid-column: 1 / -1;
}
.task-view-card label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.task-view-card p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
}
.task-view-footer-rebuild25 {
  gap: 8px;
  flex-wrap: wrap;
}
.task-history-list-rebuild25 {
  display: grid;
  gap: 10px;
}
.task-history-item-rebuild25 {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface-2, #f8fafc);
}
.task-history-item-rebuild25 span,
.task-history-item-rebuild25 time {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.main-columns-rebuild25 {
  grid-template-columns: 1fr;
}
.main-columns-rebuild25 .tasks-table-wrap-rebuild25 {
  max-height: 360px;
}
@media (max-width: 900px) {
  .main-task-filter-line-rebuild25 {
    grid-template-columns: 1fr;
  }
  .task-view-grid-rebuild25 {
    grid-template-columns: 1fr;
  }
}

/* Rebuild 26 — compact Реестр ИД + План развития */
.rebuild26-details-card {
  min-width: 1580px;
  padding: 8px 0;
  background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
}
.id-registry-details-grid-rebuild26 {
  grid-template-columns: 38px 112px 124px 300px 152px 44px 44px 230px 136px 174px 184px 134px 40px;
  row-gap: 6px;
}
.rebuild26-updated {
  min-height: 42px;
  padding: 6px 8px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.rebuild26-date-field {
  min-height: 42px;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
}
.rebuild26-date-field label {
  padding: 2px 4px;
  font-size: 9.5px;
  background: transparent;
  color: #64748b;
}
.rebuild26-id-date-input {
  height: 26px;
  min-height: 26px;
  padding: 4px 5px;
  font-size: 11px;
  text-align: center;
  border-radius: 8px;
}
.rebuild26-status-panel,
.rebuild26-ks2-panel {
  min-height: 118px;
  padding: 7px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #dbe4ef;
}
.rebuild26-status-panel h3,
.rebuild26-ks2-panel h3 {
  margin: 0 0 2px;
  font-size: 11px;
  line-height: 1.2;
  color: #0f172a;
}
.rebuild26-status-panel .compact-helper,
.rebuild26-ks2-panel .compact-helper {
  margin: 0 0 5px;
  font-size: 10px;
  line-height: 1.25;
}
.rebuild26-status-panel .form-row,
.rebuild26-ks2-panel .form-row { gap: 4px; }
.rebuild26-status-panel .form-row label { font-size: 9.8px; }
.rebuild26-status-panel .select { min-height: 28px; height: 28px; font-size: 11px; padding: 4px 22px 4px 7px; }
.rebuild26-file-list { gap: 4px; }
.rebuild26-file-list .id-registry-file-row {
  padding: 4px 5px;
  min-height: 30px;
  border-radius: 9px;
}
.rebuild26-file-list .id-registry-file-row strong { font-size: 10px; }
.rebuild26-file-list .id-registry-file-row .row-subtitle { font-size: 9.5px; max-width: 132px; }
.rebuild26-ks2-panel .rebuild26-file-list .id-registry-file-row .row-subtitle { max-width: 92px; }
.rebuild26-material-area {
  padding: 7px 8px;
  border-radius: 12px;
}
.rebuild26-used-material-main {
  align-items: center;
  gap: 10px;
}
.used-material-actions-rebuild26 { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.used-material-collapsed-summary {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.used-material-collapsed-summary span {
  display: inline-flex;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid #dbeafe;
  color: #1e40af;
  background: #eff6ff;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 750;
}
.rebuild26-used-material-table-wrap { margin-top: 8px; max-height: 260px; }
.rebuild26-used-material-table th { background: #eaf1fb; color: #243449; }
.rebuild26-material-actions { margin-top: 8px; display: flex; justify-content: flex-end; }
.roadmap-rebuild26-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 18px;
  align-items: start;
}
.roadmap-rebuild26-layout .full-width { grid-column: 1 / -1; }
.roadmap-architecture-grid,
.roadmap-stage-list,
.roadmap-test-list { display: grid; gap: 10px; }
.roadmap-architecture-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.roadmap-arch-option,
.roadmap-stage,
.roadmap-test-list > div {
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px;
}
.roadmap-arch-option span,
.roadmap-stage span,
.roadmap-test-list span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}
.roadmap-arch-option strong,
.roadmap-stage strong,
.roadmap-test-list strong { color: #0f172a; }
.roadmap-arch-option p,
.roadmap-stage p { margin: 6px 0 0; color: #475569; font-size: 13px; line-height: 1.45; }
.roadmap-stage-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1200px) {
  .roadmap-architecture-grid,
  .roadmap-stage-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .roadmap-rebuild26-layout,
  .roadmap-architecture-grid,
  .roadmap-stage-list { grid-template-columns: 1fr; }
}

/* Rebuild 27 — сотрудники, роли и доступ */
.sidebar-user-role-switch-rebuild27 {
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
}
.sidebar-user-role-switch-rebuild27 label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
  font-weight: 800;
}
.sidebar-user-role-switch-rebuild27 .select {
  width: 100%;
  min-height: 32px;
  font-size: 12px;
  padding: 5px 8px;
}
.sidebar-user-role-switch-rebuild27 small {
  display: block;
  line-height: 1.25;
  color: #64748b;
}
.sidebar-nav-btn.is-locked {
  opacity: .58;
  cursor: not-allowed;
}
.sidebar-nav-btn.is-readonly span:first-child::after {
  content: '';
}
.sidebar-access-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 11px;
  font-weight: 800;
}
.sidebar-access-badge.readonly {
  background: #e0f2fe;
  color: #075985;
}
.employees-topbar-rebuild27 h1 {
  margin-bottom: 4px;
}
.employees-summary-rebuild27 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.employees-active-card-rebuild27 {
  display: grid;
  gap: 3px;
  padding: 10px 14px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  min-width: 260px;
}
.employees-active-card-rebuild27 span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.employees-active-card-rebuild27 strong {
  color: #0f172a;
  font-size: 18px;
}
.employees-active-card-rebuild27 small {
  color: #475569;
}
.employees-toolbar-rebuild27 {
  justify-content: flex-end;
  flex-wrap: wrap;
}
.employees-table-rebuild27 th,
.access-matrix-table-rebuild27 th {
  background: #1f2937;
  color: #f8fafc;
  font-family: Inter, Arial, sans-serif;
  font-size: 12px;
  text-align: center;
  vertical-align: middle;
}
.employees-table-rebuild27 td,
.access-matrix-table-rebuild27 td {
  border: 1px solid #e2e8f0;
  vertical-align: top;
}
.employees-table-rebuild27 .table-input {
  min-width: 120px;
  height: 34px;
  padding: 5px 8px;
}
.employees-table-rebuild27 select.select {
  min-width: 145px;
}
.employee-objects-select-rebuild27 {
  margin-top: 6px;
  width: 220px;
  min-height: 60px;
  font-size: 12px;
}
.employees-table-rebuild27 tr.is-current-employee {
  box-shadow: inset 4px 0 0 #2563eb;
  background: #eff6ff;
}
.access-matrix-card-rebuild27 {
  margin-top: 16px;
}
.access-matrix-wrap-rebuild27 {
  max-height: 430px;
}
.access-matrix-table-rebuild27 {
  min-width: 1450px;
  font-size: 12px;
}
.access-matrix-table-rebuild27 td:first-child {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
}
.access-matrix-table-rebuild27 th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}
.access-matrix-table-rebuild27 td {
  max-width: 155px;
  white-space: normal;
  line-height: 1.25;
}
.access-full {
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
}
.access-view {
  background: #e0f2fe;
  color: #075985;
  font-weight: 700;
}
.access-none {
  background: #fee2e2;
  color: #991b1b;
  font-weight: 700;
}
@media (max-width: 1100px) {
  .employees-summary-rebuild27 {
    align-items: stretch;
    flex-direction: column;
  }
  .employees-toolbar-rebuild27 {
    justify-content: flex-start;
  }
}

/* Rebuild 28 — сотрудники, роли, уведомления */
.employee-object-picker-rebuild28 {
  min-width: 220px;
  display: grid;
  gap: 8px;
}
.employee-object-mode-row-rebuild28 {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.segmented-btn {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.segmented-btn.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}
.employee-object-counter-rebuild28 {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
}
.employee-object-checkboxes-rebuild28 {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 320px;
  max-height: 86px;
  overflow: auto;
  padding: 2px;
}
.employee-object-chip-rebuild28 {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #dbe3ef;
  background: #fff;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.employee-object-chip-rebuild28.checked {
  background: #eef6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.employee-object-chip-rebuild28 input { margin: 0; }
.employee-object-actions-rebuild28 {
  display: flex;
  gap: 10px;
  align-items: center;
}
.link-btn {
  border: 0;
  background: transparent;
  color: #2563eb;
  padding: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.employee-object-summary-rebuild28 { margin: 0; }
.employees-table-rebuild28 th:nth-child(6),
.employees-table-rebuild28 td:nth-child(6) { min-width: 250px; }
.access-matrix-toolbar-rebuild28 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 12px;
}
.access-cell-select-rebuild28 {
  min-width: 142px;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 10px;
}
.access-matrix-table-rebuild28 td {
  vertical-align: middle;
  padding: 6px;
}
.notifications-framework-rebuild28 {
  border-style: dashed;
  background: #fbfdff;
}
.sidebar-nav-btn.is-readonly span:first-child::after {
  content: ' · просмотр';
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
}

/* Rebuild 29 — единый стиль таблиц и задачи */
.crm-table,
.entity-table-rebuild29,
.object-contracts-compact-rebuild29,
.object-projects-compact-rebuild29 {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  background: #fff;
}
.entity-table-wrap-rebuild29,
.object-drawer-table-wrap-rebuild29 {
  border: 1px solid #d6deea;
  border-radius: 14px;
  overflow: auto;
  background: #fff;
}
.crm-table thead th,
.entity-table-rebuild29 thead th,
.object-contracts-compact-rebuild29 thead th,
.object-projects-compact-rebuild29 thead th {
  background: linear-gradient(180deg, #eaf1fb 0%, #dbe7f5 100%);
  color: #14213d;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: .025em;
  text-transform: none;
  text-align: center;
  vertical-align: middle;
  padding: 9px 10px;
  border-right: 1px solid #c9d5e5;
  border-bottom: 1px solid #bdcce0;
  white-space: nowrap;
}
.crm-table thead th:last-child,
.entity-table-rebuild29 thead th:last-child,
.object-contracts-compact-rebuild29 thead th:last-child,
.object-projects-compact-rebuild29 thead th:last-child { border-right: 0; }
.crm-table tbody td,
.entity-table-rebuild29 tbody td,
.object-contracts-compact-rebuild29 tbody td,
.object-projects-compact-rebuild29 tbody td {
  padding: 9px 10px;
  border-right: 1px solid #e4eaf2;
  border-bottom: 1px solid #e4eaf2;
  vertical-align: middle;
}
.crm-table tbody td:last-child,
.entity-table-rebuild29 tbody td:last-child,
.object-contracts-compact-rebuild29 tbody td:last-child,
.object-projects-compact-rebuild29 tbody td:last-child { border-right: 0; }
.crm-table tbody tr:hover,
.entity-table-rebuild29 tbody tr:hover,
.object-contracts-compact-rebuild29 tbody tr:hover,
.object-projects-compact-rebuild29 tbody tr:hover { background: #f8fbff; }
.objects-table-rebuild29 th:nth-child(1), .objects-table-rebuild29 td:nth-child(1) { min-width: 230px; }
.objects-table-rebuild29 th:nth-child(2), .objects-table-rebuild29 td:nth-child(2) { min-width: 180px; }
.objects-table-rebuild29 th:nth-child(3), .objects-table-rebuild29 td:nth-child(3) { width: 120px; text-align: center; }
.objects-table-rebuild29 th:nth-child(5), .objects-table-rebuild29 td:nth-child(5) { width: 105px; text-align: center; }
.objects-table-rebuild29 th:nth-child(6), .objects-table-rebuild29 td:nth-child(6) { width: 120px; text-align: right; }
.objects-table-rebuild29 th:nth-child(7), .objects-table-rebuild29 td:nth-child(7),
.objects-table-rebuild29 th:nth-child(8), .objects-table-rebuild29 td:nth-child(8) { width: 82px; text-align: center; }
.customers-table-rebuild29 th:nth-child(1), .customers-table-rebuild29 td:nth-child(1) { min-width: 260px; }
.customers-table-rebuild29 th:nth-child(3), .customers-table-rebuild29 td:nth-child(3) { min-width: 220px; }
.customers-table-rebuild29 th:nth-child(4), .customers-table-rebuild29 td:nth-child(4) { width: 135px; }
.customers-table-rebuild29 th:nth-child(5), .customers-table-rebuild29 td:nth-child(5) { width: 90px; text-align: center; }
.projects-table-rebuild29 th:nth-child(1), .projects-table-rebuild29 td:nth-child(1) { width: 190px; }
.projects-table-rebuild29 th:nth-child(2), .projects-table-rebuild29 td:nth-child(2) { min-width: 260px; }
.projects-table-rebuild29 th:nth-child(4), .projects-table-rebuild29 td:nth-child(4) { width: 115px; text-align: center; }
.projects-table-rebuild29 th:nth-child(6), .projects-table-rebuild29 td:nth-child(6) { width: 80px; text-align: center; }
.project-section-chip-rebuild29 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 999px;
  color: #102033;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
}
.contract-title-file-link-rebuild29 {
  color: #0f4c81;
  text-decoration: none;
  border-bottom: 1px dashed rgba(15, 76, 129, .35);
}
.contract-title-file-link-rebuild29:hover { color: #0b63ce; border-bottom-color: currentColor; }
.object-contracts-compact-rebuild29 th:nth-child(1), .object-contracts-compact-rebuild29 td:nth-child(1) { min-width: 280px; }
.object-contracts-compact-rebuild29 th:nth-child(2), .object-contracts-compact-rebuild29 td:nth-child(2),
.object-contracts-compact-rebuild29 th:nth-child(3), .object-contracts-compact-rebuild29 td:nth-child(3) { width: 150px; text-align: center; }
.object-projects-compact-rebuild29 th:nth-child(1), .object-projects-compact-rebuild29 td:nth-child(1) { width: 190px; }
.object-projects-compact-rebuild29 th:nth-child(2), .object-projects-compact-rebuild29 td:nth-child(2) { min-width: 280px; }
.object-projects-compact-rebuild29 th:nth-child(3), .object-projects-compact-rebuild29 td:nth-child(3) { width: 220px; }
.task-history-modal-rebuild29 { max-width: 980px; }
.task-history-exec-block-rebuild29 {
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  background: #f8fbff;
  padding: 14px;
  margin-bottom: 14px;
}
.task-exec-text-item-rebuild29 {
  margin: 10px 0 0 calc(var(--task-level, 0) * 18px);
  padding: 12px 13px;
  border: 1px solid #d9e4f2;
  border-radius: 14px;
  background: #fff;
}
.task-exec-text-head-rebuild29 {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #13233a;
}
.task-exec-text-head-rebuild29 span { color: #64748b; font-size: 12px; }
.task-exec-text-item-rebuild29 p { white-space: pre-wrap; margin: 8px 0 0; color: #1f2937; }
.task-history-divider-rebuild29 { height: 1px; background: #e2e8f0; margin: 12px 0; }
.task-history-item-rebuild29 { margin-left: calc(var(--task-level, 0) * 18px); }
.task-history-item-rebuild29 span { display: block; color: #64748b; font-size: 12px; margin-top: 2px; }

/* Rebuild 30 — local UI fixes */
.object-card-fit-wrap-r30 {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.object-card-fit-wrap-r30 .crm-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
.object-contracts-fit-r30 th,
.object-contracts-fit-r30 td,
.object-projects-fit-r30 th,
.object-projects-fit-r30 td {
  padding: 8px 9px;
  vertical-align: middle;
  white-space: normal;
  word-break: break-word;
}
.object-card-file-link-r30,
.object-card-file-btn-r30 {
  max-width: 100%;
  display: inline-flex;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.object-card-file-link-r30 {
  font-weight: 700;
  color: #1d4ed8;
  text-decoration: none;
}
.muted-link-r30 {
  color: #64748b;
}
.object-projects-fit-r30 .project-section-chip-r30 {
  max-width: 100%;
  white-space: normal;
  line-height: 1.15;
}
.compact-drawer-head-r30 {
  gap: 12px;
}
.projects-table-r30 th,
.projects-table-r30 td {
  vertical-align: middle;
}
.project-section-chip-r30 {
  border: 1px solid rgba(15, 23, 42, .08);
  color: #0f172a;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
}
.object-open-link-r30 {
  white-space: nowrap;
  font-size: 12px;
}
.invoice-filter-toolbar-r30,
.requests-top-filter-row-r30 {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 260px) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
}
.invoice-status-filter-panel-r30,
.status-filter-panel {
  margin-top: 10px;
}
.invoice-status-filter-r30 {
  border-color: rgba(15, 23, 42, .12);
}
.role-from-employee-r30 {
  border: 1px solid rgba(37, 99, 235, .16);
  background: linear-gradient(135deg, rgba(239,246,255,.92), rgba(255,255,255,.98));
}
@media (max-width: 980px) {
  .invoice-filter-toolbar-r30,
  .requests-top-filter-row-r30 {
    grid-template-columns: 1fr;
  }
}

/* Rebuild 31 — statuses, active filters, journals, date picker */
.payment-select.payment-in_payment,
.payment-in_payment,
.status-filter-btn.payment-in_payment,
.status-filter-btn.invoice-in_payment,
.payment-status-option.payment-in_payment {
  background: #e0f2fe !important;
  border-color: #7dd3fc !important;
  color: #0369a1 !important;
}
.badge.payment-in_payment { background: #e0f2fe; color: #0369a1; }
.filter-panel-active {
  border-width: 2px !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.65), 0 8px 20px rgba(15, 23, 42, .08);
}
.filter-panel-active .status-filter-title { color: inherit; }
.filter-panel-active .status-filter-reset { background: rgba(255,255,255,.72); }
.invoice-status-filter-r30.payment-in_payment,
.invoice-status-filter-r30.invoice-in_payment { background: #e0f2fe; color: #0369a1; border-color: #7dd3fc; }

.journals-toolbar-r31 {
  display: grid;
  grid-template-columns: auto minmax(260px, 420px);
  align-items: center;
  justify-content: start;
  gap: 10px;
}
.journal-table-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0 10px;
}
.general-journal-table {
  min-width: 1420px;
}
.general-journal-table th {
  text-align: center;
  vertical-align: middle;
}
.general-journal-table th:nth-child(1) { width: 130px; }
.general-journal-table th:nth-child(2) { width: 150px; }
.general-journal-table th:nth-child(3) { width: 120px; }
.general-journal-table th:nth-child(4) { width: 190px; }
.general-journal-table th:nth-child(5) { width: 150px; }
.general-journal-table th:nth-child(6) { width: 320px; }
.general-journal-table th:nth-child(7) { width: 90px; }
.general-journal-table th:nth-child(8) { width: 110px; }
.general-journal-table th:nth-child(9) { width: 260px; }
.general-journal-table th:nth-child(10) { width: 190px; }
.general-journal-table td { vertical-align: top; }
.general-journal-table .input,
.general-journal-table .textarea {
  width: 100%;
  min-width: 0;
  font-size: 12px;
  padding: 6px 7px;
  border-radius: 8px;
}
.general-journal-table .journal-date { min-width: 112px; }
.general-journal-table .compact-number { min-width: 76px; text-align: right; }
.general-journal-table .compact-unit { min-width: 60px; text-align: center; }
.general-journal-table .journal-textarea {
  min-height: 34px;
  resize: vertical;
}
.general-journal-table .journal-description { min-height: 38px; }
.date-picker-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 42px;
  gap: 8px;
  align-items: center;
  position: relative;
}
.date-picker-btn {
  height: 38px;
  width: 42px;
  border-radius: 10px;
}
.native-date-hidden {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Rebuild 32 — приказы: красивый календарь + Реестр ИД раскрытие по колонкам */
.object-pill-compat-r32 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}
.object-pill-code {
  display: inline-flex;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 10px;
}
.fancy-date-row-r32 {
  grid-template-columns: minmax(150px, 1fr) 42px;
}
.fancy-date-trigger-r32 {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #bfdbfe;
  box-shadow: 0 6px 14px rgba(37, 99, 235, .12);
}
.fancy-date-picker-r32 {
  position: absolute;
  z-index: 9999;
  width: 314px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .22);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
.fancy-date-head-r32 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.fancy-date-head-r32 strong {
  color: #0f172a;
  font-size: 14px;
  letter-spacing: .01em;
}
.fancy-date-weekdays-r32,
.fancy-date-grid-r32 {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.fancy-date-weekdays-r32 span {
  text-align: center;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.date-cell-r32 {
  height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.date-cell-r32:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}
.date-cell-r32.today {
  border-color: #60a5fa;
  color: #1d4ed8;
}
.date-cell-r32.selected {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 8px 16px rgba(37, 99, 235, .24);
}
.date-cell-r32.muted {
  background: transparent;
  pointer-events: none;
}
.fancy-date-footer-r32 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
}

.rebuild32-details-card {
  min-width: 1580px;
  padding: 7px 0 9px;
  background: linear-gradient(180deg, #f8fbff 0%, #f5f7fb 100%);
}
.id-registry-details-grid-rebuild32 {
  grid-template-columns: 38px 112px 124px 300px 152px 44px 44px 230px 136px 174px 184px 134px 40px;
  row-gap: 6px;
  align-items: start;
}
.rebuild32-updated {
  grid-column: 2 / 3 !important;
  width: 112px;
  min-height: 42px;
  padding: 6px 7px;
  border-radius: 10px;
  box-sizing: border-box;
  overflow: hidden;
}
.rebuild32-updated strong {
  font-size: 11px;
  line-height: 1.15;
}
.rebuild32-dnr {
  grid-column: 3 / 4 !important;
  width: 124px;
  padding: 0 4px;
  box-sizing: border-box;
}
.rebuild32-dor {
  grid-column: 4 / 5 !important;
  width: 124px;
  padding: 0 4px;
  box-sizing: border-box;
}
.rebuild32-id-panel {
  grid-column: 9 / 10 !important;
  width: 204px;
  padding: 0 4px;
  box-sizing: border-box;
}
.rebuild32-aosr-panel {
  grid-column: 11 / 12 !important;
  width: 204px;
  padding: 0 4px;
  box-sizing: border-box;
}
.rebuild32-ks2-cell {
  grid-column: 12 / 13 !important;
  width: 134px;
  padding: 0 4px;
  box-sizing: border-box;
}
.rebuild32-status-panel,
.rebuild32-ks2-panel {
  min-height: 104px;
  padding: 6px;
  border-radius: 11px;
  box-sizing: border-box;
}
.rebuild32-status-panel h3,
.rebuild32-ks2-panel h3 {
  margin: 0 0 3px;
  font-size: 11px;
  line-height: 1.15;
}
.rebuild32-status-panel .compact-helper,
.rebuild32-ks2-panel .compact-helper {
  display: none;
}
.rebuild32-status-panel .compact-executor-row {
  margin-bottom: 5px;
}
.rebuild32-status-panel .compact-executor-row label {
  font-size: 9.5px;
}
.rebuild32-file-list .id-registry-file-row {
  padding: 5px;
  gap: 4px;
  border-radius: 9px;
}
.rebuild32-file-list .id-registry-file-row strong {
  font-size: 10px;
}
.rebuild32-file-list .id-registry-file-row .row-subtitle {
  max-width: 114px;
  font-size: 9px;
}
.rebuild32-ks2-panel .id-registry-file-row .row-subtitle {
  max-width: 84px;
}
.rebuild32-material-area {
  grid-column: 2 / 13 !important;
  padding: 7px 8px;
  border-radius: 12px;
  min-height: 34px;
}
.rebuild32-used-material-empty {
  min-height: 28px !important;
  padding: 5px 8px !important;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  background: #f8fafc;
}
.rebuild32-used-material-empty strong {
  font-size: 12px;
}
.rebuild32-used-material-empty .row-subtitle {
  margin: 0;
}
.rebuild32-used-material-main {
  min-height: 34px;
  padding: 5px 8px;
}
.rebuild32-used-material-summary {
  padding: 5px 8px 2px;
}
.rebuild32-material-actions {
  margin-top: 6px;
}
.rebuild32-dnr .rebuild26-date-field,
.rebuild32-dor .rebuild26-date-field {
  min-height: 42px;
  padding: 4px;
}
.rebuild32-dnr .rebuild26-id-date-input,
.rebuild32-dor .rebuild26-id-date-input {
  height: 24px;
  min-height: 24px;
  font-size: 10.5px;
}

/* Rebuild 33 — local refinements */
.contracts-table-r33 th:nth-child(1) { min-width: 240px; }
.contracts-table-r33 th:nth-child(2),
.contracts-table-r33 td:nth-child(2) { min-width: 180px; }
.counterparty-chip-r33 {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef6ff;
  color: #0f3f73;
  border: 1px solid #bfdbfe;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nested-field-r33 {
  padding: 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}
.projects-table-r33 .object-chip {
  max-width: 180px;
  justify-content: center;
  font-weight: 800;
}
.project-actions-r33 {
  min-width: 255px;
  gap: 6px;
  flex-wrap: wrap;
}
.project-action-btn-r33 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1f2937;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.project-action-btn-r33.open {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.project-action-btn-r33.version {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #047857;
}
.project-action-btn-r33.danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
.project-action-btn-r33:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, .12);
}
.object-projects-fit-r33,
.object-contracts-fit-r33 {
  width: 100%;
  table-layout: fixed;
}
.id-registry-details-row.rebuild33-details-row > td {
  background: #f8fafc;
  padding: 10px 12px 14px;
}
.rebuild33-details-card {
  border: 1px solid #dbe4ef;
  border-radius: 16px;
  background: #ffffff;
  padding: 10px;
  overflow-x: auto;
}
.id-registry-layout-toolbar-r33 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.id-registry-details-grid-r33 {
  display: grid;
  grid-template-columns: repeat(12, minmax(70px, 1fr));
  grid-auto-rows: minmax(44px, auto);
  gap: 8px;
  align-items: start;
  min-width: 1120px;
}
.r33-field {
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
}
.r33-field > .id-registry-detail-panel,
.r33-field > .id-registry-date-field-r26,
.r33-field > .id-registry-used-material {
  height: 100%;
  box-sizing: border-box;
}
.r33-updated {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
.r33-material .id-registry-used-material.empty {
  min-height: 44px;
  padding: 8px 10px;
}
.r33-material .rebuild20-material-actions {
  margin-top: 6px;
}
.id-layout-editor-r33 {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}
.id-layout-editor-table-r33 th,
.id-layout-editor-table-r33 td {
  text-align: center;
  vertical-align: middle;
}
.id-layout-editor-table-r33 td:first-child {
  text-align: left;
  font-weight: 800;
}
.id-layout-editor-table-r33 .small-input {
  max-width: 82px;
  text-align: center;
}

/* Rebuild 34 — закрепленная раскладка раскрытия Реестра ИД */
.rebuild34-details-card {
  padding: 10px;
}
.id-registry-details-grid-r34 {
  grid-template-columns: 100px 128px 128px 250px 250px 250px 250px 250px 250px 80px 80px 80px;
  grid-auto-rows: minmax(42px, auto);
  min-width: 2024px;
  gap: 8px;
  align-items: start;
}
.r34-field {
  overflow: visible;
}
.r34-updated {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #f8fafc;
  box-sizing: border-box;
}
.rebuild34-date-field {
  margin: 0;
  height: 100%;
  justify-content: center;
  gap: 5px;
}
.rebuild34-date-field label,
.rebuild34-executor-row label {
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #64748b;
}
.id-registry-fancy-date-row-r34 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 5px;
}
.rebuild34-id-date-input {
  min-height: 32px;
  height: 32px;
  padding: 6px 8px;
  font-size: 12px;
}
.rebuild34-status-panel,
.rebuild34-ks2-panel {
  min-height: 100%;
  padding: 9px;
  border-radius: 14px;
  overflow: hidden;
}
.rebuild34-status-panel h3,
.rebuild34-ks2-panel h3 {
  font-size: 12px;
  line-height: 1.15;
}
.r34-panel-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.r34-panel-top .compact-helper {
  margin: 0;
  font-size: 10px;
  white-space: nowrap;
}
.rebuild34-executor-row {
  margin-bottom: 6px;
}
.rebuild34-executor-row .select {
  min-height: 30px;
  height: 30px;
  font-size: 12px;
  padding: 4px 8px;
}
.rebuild34-file-list {
  display: grid;
  gap: 6px;
}
.rebuild34-file-list.two-files-r34 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.rebuild34-file-list.one-file-r34 {
  grid-template-columns: minmax(0, 1fr);
}
.id-registry-file-cell-r34 {
  min-width: 0;
  padding: 7px;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
.id-registry-file-cell-r34.has-file {
  border-color: #9fd8b5;
  background: #f0fdf4;
}
.file-cell-head-r34 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.file-cell-head-r34 strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  color: #0f172a;
}
.file-state-r34 {
  flex: 0 0 auto;
  font-size: 9px;
  color: #64748b;
}
.id-registry-file-cell-r34.has-file .file-state-r34 {
  color: #15803d;
  font-weight: 800;
}
.file-name-r34 {
  margin-top: 4px;
  min-height: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  color: #475569;
}
.file-icon-actions-r34 {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
}
.file-action-icon-r34 {
  width: 27px;
  height: 27px;
  min-width: 27px;
  border-radius: 9px;
  font-size: 13px;
  text-decoration: none;
}
.file-action-icon-r34.disabled {
  opacity: .35;
  cursor: not-allowed;
}
.r34-material .id-registry-used-material.empty,
.r34-material .id-registry-used-material.collapsed {
  min-height: 38px;
  padding: 7px 10px;
}
.r34-material .id-registry-used-material.empty p.helper {
  margin: 2px 0 0;
  font-size: 10.5px;
}
.r34-material .rebuild34-material-actions {
  margin-top: 4px;
}


/* Rebuild 35 — локальные правки */
.rebuild35-date-field {
  position: relative;
  padding: 10px 9px 8px;
}
.rebuild35-date-field > label {
  display: block;
  padding-right: 32px;
  margin-bottom: 7px;
}
.rebuild35-date-field .id-date-corner-btn-r35 {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 9px;
  font-size: 13px;
  z-index: 2;
}
.rebuild35-id-date-input {
  height: 31px;
  min-height: 31px;
  padding: 5px 8px;
  font-size: 12px;
}
.rebuild35-details-grid {
  align-items: start;
}
.rebuild35-status-panel,
.rebuild35-ks2-panel {
  min-height: 100%;
}
.rebuild35-material-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.orders-table .object-chip {
  min-width: 120px;
  max-width: 220px;
  cursor: pointer;
}
.orders-table td:first-child {
  text-align: center;
}
