/* =============================================
   ContratoEC — Design System Propio
   Dark modern UI, accent azul eléctrico
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: dark;
  /* Paleta propia */
  --bg-base: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-input: #0f172a;
  --bg-muted: #1e293b;
  --border: rgba(255,255,255,0.1);
  --border-strong: rgba(255,255,255,0.2);
  
  /* Acento principal: azul eléctrico */
  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-glow: rgba(249, 115, 22, 0.25);
  --accent-faint: rgba(249, 115, 22, 0.1);

  /* Texto */
  --text-1: #f8fafc;
  --text-2: #94a3b8;
  --text-3: #64748b;

  /* Estado colores */
  --green:    #10b981;
  --green-bg: rgba(16,185,129,0.12);
  --amber:    #f59e0b;
  --amber-bg: rgba(245,158,11,0.12);
  --red:      #ef4444;
  --red-bg:   rgba(239,68,68,0.1);

  /* Tipografía y radios Apple-style */
  --font: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  --text-landing-title: clamp(2.1rem, 1.45rem + 2.4vw, 3.35rem);
  --text-editorial-title: clamp(1.9rem, 1.45rem + 1.8vw, 2.75rem);
  --text-page-title: clamp(1.5rem, 1.32rem + 0.65vw, 1.85rem);
  --text-section-title: clamp(1.35rem, 1.15rem + 0.8vw, 1.85rem);
  --text-page-sub: 0.92rem;
  --text-editorial-sub: 0.98rem;
  --text-body: 0.9375rem;
  --text-caption: 0.75rem;
  --radius:    16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 4px 20px -2px rgba(0,0,0,0.3);
  --shadow-lg: 0 16px 40px -4px rgba(0,0,0,0.55);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: var(--text-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  text-wrap: balance;
}
.hero-sub,
.pf-autofill-sub,
.pres-hero-sub,
.perfil-subtitle,
.apple-hero-sub,
.feat-hero-sub,
.how-sub,
.pricing-sub,
.privacy-sub,
.terms-sub {
  text-wrap: pretty;
}

/* ─── SCROLLBARS GLOBALES INTEGRADAS Y DISCRETAS (ESTILO DARK UNIFICADO) ─── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* ===========================
   NAV (Apple Minimalist Frosted Header)
   =========================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-brand a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.nav-brand a:hover {
  opacity: 0.92;
}
.nav-brand a:hover .nav-logo-img {
  transform: scale(1.05);
}
.nav-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  box-shadow: none;
}

.nav-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.footer-mini-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}
.nav-brand-name {
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--text-1);
  letter-spacing: -0.025em;
  white-space: nowrap;
}
.nav-brand-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-faint);
  border: 1px solid rgba(249, 115, 22, 0.3);
  padding: 2px 7px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* APPLE-STYLE NAV LINKS - TEXTO LIMPIO SIN CUADROS NI BORDES */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 0 8px;
}
.nav-menu::-webkit-scrollbar {
  display: none;
}
.nav-link {
  font-size: 0.84rem;
  font-weight: 450;
  letter-spacing: -0.012em;
  color: rgba(241, 245, 249, 0.72);
  text-decoration: none;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  transition: color 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-link:hover {
  color: #ffffff;
  background: transparent !important;
  border: none !important;
}
.nav-link.is-active, .nav-link.active {
  color: #ffffff;
  font-weight: 600;
}
.nav-link.is-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
#btnPerfilContratista,
.nav-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 0.82rem;
  transition: background 0.18s ease, border-color 0.18s ease;
}
#btnPerfilContratista:hover,
.nav-profile-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}
#btnPerfilContratista.is-active,
.nav-profile-pill.is-active {
  background: rgba(249, 115, 22, 0.16);
  border-color: rgba(249, 115, 22, 0.45);
  color: #ffffff;
}
.nav-admin-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  border-radius: 9999px;
  border: 1px solid rgba(249, 115, 22, 0.35);
  background: rgba(249, 115, 22, 0.12);
  color: #fdba74;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.79rem;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.nav-admin-pill:hover,
.nav-admin-pill.is-active {
  background: #f97316;
  border-color: #f97316;
  color: #ffffff;
}
.nav-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 11px;
  border-radius: 9999px;
}
.nav-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.nav-live-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: -0.005em;
}

/* BOTON LIMPIO ESTILO APPLE EN BUSQUEDA SIN RESULTADOS */
.btn-switch-category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 980px;
  color: var(--text-1);
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}
.btn-switch-category:hover {
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.45);
  color: #fb923c;
  transform: translateY(-1px);
}

/* ===========================
   HERO (Apple-style typography & ambient lighting)
   =========================== */
.hero {
  background: var(--bg-base, #0f172a);
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  position: relative;
  z-index: 30;
  overflow: visible;
}
.hero::before {
  display: none;
}
.hero-inner {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
}
.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-page-title);
  font-weight: 750;
  line-height: 1.22;
  letter-spacing: -0.025em;
  color: var(--text-1);
  margin-bottom: 4px;
}
.hero-accent {
  color: var(--accent);
}
.hero-sub {
  font-size: var(--text-page-sub);
  color: #94a3b8;
  font-weight: 450;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  max-width: 64ch;
  line-height: 1.48;
}

/* SEARCH BOX */
.search-box {
  position: relative;
  z-index: 35;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 15px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.28);
}
.search-row-main {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon-inner {
  position: absolute;
  left: 12px;
  color: var(--text-3);
  pointer-events: none;
  flex-shrink: 0;
}
.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  color: var(--text-1);
  font-family: var(--font);
  font-size: 0.88rem;
  letter-spacing: -0.01em;
  padding: 8px 12px 8px 36px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-input::placeholder { color: var(--text-3); }
.clear-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 0.75rem;
}
.clear-btn:hover { color: var(--text-2); }
.btn-search {
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  box-shadow: 0 2px 10px rgba(249, 115, 22, 0.25);
}
.btn-search:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35);
  transform: translateY(-1px);
}
.btn-search:active { transform: translateY(0) scale(0.98); }

.search-row-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 8px;
}
.search-row-filters .autocomplete-wrapper {
  flex: 1 1 240px;
  min-width: 0;
}
.btn-tools-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  color: #ffffff;
  font-family: var(--font);
  font-size: 0.81rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.btn-tools-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}
.btn-tools-toggle.is-open {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.5);
  color: #ffffff;
}
.tools-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.75);
  flex-shrink: 0;
}
.search-tools-panel {
  display: block;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-bottom: 0;
  padding: 0;
  border-top: 1px solid transparent;
  transform: translateY(-4px);
  pointer-events: none;
  visibility: hidden;
  transition:
    max-height 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.18s ease,
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    margin-bottom 0.22s ease,
    padding 0.22s ease,
    border-color 0.22s ease,
    visibility 0.24s;
}
.search-tools-panel.is-open {
  max-height: 110px;
  opacity: 1;
  overflow: visible;
  margin-bottom: 8px;
  padding: 7px 2px 3px;
  border-top-color: rgba(255, 255, 255, 0.08);
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
  position: relative;
  z-index: 60;
}
.search-tools-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
.gtool-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.gtool-native-select {
  display: none !important;
}
.gtool-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #ffffff;
  font-family: var(--font);
  font-size: 0.79rem;
  font-weight: 500;
  padding: 5px 10px;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}
.gtool-trigger:hover,
.gtool-dropdown.is-menu-open .gtool-trigger {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}
.gtool-item.is-filtered .gtool-trigger {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.42);
  color: #ffffff;
  font-weight: 600;
}
.gtool-caret {
  position: static;
  color: #ffffff;
  pointer-events: none;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.gtool-dropdown.is-menu-open .gtool-caret {
  transform: rotate(180deg);
}
.gtool-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  max-width: min(320px, 82vw);
  padding: 5px;
  background: var(--bg-card, #111827);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.62);
  z-index: 1200;
  display: none;
  flex-direction: column;
  gap: 2px;
}
.gtool-dropdown.is-menu-open .gtool-menu {
  display: flex;
}
.gtool-option {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: #ffffff;
  font-family: var(--font);
  font-size: 0.79rem;
  font-weight: 450;
  padding: 7px 10px;
  cursor: pointer;
  transition: background-color 0.14s ease;
}
.gtool-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.gtool-option.is-selected {
  background: rgba(249, 115, 22, 0.16);
  color: #ffffff;
  font-weight: 600;
}
.gtool-clear-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #ffffff;
  font-family: var(--font);
  font-size: 0.76rem;
  font-weight: 500;
  padding: 4px 8px;
  cursor: pointer;
  transition: background-color 0.16s ease;
}
.gtool-clear-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.filter-input, .filter-select {
  flex: 1;
  min-width: 0;
  height: 34px;
  box-sizing: border-box;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  color: var(--text-1);
  font-family: var(--font);
  font-size: 0.82rem;
  letter-spacing: -0.005em;
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.filter-input:focus, .filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.filter-input::placeholder { color: var(--text-3); }
.filter-select option { background: var(--bg-card); }

/* SELECTOR DE ETAPA ACTIVA DEL PROCESO (SERCOP / LICITA.EC) */
.filter-select-etapa {
  cursor: pointer;
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(15, 23, 42, 0.92);
  font-weight: 500;
}
.filter-select-etapa:hover {
  border-color: rgba(16, 185, 129, 0.5);
}
.filter-select-etapa:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-bg);
}

/* QUICK TAGS & SMART SWITCH BOTTOM BAR */
.search-bottom-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.quick-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.qtag-label {
  font-size: 0.74rem;
  color: var(--text-3);
  font-weight: 600;
  margin-right: 2px;
}
.qtag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 0.71rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  padding: 3px 9px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.qtag:hover {
  border-color: rgba(249, 115, 22, 0.35);
  color: #fb923c;
  background: rgba(249, 115, 22, 0.1);
  transform: translateY(-1px);
}
.smart-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 4px 8px 4px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9999px;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.smart-switch-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-1);
}
.smart-switch-btn.is-active {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.42);
  color: #f8fafc;
}
.smart-switch-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 30px;
  height: 17px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.18);
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}
.smart-switch-btn.is-active .smart-switch-track {
  background: #10b981;
}
.smart-switch-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  transform: translateX(2px);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.smart-switch-btn.is-active .smart-switch-thumb {
  transform: translateX(15px);
}

/* ===========================
   TOPBAR RESULTADOS (Apple Segmented Bar)
   =========================== */
.topbar {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 10;
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 24px;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.tab-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 3px;
  border-radius: 980px;
}
.tab-pill {
  padding: 5px 16px;
  border-radius: 980px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tab-pill:hover {
  color: var(--text-1);
}
.tab-sel {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.topbar-right {
  position: absolute;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.res-count {
  font-size: 0.82rem;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.btn-sync-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-sync-mini:hover {
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  transform: translateY(-1px);
}
.btn-sync-mini.spinning svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ALERTA */
.alert-strip {
  background: var(--amber-bg);
  border-bottom: 1px solid var(--amber);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--amber);
}
.alert-strip button { background: none; border: none; cursor: pointer; color: var(--amber); font-size: 0.9rem; margin-left: auto; }

/* ===========================
   MAIN / GRID
   =========================== */
.main-wrap {
  width: 100%;
  flex: 1 0 auto;
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 24px 36px;
}

/* LOADER */
.loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 0;
  color: var(--text-3);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loader-text { font-size: 0.9rem; }

/* GRID */
.processes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

/* ===========================
   TARJETA DE PROCESO
   =========================== */
.pcard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.25);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s ease;
  cursor: default;
  position: relative;
  box-sizing: border-box;
}
.pcard:hover {
  border-color: rgba(249, 115, 22, 0.38);
  box-shadow: 0 14px 34px -4px rgba(0, 0, 0, 0.45),
              0 0 0 1px rgba(249, 115, 22, 0.22);
  transform: translateY(-3px);
}
/* PROCESOS INACTIVOS / ADJUDICADOS / FINALIZADOS */
.pcard.pcard-inactive {
  opacity: 0.6;
  filter: grayscale(20%);
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(255, 255, 255, 0.05);
  transition: opacity 0.22s ease, filter 0.22s ease, border-color 0.22s ease, box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.pcard.pcard-inactive:hover {
  opacity: 0.95;
  filter: grayscale(0%);
  border-color: rgba(249, 115, 22, 0.3);
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}
.pcard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  box-sizing: border-box;
  overflow: hidden;
}
.pcard-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}
.codigo-pill {
  font-size: 0.71rem;
  font-weight: 600;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  padding: 2.5px 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  max-width: 55%;
  min-width: 0;
  box-sizing: border-box;
}
.pcard-tipo-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.73rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 6px;
  padding: 2.5px 8px;
  white-space: nowrap;
  line-height: 1.25;
  box-sizing: border-box;
  flex-shrink: 1;
  min-width: 0;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.pcard.pcard-inactive .pcard-tipo-badge {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.06);
  border-color: rgba(148, 163, 184, 0.15);
}
.tipo-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-3);
  background: var(--bg-muted);
  border-radius: 6px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  display: inline-block;
  vertical-align: middle;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* BADGES DE ESTADO */
.estado-pill {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0;
  background: transparent !important;
  border: none !important;
  border-radius: 0;
  white-space: nowrap;
  flex-shrink: 0;
}
.estado-preguntas { color: var(--amber); }
.estado-ofertas   { color: var(--green); }
.estado-en-curso  { color: #818cf8; }
.estado-adjudicado { color: #34d399; }
.estado-ejecucion  { color: #60a5fa; }
.estado-calificacion { color: #fbbf24; }
.estado-cerrado   { color: var(--text-3); }

.badge-status {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0;
  background: transparent !important;
  border: none !important;
  border-radius: 0;
  white-space: nowrap;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
}
.badge-abierto {
  background: transparent !important;
  border: none !important;
  color: #10b981 !important;
}
.badge-cerrado {
  background: transparent !important;
  border: none !important;
  color: #ef4444 !important;
}

.pcard-tipo-estado {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  justify-content: flex-end;
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 58%;
}
.pcard-tipo-text {
  color: var(--text-2);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pcard-sep {
  color: var(--text-3);
  opacity: 0.55;
  margin: 0 2px;
}
.pcard-estado-text {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pcard-estado-text.estado-preguntas { color: var(--amber); }
.pcard-estado-text.estado-ofertas   { color: var(--green); }
.pcard-estado-text.estado-en-curso  { color: #818cf8; }
.pcard-estado-text.estado-adjudicado { color: #34d399; }
.pcard-estado-text.estado-ejecucion  { color: #60a5fa; }
.pcard-estado-text.estado-calificacion { color: #fbbf24; }
.pcard-estado-text.estado-cerrado   { color: var(--text-3); }
.pcard-estado-text.urgente-infima   { color: #f87171; }
.badge-cached {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16,185,129,0.15);
  color: #10b981;
  border: 1px solid rgba(16,185,129,0.3);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* CIERRE BANNER (Apple status capsule) - EXACT SLOT HEIGHT */
.cierre-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-2);
  background: rgba(249, 115, 22, 0.06);
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 9px;
  padding: 0 12px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
}
.cierre-banner svg {
  flex-shrink: 0;
}
.cierre-banner .cierre-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cierre-banner strong { color: var(--text-1); font-weight: 600; }
.cierre-banner.urgente {
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  animation: pulse-red 2s ease-in-out infinite;
}
.cierre-banner.urgente strong { color: #fca5a5; }
.cierre-banner.cierre-cerrado {
  background: rgba(148, 163, 184, 0.05);
  border-color: rgba(148, 163, 184, 0.15);
  color: var(--text-3);
}
.cierre-banner.cierre-vigente {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.18);
  color: #a7f3d0;
}
.dias-chip {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: rgba(249, 115, 22, 0.14);
  color: #fb923c;
  border-radius: 9999px;
  padding: 2px 8px;
  flex-shrink: 0;
}
.cierre-banner.urgente .dias-chip {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}
.dias-chip-vigente {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border-radius: 9999px;
  padding: 2px 8px;
  flex-shrink: 0;
}
.dias-chip-neutral {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-2);
  border-radius: 9999px;
  padding: 2px 8px;
  flex-shrink: 0;
}
@keyframes pulse-red {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50%      { box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }
}

/* TITULO - SLOT FIJO EXACTO DE 3 LINEAS */
.pcard-title {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text-1);
  line-height: 1.42;
  letter-spacing: -0.016em;
  min-height: calc(1.42em * 3);
  max-height: calc(1.42em * 3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

/* ENTIDAD - LINEA FIJA EXACTA */
.pcard-entidad {
  font-size: 0.81rem;
  color: var(--text-2);
  font-weight: 500;
  letter-spacing: -0.005em;
  height: 1.4em;
  min-height: 1.4em;
  max-height: 1.4em;
  line-height: 1.4em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

/* METADATA - EXACTAMENTE 2 FILAS ALINEADAS */
.pcard-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  box-sizing: border-box;
  margin: 0;
}
.pmeta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.77rem;
  color: var(--text-3);
  height: 18px;
  line-height: 18px;
  min-height: 18px;
  max-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pmeta-item svg { flex-shrink: 0; opacity: 0.8; }
.pmeta-item span {
  color: var(--text-2);
  font-weight: 450;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* FOOTER - ALINEADO AL FONDO EN EXACTA COORDENADA Y */
.pcard-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 12px;
  gap: 12px;
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  box-sizing: border-box;
}
.pcard-amount {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  height: 38px;
}
.amount-label {
  font-size: 0.65rem;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.2;
}
.amount-val {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.pcard-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 38px;
}
.btn-soce-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  background: var(--accent-faint);
  border: 1px solid rgba(249, 115, 22, 0.22);
  border-radius: var(--radius-xs);
  color: #fb923c;
  font-family: var(--font);
  font-size: 0.77rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-soce-card:hover {
  background: rgba(249, 115, 22, 0.18);
  color: #ffedd5;
  border-color: rgba(249, 115, 22, 0.38);
  transform: translateY(-1px);
}
.btn-detail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 980px;
  color: #f1f5f9;
  font-family: var(--font);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  text-decoration: none;
}
.btn-detail:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-detail:active, .btn-soce-card:active {
  transform: scale(0.98);
}

/* EMPTY + PAGINATION */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-3);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-2); margin-bottom: 8px; }
.empty-state p  { font-size: 0.9rem; margin-bottom: 20px; }
.btn-outline {
  padding: 8px 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-outline:hover {
  border-color: rgba(249, 115, 22, 0.4);
  color: #fb923c;
  background: rgba(249, 115, 22, 0.1);
  transform: translateY(-1px);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}
.page-btn {
  width: 36px; height: 36px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.page-btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-info {
  font-size: 0.85rem;
  color: var(--text-2);
  font-weight: 500;
  letter-spacing: -0.005em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* ===========================
   MODAL
   =========================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: padding 0.2s ease;
}
.modal-overlay.is-fullscreen {
  padding: 0;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: min(1080px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}
.modal-box.is-fullscreen {
  max-width: 100vw;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  border: none;
}
.modal-box::-webkit-scrollbar { width: 6px; }
.modal-box::-webkit-scrollbar-track { background: transparent; }
.modal-box::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 10;
}
.modal-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-expand-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-expand-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-card-hover);
}
.modal-topbar-left { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.modal-codigo {
  font-size: 0.74rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  padding: 3px 10px;
}
.modal-tipo-tag {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-3);
  background: transparent;
  border: none;
  padding: 0;
}
.modal-close {
  width: 32px; height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.modal-close:hover { border-color: var(--red); color: var(--red); background: rgba(239, 68, 68, 0.1); }

.modal-loader-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 60px 20px;
  color: var(--text-3);
  font-size: 0.9rem;
}

#modal-body { padding: 22px; display: flex; flex-direction: column; gap: 20px; }

.modal-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.estado-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0;
  background: transparent !important;
  border: none !important;
}
.modal-proximo {
  font-size: 0.8rem;
  color: var(--text-3);
}

.modal-title-h2 {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.38;
  letter-spacing: -0.018em;
}
.modal-desc-p {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.6;
}

.modal-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.mgc {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}
.mgc-label {
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mgc-val { 
  font-size: 0.88rem; 
  font-weight: 600; 
  color: var(--text-1); 
  letter-spacing: -0.01em; 
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
  line-height: 1.35;
}
.mgc-money {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* SECCIONES MODAL */
.msection {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  overflow: hidden;
}
.msection-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* CRONOGRAMA */
.crono-list { display: flex; flex-direction: column; }
.crono-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.83rem;
}
.crono-row:last-child { border-bottom: none; }
.crono-row.past { opacity: 0.55; }
.crono-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-3);
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.crono-row.past .crono-num { background: var(--green-bg); color: var(--green); border-color: rgba(16,185,129,0.3); }
.crono-label { font-weight: 600; color: var(--text-1); }
.crono-date { font-size: 0.78rem; color: var(--text-2); font-family: var(--font-mono); }
.crono-status {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  white-space: nowrap;
}
.crono-status.done { background: var(--green-bg); color: var(--green); }
.crono-status.pending { background: var(--accent-faint); color: var(--accent); }

/* PRODUCTOS */
.prods-scroll { overflow-x: auto; }
.prods-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 580px; }
.prods-table th {
  padding: 9px 12px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
}
.prods-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
  vertical-align: top;
}
.prods-table tr:last-child td { border-bottom: none; }
.prods-table tr:hover td { background: rgba(255,255,255,0.015); }
.cpc-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--accent-faint);
  color: var(--accent);
  border-radius: 5px;
  padding: 2px 7px;
}
.subtotal-val { font-weight: 700; color: var(--green); }

/* MODAL FOOTER */
.modal-footer-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
  flex-wrap: wrap;
}
.btn-soce-lg {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 12px rgba(249, 115, 22, 0.3);
}
.btn-soce-lg:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 18px rgba(249, 115, 22, 0.45);
  transform: translateY(-1px);
}
.btn-modal-close {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #f1f5f9;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ===========================
   FOOTER (Apple minimal unified slim footer)
   =========================== */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 20px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-sizing: border-box;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  min-height: 26px;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-brand {
  font-weight: 700;
  color: var(--text-2);
  font-size: 0.82rem;
  letter-spacing: -0.01em;
}
.footer-desc {
  font-size: 0.74rem;
  color: var(--text-3);
  opacity: 0.8;
}
.footer-center {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-right {
  display: flex;
  align-items: center;
}
.footer-db {
  font-size: 0.73rem;
  color: var(--text-3);
  letter-spacing: 0.01em;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 640px) {
  .hero { padding: 16px 16px 14px; }
  .search-row-main { flex-direction: column; }
  .search-row-filters { flex-direction: column; }
  .search-row-filters .autocomplete-wrapper,
  .search-row-filters .btn-tools-toggle {
    flex: 1 1 auto;
    width: 100%;
  }
  .search-bottom-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .smart-switch-btn {
    margin-left: 0;
  }
  .processes-grid { grid-template-columns: 1fr; }
  .nav-inner, .topbar-inner, .main-wrap, .footer-inner { padding-left: 16px; padding-right: 16px; }
  .modal-overlay { padding: 0; }
  .modal-box { border-radius: 0; max-height: 100vh; }
  .modal-grid-4 { grid-template-columns: 1fr 1fr; }
}


/* AUTOCOMPLETE CUSTOM */
.autocomplete-wrapper {
  position: relative;
  flex: 1;
  display: flex;
}
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  display: none;
}
.ac-item {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.active {
  background: var(--bg-card-hover);
  color: var(--text-1);
}

/* ESTILOS IA */
.btn-ai-lg {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #7c3aed 100%);
  color: #ffffff;
  border: 1px solid rgba(165, 180, 252, 0.35);
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.35);
}
.btn-ai-lg:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 50%, #6d28d9 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(79, 70, 229, 0.55);
  border-color: rgba(199, 210, 254, 0.6);
}
.btn-ai-lg.loading {
  animation: pulse 1.5s infinite;
  opacity: 0.85;
  cursor: not-allowed;
}

/* ─── BOTÓN ROJO: VOLVER A ANALIZAR CON TDRs (FORCE RE-ANALYZE) ─── */
.btn-reanalyze-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
  color: #ffffff !important;
  border: 1px solid rgba(252, 165, 165, 0.4);
  border-radius: 10px;
  padding: 11px 22px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 14px rgba(220, 38, 38, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  letter-spacing: -0.005em;
}
.btn-reanalyze-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 20px rgba(220, 38, 38, 0.45);
}
.btn-reanalyze-danger:active {
  transform: translateY(0);
}
.btn-reanalyze-danger.loading {
  animation: pulse-red 1.4s infinite;
  opacity: 0.88;
  cursor: not-allowed;
}

.btn-reanalyze-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  color: #fca5a5;
  font-family: var(--font, inherit);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}
.btn-reanalyze-sm:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(248, 113, 113, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}
.btn-reanalyze-sm.loading {
  animation: pulse-red 1.4s infinite;
  opacity: 0.8;
  cursor: not-allowed;
}

.ai-box {
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(129, 140, 248, 0.25);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 24px;
  animation: slideDown 0.3s ease;
  box-shadow: 0 4px 25px rgba(0,0,0,0.25);
}
.ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(129, 140, 248, 0.25);
  padding-bottom: 12px;
}
.ai-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ai-title {
  font-weight: 800;
  color: #c7d2fe;
  font-size: 1.05rem;
  letter-spacing: -0.2px;
}
.ai-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #818cf8;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(129, 140, 248, 0.35);
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.btn-ai-expand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.4);
  border-radius: var(--radius-xs);
  color: #ffedd5;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-ai-expand:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(249, 115, 22, 0.35);
}

.ai-content {
  color: var(--text-1);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ─── TABLA DE REQUISITOS PROFESIONAL ─── */
.ai-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(249, 115, 22, 0.28);
  background: #0b1120;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  margin-top: 10px;
}
.ai-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}
.ai-table thead {
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.2) 0%, rgba(249, 115, 22, 0.08) 100%);
  border-bottom: 2px solid rgba(249, 115, 22, 0.4);
}
.ai-table th {
  padding: 10px 12px;
  font-weight: 800;
  color: #fed7aa;
  text-transform: uppercase;
  font-size: 0.73rem;
  letter-spacing: 0.04em;
  white-space: normal;
  vertical-align: middle;
}
.ai-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-1);
  vertical-align: top;
  line-height: 1.5;
  word-break: break-word;
}
.ai-table tr:last-child td {
  border-bottom: none;
}
.ai-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}
.ai-table tr:hover {
  background: rgba(249, 115, 22, 0.07);
}
.ai-table .col-categoria {
  width: 26%;
  min-width: 130px;
  color: #ffedd5;
  font-weight: 700;
}
.ai-table .col-detalle {
  width: 48%;
  min-width: 180px;
}
.ai-table .col-criterio {
  width: 26%;
  min-width: 130px;
  color: #cbd5e1;
}
.ai-table strong {
  color: #fed7aa;
}
.ai-table ul, .ai-table ol {
  margin-left: 18px;
  margin-top: 4px;
}
.ai-table li {
  margin-bottom: 4px;
}

/* ─── BLOQUES DETALLADOS DE REQUISITOS (RESUMEN + LITERAL DEL PDF) ─── */
.ai-req-group {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.24);
}
.ai-req-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.ai-req-group-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #7dd3fc;
}
.ai-req-group-summary {
  margin: 0 0 10px 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #e2e8f0;
}
.ai-req-sublist {
  margin: 6px 0 0 18px;
  padding: 0;
  color: #cbd5e1;
  font-size: 0.84rem;
  line-height: 1.48;
}
.ai-req-sublist li {
  margin-bottom: 4px;
}

/* ─── NOTA AL PIE DE FUENTE ─── */
.ai-footer-note {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-2);
}
.ai-footer-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-footer-icon {
  font-size: 1.15rem;
}
.ai-footer-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
  border-radius: 4px;
  border: 1px solid rgba(249, 115, 22, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ===========================
   ÍNFIMA CUANTÍA CARDS & ACTIONS
   =========================== */
.pcard.is-infima {
  cursor: default;
}
.btn-cotizar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  background: #f59e0b;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  color: #0f172a;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}
.btn-cotizar:hover {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
  transform: translateY(-1px);
}
.btn-copy-email {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 0.77rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}
.btn-copy-email:hover {
  border-color: #f59e0b;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  transform: translateY(-1px);
}
.infima-funcionario-bar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 54px;
  min-height: 54px;
  max-height: 54px;
  font-size: 0.8rem;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.55);
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-sizing: border-box;
  margin: 0;
  overflow: hidden;
}
.infima-funcionario-nombre {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.80rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.infima-funcionario-email {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fef08a;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.toast-copy {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #10b981;
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: slideUp 0.2s ease;
}

/* ─── AUTO-SYNC Y BOTON ACTUALIZAR ─── */
.btn-sync-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #f1f5f9;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-sync-mini:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #38bdf8;
  color: #38bdf8;
}
.btn-sync-mini.spinning svg {
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.auto-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 4px 10px;
  border-radius: 9999px;
  user-select: none;
}
.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

/* ─── BARRA INFERIOR DE SYNC UNIFICADA EN FOOTER ─── */
.bottom-sync-bar {
  display: none;
}

/* ─── AI EXECUTIVE SUMMARY BOX ─── */
.ai-summary-box {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-left: 4px solid #38bdf8;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 22px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.ai-summary-title {
  color: #38bdf8;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-summary-text {
  color: #f1f5f9;
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
}




/* ========================================================
   BUSCADOR INTELIGENTE - DISEÑO INTEGRADO Y COHESIVO
   ======================================================== */
.search-row-smart {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.btn-smart-toggle {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 0.82rem;
  letter-spacing: -0.005em;
  padding: 6px 12px;
  height: 34px;
  box-sizing: border-box;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  user-select: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-smart-toggle:hover {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-1);
}

.btn-smart-toggle.is-active {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.4);
  color: #f8fafc;
}

.btn-smart-toggle.is-active:hover {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.12);
}

.smart-title {
  font-weight: 500;
  white-space: nowrap;
}

.smart-status-chip {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.70rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.btn-smart-toggle.is-active .smart-status-chip {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.smart-select {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  color: var(--text-1);
  font-family: var(--font);
  font-size: 0.82rem;
  letter-spacing: -0.005em;
  padding: 6px 10px;
  height: 34px;
  box-sizing: border-box;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.smart-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-faint);
}

/* Modal de rubros */
.modal-rubros-container {
  max-width: 680px;
  width: 92%;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.rubros-grid-modal {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 2px;
}

.rubro-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.rubro-checkbox-item:hover {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(168, 85, 247, 0.4);
}

.rubro-checkbox-item.is-checked {
  background: rgba(124, 58, 237, 0.14);
  border-color: #a855f7;
}

.rubro-checkbox-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #7c3aed;
  cursor: pointer;
}

.rubro-checkbox-label {
  font-size: 0.88rem;
  color: var(--text-1);
  font-weight: 500;
  flex: 1;
}

/* ===========================================================
   AUTENTICACIÓN POR CORREO Y CONTRASEÑA + DIALOG NATIVO
   =========================================================== */
.nav-auth-slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(249, 115, 22, 0.55);
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.92), rgba(249, 115, 22, 0.88));
  color: #ffffff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}
.nav-auth-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

.nav-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 5px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: #f8fafc;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  max-width: 190px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.nav-user-chip:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.28);
}
.nav-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ea580c, #f97316);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-logout-btn {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav-logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

dialog.auth-dialog {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  width: min(430px, calc(100vw - 24px));
  max-width: 430px;
  color: #f8fafc;
}
dialog.auth-dialog[open] {
  display: block;
}
dialog.auth-dialog:modal {
  overscroll-behavior: contain;
}
dialog.auth-dialog::backdrop {
  background: rgba(2, 6, 23, 0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.auth-dialog-card {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  color: #f8fafc;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.auth-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.auth-dialog-kicker {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fb923c;
  margin-bottom: 4px;
}
.auth-dialog-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}
.auth-dialog-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.auth-dialog-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
}
.auth-tab-btn {
  padding: 8px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.auth-tab-btn.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.auth-alert {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 14px;
}
.auth-alert.is-error {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
}
.auth-alert.is-success {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-form[hidden] {
  display: none;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
}
.auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(2, 6, 23, 0.55);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-field input:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.auth-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-password-wrap input {
  padding-right: 76px;
}
.auth-toggle-pw {
  position: absolute;
  right: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}
.auth-toggle-pw:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.auth-submit-btn {
  margin-top: 4px;
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #ea580c, #f97316);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, opacity 0.15s ease;
}
.auth-submit-btn:hover {
  filter: brightness(1.06);
}
.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.auth-dialog-foot {
  margin: 16px 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: #94a3b8;
}
.auth-dialog-foot a {
  color: #fb923c;
  text-decoration: none;
  font-weight: 500;
}
.auth-dialog-foot a:hover {
  text-decoration: underline;
}

/* Banner de cuenta en Mi Perfil */
.perfil-account-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.perfil-account-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.perfil-account-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
}
.perfil-account-dot.is-online {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.55);
}
.perfil-account-title {
  font-size: 0.86rem;
  color: #f8fafc;
}
.perfil-account-sub {
  font-size: 0.76rem;
  color: #94a3b8;
  margin-top: 2px;
}
.perfil-account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.perfil-banner-login-btn {
  padding: 7px 14px !important;
  font-size: 0.8rem !important;
}

/* Página dedicada login.html */
.login-page-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top center, rgba(234, 88, 12, 0.14), transparent 55%), #05070d;
  color: #f8fafc;
}
.login-main {
  flex: 1;
  min-height: calc(100vh - 54px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}
.login-card {
  width: min(440px, 100%);
}
.login-card .auth-dialog-title {
  font-family: var(--font-display);
  font-size: var(--text-page-title);
}
.login-sub {
  margin: 0 0 18px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #94a3b8;
}
.login-logged-box {
  padding: 16px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
}
.login-logged-text {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: #d1fae5;
}
.login-logged-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .nav-inner {
    gap: 10px;
    padding: 0 12px;
  }
  .nav-menu {
    justify-content: flex-start;
    gap: 14px;
  }
  #btnPerfilContratista {
    padding: 5px 10px;
    font-size: 0.78rem;
  }
  .nav-live-indicator {
    display: none !important;
  }
  .nav-user-email {
    max-width: 110px;
  }
}

/* ─── ARMONÍA DARK MODE PARA MODAL LEGACY #modalContratista ─── */
#modalContratista {
  background: rgba(2, 6, 23, 0.72) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#modalContratista > div {
  background: #131c31 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55) !important;
  font-family: var(--font) !important;
  color: var(--text-1) !important;
}
#modalContratista > div > div:first-child {
  background: rgba(15, 23, 42, 0.85) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
#modalContratista > div > div:nth-child(2) {
  color: var(--text-1) !important;
}
#modalContratista label,
#modalContratista strong {
  color: #cbd5e1 !important;
  font-size: 0.82rem !important;
}
#modalContratista input[type="text"],
#modalContratista input[type="email"],
#modalContratista select {
  background: rgba(15, 23, 42, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #f8fafc !important;
  border-radius: 8px !important;
  font-family: var(--font) !important;
  font-size: 0.86rem !important;
  margin-top: 4px;
}
#modalContratista input[type="file"] {
  color: #cbd5e1 !important;
  margin-top: 4px;
}
#modalContratista > div > div:last-child {
  background: rgba(15, 23, 42, 0.7) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}
#modalContratista > div > div:last-child button:first-child {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #e2e8f0 !important;
  border-radius: 8px !important;
}
#modalContratista > div > div:last-child button:last-child {
  background: linear-gradient(135deg, #ea580c, #f97316) !important;
  color: #ffffff !important;
  border-radius: 8px !important;
}

/* ─── FOOTER UNIFICADO DE 3 COLUMNAS (ESTILO CARACTERÍSTICAS) ─── */
.home-footer {
  background: var(--bg-base, #0f172a);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: auto;
  padding: 48px 24px 28px;
  flex-shrink: 0;
  color: #94a3b8;
}

.home-footer-inner {
  max-width: 1200px;
  margin: 0 auto 28px;
  display: grid;
  grid-template-columns: 1.45fr 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.footer-logo-box {
  margin: 0 0 12px;
}

.footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.footer-logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.footer-brand-title {
  font-size: 1.15rem;
  font-weight: 750;
  color: #f8fafc;
}

.home-footer .footer-brand-desc {
  display: block !important;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.6;
  color: #94a3b8;
  max-width: 340px;
}

.footer-col-title {
  font-size: 0.76rem;
  font-weight: 750;
  color: #fb923c;
  margin: 0 0 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.84rem;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: #fb923c !important;
}

.footer-email-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fb923c !important;
  font-weight: 500;
}

.footer-country {
  font-size: 0.82rem;
  color: #cbd5e1;
  font-weight: 600;
}

.footer-bottom-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 20px;
}

.footer-bottom-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: #64748b;
}

.footer-bottom-inner p {
  margin: 0;
}

.footer-bottom-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-bottom-badges span {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(249, 115, 22, 0.22);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  color: #fdba74;
}

.footer-sync-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 960px) {
  .home-footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .home-footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media print {
  .home-footer {
    display: none !important;
  }
}
