/* static/css/procurement.css
   ВАЖНО:
   - Этот файл НЕ должен ломать select2 bootstrap4 theme.
   - НИКАКИХ общих правил вида ".select2-container .select2-selection..." здесь нет.
   - Все select2-настройки живут только в custom.css (единый блок).
*/

/* =========================================================
   Таблица тендеров (manage_list)
========================================================= */

.table.tenders-table th,
.table.tenders-table td {
  vertical-align: middle;
  text-align: center;
}

.table.tenders-table thead th {
  white-space: nowrap;
  text-align: center !important;
}

.table.tenders-table thead th.th-subject {
  text-align: left !important;
}

.table.tenders-table thead th a {
  display: inline-block;
}

.table.tenders-table td.td-subject,
.table.tenders-table th.th-subject {
  text-align: left;
}

.table.tenders-table td.td-project,
.table.tenders-table td.td-type,
.table.tenders-table td.td-org {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table.tenders-table a.subject-link {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Десктоп: фиксированная сетка, предмет — гибкая колонка с троеточием */
@media (min-width: 992px) {
  .manage-table-wrap .table.tenders-table {
    table-layout: fixed;
    width: 100%;
  }

  .table.tenders-table col.tenders-col-num { width: 3%; }
  .table.tenders-table col.tenders-col-id { width: 3%; }
  .table.tenders-table col.tenders-col-tender-no { width: 5%; }
  .table.tenders-table col.tenders-col-project { width: 8%; }
  .table.tenders-table col.tenders-col-type { width: 7%; }
  .table.tenders-table col.tenders-col-subject { width: 25%; }
  .table.tenders-table col.tenders-col-org { width: 9%; }
  .table.tenders-table col.tenders-col-status { width: 9%; }
  .table.tenders-table col.tenders-col-date { width: 6%; }
  .table.tenders-table col.tenders-col-count { width: 5%; }
  .table.tenders-table col.tenders-col-actions { width: 5%; }

  .table.tenders-table th.manage-sticky-actions,
  .table.tenders-table td.manage-sticky-actions {
    min-width: 0;
    width: 5.75rem;
    max-width: 5.75rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .table.tenders-table td.td-actions .btn-group-actions .btn {
    padding: 0.2rem 0.4rem;
  }

  .table.tenders-table td.td-subject {
    overflow: hidden;
  }
}

/* колонки с датами — центр + без переноса */
.table.tenders-table td.td-date {
  text-align: center !important;
  white-space: nowrap;
  padding-right: 0.5rem !important;
}

/* бейджи статуса */
.table.tenders-table .badge {
  white-space: nowrap;
}

/* узкие служебные колонки; колонка Действия — по центру, без лишних отступов */
.table.tenders-table td.td-actions,
.table.tenders-table th.th-actions,
.table.tenders-table td.td-count,
.table.tenders-table th.th-count {
  white-space: nowrap;
  width: 1%;
}
.table.tenders-table th.th-actions {
  text-align: center !important;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}
.table.tenders-table td.td-actions {
  text-align: center !important;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

/* =========================================================
   Dropzone / Файлы (компактный стиль как у вас)
========================================================= */

.dz-wrap {
  background: #f8fafc;
  border: 1px solid #e0e6ef;
  border-radius: 0.5rem;
  padding: 0.6rem;
  text-align: center;
}

.dz-wrap .dz-message {
  color: #6c757d;
  font-size: 0.82rem;
  margin: 0;
  line-height: 1.4;
}

.file-section-title {
  font-weight: 600;
  margin: 0.3rem 0 0.25rem;
  font-size: 0.82rem;
}

.file-row {
  display: flex;
  align-items: center;
  background: #f9fafb;
  border: 1px solid #e2e6ec;
  border-radius: 0.5rem;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.3rem;
  font-size: 0.82rem;
}

.file-row .icon {
  width: 22px;
  text-align: center;
  margin-right: 0.4rem;
  font-size: 0.85rem;
}

.file-row .name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.file-row .meta {
  color: #6c757d;
  font-size: 0.78rem;
  margin-left: 0.5rem;
  white-space: nowrap;
}

.file-row .actions {
  margin-left: 0.4rem;
  white-space: nowrap;
}

.file-row.opacity-50 {
  opacity: 0.55;
}

.form-actions {
  padding: 0.5rem 0.7rem;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 0.4rem;
  font-size: 0.82rem;
}

.form-actions .btn {
  font-size: 0.82rem;
  padding: 0.35rem 0.6rem;
}

.form-control[readonly] {
  background-color: #fff;
  opacity: 1;
}

/* =========================================================
   Унифицированный “tiny-file” стиль (tf-*)
========================================================= */

.tf { font-size: .85rem; }
.tf-sec { font-weight: 600; font-size: .82rem; margin: .5rem 0 .35rem; color: #111827; }

.tf-item {
  display: flex;
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: .55rem;
  padding: .45rem .6rem;
  margin-bottom: .45rem;
}

.tf-ico { width: 22px; margin-right: .5rem; line-height: 1; font-size: .9rem; text-align: center; }

.tf-name { flex: 1; min-width: 0; }

.tf-name a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  vertical-align: bottom;
}

.tf-meta { color: #6b7280; font-size: .78rem; margin-top: .2rem; }
.tf-act { margin-left: .6rem; white-space: nowrap; }

.tf-btn {
  border: 1px solid #e5eaf2;
  background: #fff;
  border-radius: .5rem;
  padding: .3rem .45rem;
}

.tf-pending { opacity: .6; border-style: dashed; }

.tf-badge {
  display: inline-block;
  font-size: .72rem;
  color: #92400e;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: .4rem;
  padding: .05rem .35rem;
  margin-left: .4rem;
  vertical-align: middle;
}

/* =========================================================
   Модалка организаций — сетка/гаттеры
========================================================= */

#addOrgModal .modal-dialog { max-width: 760px; }
#addOrgModal .modal-content { overflow-x: hidden; }

#addOrgPanel .card-body { --gutter: .5rem; }

#addOrgPanel .row {
  margin-left: calc(var(--gutter) * -1);
  margin-right: calc(var(--gutter) * -1);
}

#addOrgPanel .row > [class^="col-"],
#addOrgPanel .row > [class*=" col-"] {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

#addOrgPanel .form-control {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

#addOrgPanel .btn { white-space: nowrap; }

@media (max-width: 768px){
  #addOrgModal .modal-dialog { max-width: 95%; margin: .5rem auto; }
}

#addOrgPanel #btnCheckInn {
  height: calc(1.5rem + 2px);
  line-height: 1.25;
}

/* =========================================================
   Карточки кандидатов
========================================================= */

.cand-card {
  border: 1px solid #e2e6ec;
  border-radius: .5rem;
  background: #fff;
  margin-bottom: .4rem;
  padding: .45rem .55rem;
}

.cand-head { display: flex; align-items: center; justify-content: space-between; }
.cand-title { font-weight: 600; font-size: .9rem; margin: 0; }
.cand-meta { color: #6c757d; font-size: .78rem; margin-top: .15rem; }

.cand-badge {
  display: inline-block;
  background: #eef2f7;
  color: #334155;
  border: 1px solid #d8dee9;
  border-radius: .375rem;
  padding: .05rem .4rem;
  font-size: .72rem;
  margin-right: .4rem;
}

.cand-actions .btn { padding: .15rem .4rem; font-size: .75rem; }
.cand-removed { opacity: .55; background: #fbfbfb; }

/* =========================================================
   Компактные dropzone-блоки (dz-sm / dz-box)
========================================================= */

.dz-wrap.dz-sm {
  min-height: 90px;
  padding: 8px;
  border: 1px dashed #c7cdd6;
  border-radius: .25rem;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dz-wrap .dz-preview { margin: .25rem; }

.dz-box {
  min-height: 66px;
  padding: 8px 10px;
  border: 1px dashed #c7cdd6;
  border-radius: .25rem;
  background: #fafbfc;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.dz-btn,
.dz-btn-static { white-space: nowrap; }

/* карточка файла (dz-list) */
.dz-list .dz-row {
  display: block;
  border: 1px solid rgba(0,0,0,.08);
  background: #fff;
  border-radius: .5rem;
  padding: .35rem .5rem;
  margin-bottom: .5rem;
}

.dz-row .tfile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}

.dz-row .tfile-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: .4rem;
}

.dz-row .tfile-name a,
.dz-row .tfile-name span {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dz-row .dz-row-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 4px;
}

.dz-row-actions .btn { padding: 2px 6px; line-height: 1; }

.dz-row .tfile-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .25rem;
}

.dz-row .tfile-meta { color: #6c757d; font-size: .84rem; }

.dz-row *:focus,
.dz-row *:active,
.dz-row *:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.dz-row.tf-pending { border-color: rgba(255,193,7,.45); }

/* =========================================================
   Документы типа — аккуратные строки и обрезка имён
========================================================= */

#type-docs-list .tf-item { background: #fff; }
#type-docs-list .tf-name { min-width: 0; }

#type-docs-list .tf-name .title { font-weight: 600; }

#type-docs-list .tf-name .fname a {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   Карточка документов — равномерное распределение секций
========================================================= */

.card-body.files {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 100%;
}

.card-body.files.distribute {
  justify-content: space-between;
}

.file-block { display: block; }
.file-block .file-section-title { margin: 0 0 .35rem; }
.file-block .dz-wrap { margin: 0; }
.file-block .dz-list { margin-top: .4rem; }

/* =========================================================
   Текстовые описания (clamp)
========================================================= */

.desc-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 10;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.desc-expanded {
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* мелкая адаптивность блока мини-карточек */
.card-body .d-flex.flex-wrap.justify-content-center > div {
  min-width: 180px;
}

/* =========================================================
   Форма создания / редактирования тендера (как form_letter)
========================================================= */
.tender-form-page .page-head {
  gap: 0.5rem;
}
.tender-form-page form .card .card-header {
  padding: 0.35rem 0.6rem;
  background: #f8fafc;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  font-weight: 700;
}
.tender-form-page form .card .card-header strong {
  font-weight: 700;
}
.tender-form-page form .card .card-body {
  padding: 0.6rem;
}
.tender-form-page form .card .card-footer {
  padding: 0.45rem 0.6rem;
}
.tender-form-page form .form-group {
  margin-bottom: 0.55rem;
}
.tender-form-page form label {
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}
.tender-form-page form .help-hint,
.tender-form-page form .form-text {
  font-size: 0.75rem;
  color: #6c757d;
  line-height: 1.15;
}
.tender-form-page form .text-muted.small,
.tender-form-page form .log-history {
  font-size: 0.75rem;
}
.tender-form-page .page-head h3 {
  font-size: 1.25rem;
  font-weight: 600;
}
@media (max-width: 576px) {
  .tender-form-page .page-head {
    flex-direction: column;
    align-items: stretch !important;
  }
  .tender-form-page .page-head .btn-toolbar {
    width: 100%;
  }
  .tender-form-page .page-head .btn-toolbar .btn {
    flex: 1 1 auto;
  }
  .tender-form-page .page-head h3 {
    font-size: 1.1rem;
  }
}

/* Список тендеров: узкий экран — горизонтальный скролл */
@media (max-width: 991.98px) {
  .table.tenders-table thead th {
    white-space: normal;
  }

  .table.tenders-table td.td-subject {
    min-width: 10rem;
    max-width: 16rem;
  }

  .table.tenders-table td.manage-sticky-actions,
  .table.tenders-table th.manage-sticky-actions {
    background-color: #fff;
  }

  .table.tenders-table thead th.manage-sticky-actions {
    background-color: #f8f9fa;
  }
}

/* =========================================================
   Карточка тендера (организатор / наблюдатель)
========================================================= */
.tender-detail-page .card-header {
  display: flex;
  align-items: center;
  font-size: inherit;
  font-weight: 700;
}

.tender-detail-page .card-header .card-header-title {
  font-weight: 700;
  font-size: inherit;
  margin: 0;
  min-width: 0;
}

.tender-detail-page .card-header .card-title-right {
  margin-left: auto;
  flex-shrink: 0;
  font-weight: 400;
  font-size: inherit;
  text-align: right;
}

.tender-detail-page .card-header .card-title-right.text-muted {
  color: #6c757d !important;
}

.tender-detail-page .card-header.summary-card-header {
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tender-detail-page .summary-card {
  overflow: hidden;
  min-width: 0;
}

.tender-detail-page .summary-card-body {
  min-width: 0;
}

.tender-detail-page .summary-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.6rem;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
}

.tender-detail-page .summary-status-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  flex: 0 0 auto;
}

.tender-detail-page .summary-status-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 10rem;
  min-width: 0;
}

.tender-detail-page .summary-status-select {
  flex: 1 1 9rem;
  min-width: 0;
  max-width: 100%;
  width: auto !important;
  font-size: 0.8125rem;
  height: calc(1.5em + 0.5rem + 2px);
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  border-color: #cbd5e1;
  background-color: #fff;
}

.tender-detail-page .summary-status-save {
  white-space: nowrap;
  font-size: 0.8125rem;
  padding: 0.25rem 0.55rem;
}

.tender-detail-page .summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem 0.75rem;
}

.tender-detail-page .summary-metric,
.tender-detail-page .summary-field {
  min-width: 0;
}

.tender-detail-page .summary-metric-value,
.tender-detail-page .summary-desc {
  font-weight: 500;
  word-break: break-word;
  line-height: 1.35;
  min-width: 0;
}

.tender-detail-page .js-summary-clamp.is-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--summary-clamp-lines, 3);
  overflow: hidden;
}

.tender-detail-page .js-summary-clamp.is-expanded {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.tender-detail-page .summary-clamp-toggle {
  font-size: 0.8125rem;
  line-height: 1.2;
  margin-top: 0.15rem;
}

.tender-detail-page .summary-dates {
  min-width: 0;
}

.tender-detail-page .dates-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem 0.35rem;
  align-items: start;
  text-align: center;
}

.tender-detail-page .dates-row .date-item {
  min-width: 0;
  padding: 0 0.15rem;
}

@media (max-width: 575.98px) {
  .tender-detail-page .summary-metrics {
    grid-template-columns: 1fr;
  }

  .tender-detail-page .summary-metric.text-md-center,
  .tender-detail-page .summary-metric.text-md-right {
    text-align: left !important;
  }

  .tender-detail-page .dates-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tender-detail-page .summary-status-form {
    width: 100%;
  }

  .tender-detail-page .summary-status-select {
    flex: 1 1 100%;
  }
}

.tender-detail-page .dates-row .date-item {
  min-width: 0;
}

.tender-detail-page .dates-row .tender-date-inline-input {
  display: inline-block;
  width: auto;
  min-width: 6.5rem;
  max-width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  height: auto;
}

.tender-detail-page .dates-row .tender-date-inline-input:focus {
  outline: none;
  box-shadow: none;
  border-bottom: 1px dashed #94a3b8;
}

.tender-detail-page .tender-status-form {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.tender-detail-page .tender-status-form .select2-container {
  flex-shrink: 0;
}

/* Полоса дат в «Основные сведения»: без рамки у редактируемого срока */
.tender-detail-page .dates-row .deadline-submit-input {
  display: block;
  width: 100%;
  max-width: 9.5rem;
  margin: 0 auto;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  height: auto;
  line-height: inherit;
  font-size: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
}
.tender-detail-page .dates-row .deadline-submit-input:focus {
  outline: none;
  box-shadow: none;
  border-bottom: 1px dashed #94a3b8;
}
.tender-detail-page .dates-row .deadline-submit-input:hover {
  border-bottom: 1px dashed #cbd5e1;
}

.tender-detail-page .tender-title-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.35;
  max-width: 100%;
}

/* =========================================================
   Общий стиль карточки тендера и протокола
========================================================= */
.tender-detail-page .tender-grid .card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.tender-detail-page .tender-grid .card > .card-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.tender-detail-page,
.protocol-page {
  color: #1e293b;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.tender-page-header,
.protocol-header {
  gap: 0.75rem;
}

.tender-page-title,
.protocol-page-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #0f172a;
  line-height: 1.35;
}

.tender-page-actions,
.protocol-actions {
  flex-shrink: 0;
  gap: 0.5rem;
}

.tender-page-actions .btn,
.protocol-actions .btn {
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
}

.tender-card,
.protocol-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.tender-card .card-header,
.protocol-card .card-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.tender-participants-head-actions {
  gap: 0.5rem;
}

.tender-participants-head-actions .btn {
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
}

.tender-table .btn-group-actions {
  display: inline-flex;
  flex-wrap: nowrap;
}

.tender-table .manage-td-actions .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.tender-section-title,
.protocol-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

.tender-table.table-sm th,
.tender-table.table-sm td,
.protocol-table.table-sm th,
.protocol-table.table-sm td {
  padding: 0.55rem 0.65rem;
  vertical-align: middle;
  border-color: #e2e8f0;
  font-size: 0.9375rem;
}

.tender-table thead th,
.protocol-table thead th {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: bottom;
  white-space: normal;
  line-height: 1.25;
  text-align: center;
  hyphens: auto;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.tender-table thead th {
  text-align: center !important;
}

.protocol-page .protocol-table thead th.protocol-th-left {
  text-align: left;
}

.protocol-page .protocol-th-sub {
  display: block;
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: #94a3b8;
  margin-top: 0.1rem;
}

.tender-table tbody tr:hover,
.protocol-table tbody tr:hover {
  background-color: #f8fafc;
}

.tender-table .td-num,
.protocol-table .td-num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Таблица заявок: компактные числовые колонки */
.protocol-table-bids .td-num {
  min-width: 0;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.protocol-table-bids .td-num-compound {
  min-width: 0;
  font-size: 0.8125rem;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.protocol-page .protocol-table-bids,
.protocol-page .protocol-table-rating,
.protocol-page .protocol-table-participants {
  table-layout: fixed;
  width: 100%;
}

.protocol-page .protocol-table-bids .protocol-col-num { width: 2.25rem; }
.protocol-page .protocol-table-bids .protocol-col-org { width: 19%; }
.protocol-page .protocol-table-bids .protocol-col-contact { width: 7.5rem; }
.protocol-page .protocol-table-bids .protocol-col-inn { width: 6.25rem; }
.protocol-page .protocol-table-bids .protocol-col-rating { width: 3.25rem; }
.protocol-page .protocol-table-bids .protocol-col-amount { width: 7rem; }
.protocol-page .protocol-table-bids .protocol-col-compound { width: 8.25rem; }
.protocol-page .protocol-table-bids .protocol-col-term { width: 5.25rem; }
.protocol-page .protocol-table-bids .protocol-col-flag { width: 2.75rem; }
.protocol-page .protocol-table-bids .protocol-col-mark { width: 5.25rem; }

.protocol-page .protocol-table-bids tbody td.protocol-col-num {
  text-align: center;
}

.protocol-page .protocol-table-bids .td-org {
  max-width: none;
  text-align: left;
  vertical-align: middle;
}

.protocol-page .protocol-table-bids .protocol-org-name--wrap {
  display: block;
  overflow: visible;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.35;
  font-weight: 500;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
}

.protocol-page .protocol-table-bids tbody td.protocol-col-inn {
  text-align: center;
}

.protocol-page .protocol-table-bids tbody td.protocol-col-flag,
.protocol-page .protocol-table-bids tbody td.protocol-col-mark,
.protocol-page .protocol-table-bids tbody td.protocol-col-term {
  text-align: center;
  vertical-align: middle;
}

.protocol-page .protocol-table-bids thead th.protocol-col-num,
.protocol-page .protocol-table-bids thead th.protocol-col-inn,
.protocol-page .protocol-table-bids thead th.protocol-col-rating,
.protocol-page .protocol-table-bids thead th.protocol-col-amount,
.protocol-page .protocol-table-bids thead th.protocol-col-compound,
.protocol-page .protocol-table-bids thead th.protocol-col-term,
.protocol-page .protocol-table-bids thead th.protocol-col-flag,
.protocol-page .protocol-table-bids thead th.protocol-col-mark {
  hyphens: none;
}

.protocol-page .protocol-table-bids thead th.protocol-col-num,
.protocol-page .protocol-table-bids thead th.protocol-col-inn,
.protocol-page .protocol-table-bids thead th.protocol-col-rating,
.protocol-page .protocol-table-bids thead th.protocol-col-term,
.protocol-page .protocol-table-bids thead th.protocol-col-flag,
.protocol-page .protocol-table-bids thead th.protocol-col-mark {
  white-space: nowrap;
}

.protocol-page .protocol-table-bids .td-contact {
  text-align: left;
  min-width: 0;
  max-width: none;
  font-size: 0.75rem;
  line-height: 1.3;
  vertical-align: middle;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.protocol-page .protocol-table-bids tbody td.protocol-col-rating {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.875rem;
}

.protocol-page .protocol-table-bids .protocol-col-term {
  font-size: 0.8125rem;
  white-space: nowrap;
}

.protocol-page .protocol-table-bids tbody td.protocol-col-mark {
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.protocol-page .protocol-table-bids .protocol-badge--winner {
  font-size: 0.6875rem;
  padding: 0.15rem 0.35rem;
  white-space: nowrap;
}

/* Таблица участников протокола */
.protocol-page .protocol-table-participants col.participants-col-num { width: 2.25rem; }
.protocol-page .protocol-table-participants col.participants-col-org { width: 20%; }
.protocol-page .protocol-table-participants col.participants-col-contact { width: 8rem; }
.protocol-page .protocol-table-participants col.participants-col-inn { width: 6.25rem; }
.protocol-page .protocol-table-participants col.participants-col-status { width: 9%; }
.protocol-page .protocol-table-participants col.participants-col-flag { width: 2.75rem; }
.protocol-page .protocol-table-participants col.participants-col-reliability { width: 8.5rem; }
.protocol-page .protocol-table-participants col.participants-col-date { width: 7rem; }

.protocol-page .protocol-table-participants thead th {
  text-align: center;
  hyphens: none;
}

.protocol-page .protocol-table-participants thead th.protocol-col-num,
.protocol-page .protocol-table-participants thead th.protocol-col-inn,
.protocol-page .protocol-table-participants thead th.protocol-col-flag,
.protocol-page .protocol-table-participants thead th.protocol-col-date,
.protocol-page .protocol-table-participants thead th.protocol-col-reliability {
  white-space: nowrap;
}

.protocol-page .protocol-table-participants tbody td {
  vertical-align: middle;
  text-align: center;
}

.protocol-page .protocol-table-participants .td-org {
  min-width: 0;
  max-width: none;
  text-align: center;
}

.protocol-page .protocol-table-participants .protocol-org-name--wrap {
  display: block;
  overflow: visible;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.35;
  font-weight: 500;
  text-align: center;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
}

.protocol-page .protocol-table-participants .td-contact {
  min-width: 0;
  max-width: none;
  font-size: 0.75rem;
  line-height: 1.35;
  text-align: center;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

.protocol-page .protocol-table-participants .td-contact-name,
.protocol-page .protocol-table-participants .td-contact-phone {
  text-align: center;
}

.protocol-page .protocol-table-participants tbody td.protocol-col-status {
  font-size: 0.8125rem;
  line-height: 1.35;
  word-break: break-word;
  text-align: center;
}

.protocol-page .protocol-table-participants tbody td.protocol-col-inn {
  font-size: 0.8125rem;
  text-align: center;
}

.protocol-page .protocol-table-participants tbody td.protocol-col-date {
  font-size: 0.8125rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.protocol-page .protocol-table-participants .protocol-badges {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  max-width: 100%;
}

.protocol-page .protocol-table-participants .protocol-badge {
  font-size: 0.625rem;
  padding: 0.12rem 0.35rem;
  white-space: nowrap;
  line-height: 1.2;
  border-radius: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.protocol-page .protocol-table .protocol-col-num { width: 3.5rem; white-space: nowrap; }
.protocol-page .protocol-table .protocol-col-org { width: 18%; }
.protocol-page .protocol-table .protocol-col-contact { width: 12%; }
.protocol-page .protocol-table .protocol-col-inn { width: 8.5rem; white-space: nowrap; }
.protocol-page .protocol-table .protocol-col-status { width: 14%; }
.protocol-page .protocol-table .protocol-col-reliability { width: 11rem; white-space: nowrap; }
.protocol-page .protocol-table .protocol-col-date { width: 9.5rem; white-space: nowrap; }

.protocol-page .protocol-table .td-org {
  min-width: 0;
  max-width: 16rem;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.3;
  vertical-align: middle;
}

.protocol-page .protocol-org-name,
.protocol-page .protocol-org-head {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.protocol-page .protocol-org-name a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.2);
}

.protocol-page .protocol-rating-org {
  min-width: 0;
  white-space: normal;
  font-size: 0.6875rem;
  line-height: 1.25;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.protocol-page .protocol-table-rating thead tr:first-child th.protocol-rating-org:first-of-type {
  border-left: 2px solid #94a3b8;
}

.protocol-page .protocol-table-rating thead tr:nth-child(2) th.protocol-rating-col-score:first-child {
  border-left: 2px solid #94a3b8;
}

.protocol-page .protocol-table-rating .protocol-rating-bid-sep {
  border-left: 2px solid #cbd5e1;
}

.protocol-page .protocol-table-rating tbody tr:not(.protocol-rating-total-row) td:nth-child(3) {
  border-left: 2px solid #94a3b8;
}

.protocol-page .protocol-table-rating tr.protocol-rating-total-row td:nth-child(2) {
  border-left: 2px solid #94a3b8;
}

.protocol-page .protocol-table-rating col.rating-col-criterion {
  width: 17rem;
}

.protocol-page .protocol-table-rating col.rating-col-weight {
  width: 2.75rem;
}

.protocol-page .protocol-table-rating .protocol-rating-col-criterion {
  width: 17rem;
  max-width: 17rem;
}

.protocol-page .protocol-table-rating .protocol-rating-col-weight {
  width: 2.75rem;
  min-width: 2.75rem;
  max-width: 2.75rem;
  white-space: nowrap;
  hyphens: none;
  letter-spacing: normal;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.protocol-page .protocol-table-rating .protocol-rating-col-score,
.protocol-page .protocol-table-rating .protocol-rating-col-weighted {
  min-width: 2.25rem;
  font-size: 0.625rem;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
  white-space: nowrap;
  hyphens: none;
}

.protocol-page .protocol-table-rating tbody td:nth-child(2) {
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.protocol-page .protocol-table-rating tbody td:first-child {
  text-align: left;
  font-size: 0.8125rem;
  line-height: 1.35;
  word-break: break-word;
  padding-right: 0.5rem;
}

.protocol-page .protocol-table-rating tbody td:not(:first-child):not(:nth-child(2)) {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.protocol-page .protocol-table-rating thead th[rowspan] {
  vertical-align: middle;
}

.protocol-page .protocol-rating-total-row td {
  background: #f1f5f9;
  border-top: 2px solid #cbd5e1;
}

.protocol-page .protocol-winner-banner {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.protocol-page .protocol-page-title {
  min-width: 0;
  flex: 1 1 auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.protocol-page .protocol-header {
  flex-wrap: wrap;
}

/* thead th base rules above; bids table needs no extra header overrides */

.tender-table .td-inn,
.protocol-table .td-inn {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  color: #475569;
  white-space: nowrap;
}

.tender-table .td-submitted-at,
.tender-table .td-submitted,
.protocol-table .td-submitted {
  white-space: nowrap;
  min-width: 9.5rem;
  font-variant-numeric: tabular-nums;
}

.tender-table .td-ceo {
  font-size: 0.8125rem;
  color: #475569;
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tender-table .td-address {
  font-size: 0.8125rem;
  color: #475569;
  min-width: 140px;
  max-width: 220px;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

.tender-table .td-contact,
.protocol-table .td-contact {
  font-size: 0.8125rem;
  color: #475569;
  min-width: 120px;
  max-width: 160px;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

.tender-table .td-contact-name,
.protocol-table .td-contact-name {
  font-weight: 500;
  color: #334155;
}

.tender-table .td-contact-phone,
.protocol-table .td-contact-phone {
  font-size: 0.75rem;
  color: #64748b;
}

.tender-table thead th:nth-child(3),
.tender-table thead th:nth-child(4),
.tender-table thead th:nth-child(5) {
  white-space: nowrap;
}

.tender-badge,
.protocol-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  border: 1px solid transparent;
  letter-spacing: 0.01em;
}

.tender-badge--success,
.protocol-badge--success {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.tender-badge--danger,
.protocol-badge--danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.tender-badge--warning,
.protocol-badge--warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.tender-badge--info,
.protocol-badge--info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.tender-badge--neutral,
.protocol-badge--neutral {
  background: #f8fafc;
  color: #64748b;
  border-color: #e2e8f0;
}

.tender-badge--winner,
.protocol-badge--winner {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.tender-badge--rating,
.protocol-badge--rating {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.tender-badge--clickable {
  cursor: pointer;
}

.tender-badges,
.protocol-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
  align-items: center;
}

.protocol-winner-banner {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  color: #166534;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
}

.protocol-row-winner {
  background: #f0fdf4 !important;
  box-shadow: inset 3px 0 0 #22c55e;
}

@media (max-width: 767.98px) {
  .tender-page-header {
    flex-direction: column;
    align-items: stretch !important;
  }
  .tender-page-actions {
    width: 100%;
  }
  .tender-page-actions .btn {
    flex: 1 1 auto;
  }
}

/* =========================================================
   Модалка ручной заявки (стиль как в проектировании / ds-share)
   ========================================================= */

.manual-bid-modal-shell .manual-bid-dialog {
  max-width: min(1120px, 96vw);
  width: min(1120px, 96vw);
}

.manual-bid-modal-content {
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .18);
}

.manual-bid-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.15rem .85rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-bottom: 1px solid #eef2f6;
}

.manual-bid-header-main {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}

.manual-bid-badge {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8f1ff;
  color: #0d6efd;
  font-size: 1rem;
}

.manual-bid-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.25;
}

.manual-bid-subtitle {
  font-size: .82rem;
  color: #6b7280;
  margin-top: .15rem;
}

.manual-bid-close {
  border: 0;
  background: transparent;
  color: #6b7280;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.manual-bid-close:hover {
  background: #f1f5f9;
  color: #111827;
}

.manual-bid-body {
  padding: 1rem 1.15rem;
  max-height: min(78vh, 720px);
  overflow-y: auto;
  background: #fff;
}

.manual-bid-footer {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: .75rem 1.15rem;
  border-top: 1px solid #eef2f6;
  background: #fafbfc;
}

.manual-bid-grid > [class*="col-"] {
  display: flex;
}

.manual-bid-panel {
  width: 100%;
  border: 1px solid #e8eef4;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.manual-bid-panel-head {
  padding: .55rem .85rem;
  font-size: .82rem;
  font-weight: 700;
  color: #374151;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f6;
}

.manual-bid-panel-body {
  padding: .85rem;
  flex: 1 1 auto;
}

.manual-bid-org-select-row .select2-container {
  width: 100% !important;
}

.manual-bid-org-select-row .btn {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}

/* Модалка организации поверх модалки участника */
body.modal-open #addOrgModal {
  z-index: 1060;
}
body.modal-open .modal-backdrop.show ~ .modal-backdrop.show {
  z-index: 1055;
}

.manual-bid-form .form-group label.small,
.manual-bid-form label.small {
  font-weight: 600;
  color: #4b5563;
}

.manual-bid-form .custom-control {
  padding-left: 1.5rem;
  min-height: 1.35rem;
  display: block;
  position: relative;
}

.manual-bid-form .custom-control-input {
  position: absolute;
  left: 0;
  z-index: 1;
  width: 1rem;
  height: 1.15rem;
  opacity: 0;
}

.manual-bid-form .custom-control-label {
  position: relative;
  margin-bottom: 0;
  vertical-align: top;
  font-size: .875rem;
  line-height: 1.35;
  color: #374151;
  cursor: pointer;
}

.manual-bid-form .custom-control-label::before {
  position: absolute;
  top: .15rem;
  left: -1.5rem;
  display: block;
  width: 1rem;
  height: 1rem;
  pointer-events: none;
  content: "";
  background-color: #fff;
  border: 1px solid #adb5bd;
  border-radius: .25rem;
}

.manual-bid-form .custom-control-label::after {
  position: absolute;
  top: .15rem;
  left: -1.5rem;
  display: block;
  width: 1rem;
  height: 1rem;
  content: "";
  background: no-repeat 50% / 50% 50%;
}

.manual-bid-form .custom-control-input:checked ~ .custom-control-label::before {
  color: #fff;
  border-color: #0d6efd;
  background-color: #0d6efd;
}

.manual-bid-form .custom-control-input:checked ~ .custom-control-label::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e");
}

.manual-bid-form .custom-control-input:focus ~ .custom-control-label::before {
  box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .25);
}

.manual-bid-doc-block + .manual-bid-doc-block {
  margin-top: .65rem;
  padding-top: .65rem;
  border-top: 1px dashed #e5e7eb;
}

.manual-bid-doc-title {
  font-size: .8rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: .35rem;
}

.manual-bid-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  min-height: 64px;
  padding: .55rem .65rem;
  margin-bottom: .4rem;
  border: 2px dashed #c5d0dc;
  border-radius: 10px;
  background: #f8fafc;
  color: #4b5563;
  text-align: center;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
  user-select: none;
}

.manual-bid-dropzone:hover,
.manual-bid-dropzone.is-dragover {
  border-color: #0d6efd;
  background: #eef5ff;
  color: #0d6efd;
}

.manual-bid-dropzone strong {
  font-size: .8rem;
  line-height: 1.25;
}

.manual-bid-dropzone span {
  font-size: .72rem;
  color: #6b7280;
  line-height: 1.25;
}

.manual-bid-dropzone.is-dragover span {
  color: #3b82f6;
}

.manual-bid-files-list {
  font-size: .8rem;
}

.manual-bid-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .25rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.manual-bid-file-row:last-child {
  border-bottom: 0;
}

.manual-bid-file-name {
  min-width: 0;
  flex: 1 1 auto;
  color: #1f2937;
}

.manual-bid-file-actions {
  flex: 0 0 auto;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 991.98px) {
  .manual-bid-modal-shell .manual-bid-dialog {
    max-width: 96vw;
    margin: .5rem auto;
  }
  .manual-bid-body {
    max-height: min(82vh, 900px);
  }
}

.protocol-page .protocol-round-group {
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.protocol-page .protocol-round-group--1 {
  background: #f8fafc;
  color: #475569;
}
.protocol-page .protocol-round-group--2 {
  background: #fff7ed;
  color: #9a3412;
}
.protocol-page .protocol-table-bids.has-rounds {
  table-layout: auto;
}
.protocol-page .protocol-table-bids.has-rounds .td-num,
.protocol-page .protocol-table-bids.has-rounds .td-num-compound {
  white-space: normal;
}
.protocol-page .protocol-table-bids.has-rounds .fin-amt {
  display: inline-block;
  font-size: 0.75rem;
  color: #64748b;
}

.round2-modal-shell .ds-share-subtitle {
  max-width: 420px;
}
