/* ============================================================
   Unicentro Cúcuta · Portal de Licitaciones — v3.0 Premium
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --color-primary:       #2d7a3a;
  --color-primary-dark:  #1e4d2b;
  --color-primary-light: #f0f7f1;
  --color-accent:        #5aab2a;
  --color-gold:          #c9a84c;
  --color-text:          #1a1a1a;
  --color-text-light:    #555555;
  --color-text-muted:    #888888;
  --color-bg:            #f8faf8;
  --color-white:         #ffffff;
  --color-border:        #e0ebe0;
  --color-success:       #2e7d32;
  --color-warning:       #f57c00;
  --color-danger:        #c62828;
  --color-info:          #1565c0;
  --shadow-sm:  0 2px 8px rgba(30,77,43,0.08);
  --shadow-md:  0 8px 24px rgba(30,77,43,0.12);
  --shadow-lg:  0 16px 48px rgba(30,77,43,0.16);
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* legacy aliases */
  --primary:       #2d7a3a;
  --primary-hover: #1e4d2b;
  --primary-light: #f0f7f1;
  --white:         #ffffff;
  --bg:            #f8faf8;
  --border:        #e0ebe0;
  --text:          #1a1a1a;
  --muted:         #888888;
  --danger:        #c62828;
  --danger-bg:     #ffebee;
  --danger-border: #ef9a9a;
  --success:       #2e7d32;
  --success-bg:    #e8f5e9;
  --success-border:#a5d6a7;
  --radius:        12px;
  --shadow:        0 2px 8px rgba(30,77,43,0.08);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--color-primary); text-decoration: none; }
.adjunto-link svg,
.alert svg,
.badge svg,
.doc-chip svg { vertical-align: -3px; flex-shrink: 0; }
.alert svg { margin-top: 1px; }
a:hover { text-decoration: none; }
small { font-size: 0.78rem; color: var(--color-text-muted); }

/* ── HEADER PÚBLICO ─────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 1000;
  height: 72px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.site-header.scrolled { box-shadow: var(--shadow-md); }

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo img { height: 48px; width: auto; }
.site-logo-text { display: flex; flex-direction: column; }
.site-logo-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-primary-dark);
  letter-spacing: 1.5px;
  line-height: 1.2;
}
.site-logo-sub {
  font-size: 11px;
  font-weight: 300;
  color: var(--color-text-muted);
  letter-spacing: 0.5px;
}

/* Nav central */
.site-nav {
  display: flex;
  align-items: center;
}
.site-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-light);
  padding: 8px 0;
  margin: 0 20px;
  text-decoration: none;
  position: relative;
  transition: color 0.2s;
}
.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--color-primary);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.site-nav a:hover { color: var(--color-primary); }
.site-nav a:hover::after { width: 100%; }

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-ghost {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  border-radius: 24px;
  padding: 8px 20px;
  background: transparent;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn-ghost:hover {
  background: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
}
.btn-accent-pill {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-white);
  background: var(--color-accent);
  border-radius: 24px;
  padding: 8px 20px;
  text-decoration: none;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-accent-pill:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

/* User dropdown */
.user-menu { position: relative; }
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.user-avatar:hover {
  background: var(--color-primary-dark);
  transform: scale(1.05);
}
.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  z-index: 1001;
}
.user-dropdown.open {
  display: block;
  animation: fadeInDrop 0.2s ease;
}
@keyframes fadeInDrop {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-primary-light);
}
.dropdown-header strong {
  display: block;
  font-size: 14px;
  color: var(--color-text);
  margin-bottom: 2px;
  font-weight: 600;
}
.dropdown-header span {
  font-size: 12px;
  color: var(--color-text-muted);
}
.dropdown-item {
  display: block;
  padding: 11px 20px;
  font-size: 14px;
  color: var(--color-text-light);
  text-decoration: none;
  transition: background 0.15s;
}
.dropdown-item:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  text-decoration: none;
}
.dropdown-item-danger { color: var(--color-danger); }
.dropdown-item-danger:hover { background: #fff5f5; color: var(--color-danger); }
.dropdown-divider { height: 1px; background: var(--color-border); margin: 4px 0; }

/* Hamburguesa */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  z-index: 1100;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary-dark);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menú móvil */
.mobile-menu {
  display: none;
  position: fixed;
  top: 72px; left: 0;
  width: 100%;
  background: var(--color-white);
  box-shadow: var(--shadow-md);
  z-index: 999;
  border-top: 1px solid var(--color-border);
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 16px 24px;
  color: var(--color-text-light);
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition);
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

/* Legacy header classes */
.btn-login  { border: 1.5px solid var(--color-primary) !important; color: var(--color-primary) !important; border-radius: 20px !important; background: transparent !important; padding: 8px 20px; font-size: 14px; }
.btn-login:hover  { background: var(--color-primary) !important; color: var(--color-white) !important; }
.btn-register { background: var(--color-accent) !important; color: var(--color-white) !important; border-radius: 20px !important; padding: 8px 20px; font-size: 14px; }
.btn-register:hover { background: var(--color-primary-dark) !important; color: var(--color-white) !important; }

/* ── HERO BANNER ─────────────────────────────────────────────── */
.hero-banner {
  min-height: 380px;
  background:
    radial-gradient(circle at 8% 15%, rgba(201,168,76,0.18) 0%, transparent 40%),
    linear-gradient(135deg, #163d22 0%, #1e4d2b 45%, #2d7a3a 85%, #357a2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  margin-top: 72px;
  padding: 64px 20px 56px;
  position: relative;
  overflow: hidden;
}
.hero-banner::before {
  content: '';
  position: absolute;
  top: -80px; left: -80px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
  animation: heroFloat 9s ease-in-out infinite;
}
.hero-banner::after {
  content: '';
  position: absolute;
  bottom: -100px; right: -60px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  pointer-events: none;
  animation: heroFloat 11s ease-in-out infinite reverse;
}
@keyframes heroFloat {
  0%, 100% { transform: translateY(0) translateX(0); }
  50%      { transform: translateY(-16px) translateX(10px); }
}
.hero-illustration {
  position: absolute;
  right: -20px;
  bottom: 0;
  width: min(46%, 560px);
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
}
.hero-illustration svg { width: 100%; height: auto; display: block; }
.hero-bg-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.14) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), transparent 70%);
          mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 620px; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--color-gold);
  text-transform: uppercase;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}
.hero-eyebrow::before,
.hero-eyebrow::after {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--color-gold);
  opacity: 0.7;
}
.hero-banner h1 {
  font-family: 'Playfair Display', serif;
  font-size: 48px;
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.15;
  position: relative;
  z-index: 1;
}
.hero-divider {
  width: 60px;
  height: 2px;
  background: var(--color-gold);
  margin: 16px auto;
  position: relative;
  z-index: 1;
}
.hero-banner p {
  font-size: 16px;
  font-weight: 300;
  color: rgba(255,255,255,0.85);
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ── STAT PILLS (barra de estadísticas del home) ────────────── */
.stat-pill-bar {
  position: relative;
  z-index: 10;
  width: fit-content;
  max-width: 980px;
  margin: -44px auto 0;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  padding: 8px;
}
.stat-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.stat-pill:hover { background: var(--color-primary-light); }
.stat-pill + .stat-pill { border-left: 1px solid var(--color-border); }
.stat-pill-icon {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-white);
  box-shadow: 0 6px 16px rgba(30,77,43,0.25);
}
.stat-pill-value {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--color-primary-dark);
  line-height: 1.1;
}
.stat-pill-label { font-size: 12.5px; color: var(--color-text-muted); font-weight: 500; }

/* ── SECCIÓN "CÓMO FUNCIONA" ─────────────────────────────────── */
.how-section { padding: 64px 20px 48px; text-align: center; }
.how-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--color-primary);
  text-transform: uppercase;
}
.how-title {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--color-text);
  margin: 8px 0 40px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}
.feature-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  text-align: left;
  position: relative;
  transition: var(--transition);
  overflow: hidden;
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.feature-step {
  position: absolute;
  top: 18px; right: 22px;
  font-family: 'Playfair Display', serif;
  font-size: 40px;
  font-weight: 700;
  color: var(--color-primary-light);
}
.feature-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: var(--color-white);
  margin-bottom: 18px;
  box-shadow: 0 8px 20px rgba(45,122,58,0.25);
}
.feature-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}
.feature-card p { font-size: 14px; color: var(--color-text-light); line-height: 1.6; }

/* ── SCROLL REVEAL ────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ── MAIN & CONTENEDOR ───────────────────────────────────────── */
main { min-height: calc(100vh - 72px); }
.main-with-header { padding-top: 72px; }
.page-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 48px;
}
.page-section-padded {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

/* ── FILTROS FLOTANTES ───────────────────────────────────────── */
.search-card {
  background: var(--color-white);
  padding: 20px 28px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: -32px auto 40px;
  max-width: 900px;
  position: relative;
  z-index: 10;
}
.search-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.search-input-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
  color: var(--color-text-muted);
}
.search-input-wrap input[type="text"] { padding-left: 40px; }
.search-select-wrap { min-width: 200px; }
/* legacy */
.search-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.search-input { flex: 1; min-width: 200px; }
.search-select { max-width: 220px; }

/* ── TARJETAS DE LICITACIONES ────────────────────────────────── */
.licit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
  padding-bottom: 60px;
}
.card-licitacion {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.card-licitacion::before {
  content: '';
  display: block;
  height: 4px;
  background: #9e9e9e;
  flex-shrink: 0;
}
.card-licitacion[data-estado="publicada"]::before        { background: #2d7a3a; }
.card-licitacion[data-estado="cierre_recepcion"]::before  { background: #9e9e9e; }
.card-licitacion[data-estado="evaluacion"]::before        { background: #1565c0; }
.card-licitacion[data-estado="seleccion"]::before         { background: #1565c0; }
.card-licitacion[data-estado="adjudicada"]::before        { background: #c9a84c; }
.card-licitacion[data-estado="en_ejecucion"]::before      { background: #00695c; }
.card-licitacion[data-estado="finalizada"]::before        { background: #37474f; }
.card-licitacion[data-estado="suspendida"]::before        { background: #f57c00; }
.card-licitacion[data-estado="desierta"]::before          { background: #c62828; }
.card-licitacion[data-estado="cancelada"]::before         { background: #c62828; }
.card-licitacion[data-estado="borrador"]::before          { background: #1565c0; }
.card-licitacion:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}
.card-licitacion-header {
  padding: 20px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.card-licitacion-body {
  padding: 16px 24px;
  flex: 1;
}
.card-licitacion-body .card-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 10px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chip-categoria {
  display: inline-block;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  margin-bottom: 10px;
}
.card-fecha { font-size: 13px; color: var(--color-text-muted); margin-bottom: 4px; }
.card-fecha strong { font-size: 14px; font-weight: 600; color: var(--color-text); }
.card-descripcion {
  font-size: 14px;
  color: var(--color-text-light);
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}
.card-licitacion-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.btn-card-detail {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-white);
  background: var(--color-primary);
  border-radius: 20px;
  padding: 8px 20px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-block;
}
.btn-card-detail:hover {
  background: var(--color-primary-dark);
  transform: scale(1.03);
  color: var(--color-white);
  text-decoration: none;
}

/* ── ESTADO VACÍO ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state-icon { display: inline-block; width: 160px; margin-bottom: 8px; }
.empty-state-icon svg { width: 100%; height: auto; display: block; }
.empty-state h3 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}
.empty-state p { color: var(--color-text-muted); }

/* ── DETALLE LICITACIÓN ──────────────────────────────────────── */
.licit-layout {
  display: grid;
  grid-template-columns: 65fr 35fr;
  gap: 32px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
}
.detail-header {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.breadcrumb { font-size: 12px; color: var(--color-text-muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-primary); }
.licit-detail-title {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text);
  margin-top: 12px;
  line-height: 1.25;
  overflow-wrap: break-word;
}
/* Legacy */
.licit-detail-header {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.detail-adjuntos {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  margin-top: 20px;
}

/* Info card sidebar */
.info-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  position: sticky;
  top: 88px;
}
.info-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 16px;
}
.info-row { margin-bottom: 20px; }
.info-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.info-value { font-size: 15px; font-weight: 600; color: var(--color-text); }
.inscritos-count {
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
/* Legacy info table */
.licit-info-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  position: sticky;
  top: 88px;
}
.info-table { width: 100%; font-size: 14px; }
.info-table th {
  text-align: left;
  color: var(--color-text-muted);
  font-weight: 500;
  padding: 8px 8px 8px 0;
  width: 40%;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
}
.info-table td {
  padding: 8px 0;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  font-weight: 500;
}
.info-table tr:last-child th,
.info-table tr:last-child td { border-bottom: none; }

/* ── ADJUNTOS ────────────────────────────────────────────────── */
.adjuntos-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.adjuntos-list-sm { font-size: 13px; }
.adjunto-link {
  color: var(--color-primary);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.adjunto-link:hover { color: var(--color-primary-dark); text-decoration: underline; }

/* ── BOTÓN INSCRIBIRSE ───────────────────────────────────────── */
.btn-inscribirse {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--color-accent);
  color: var(--color-white);
  padding: 14px;
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  margin-top: 20px;
}
.btn-inscribirse:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

/* ── FORMULARIOS ─────────────────────────────────────────────── */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px 48px;
  background: linear-gradient(135deg, #f0f7f1 0%, #ffffff 100%);
  min-height: calc(100vh - 72px);
}
.auth-card { width: 100%; }
.registro-card { max-width: 760px; }

/* ── AUTH SPLIT (login / registro / login admin) ─────────────── */
.auth-split-container {
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-height: calc(100vh - 72px);
  padding: 40px 20px;
  background: linear-gradient(135deg, #f0f7f1 0%, #ffffff 100%);
}
.auth-split {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 42fr 58fr;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.auth-split.auth-split-admin { grid-template-columns: 58fr 42fr; }
.auth-split.auth-split-admin .auth-split-brand { order: 2; }
.auth-split.auth-split-admin .auth-split-form  { order: 1; }

.auth-split-brand {
  position: relative;
  background:
    radial-gradient(circle at 15% 20%, rgba(201,168,76,0.16) 0%, transparent 45%),
    linear-gradient(160deg, #163d22 0%, #1e4d2b 55%, #2d7a3a 100%);
  padding: 44px 38px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--color-white);
  overflow: hidden;
}
.auth-split-brand-top { position: relative; z-index: 1; }
.auth-split-brand .logo-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-split-brand .logo-wrap img { height: 40px; width: auto; }
.auth-split-brand .logo-name { font-size: 14px; font-weight: 700; letter-spacing: 1.5px; display: block; }
.auth-split-brand .logo-sub  { font-size: 11px; color: rgba(255,255,255,0.6); display: block; }
.auth-split-brand h2 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 12px;
}
.auth-split-brand p { font-size: 14px; color: rgba(255,255,255,0.78); line-height: 1.6; max-width: 320px; }
.auth-split-badges { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.auth-split-badge { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255,255,255,0.88); }
.auth-split-badge .item-icon-wrap {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-gold);
}
.auth-split-illustration {
  position: absolute;
  bottom: -10px; right: -30px;
  width: 78%;
  opacity: 0.9;
  z-index: 0;
  pointer-events: none;
}
.auth-split-illustration svg { width: 100%; height: auto; display: block; }

.auth-split-form { padding: 56px 40px; display: flex; flex-direction: column; justify-content: flex-start; }
.auth-split-form .form-title { margin-bottom: 4px; }
.auth-split-form .form-subtitle { margin-bottom: 28px; }

@media (max-width: 860px) {
  .auth-split, .auth-split.auth-split-admin { grid-template-columns: 1fr; }
  .auth-split-brand { order: 1 !important; padding: 32px 28px; }
  .auth-split-form  { order: 2 !important; padding: 32px 28px; }
  .auth-split-illustration { width: 50%; opacity: 0.35; }
}

/* ── TIMELINE horizontal (ciclo de vida de una contratación) ─── */
.timeline {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0;
  margin: 4px 0 6px;
}
.timeline-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  flex: 1 1 0;
  min-width: 92px;
  padding-bottom: 0;
}
.timeline-dot-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  flex-shrink: 0;
}
.timeline-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary-light); color: var(--color-primary);
  flex-shrink: 0;
  border: none; padding: 0; font: inherit;
  position: relative; z-index: 2;
  cursor: help;
}
.timeline-item.is-done .timeline-dot { background: var(--color-primary); color: var(--color-white); }
.timeline-item.is-active .timeline-dot { background: var(--color-gold); color: var(--color-primary-dark); box-shadow: 0 0 0 4px rgba(201,168,76,0.25); }
.timeline-line { width: auto; height: 2px; flex: 1; background: var(--color-border); margin-top: 0; }
.timeline-item.is-done .timeline-line { background: var(--color-primary); }
.timeline-item:last-child .timeline-line { visibility: hidden; }
.timeline-body { padding-top: 10px; }
.timeline-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--color-text-muted); }
.timeline-value { font-size: 13.5px; font-weight: 600; color: var(--color-text); margin-top: 4px; }
.timeline-value-real { font-size: 11.5px; color: var(--color-text-muted); margin-top: 2px; }
.timeline-delayed {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--color-danger);
  background: #ffebee; border-radius: 20px; padding: 2px 8px; margin-top: 4px;
}
.timeline-item.is-pending .timeline-dot { background: var(--color-bg); color: var(--color-text-muted); border: 1.5px dashed var(--color-border); }
.timeline-item.is-pending .timeline-label,
.timeline-item.is-pending .timeline-value { color: var(--color-text-muted); }

/* En pantallas angostas la línea horizontal no cabe bien: vuelve a vertical. */
@media (max-width: 640px) {
  .timeline { flex-direction: column; }
  .timeline-item {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 14px;
    min-width: 0;
    padding-bottom: 26px;
  }
  .timeline-item:last-child { padding-bottom: 0; }
  .timeline-dot-wrap { flex-direction: column; width: auto; align-self: stretch; }
  .timeline-line { width: 2px; height: auto; flex: 1; margin-top: 4px; }
  .timeline-body { padding-top: 3px; text-align: left; }
}

/* ── TOOLTIPS DE AYUDA (campos de formulario y línea de tiempo) ── */
.field-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: none;
  padding: 0;
  margin-left: 5px;
  cursor: help;
  vertical-align: -3px;
  flex-shrink: 0;
}
.field-help:hover, .field-help:focus-visible { background: var(--color-primary); color: var(--color-white); outline: none; }
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%; bottom: calc(100% + 9px);
  transform: translateX(-50%) translateY(4px);
  background: #1a1a1a; color: #fff;
  font-size: 12px; font-weight: 400; line-height: 1.5; letter-spacing: normal; text-transform: none;
  padding: 8px 12px; border-radius: 8px;
  width: max-content; max-width: 230px;
  text-align: left; white-space: normal;
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 60;
}
[data-tooltip]::before {
  content: '';
  position: absolute;
  left: 50%; bottom: calc(100% + 3px);
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #1a1a1a;
  opacity: 0; visibility: hidden;
  transition: opacity .15s ease;
  z-index: 60;
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after, [data-tooltip].is-open::after {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
[data-tooltip]:hover::before, [data-tooltip]:focus-visible::before, [data-tooltip].is-open::before {
  opacity: 1; visibility: visible;
}
.timeline-item:first-child [data-tooltip]::after,
.timeline-item:first-child [data-tooltip]::before { left: 0; transform: none; }
.timeline-item:last-child [data-tooltip]::after,
.timeline-item:last-child [data-tooltip]::before { left: auto; right: 0; transform: none; }
.timeline-item:first-child [data-tooltip].is-open::after,
.timeline-item:first-child [data-tooltip]:hover::after,
.timeline-item:last-child [data-tooltip].is-open::after,
.timeline-item:last-child [data-tooltip]:hover::after { transform: translateY(0); }

/* ── CHIPS DE CATEGORÍA MÚLTIPLE ─────────────────────────────── */
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-row .chip-categoria { margin-bottom: 0; }

/* ── CONTROL DE CAMBIO DE ESTADO (admin) ─────────────────────── */
.estado-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.estado-control select {
  width: auto;
  min-width: 150px;
  padding: 6px 32px 6px 10px;
  background-position: right 8px center;
  background-size: 16px;
  font-size: 13px;
}
.estado-control-forzar {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.estado-control-obs {
  width: 100%;
  min-width: 220px;
  padding: 6px 10px;
  font-size: 13px;
  min-height: 34px;
}

/* ── TABLA DE HISTORIAL DE ESTADO ─────────────────────────────── */
.historial-estado-table { font-size: 13px; }
.historial-estado-table th { white-space: nowrap; }
.historial-estado-obs { color: var(--color-text-muted); font-style: italic; font-size: 12.5px; }

/* ── PLANTILLA OFICIAL (Registro de Proveedores) ─────────────── */
.plantilla-activa-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 12px;
}
.plantilla-activa-box .item-icon-wrap {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: var(--color-primary); color: var(--color-white);
  display: flex; align-items: center; justify-content: center;
}
.plantilla-activa-info { flex: 1; min-width: 0; }
.plantilla-activa-info strong { display: block; font-size: 13.5px; color: var(--color-primary-dark); }
.plantilla-activa-info span { font-size: 12px; color: var(--color-text-muted); }
.plantilla-none { color: var(--color-text-muted); font-size: 13.5px; font-style: italic; }

.form-card {
  width: 100%;
  max-width: 480px;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.form-card-wide { max-width: 760px; }

.form-card-header {
  background: linear-gradient(135deg, #1e4d2b, #2d7a3a);
  padding: 36px 40px;
  text-align: center;
}
.form-card-header .logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}
.form-card-header .logo-wrap img { height: 56px; width: auto; }
.form-card-header .logo-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-white);
  letter-spacing: 2px;
  display: block;
  text-align: left;
}
.form-card-header .logo-sub {
  font-size: 12px;
  font-weight: 300;
  color: rgba(255,255,255,0.7);
  display: block;
  text-align: left;
}
.form-card-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-white);
}
.form-card-header p {
  font-size: 14px;
  font-weight: 300;
  color: rgba(255,255,255,0.8);
  margin-top: 6px;
}
.form-card-body { padding: 40px; }

/* Legacy form helpers */
.auth-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 8px;
}
.auth-subtitle { font-size: 14px; color: var(--color-text-muted); margin-bottom: 32px; }
.auth-links { margin-top: 20px; text-align: center; font-size: 14px; color: var(--color-text-muted); }
.auth-links a { font-weight: 600; color: var(--color-primary); }
.admin-link { margin-top: 16px; text-align: center; }
.admin-link a { color: var(--color-text-muted); font-size: 13px; }
.admin-link a:hover { color: var(--color-primary); }
.admin-badge {
  display: inline-block;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.form-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 8px;
}
.form-subtitle { font-size: 14px; color: var(--color-text-muted); margin-bottom: 32px; }
.form-group { margin-bottom: 20px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--color-text);
  background: #fafafa;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}
.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-white);
  box-shadow: 0 0 0 4px rgba(45,122,58,0.1);
}

/* Flecha del <select> — appearance:none arriba la quita, se repone a medida */
select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23555555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  cursor: pointer;
}
input::placeholder, textarea::placeholder { color: #aaa; }
.input-error,
.form-control.error {
  border-color: var(--color-danger) !important;
  box-shadow: 0 0 0 4px rgba(198,40,40,0.1) !important;
}
.field-error, .form-error-msg {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--color-danger);
  margin-top: 4px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.form-divider {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
  margin: 20px 0;
  position: relative;
}
.form-divider::before, .form-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 30px);
  height: 1px;
  background: var(--color-border);
}
.form-divider::before { left: 0; }
.form-divider::after  { right: 0; }

/* Checkboxes de categorías */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  color: var(--color-text);
  background: #fafafa;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  border: 1.5px solid var(--color-border);
  transition: var(--transition);
}
.checkbox-item:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 500;
}
.checkbox-item:hover:not(:has(input:checked)) {
  border-color: rgba(45,122,58,0.5);
}
.checkbox-item input[type="checkbox"] {
  width: auto;
  flex-shrink: 0;
  accent-color: var(--color-primary);
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.no-categorias { color: var(--color-text-muted); font-size: 14px; font-style: italic; }

/* ── BOTONES ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  border: none;
  line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn:disabled:hover { transform: none; }
.btn-primary { background: var(--color-primary); color: var(--color-white); }
.btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-1px); color: var(--color-white); }
.btn-secondary { background: transparent; border: 1.5px solid var(--color-primary); color: var(--color-primary); }
.btn-secondary:hover { background: var(--color-primary-light); color: var(--color-primary); }
.btn-danger { background: var(--color-danger); color: var(--color-white); }
.btn-danger:hover { background: #b71c1c; color: var(--color-white); }
.btn-success { background: var(--color-success); color: var(--color-white); }
.btn-success:hover { background: #1b5e20; color: var(--color-white); }
.btn-warning { background: var(--color-warning); color: var(--color-white); }
.btn-warning:hover { background: #e65100; color: var(--color-white); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
}
.btn.btn-primary.btn-block {
  background: linear-gradient(135deg, #2d7a3a, #1e4d2b);
  color: var(--color-white);
}
.btn.btn-primary.btn-block:hover {
  background: linear-gradient(135deg, #1e4d2b, #163d22);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--color-white);
}
.btn-link {
  color: var(--color-primary);
  text-decoration: underline;
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

/* ── ALERTAS FLASH ───────────────────────────────────────────── */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideDown 0.3s ease;
  font-size: 14px;
}
.alert-success { background: #f0faf0; border: 1px solid #a8d5a8; color: #1e4d2b; }
.alert-danger  { background: #fff5f5; border: 1px solid #f5a8a8; color: #7d1f1f; }
.alert-error   { background: #fff5f5; border: 1px solid #f5a8a8; color: #7d1f1f; }
.alert-info    { background: #f0f4ff; border: 1px solid #a8b8f5; color: #1f3a7d; }
.alert-warning { background: #fff8e1; border: 1px solid #f5d98a; color: #7d5a00; }

/* ── BADGES DE ESTADO ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  gap: 4px;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.badge-lg { font-size: 13px; padding: 5px 14px; }
.badge-abierta    { background: #e8f5e9; color: #2e7d32; }
.badge-abierta::before    { background: #2e7d32; }
.badge-cerrada    { background: #f5f5f5; color: #757575; }
.badge-cerrada::before    { background: #757575; }
.badge-suspendida { background: #fff8e1; color: #f57c00; }
.badge-suspendida::before { background: #f57c00; }
.badge-desierta   { background: #ffebee; color: #c62828; }
.badge-desierta::before   { background: #c62828; }
.badge-borrador   { background: #e3f2fd; color: #1565c0; }
.badge-borrador::before   { background: #1565c0; }
.badge-pendiente  { background: #e3f2fd; color: #1565c0; }
.badge-pendiente::before  { background: #1565c0; }

/* Ciclo de vida de contrataciones (etapas nuevas) */
.badge-publicada        { background: #e8f5e9; color: #2e7d32; }
.badge-publicada::before        { background: #2e7d32; }
.badge-cierre_recepcion { background: #f5f5f5; color: #757575; }
.badge-cierre_recepcion::before { background: #757575; }
.badge-evaluacion       { background: #e3f2fd; color: #1565c0; }
.badge-evaluacion::before       { background: #1565c0; }
.badge-seleccion        { background: #e3f2fd; color: #1565c0; }
.badge-seleccion::before        { background: #1565c0; }
.badge-adjudicada       { background: #fdf6e3; color: #a8862f; }
.badge-adjudicada::before       { background: #c9a84c; }
.badge-en_ejecucion     { background: #e0f2f1; color: #00695c; }
.badge-en_ejecucion::before     { background: #00695c; }
.badge-finalizada       { background: #eceff1; color: #37474f; }
.badge-finalizada::before       { background: #37474f; }
.badge-cancelada        { background: #ffebee; color: #c62828; }
.badge-cancelada::before        { background: #c62828; }

/* Etapa del proceso por proveedor inscrito (independiente del estado de la contratación) */
.badge-inscrito       { background: #e3f2fd; color: #1565c0; }
.badge-inscrito::before       { background: #1565c0; }
.badge-evaluado        { background: #ede7f6; color: #5e35b1; }
.badge-evaluado::before        { background: #5e35b1; }
.badge-mejora-propuesta        { background: #fdf6e3; color: #a8862f; }
.badge-mejora-propuesta::before        { background: #c9a84c; }
.badge-ganador           { background: #e8f5e9; color: #2e7d32; }
.badge-ganador::before           { background: #2e7d32; }
.badge-no_seleccionado  { background: #f5f5f5; color: #757575; }
.badge-no_seleccionado::before  { background: #757575; }
.badge-rechazado        { background: #ffebee; color: #c62828; }
.badge-rechazado::before        { background: #c62828; }

/* Tipo de acceso de la contratación (independiente del estado/etapa) */
.badge-tipo-publica  { background: #e3f2fd; color: #1565c0; }
.badge-tipo-publica::before  { background: #1565c0; }
.badge-tipo-cerrada  { background: #fdf6e3; color: #a8862f; }
.badge-tipo-cerrada::before  { background: #c9a84c; }

/* ── SIDEBAR ADMIN ───────────────────────────────────────────── */
.admin-body { background: var(--color-bg); }

.sidebar {
  position: fixed;
  left: 0; top: 0;
  height: 100vh;
  width: 260px;
  z-index: 900;
  background: linear-gradient(180deg, #1a3d24 0%, #0f2516 100%);
  border-right: 1px solid rgba(255,255,255,0.05);
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  overflow-y: auto;
  padding-bottom: 20px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
}
.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sidebar-logo-img {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.sidebar-logo-img img { height: 40px; width: auto; }
.sidebar-logo-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: 2px;
}
.sidebar-logo-sub {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}
.sidebar-gold-line {
  width: 32px;
  height: 2px;
  background: var(--color-gold);
  margin-top: 12px;
}
.sidebar-section-title {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  padding: 24px 16px 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.sidebar-nav { padding: 8px 0; flex: 1; }
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border-left: 3px solid transparent;
  margin-bottom: 2px;
}
.sidebar-item:hover {
  background: rgba(255,255,255,0.08);
  color: var(--color-white);
  border-left-color: var(--color-accent);
  text-decoration: none;
}
.sidebar-item.active {
  background: rgba(255,255,255,0.12);
  color: var(--color-white);
  border-left-color: var(--color-gold);
}
.item-icon { font-size: 16px; flex-shrink: 0; opacity: 0.8; display: inline-flex; }
.item-icon svg { width: 18px; height: 18px; }
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logout { border-top: 1px solid rgba(255,255,255,0.08); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 899;
}
.sidebar-overlay.open { display: block; }

/* ── CONTENIDO ADMIN ─────────────────────────────────────────── */
.admin-layout {
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.admin-header {
  background: var(--color-white);
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-header-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin: 0;
}
.admin-header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--color-text-muted);
}
.admin-header-user strong { color: var(--color-text); }
.notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--color-primary-dark);
  padding: 4px;
}
.notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--color-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.notif-badge-bell {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 17px;
  height: 17px;
  font-size: 10px;
  border: 2px solid var(--color-white);
}
.btn-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--color-primary-dark);
  font-size: 22px;
  line-height: 1;
  align-items: center;
}
.admin-content {
  flex: 1;
  padding: 24px;
  background: var(--color-bg);
}

/* ── MÉTRICAS ─────────────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.metric-card {
  background: var(--color-white);
  padding: 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--color-primary);
  transition: var(--transition);
}
.metric-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.metric-icon { font-size: 36px; margin-bottom: 12px; display: block; }
.metric-icon-wrap {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: var(--color-white);
  margin-bottom: 14px;
  box-shadow: 0 8px 18px rgba(45,122,58,0.22);
}
.metric-icon-wrap.gold { background: linear-gradient(135deg, var(--color-gold), #a8862f); box-shadow: 0 8px 18px rgba(201,168,76,0.3); }
.metric-value {
  font-family: 'Playfair Display', serif;
  font-size: 40px;
  font-weight: 700;
  color: var(--color-primary-dark);
  line-height: 1;
}
.metric-label { font-size: 14px; color: var(--color-text-muted); margin-top: 4px; }

/* Legacy stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--color-primary);
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card-highlight { border-top-color: var(--color-accent); }
.stat-number { font-family: 'Playfair Display', serif; font-size: 2.25rem; font-weight: 700; color: var(--color-primary-dark); line-height: 1; }
.stat-label  { font-size: .8rem; color: var(--color-text-muted); margin-top: .35rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-action { color: var(--color-primary); font-weight: 600; font-size: .875rem; }

/* ── DASHBOARD PROVEEDOR ─────────────────────────────────────── */
.proveedor-dash-hero {
  background: linear-gradient(135deg, #1e4d2b, #2d7a3a);
  padding: 40px 24px;
  margin-bottom: 32px;
}
.proveedor-dash-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.proveedor-dash-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 6px;
}
.proveedor-dash-hero p {
  font-size: 14px;
  font-weight: 300;
  color: rgba(255,255,255,0.8);
}
.dash-greeting { margin-bottom: 28px; }
.dash-greeting h1 { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; color: var(--color-primary-dark); }
.dash-greeting h1 span { color: var(--color-text); }

/* ── TABLAS ──────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead th {
  background: var(--color-primary-dark);
  color: var(--color-white);
  padding: 12px 16px;
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
}
.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.table tbody tr:hover td { background: var(--color-primary-light); }
.table tbody tr:nth-child(even) td { background: #fafafa; }
.table tbody tr:nth-child(even):hover td { background: var(--color-primary-light); }
.table tbody tr:last-child td { border-bottom: none; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.actions-cell { white-space: nowrap; }
.actions-cell .btn + .btn,
.actions-cell .btn + form,
.actions-cell form + form { margin-left: 4px; }

/* ── SUBIDA DE DOCUMENTOS ────────────────────────────────────── */
.doc-upload-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.doc-upload-item {
  background: var(--color-white);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.doc-upload-item.has-file { border-color: var(--color-primary); border-style: solid; background: var(--color-primary-light); }
.doc-upload-item.has-error { border-color: var(--color-danger); background: #ffebee; }
.doc-upload-icon { font-size: 28px; flex-shrink: 0; }
.doc-upload-info { flex: 1; }
.doc-upload-name { font-size: 14px; font-weight: 600; color: var(--color-text); margin-bottom: 2px; }
.doc-upload-desc { font-size: 12px; color: var(--color-text-muted); }
input[type="file"] { font-size: 13px; padding: 6px 0; cursor: pointer; width: 100%; }
.doc-upload-group { padding: 16px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
.doc-upload-group.has-error { border-color: var(--color-danger); background: #ffebee; }

/* ── HISTORIAL PROVEEDOR ─────────────────────────────────────── */
.historial-card { background: var(--color-white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); margin-bottom: 16px; overflow: hidden; }
.historial-card-header { background: var(--color-primary-light); padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.historial-card-body { padding: 16px 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ── CARD GENERAL ────────────────────────────────────────────── */
.card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  padding: 24px;
}

/* ── HEADINGS & HELPERS ──────────────────────────────────────── */
.page-heading { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; color: var(--color-primary-dark); margin-bottom: 1.5rem; }
.page-header-bar { margin-bottom: 24px; }
.page-title { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 700; color: var(--color-primary-dark); margin-bottom: 6px; }
.page-subtitle { color: var(--color-text-muted); font-size: 15px; }
.card-header-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.card-heading { font-family: 'Playfair Display', serif; font-size: 17px; font-weight: 700; color: var(--color-primary-dark); margin-bottom: 16px; }
.section-heading { font-size: 16px; font-weight: 600; color: var(--color-primary-dark); margin-bottom: 14px; }
.text-muted { color: var(--color-text-muted); }
.empty-msg { color: var(--color-text-muted); font-size: .9rem; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--color-text-muted); font-size: 14px; margin-bottom: 20px; transition: var(--transition); }
.back-link:hover { color: var(--color-primary); }

/* ── INSCRITOS CARDS ─────────────────────────────────────────── */
.inscritos-list { display: flex; flex-direction: column; gap: 16px; }
.inscrito-card { padding: 20px; }
.inscrito-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.inscrito-meta { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--color-text-muted); margin-bottom: 12px; }
.inscrito-docs { margin-top: 8px; }
.docs-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-chip { background: var(--color-primary-light); color: var(--color-primary-dark); padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; text-decoration: none; }
.doc-chip:hover { background: #c8e6c9; text-decoration: none; }

/* ── LAYOUT 2 COLUMNAS ───────────────────────────────────────── */
.two-col-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }

/* ── LEGACY LICIT CLASSES ────────────────────────────────────── */
.licit-card { display: flex; flex-direction: column; }
.licit-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.licit-cat { font-size: 13px; color: var(--color-text-muted); font-weight: 500; }
.licit-title { font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 600; color: var(--color-text); margin-bottom: 8px; line-height: 1.4; }
.licit-title a { color: inherit; }
.licit-title a:hover { color: var(--color-primary); }
.licit-excerpt { font-size: 14px; color: var(--color-text-muted); line-height: 1.5; flex: 1; }
.licit-meta { font-size: 13px; color: var(--color-text-muted); margin-top: 12px; }
.licit-sidebar .licit-info-card { position: sticky; top: 88px; }

/* ── FOOTER CORPORATIVO ─────────────────────────────────────── */
.site-footer {
  background: #0f2516;
  padding: 48px 0 24px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
}
.footer-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.footer-logo-wrap img { height: 44px; width: auto; }
.footer-logo-name { font-size: 16px; font-weight: 600; color: var(--color-white); display: block; }
.footer-logo-sub { font-size: 13px; color: rgba(255,255,255,0.5); display: block; }
.footer-gold-line { width: 40px; height: 2px; background: var(--color-gold); margin-top: 12px; }
.footer-col-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 14px; color: rgba(255,255,255,0.6); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--color-white); }
.footer-contact p { font-size: 14px; color: rgba(255,255,255,0.6); margin-bottom: 4px; }
.footer-separator { height: 1px; background: rgba(255,255,255,0.08); margin: 32px 0; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.footer-bottom p { font-size: 13px; color: rgba(255,255,255,0.4); }
.footer-bottom span { font-size: 12px; color: rgba(255,255,255,0.3); }
/* legacy */
.footer-logo { font-size: 18px; font-weight: 700; color: var(--color-white); }
.footer-logo span { display: block; font-size: 12px; font-weight: 400; color: rgba(255,255,255,0.55); }
.footer-copy { font-size: 13px; color: rgba(255,255,255,0.4); }

/* ── ERROR PAGE ──────────────────────────────────────────────── */
.error-code { font-family: 'Playfair Display', serif; font-size: 5rem; font-weight: 700; color: var(--color-primary-dark); line-height: 1; margin-bottom: 8px; }
.error-message { color: var(--color-text-muted); font-size: 1.05rem; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-260px); }
  .sidebar.open { transform: translateX(0); }
  .admin-layout { margin-left: 0; }
  .btn-sidebar-toggle { display: flex; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .hero-illustration { width: 40%; opacity: 0.6; }
}

@media (max-width: 768px) {
  .site-nav { display: none; }
  .hamburger { display: flex; }
  .header-actions .btn-ghost,
  .header-actions .btn-accent-pill { display: none; }
  .hero-banner { height: 200px; }
  .hero-banner h1 { font-size: 28px; }
  .hero-banner p { font-size: 14px; }
  .licit-grid { grid-template-columns: 1fr; }
  .licit-layout { grid-template-columns: 1fr; }
  .licit-sidebar .licit-info-card { position: static; }
  .info-card { position: static; }
  .two-col-layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .checkbox-grid { grid-template-columns: repeat(2, 1fr); }
  .table { font-size: 13px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .historial-card-body { grid-template-columns: 1fr 1fr; }
  .footer-top { flex-direction: column; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .licit-detail-title { font-size: 22px; }
  .proveedor-dash-hero { padding: 28px 20px; }
  .proveedor-dash-hero h1 { font-size: 22px; }
  .stat-pill-bar { width: calc(100% - 40px); margin-top: -28px; }
  .stat-pill { width: 100%; }
  .stat-pill + .stat-pill { border-left: none; border-top: 1px solid var(--color-border); }
  .feature-grid { grid-template-columns: 1fr; }
  .how-title { font-size: 24px; }
  .hero-illustration { display: none; }
}

@media (max-width: 480px) {
  .checkbox-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-card-body { padding: 24px; }
  .form-card-header { padding: 28px 24px; }
  .hero-banner { height: 160px; }
  .hero-banner h1 { font-size: 22px; }
  .hero-banner p { font-size: 13px; }
  .historial-card-body { grid-template-columns: 1fr; }
  .page-section { padding: 0 16px 32px; }
  .admin-content { padding: 16px; }
  .card { padding: 16px; }
  .licit-detail-header { padding: 20px; }
  .card-licitacion { border-radius: 12px; }
}
