/* =========================================================
   Compras Abiertas – Portal Público
   Estilo institucional unificado
   ========================================================= */

/* Base */
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #f3f5f8;
  color: #222;
}

a {
  color: #005a9e;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* =========================================================
   Topbar
   ========================================================= */

.topbar {
  background: #002b5c;
  color: #ffffff;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-logo {
  height: 40px;
  width: auto;
}

.topbar-title {
  display: flex;
  flex-direction: column;
}

.topbar-title span:first-child {
  font-weight: 600;
  font-size: 18px;
}

.topbar-title span:last-child {
  font-size: 12px;
  opacity: 0.9;
}

.topbar-right,
.topbar-right a {
  font-size: 13px;
  color: #ffffff;
  opacity: 0.95;
}

.topbar-right a {
  margin-left: 14px;
  text-decoration: underline;
}

/* =========================================================
   Layout general
   ========================================================= */

.page-wrapper {
  max-width: 1100px;
  margin: 30px auto 40px auto;
  padding: 0 16px;
}

.page-header {
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 0 0 6px 0;
  font-size: 26px;
  color: #002b5c;
}

.page-header p {
  margin: 0;
  font-size: 14px;
  color: #555;
}

/* =========================================================
   Cards
   ========================================================= */

.card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  padding: 22px 24px;
  margin-bottom: 20px;
  border-top: 3px solid #005a9e;
}

/* =========================================================
   Portal grid
   ========================================================= */

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.portal-card {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #d6dbe5;
  padding: 20px 18px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.portal-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  border-color: #005a9e;
}

.portal-card h3 {
  margin: 0 0 6px 0;
  font-size: 18px;
  color: #003366;
}

.portal-card p {
  margin: 0;
  font-size: 13px;
  color: #555;
  line-height: 1.4;
}

/* Gestión interna (énfasis visual) */
.portal-card-interno {
  border-color: #c62828;
}

.portal-card-interno h3 {
  color: #c62828;
}

/* =========================================================
   Botones
   ========================================================= */

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: #005a9e;
  color: #ffffff;
}

.btn-secondary {
  background: #ffffff;
  color: #005a9e;
  border: 1px solid #005a9e;
}

/* NUEVO: botón chico para grillas compactas */
.btn-xs{
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 4px;
}

/* =========================================================
   ÚLTIMAS 5 PUBLICADAS (diseño tipo screenshot)
   ========================================================= */

.pub5-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 820px){
  .pub5-grid{ grid-template-columns: 1fr; }
}

.pub5-card{
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 18px;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.pub5-card:hover{
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.pub5-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  margin-bottom: 10px;
}

.pub5-title{
  margin: 0;
  font-weight: 800;
  font-size: 20px;
  line-height: 1.15;
  color: #0b2f5b;
}

.pub5-status{
  font-size: 16px;
  color: #1f2937;
  white-space: nowrap;
}

.pub5-lines{
  margin-top: 6px;
}

.pub5-line{
  margin: 6px 0 0 0;
  font-size: 14px;
  color: #334155;
  line-height: 1.35;
}

.pub5-label{
  color: #64748b;
}

.pub5-value{
  color: #005a9e; /* como link */
  font-weight: 600;
}

.pub5-detail{
  display: inline-block;
  margin-top: 14px;
  font-size: 14px;
  color: #64748b;
  text-decoration: none;
}

.pub5-detail:hover{
  text-decoration: underline;
}


/* =========================================================
   Footer
   ========================================================= */

.footer {
  margin-top: 30px;
  font-size: 11px;
  color: #777;
  text-align: right;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 820px){
  .pub5-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .page-wrapper {
    margin-top: 20px;
  }

  .topbar-right a {
    margin-left: 0;
    margin-right: 12px;
  }
}
