/* ============================================================
   COMPONENTS.CSS · Estilos Globales Modulares
   ============================================================ */

/* ── CABECERAS DE PÁGINA ── */
.page-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 4px; color: var(--ios-text); }
.page-subtitle { font-size: 14px; color: var(--ios-muted); margin: 0; }

/* ── BOTÓN SUPERIOR (Limpio, sin sombras raras) ── */
.btn-top-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  background: var(--ios-text);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  
  /* RESET DE ESTILOS HEREDADOS */
  text-shadow: none !important;
  box-shadow: none !important;
  -webkit-text-stroke: 0 !important;
  outline: none;
}
.btn-top-action svg { width: 16px; height: 16px; }

/* ── PESTAÑAS (TABS) ESTILO IOS ── */
.tabs-estado {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px; 
  margin-left: -4px;
}
.tabs-estado::-webkit-scrollbar { display: none; }

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 100px;
  background: var(--ios-card);
  border: 1px solid var(--ios-border);
  color: var(--ios-text);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.tab svg { width: 16px; height: 16px; opacity: 0.6; }

.tab.active { 
  background: #000; 
  border-color: #000; 
  color: #fff; 
}
.tab.active svg { opacity: 1; }

.tab-count { 
  background: var(--ios-bg); 
  color: var(--ios-muted); 
  padding: 2px 8px; 
  border-radius: 20px; 
  font-size: 11px; 
  font-weight: 800; 
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
}
.tab.active .tab-count { 
  background: rgba(255,255,255,0.25); 
  color: #fff; 
}

/* Ajuste para móvil */
@media (max-width: 899px) {
  .page-header-flex { flex-direction: column; align-items: flex-start; gap: 16px; }
  .btn-top-action { width: 100%; }
}
/* ============================================================
   NOTIFICACIONES FLASH (Estilo iOS)
   ============================================================ */

.nx-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
  animation: slideDownFade 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.nx-alert svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nx-alert-success {
  background: rgba(10, 138, 74, 0.1);
  color: var(--ios-green);
  border: 1px solid rgba(10, 138, 74, 0.2);
}

.nx-alert-error {
  background: rgba(214, 46, 38, 0.1);
  color: var(--ios-red);
  border: 1px solid rgba(214, 46, 38, 0.2);
}

.nx-alert-info {
  background: rgba(0, 122, 255, 0.1);
  color: #007aff;
  border: 1px solid rgba(0, 122, 255, 0.2);
}

@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
/* ============================================================
   MODAL GLOBAL DE CONFIRMACIÓN (Estilo iOS)
   ============================================================ */

.nx-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px); /* Efecto de desenfoque elegante */
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.nx-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.nx-modal-box {
  background: var(--ios-card);
  width: 100%;
  max-width: 340px; /* Ancho tipo alerta de iPhone */
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nx-modal-overlay.open .nx-modal-box {
  transform: scale(1);
}

.nx-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ios-text);
  margin: 0 0 8px 0;
  letter-spacing: -0.3px;
}

.nx-modal-desc {
  font-size: 14px;
  color: var(--ios-muted);
  line-height: 1.4;
  margin: 0 0 24px 0;
}

.nx-modal-actions {
  display: flex;
  gap: 10px;
}

.nx-modal-actions button {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}

.nx-modal-actions button:active {
  opacity: 0.7;
}

.nx-btn-ghost {
  background: var(--ios-bg);
  color: var(--ios-text);
}

.nx-btn-danger {
  background: var(--ios-red);
  color: #fff;
}