/* Extracted module styles: Vendors */

.project-payment-kpi-card[data-project-vendor-kpi],
.project-payment-kpi-card[data-project-treasury-kpi] {
  cursor: pointer;
}

.project-vendors-shell {
  display: grid;
  gap: 16px;
}

.project-vendors-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.project-vendor-kpi-card {
  min-height: 82px;
  padding: 10px 12px;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.project-vendor-kpi-card:hover {
  border-color: rgba(31, 72, 165, 0.28);
  box-shadow: 0 10px 24px rgba(16, 40, 79, 0.08);
}

.project-vendor-kpi-card.is-active {
  border-color: rgba(31, 72, 165, 0.6);
  box-shadow: inset 0 0 0 1px rgba(31, 72, 165, 0.28), 0 12px 28px rgba(16, 40, 79, 0.08);
  background: linear-gradient(180deg, rgba(241, 246, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.project-vendor-kpi-card:focus-visible {
  outline: 2px solid rgba(31, 72, 165, 0.4);
  outline-offset: 2px;
}

.project-vendor-kpi-card .members-summary-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.project-vendor-kpi-card .members-summary-copy {
  gap: 1px;
  min-width: 0;
}

.project-vendor-kpi-card .members-summary-copy span {
  font-size: 11px;
  margin-bottom: 2px;
}

.project-vendor-kpi-card .members-summary-copy strong {
  font-size: clamp(1rem, 1.55vw, 1.8rem);
  line-height: 1.02;
  white-space: nowrap;
  letter-spacing: 0;
}

.project-vendor-kpi-card .members-summary-copy small {
  font-size: 10px;
  margin-top: 3px;
  line-height: 1.2;
}

.project-vendor-kpi-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.project-vendor-kpi-copy span {
  font-size: 11px;
  color: #5e7089;
}

.project-vendor-kpi-copy strong {
  display: block;
  font-size: clamp(0.95rem, 1.35vw, 1.65rem);
  line-height: 1.02;
  color: #10284f;
  white-space: nowrap;
  letter-spacing: 0;
}

.project-vendor-kpi-copy small {
  font-size: 10px;
  color: #6a7b92;
  line-height: 1.2;
}

.project-vendors-filters {
  padding: 14px 16px;
  width: 100%;
  max-width: none;
  min-width: 0;
}

.project-vendors-filter-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(4, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  width: 100%;
  max-width: none;
  min-width: 0;
}

.project-vendors-filter-row label {
  display: grid;
  gap: 6px;
}

.project-vendors-filter-row label span {
  font-size: 12px;
  font-weight: 700;
  color: #52657a;
}

.project-vendors-main {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
}

.project-vendors-table-card,
.project-vendors-detail-card {
  min-width: 0;
}

.project-vendors-table-card {
  width: 100%;
  max-width: none;
  overflow: visible;
  grid-column: 1 / -1;
  justify-self: stretch;
  box-sizing: border-box;
}

.project-vendors-table-card .table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: visible;
  box-sizing: border-box;
}

.project-vendors-table {
  width: 100%;
  max-width: none;
  min-width: 0;
  table-layout: fixed;
}

.project-vendors-table th,
.project-vendors-table td {
  padding: 9px 8px;
}

.project-vendors-table th:nth-child(1),
.project-vendors-table td:nth-child(1) { width: 15%; }
.project-vendors-table th:nth-child(2),
.project-vendors-table td:nth-child(2) { width: 8%; }
.project-vendors-table th:nth-child(3),
.project-vendors-table td:nth-child(3) { width: 13%; }
.project-vendors-table th:nth-child(4),
.project-vendors-table td:nth-child(4) { width: 13%; }
.project-vendors-table th:nth-child(5),
.project-vendors-table td:nth-child(5) { width: 10%; }
.project-vendors-table th:nth-child(6),
.project-vendors-table td:nth-child(6) { width: 9%; }
.project-vendors-table th:nth-child(7),
.project-vendors-table td:nth-child(7) { width: 7%; }
.project-vendors-table th:nth-child(8),
.project-vendors-table td:nth-child(8) { width: 10%; }
.project-vendors-table th:nth-child(9),
.project-vendors-table td:nth-child(9) { width: 8%; }
.project-vendors-table th:nth-child(10),
.project-vendors-table td:nth-child(10) { width: 7%; text-align: right; }

.project-vendors-table td:nth-child(2),
.project-vendors-table td:nth-child(6),
.project-vendors-table td:nth-child(7),
.project-vendors-table td:nth-child(8),
.project-vendors-table td:nth-child(9),
.project-vendors-table td:nth-child(10) {
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .project-vendors-table-card .table-wrap {
    overflow-x: auto;
  }

  .project-vendors-table {
    min-width: 1040px;
  }
}

.project-vendors-detail-card {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.vendor-details-dialog-card {
  width: min(1180px, 92vw);
  max-width: calc(100vw - 48px);
  max-height: 88vh;
  border-radius: 20px;
  border: 1px solid #e4ebf5;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.vendor-details-dialog-card .dialog-title {
  position: sticky;
  top: 0;
  z-index: 6;
  padding: 14px 20px 8px;
  background: #fff;
  border-bottom: 1px solid #e8eef6;
  flex-shrink: 0;
}

.vendor-details-dialog-card .procurement-detail-dialog-body {
  padding: 10px 20px;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

.vendor-details-dialog-card .procurement-detail-dialog-body:focus {
  outline: none;
}

.vendor-details-dialog-card .procurement-detail-dialog-footer {
  position: sticky;
  bottom: 0;
  z-index: 6;
  min-height: 52px;
  padding: 8px 20px 10px;
  justify-content: flex-end;
  background: #fff;
  border-top: 1px solid #e8eef6;
  flex-shrink: 0;
}

.vendor-details-header-shell {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-right: 56px;
}

.vendor-details-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding-right: 56px;
}

.vendor-details-toggle-btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid #dce7f3;
  border-radius: 10px;
  background: #fff;
  color: #0f5f46;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
  flex-shrink: 0;
}

.vendor-details-toggle-btn:hover,
.vendor-details-toggle-btn:focus-visible,
.vendor-details-toggle-btn.is-active {
  border-color: #b7e4cb;
  background: #f0fdf4;
  color: #047857;
  outline: none;
}

.vendor-details-header-stack {
  display: grid;
  gap: 10px;
}

.vendor-details-header-stack .vendor-financial-strip {
  margin: 0;
}

.vendor-details-summary-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.vendor-details-summary-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.vendor-details-summary-copy h3 {
  margin: 0;
  color: #122743;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.15;
}

.vendor-details-summary-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: #64748b;
  font-size: 13px;
}

.vendor-details-summary-inline span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.vendor-details-summary-inline strong {
  color: #122743;
  font-weight: 600;
}

.vendor-details-header-shell h3 {
  margin: 0 0 3px;
  font-size: 18px;
  color: #122743;
}

.vendor-details-header-shell p {
  margin: 0;
  color: #60738a;
  font-size: 13px;
}

.vendor-details-header-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f4f8ff 0%, #eef5ff 100%);
  color: #1d4ed8;
  font-size: 22px;
  flex-shrink: 0;
}

.vendor-details-top-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr 0.9fr 0.9fr;
  gap: 12px;
}

.vendor-details-financial-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #e5eaf2;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.vendor-financial-strip {
  margin: 4px 0 10px;
}

.vendor-details-financial-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  min-width: 0;
}

.vendor-details-financial-item + .vendor-details-financial-item {
  border-left: 1px solid #e5eaf2;
}

.vendor-details-financial-item span {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 2px;
}

.vendor-details-financial-item strong {
  color: #122743;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
}

.vendor-details-financial-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef4ff;
  color: #2563eb;
  font-size: 18px;
  flex-shrink: 0;
}

.vendor-details-financial-icon.is-paid {
  background: #ecfbf2;
  color: #0f9f57;
}

.vendor-details-financial-icon.is-outstanding {
  background: #f4efff;
  color: #7c3aed;
}

.vendor-details-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.vendor-details-info-grid-reference {
  margin-bottom: 8px;
}

.vendor-details-info-grid-collapsible {
  align-items: start;
}

.vendor-details-card,
.vendor-details-data-card,
.vendor-details-quick-actions {
  border: 1px solid #e5eaf2;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.vendor-details-card {
  padding: 12px 16px;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.vendor-details-collapse-card {
  padding: 0;
  overflow: hidden;
}

.vendor-details-card-toggle {
  width: 100%;
  min-height: 54px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.vendor-details-card-toggle-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
  flex: 1;
}

.vendor-details-card-toggle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vendor-details-card-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-height: 18px;
  color: #64748b;
  font-size: 12px;
}

.vendor-details-inline-separator {
  color: #c3cfdd;
  font-size: 11px;
}

.vendor-details-card-chevron {
  color: #64748b;
  font-size: 14px;
  flex-shrink: 0;
}

.vendor-details-collapse-card .vendor-details-kv-list {
  padding: 2px 14px 14px;
  border-top: 1px solid #edf2f8;
}

.vendor-details-collapse-card.is-expanded .vendor-details-card-toggle {
  min-height: 52px;
}

.vendor-details-identity-card {
  grid-template-rows: auto 1fr;
}

.vendor-details-identity-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.vendor-details-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #e8f2ff 0%, #dcebff 100%);
  color: #2453b4;
  font-size: 22px;
  font-weight: 800;
  flex-shrink: 0;
}

.vendor-details-identity-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.vendor-details-identity-copy h3 {
  margin: 0;
  color: #122743;
  font-size: 16px;
}

.vendor-details-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #60738a;
  font-size: 13px;
}

.vendor-details-identity-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.vendor-details-identity-metrics div,
.vendor-details-kv-list div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.vendor-details-identity-metrics span,
.vendor-details-kv-list span {
  color: #6a7b91;
  font-size: 12px;
}

.vendor-details-identity-metrics strong,
.vendor-details-kv-list strong {
  color: #122743;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

.vendor-details-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vendor-details-card-head h4 {
  margin: 0;
  color: #122743;
  font-size: 14px;
  font-weight: 600;
}

.vendor-details-card-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f6f9ff;
  color: #1f4da8;
  font-size: 12px;
}

.vendor-details-kv-list {
  display: grid;
  gap: 6px;
}

.vendor-details-tab-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 10px;
  border-top: 1px solid #edf2f8;
  border-bottom: 1px solid #edf2f8;
}

.vendor-details-tab {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #dbe4f0;
  background: #fff;
  color: #122743;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.vendor-details-tab.is-active {
  border-color: #81d3ad;
  background: #f2fbf5;
  color: #11643d;
  box-shadow: inset 0 0 0 1px rgba(28, 142, 80, 0.08);
}

.vendor-details-body-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.vendor-details-tab-panel {
  display: grid;
}

.vendor-details-tab-card {
  width: 100%;
}

.vendor-details-data-card {
  min-width: 0;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.vendor-details-data-card .procurement-detail-mini-table th,
.vendor-details-data-card .procurement-detail-mini-table td {
  padding: 6px 0;
  font-size: 12px;
}

.vendor-details-data-card .procurement-detail-mini-table th.vendor-mini-col-amount,
.vendor-details-data-card .procurement-detail-mini-table td.vendor-mini-col-amount,
.vendor-details-data-card .procurement-detail-mini-table th.vendor-mini-col-paid,
.vendor-details-data-card .procurement-detail-mini-table td.vendor-mini-col-paid,
.vendor-details-data-card .procurement-detail-mini-table th.vendor-mini-col-pending,
.vendor-details-data-card .procurement-detail-mini-table td.vendor-mini-col-pending {
  min-width: 88px;
  padding-right: 14px;
}

.vendor-details-data-card .procurement-detail-mini-table th.vendor-mini-col-status,
.vendor-details-data-card .procurement-detail-mini-table td.vendor-mini-col-status {
  width: 96px;
  min-width: 96px;
  max-width: 96px;
  padding-left: 8px;
  padding-right: 0;
  text-align: center;
}

.vendor-details-data-card .vendor-mini-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 6px 10px;
  font-size: 10px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vendor-details-data-card .procurement-detail-mini-table th {
  color: #708198;
  font-weight: 700;
}

.vendor-details-empty-state {
  min-height: 118px;
  max-height: 118px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 12px 10px;
  text-align: center;
  border: 1px dashed #e6edf6;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.vendor-details-empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f5f8fc;
  color: #7c8da2;
  font-size: 22px;
}

.vendor-details-empty-state strong {
  color: #122743;
  font-size: 15px;
  font-weight: 600;
}

.vendor-details-empty-state p {
  margin: 0;
  color: #708198;
  font-size: 12px;
}

.vendor-details-quick-actions {
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.vendor-details-quick-actions-head h4 {
  margin: 0;
  color: #122743;
  font-size: 14px;
  font-weight: 600;
}

.vendor-details-actions-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.vendor-details-actions-row .ghost-btn {
  min-height: 34px;
  justify-content: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
  border-radius: 12px;
}

.vendor-details-actions-row .ghost-btn span {
  font-size: 13px;
}

.vendor-details-dialog-card .dialog-title > .vendor-details-summary-header {
  align-items: flex-start;
}

.vendor-details-dialog-card .procurement-detail-dialog-footer .ghost-btn {
  min-height: 36px;
  padding: 0 20px;
  border-radius: 12px;
}

.vendor-details-close-btn {
  min-width: 88px;
}

.vendor-details-tab-stage {
  display: grid;
  gap: 14px;
}

.project-vendor-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 0;
}

.project-vendor-detail-header h3 {
  margin: 0 0 2px;
}

.project-vendor-primary-cell,
.project-vendor-contact-cell,
.project-vendor-tds-cell {
  display: grid;
  gap: 4px;
}

.project-vendor-primary-cell small,
.project-vendor-contact-cell small,
.project-vendor-tds-cell small,
.project-vendor-mini-row small,
.empty-copy {
  color: #6c7d90;
  font-size: 12px;
}

.project-vendor-mini-list {
  display: grid;
  gap: 8px;
}

.project-vendor-mini-row {
  width: 100%;
  border: 1px solid #e4ece7;
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
  text-align: left;
  display: grid;
  gap: 3px;
}

.project-vendor-mini-row.static {
  cursor: default;
}

.project-vendor-mini-row:not(.static):hover,
.project-vendor-mini-row:not(.static):focus-visible {
  border-color: #c8d9ec;
  background: #f8fbff;
}

.project-vendor-ledger-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.project-vendor-ledger-summary--three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-vendor-ledger-summary .content-card {
  padding: 14px;
  display: grid;
  gap: 6px;
}

.project-vendor-ledger-summary span {
  color: #5d7187;
  font-size: 12px;
  font-weight: 700;
}

.project-vendor-ledger-summary strong {
  font-size: 22px;
  color: #122743;
}

@media (max-width: 1100px) {
  .vendor-details-top-grid,
  .vendor-details-info-grid,
  .vendor-details-body-grid {
    grid-template-columns: 1fr;
  }

  .vendor-details-financial-strip {
    grid-template-columns: 1fr;
  }

  .vendor-details-financial-item + .vendor-details-financial-item {
    border-left: none;
    border-top: 1px solid #e5eaf2;
  }

  .vendor-details-actions-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .vendor-details-identity-metrics,
  .vendor-details-actions-row,
  .vendor-details-summary-main {
    grid-template-columns: 1fr;
  }

  .vendor-details-summary-main {
    display: grid;
    justify-items: flex-start;
  }

  .vendor-details-summary-inline {
    gap: 10px 14px;
  }

  .vendor-details-dialog-card .procurement-detail-dialog-body,
  .vendor-details-dialog-card .dialog-title,
  .vendor-details-dialog-card .procurement-detail-dialog-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .vendor-details-dialog-card {
    width: min(1180px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }
}

@media (max-width: 1180px) {
  .project-vendors-kpis {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

@media (max-width: 1220px) {
  .project-vendors-main {
    grid-template-columns: 1fr;
  }

  .project-vendors-detail-card {
    position: static;
  }

  .project-vendors-filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .project-vendors-kpis,
  .project-vendors-filter-row,
  .project-vendor-ledger-summary {
    grid-template-columns: 1fr;
  }
}
