/* ============================================================
 * UMSA Bridge CSS — Smooths transition from Bootstrap
 *
 * This file resolves conflicts between UMSA Design System and
 * Bootstrap 5.3 during the gradual migration. Once Bootstrap
 * is fully removed, this file should be deleted.
 *
 * Load AFTER umsa.bundle.css and Bootstrap.
 * ============================================================ */

/* ===== UMSA navbar takes priority over Bootstrap .navbar ===== */
nav.navbar {
  height: 56px;
  background: var(--color-bg-inverted);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-6);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.navbar .container-fluid {
  all: unset;
  display: contents;
}

/* UMSA nav links */
.navbar__nav {
  display: flex;
  gap: 2px;
  align-items: center;
  height: 100%;
}

.navbar__link {
  font-family: var(--font-sans);
  font-size: var(--fs-13);
  font-weight: var(--fw-medium);
  color: rgba(255,255,255,0.7);
  padding: 0 var(--space-3);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: color var(--motion-interactive), border-color var(--motion-interactive);
}
.navbar__link:hover { color: var(--color-text-inverted); }
.navbar__link.is-active,
.navbar__link.active {
  color: var(--color-text-inverted);
  border-bottom-color: var(--color-brand-primary);
}
.navbar__link .material-icons { font-size: 14px; }

/* Right section */
.navbar__right {
  margin-left: auto;
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

/* Override Bootstrap dropdown toggle inside UMSA navbar */
.navbar .dropdown-toggle::after {
  display: none;
}
.navbar .nav-link.dropdown-toggle {
  all: unset;
  font-family: var(--font-sans);
  font-size: var(--fs-13);
  font-weight: var(--fw-medium);
  color: rgba(255,255,255,0.7);
  padding: 0 var(--space-3);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--motion-interactive), border-color var(--motion-interactive);
}
.navbar .nav-link.dropdown-toggle:hover { color: var(--color-text-inverted); }
.navbar .nav-link.dropdown-toggle.show {
  color: var(--color-text-inverted);
  border-bottom-color: var(--color-brand-primary);
}
.navbar .nav-link.dropdown-toggle .material-icons { font-size: 14px; }

/* Bootstrap dropdown menu styled for UMSA */
.navbar .dropdown-menu {
  background: var(--color-bg-base);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-popover);
  padding: var(--space-2);
  margin-top: var(--space-2);
  min-width: 220px;
}
.navbar .dropdown-menu .dropdown-item {
  font-family: var(--font-sans);
  font-size: var(--fs-13);
  color: var(--color-text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--motion-interactive);
}
.navbar .dropdown-menu .dropdown-item:hover {
  background: var(--color-bg-subtle);
  color: var(--color-text-primary);
}
.navbar .dropdown-menu .dropdown-item .material-icons {
  font-size: 16px;
  color: var(--color-text-tertiary);
}
.navbar .dropdown-menu .dropdown-divider {
  margin: var(--space-1) 0;
  border-color: var(--color-border-subtle);
}

/* Bottom nav */
.sgi-bottom-nav {
  display: flex;
  height: 60px;
  background: var(--color-bg-base);
  border-top: 1px solid var(--color-border-subtle);
  padding-bottom: 4px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
}
.sgi-bottom-nav .sgi-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--color-text-tertiary);
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: var(--fw-semibold);
  text-decoration: none;
  position: relative;
  padding-top: 4px;
  padding: 8px 4px;
  border: none;
  background: none;
  cursor: pointer;
  transition: color var(--motion-interactive);
}
.sgi-bottom-nav .sgi-bottom-nav-item .material-icons { font-size: 20px; }
.sgi-bottom-nav .sgi-bottom-nav-item.active,
.sgi-bottom-nav .sgi-bottom-nav-item.is-active {
  color: var(--color-brand-primary);
}
.sgi-bottom-nav .sgi-bottom-nav-item.active::before,
.sgi-bottom-nav .sgi-bottom-nav-item.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  height: 2px;
  background: var(--color-brand-primary);
  width: 28px;
  border-radius: 0 0 2px 2px;
}

/* Main content area — override Bootstrap container */
main.container-fluid {
  padding-bottom: 72px; /* space for bottom nav */
}

/* Buttons — Bootstrap .btn vs UMSA .btn */
/* When both are loaded, UMSA .btn wins on specificity but Bootstrap
   .btn-* variant classes still apply. We handle via !important on
   the UMSA bridge for common patterns */
.btn.btn--primary,
.btn.btn--secondary,
.btn.btn--ghost,
.btn.btn--danger {
  /* UMSA buttons win */
}

/* Badge bridge */
.badge.badge--aprobado,
.badge.badge--pendiente,
.badge.badge--facturado,
.badge.badge--cobrado,
.badge.badge--vencido,
.badge.badge--proceso {
  /* UMSA badges win — they use same class names but different structure */
}
