/* =========================
   TENDER LIST & SINGLE: BASE
   ========================= */
.tender-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.tender-sidebar {
  flex: 1 1 20%;
  border-right: 1px solid #ddd;
  padding-right: 15px;
}

.tender-content {
  flex: 1 1 75%;
}

/* Card */
.tender-item {
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 20px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

/* Sidebar */
.tender-sidebar h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #333;
  font-weight: 700;
  border-bottom: 2px solid #000;
  padding-bottom: 5px;
}

.tender-sidebar ul { list-style: none; margin: 0; padding: 0; }
.tender-sidebar ul li { margin-bottom: 5px; }
.tender-sidebar ul li a {
  display: block;
  padding: 5px;
  font-size: 14px;
  color: #333;
  text-decoration: none;
  border-radius: 3px;
}
.tender-sidebar ul li a:hover { background:#f4f4f4; color:#0073aa; }
.tender-sidebar ul li.active a { font-weight: 700; color:#0073aa; }

/* Table */
.tender-details-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  border-radius: 5px;
  overflow: hidden;
}
.tender-details-table td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  vertical-align: top;
}
.tender-details-table tr:last-child td { border-bottom: none; }

.tender-status-active   { color: #008000; font-weight: 700; }
.tender-status-closed   { color: #d67f00; font-weight: 700; }
.tender-status-archived { color: #cc0000; font-weight: 700; }

/* Pagination */
.tender-pagination { text-align: center; margin-top: 20px; }
.tender-pagination a {
  margin: 0 5px;
  padding: 5px 10px;
  text-decoration: none;
  color: #0073aa;
  border: 1px solid #ddd;
  border-radius: 3px;
}
.tender-pagination a:hover { background:#0073aa; color:#fff; }

/* Search form */
.tender-search-form {
  display: flex;
  align-items: flex-end;
  gap: 15px;
  margin: 0 0 20px;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  flex-wrap: wrap;
  justify-content: space-between;
}
.tender-search-form div { flex: 1; min-width: 220px; }
.tender-search-form label {
  display:block;
  font-size:12px;
  font-weight:700;
  margin-bottom:5px;
  color:#333;
}
.tender-search-form input[type="date"],
.tender-search-form input[type="text"] {
  width:100%;
  padding:10px;
  border:1px solid #ddd;
  border-radius:5px;
  font-size:14px;
}
.tender-search-form button.search-button {
  padding: 12px 18px;
  background:#0073aa;
  color:#fff;
  border:none;
  border-radius:5px;
  cursor:pointer;
  font-size:16px;
  flex-shrink:0;
  min-width: 140px;
  transition: background .2s ease;
}
.tender-search-form button.search-button:hover { background:#005880; }

/* Downloads */
.download-buttons-row,
.addendums-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.download-button {
  display: inline-block;
  padding: 10px 15px;
  background: #0073aa;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  font-size: 14px;
  text-align: center;
  transition: background .2s ease;
}
.download-button:hover { background:#005880; }

.addendums-row .download-button { text-align:center; }

.tender-addendums-p { margin:0 !important; padding-top:10px; }

/* =========================
   RESPONSIVE
   ========================= */

/* Small phones: extra legibility */
@media (max-width: 420px) {
  .tender-title { font-size: 1.25rem; }
  .download-button { padding: 12px; font-size: 15px; }
  .tender-sidebar h3 { font-size: 15px; }
  .tender-search-form input[type="date"],
  .tender-search-form input[type="text"] { font-size: 15px; }
}

/* Mobile (tables → blocks, full-width buttons) */
@media (max-width: 767px) {
  /* Layout stacks */
  .tender-container { flex-direction: column; gap: 12px; }
  .tender-sidebar {
    flex: 1 1 100%;
    border-right: 0;
    border-bottom: 1px solid #ddd;
    padding-right: 0;
    padding-bottom: 10px;
  }
  .tender-content { flex: 1 1 100%; }

  /* Table becomes block rows */
  .tender-details-table,
  .tender-details-table tbody,
  .tender-details-table tr,
  .tender-details-table td {
    display: block;
    width: 100%;
  }
  .tender-details-table { box-shadow: none; }
  .tender-details-table tr {
    background: #fff;
    margin-bottom: 10px;
    border-bottom: 8px solid #f5f5f5;
  }
  .tender-details-table tr:last-child { border-bottom: 0; }
  .tender-details-table td {
    border-bottom: 1px solid #eee;
    padding: 10px 12px;
  }
  .tender-details-table td:last-child { border-bottom: 0; }

  /* Buttons full width for easy tap targets */
  .download-button,
  .addendums-row .download-button {
    width: 100%;
    flex: 1 1 100%;
  }

  /* Search form stacks */
  .tender-search-form { gap: 10px; }
  .tender-search-form div,
  .tender-search-form button.search-button {
    width: 100%;
    margin-top: 8px;
  }
}

/* Desktop niceties */
@media (min-width: 768px) {
  .download-buttons-row .download-button { margin-top: 0; }
  .addendums-row .download-button { flex: 0 0 auto; }
  .tender-search-form button.search-button { margin-top: 16px; }
}
