/* =============================================
   PANTALLA DE LOGIN
   position:fixed + inset:0 = cubre TODA la pantalla.
   Se oculta con JS cuando el login es correcto.
============================================= */
#loginScreen {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(10,25,40,0.72) 0%, rgba(10,25,40,0.60) 100%),
    url('../img/bodega.jpg') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-card {
  background: var(--login-card);
  border-radius: 18px;
  padding: 44px 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.06);
}

.login-card label.form-label {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

.login-card .form-control {
  background: rgba(255,255,255,0.97);
  border: none;
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 15px;
  color: #1a2e3b;
}

.login-card .form-control:focus {
  box-shadow: 0 0 0 3px rgba(235,100,9,0.35);
  outline: none;
}

.login-card .form-control::placeholder { color: #aab0b8; }

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

/* Logo PNG en login card */
.login-logo-img {
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 6px;
  display: block;
  margin: 0 auto;
}

/* Logo PNG en navbar */
.navbar-logo-img {
  height: 44px;
  width: auto;
  display: block;
}

.login-titulo {
  color: rgba(255,255,255,0.70);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 14px 0 0;
  text-align: center;
}

.login-footer {
  text-align: center;
  margin: 24px 0 0;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1px;
}

.login-error {
  background: rgba(231,76,60,0.15);
  border: 1px solid rgba(231,76,60,0.4);
  color: #ff9090;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* =============================================
   NAVBAR — Barra superior de la app
============================================= */
#appMain { display: none; }

.app-navbar {
  background: var(--navbar-bg);
  color: var(--text);
  padding: 0 20px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 #333, 0 2px 16px rgba(0,0,0,0.35);
  border-bottom: 2px solid var(--accent);
}

.nav-brand .logo-text { font-size: 18px; letter-spacing: 2px; }
.nav-brand .logo-sub  { font-size: 9px; color: var(--muted); margin-top: 0; }

/* Sobreescribir colores del logo en navbar negra */
.app-navbar .logo-hp-sm { background: transparent; }
.app-navbar .logo-hp-sm .logo-hp-text { color: #ffffff; }
.app-navbar .logo-hp-sm .logo-hp-bar  { background: var(--accent); }
.app-navbar .logo-hp-sm .logo-hp-sub  { color: #adb5bd; }
.app-navbar .navbar-logo-img { filter: none; }  /* Logo en colores originales sobre navbar negra */

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.nav-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #EB6409;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.nav-user-name { color: #f8f9fa; font-weight: 500; font-size: 13px; }

.btn-salir {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s, transform 0.15s;
}

.btn-salir:hover { background: #d4570a; transform: translateY(-1px); }

/* Badge de API SQL en navbar negra */
#apiBadge {
  background: rgba(255,255,255,0.12) !important;
  color: #e2e8f0 !important;
}

/* =============================================
   TABS — Pestañas de navegación
============================================= */
.app-tabs {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.app-tabs .nav-link {
  color: var(--muted);
  font-weight: 500;
  padding: 14px 18px;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.app-tabs .nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.app-tabs .nav-link:hover:not(.active) { color: var(--text); }

/* =============================================
   CONTENIDO PRINCIPAL
============================================= */
.app-content {
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

/* =============================================
   CARDS
============================================= */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-head {
  padding: 13px 20px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
}

.card-head.dark   { background: var(--primary); }
.card-head.orange { background: var(--accent); }

/* ─── BOTTOM NAV — oculto en desktop, mostrado en móvil ─── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--navbar-bg);
  border-top: 1px solid rgba(255,255,255,0.1);
  z-index: 1050;
  align-items: stretch;
  justify-content: space-around;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: rgba(255,255,255,0.55);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 6px 4px;
  transition: color 0.15s, background 0.15s;
  position: relative;
}
.bottom-nav-item i { font-size: 18px; }
.bottom-nav-item.active {
  color: var(--accent);
}
.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
}
.bottom-nav-badge {
  position: absolute;
  top: 5px;
  right: calc(50% - 16px);
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ─── STICKY GENERAR WRAPPER (móvil) ─── */
.sticky-generar-wrapper {
  display: none;   /* oculto en desktop */
  position: fixed;
  bottom: 68px;    /* encima del bottom nav */
  left: 12px;
  right: 12px;
  z-index: 1040;
}
.sticky-generar-wrapper .btn-naranja {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(235,100,9,0.45);
}

/* ─── PWA INSTALL BANNER ─── */
#pwaBanner {
  display: none;
  position: fixed;
  bottom: 68px;
  left: 10px;
  right: 10px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 14px 16px;
  z-index: 1045;
  align-items: center;
  gap: 12px;
  border-left: 4px solid var(--accent);
  animation: slideUpBanner 0.4s ease;
}
#pwaBanner.visible { display: flex; }
@keyframes slideUpBanner {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}
#pwaBanner img { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; }
#pwaBanner .pwa-text { flex: 1; }
#pwaBanner .pwa-text strong { display: block; font-size: 13px; color: var(--text); }
#pwaBanner .pwa-text small  { font-size: 11px; color: var(--muted); }
#pwaBanner .pwa-btn-install {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
#pwaBanner .pwa-btn-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
}

/* =============================================
   OMNIBOX - Buscador Global Instantáneo
============================================= */
.omnibox-wrapper {
  flex: 1;
  max-width: 380px;
  margin: 0 16px;
  position: relative;
}
.omnibox-input-box {
  width: 100%;
  background: rgba(255,255,255,0.10);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 7px 14px 7px 36px;
  font-size: 13.5px;
  color: #f8f9fa;
  transition: all 0.2s ease;
}
.omnibox-input-box:focus {
  background: rgba(255,255,255,0.16);
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  outline: none;
}
.omnibox-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 13px;
  pointer-events: none;
}
.omnibox-shortcut {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.14);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}
.omnibox-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.05);
  max-height: 420px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
}
.omni-cat {
  background: #f8fafc;
  padding: 6px 14px;
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid #f1f5f9;
  border-top: 1px solid #f1f5f9;
}
.omni-cat:first-child { border-top: none; border-radius: 12px 12px 0 0; }
.omni-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f8fafc;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.omni-item:hover { background: #fff7ed; }
.omni-item:last-child { border-bottom: none; border-radius: 0 0 12px 12px; }
.omni-main { font-size: 13.5px; font-weight: 600; color: var(--text); }
.omni-sub { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
