/* ==========================================================================
   KNEST Tenders table — CAK-style columns + e-GP ID, brand-themed, responsive.
   Desktop: a clean table. Mobile (<=720px): each row becomes a card.
   ========================================================================== */

.tenders-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  -webkit-overflow-scrolling: touch;
}
.tenders-table-wrap:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

.tenders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-400);
}

.tenders-table thead th {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  white-space: nowrap;
  font-size: var(--fs-300);
  letter-spacing: .02em;
}

.tenders-table tbody td {
  padding: var(--sp-4);
  border-top: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}

.tenders-table tbody tr:nth-child(even) { background: var(--surface, #f8f9f5); }
.tenders-table tbody tr:hover { background: var(--green-050); }
.tenders-table tbody tr.is-closed td { color: var(--text-muted, #6b7280); }
.tenders-table tbody tr.is-closed .tender-ref { opacity: .65; }
.tenders-table tbody tr.is-closed .tender-download,
.tenders-table tbody tr.is-closed .tender-link { opacity: .65; }
.tenders-table tbody tr.is-closed .tender-tag { filter: grayscale(.35); opacity: .75; }
.tenders-table tbody tr.is-closed .tender-egp { opacity: .4; }

.tender-ref { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: var(--fs-300); white-space: nowrap; }

/* Eligibility tags */
.tender-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-200, .72rem);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--green-050);
  color: var(--brand);
  border: 1px solid currentColor;
}
.tender-tag--open-to-all { color: var(--knest-green-bright, #0ca94b); }
.tender-tag--women       { color: #c2185b; }
.tender-tag--youth       { color: #1565c0; }
.tender-tag--pwd         { color: #6a1b9a; }

/* Document / addendum links */
.tender-link {
  display: inline-block;
  font-weight: 700;
  color: var(--brand-accent, #f47d20);
  text-decoration: none;
  white-space: nowrap;
}
.tender-link:hover { text-decoration: underline; }
.tender-size { font-size: var(--fs-200, .72rem); color: var(--text-muted); font-weight: 400; white-space: nowrap; }

.tender-egp { font-weight: 700; color: var(--brand); white-space: nowrap; }
.tender-dash { color: var(--text-muted); }

.tender-closing-date {
  display: block;
}

.tender-closed-badge {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 8px; border-radius: var(--r-pill);
  background: #e8e8e8; color: #888;
  font-size: var(--fs-200, .72rem); font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em;
}

/* ---- Filament-style paginator (brand green) ---- */
.tpager {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
  padding: var(--sp-2) 0;
  font-size: var(--fs-300);
  flex-wrap: wrap;
}
.tpager__left {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-right: auto;
}
.tpager__label {
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.tpager__select {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px 8px;
  font-size: var(--fs-300);
  color: var(--text, #111);
  background: #fff;
  cursor: pointer;
}
.tpager__select:focus { outline: var(--focus-ring); outline-offset: 2px; }
.tpager__info {
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}
.tpager__nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tpager__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 var(--sp-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--brand);
  font-size: var(--fs-300);
  font-weight: 500;
  text-decoration: none;
  line-height: 1;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.tpager__btn:hover:not(.is-active):not(.is-disabled) {
  background: var(--green-050);
  border-color: var(--brand);
}
.tpager__btn.is-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  pointer-events: none;
}
.tpager__btn.is-disabled {
  opacity: .35;
  pointer-events: none;
}
.tpager__ellipsis {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--sp-1);
  color: var(--text-muted);
  user-select: none;
}
@media (max-width: 720px) {
  .tpager { flex-direction: column; align-items: flex-start; }
  .tpager__left { margin-right: 0; }
}

.tenders-empty {
  padding: var(--sp-6); text-align: center;
  border: 1px dashed var(--border); border-radius: var(--r-lg);
  color: var(--text-muted);
}

/* ---- Mobile: rows become cards ---- */
@media (max-width: 720px) {
  .tenders-table-wrap { border: none; overflow: visible; }
  .tenders-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tenders-table, .tenders-table tbody, .tenders-table tr, .tenders-table td { display: block; width: 100%; }
  .tenders-table tr {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-4);
    padding: var(--sp-2);
    background: #fff;
  }
  .tenders-table tbody tr:nth-child(even) { background: #fff; }
  .tenders-table td {
    border: none;
    padding: var(--sp-2) var(--sp-3);
    display: flex; justify-content: space-between; gap: var(--sp-4);
    text-align: right;
  }
  .tenders-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--brand);
    text-align: left;
    font-size: var(--fs-300);
  }
  .tenders-table td[data-label="Tender Description"] {
    flex-direction: column; text-align: left;
    border-bottom: 1px solid var(--border); padding-bottom: var(--sp-3);
  }
}

/* Download icon link (Tender Document + uploaded Additional Info) */
.tender-download {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; color: var(--brand-accent, #f47d20);
  text-decoration: none; white-space: nowrap;
}
.tender-download:hover { text-decoration: underline; }
.tender-download svg { flex-shrink: 0; }
.tender-info-text { display: inline-block; line-height: 1.5; }
