/* ==========================================================================
   PEDIDOS MIX - PANEL DE ADMINISTRACIÓN ESTILO APPLE (LIGHT MODE / macOS & iOS)
   Limpio, espacioso, tipografía cuidada, tarjetas blancas y toggles nativos iOS
   ========================================================================== */

.admin-app {
  min-height: 100vh;
  padding: 24px 16px 60px;
  max-width: 920px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Barra Superior Estilo macOS Toolbar */
.admin-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-subtle);
  gap: 12px;
  flex-wrap: wrap;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: -0.02em;
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.admin-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Píldora de Estado Cloudflare */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warning);
}

.status-dot.active {
  background: var(--success);
}

/* Barra de Búsqueda y Botón Nuevo Estilo Apple */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.search-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.search-wrap input {
  padding-left: 36px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.search-wrap input:focus {
  background: #ffffff;
  border-color: var(--accent-primary);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.85rem;
  pointer-events: none;
}

/* Cuadrícula de Tarjetas de Mixes */
.mixes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 680px) {
  .mixes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tarjeta individual de Mix */
.mix-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
}

.mix-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.mix-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-title-group {
  flex: 1;
}

.client-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--accent-primary);
  background: rgba(0, 113, 227, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 5px;
}

.card-mix-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.3;
}

.card-meta {
  font-size: 0.76rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 3px;
}

/* Mini Reproductor de Preescucha Integrado */
.mini-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface-elevated);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-mini-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--text-main);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.btn-mini-play:hover {
  background: #000;
  transform: scale(1.06);
}

.mini-audio-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Caja de Permisos: Escuchar / Descargar */
.permissions-box {
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.perm-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.perm-label.always-on {
  color: var(--text-muted);
}

/* Switch Toggle Nativo iOS */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #e9e9ea;
  transition: background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: var(--radius-full);
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: var(--success);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Acciones en la tarjeta */
.card-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-copy-link {
  flex: 1;
  min-width: 125px;
}

.btn-action-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-action-icon:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.btn-action-icon.whatsapp:hover {
  background: #25D366;
  color: #fff;
  border-color: #25D366;
}

/* Modales Estilo Apple Sheet / Alert */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease forwards;
}

.modal-card {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-xl);
  padding: 26px 24px;
  box-shadow: var(--shadow-float);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: modalAppleScale 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.btn-close-modal {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.btn-close-modal:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.1);
}

/* Zona Dropzone Estilo iOS */
.dropzone {
  border: 1.5px dashed rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.02);
  transition: all var(--transition-fast);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(0, 113, 227, 0.04);
}

.dropzone-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 8px;
  color: var(--accent-primary);
}

.dropzone-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.dropzone-sub {
  font-size: 0.76rem;
  color: var(--text-dim);
}

.file-selected-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(52, 199, 89, 0.1);
  border: 1px solid rgba(52, 199, 89, 0.25);
  color: #248a3d;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 10px;
}

/* Barra de Progreso de Subida Apple */
.upload-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-primary);
  transition: width 0.1s linear;
}

.upload-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-dim);
}

/* Pantalla de Bloqueo PIN */
.pin-dialog {
  text-align: center;
  max-width: 340px;
}

.pin-input {
  font-size: 1.5rem;
  letter-spacing: 0.25em;
  text-align: center;
  font-weight: 700;
  padding: 10px;
  background: rgba(0, 0, 0, 0.04);
}

/* Estado Vacío */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  background: #ffffff;
  border: 1px dashed rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
}

.empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  font-size: 2.2rem;
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.empty-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  max-width: 320px;
  margin: 0 auto 18px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalAppleScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
