/* ─── Tarjetas Elevadas ─────────────────────────────────────────────────────── */
.card {
  background: rgba(18, 18, 35, 0.45);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 12px 32px 0 rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--grad-surface);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  letter-spacing: -0.02em;
}

/* ─── Botones ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.btn-primary {
  background: var(--grad-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-muted);
}

/* ─── Chips de Navegación ─────────────────────────────────────────────────── */
.chip-group {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.chip {
  padding: 0.6rem 1.25rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.chip.active {
  background: var(--surface-accent);
  border-color: var(--primary-color);
  color: var(--primary-color);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

/* ─── Formularios ─────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: #121223; /* Opaque background triggers dark native menu better */
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition-fast);
  color-scheme: dark;
}

select option {
  background-color: #121223;
  color: #ffffff;
}

input,
textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition-fast);
  color-scheme: dark;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.input-file-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2.5rem;
  background: rgba(139, 92, 246, 0.03);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-fast);
}

.input-file-label:hover {
  border-color: var(--primary-color);
  background: rgba(139, 92, 246, 0.06);
}

/* ─── Tablas y Mixtos ───────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-spacing: 0;
  border-collapse: separate;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

th {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  font-weight: 700;
  text-align: left;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

td {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.1);
  border-top: 1px solid var(--border-color);
  font-size: 0.95rem;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

@media (max-width: 768px) {
  .card {
    padding: 1.25rem;
  }
}

/* ─── Toasts & Notificaciones (v5.5.9.6) ─────────────────────────────────── */
.toast-msg {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(30, 41, 59, 0.95);
  color: #f1f5f9;
  padding: 14px 24px;
  border-radius: 14px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0,0,0,0.1);
  z-index: 10000;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(120%);
}

.toast-msg.show {
  transform: translateX(0);
}

.toast-msg.warning { border-left: 5px solid #f59e0b; }
.toast-msg.error   { border-left: 5px solid #ef4444; }
.toast-msg.success { border-left: 5px solid #10b981; }

.toast-msg .toast-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.toast-msg .toast-content {
  display: flex;
  flex-direction: column;
}

.toast-msg .toast-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
  margin-bottom: 2px;
}

/* Ajustes Móviles (v5.5.9.6 Certificados) */
@media (max-width: 640px) {
  .toast-msg {
    top: auto;
    bottom: 30px;
    left: 5%;
    right: 5%;
    width: 90%;
    max-width: none;
    padding: 16px 20px;
    font-size: 1rem; /* Mayor legibilidad */
    transform: translateY(150%);
    box-shadow: 0 -10px 25px rgba(0,0,0,0.3);
  }
  
  .toast-msg.show {
    transform: translateY(0);
  }
}

/* ─── Switches Compactos (v6.1.0) ────────────────────────────────────────── */
.switch-sm {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

.switch-sm input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-sm {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider-sm:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s;
}

input:checked + .slider-sm {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

input:checked + .slider-sm:before {
  transform: translateX(14px);
}

.slider-sm.round {
  border-radius: 34px;
}

.slider-sm.round:before {
  border-radius: 50%;
}
