/* ══════════════════════════════════════════════════════════════════════════════
   DiscoVault — Estilos
   Tipografía: Playfair Display (títulos/marca) + Inter (cuerpo)
   Estética: retro/vintage, paleta cálida, soporte dark mode
   ══════════════════════════════════════════════════════════════════════════════ */

/* ─── Variables de color — LIGHT MODE ──────────────────────────────────────── */
:root {
  --bg-primary:    #FDF6E3;
  --bg-secondary:  #F5EACB;
  --bg-card:       #FFFDF5;
  --surface:       #EDE0C4;
  --border:        #C9B882;
  --border-light:  #E5D5A8;
  --text-primary:  #2C1A0E;
  --text-secondary:#6B4F3A;
  --text-muted:    #A08060;
  --accent:        #8B2635;
  --accent-hover:  #6B1D28;
  --accent-light:  #F0D5D9;
  --gold:          #B8860B;
  --gold-light:    #F5E8C0;
  --success:       #2D6A4F;
  --success-light: #D8F3DC;
  --danger:        #8B2635;
  --danger-light:  #F9E0E3;
  --info:          #1A4F7A;
  --info-light:    #D6E8F7;

  /* Colores de tipos */
  --vinilo-color:  #8B2635;
  --vinilo-bg:     #F9E0E3;
  --dvd-color:     #1E3A5F;
  --dvd-bg:        #D6E4F0;
  --vhs-color:     #1A5C4A;
  --vhs-bg:        #D8EDE7;

  /* Tipografía */
  --font-serif:    'Playfair Display', Georgia, serif;
  --font-sans:     'Inter', system-ui, sans-serif;

  /* Espaciado */
  --header-height: 60px;
  --radius-sm:     4px;
  --radius-md:     8px;
  --radius-lg:     12px;
  --radius-xl:     16px;

  /* Sombras */
  --shadow-sm:  0 1px 4px rgba(44, 26, 14, 0.08);
  --shadow-md:  0 2px 10px rgba(44, 26, 14, 0.12);
  --shadow-lg:  0 8px 30px rgba(44, 26, 14, 0.18);
  --shadow-xl:  0 16px 50px rgba(44, 26, 14, 0.25);

  /* Transiciones */
  --transition: 0.2s ease;
}

/* ─── DARK MODE ─────────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary:    #1A1008;
    --bg-secondary:  #231508;
    --bg-card:       #2A1C0C;
    --surface:       #3D2B14;
    --border:        #5A3F28;
    --border-light:  #4A3020;
    --text-primary:  #F5E6C8;
    --text-secondary:#C9A87A;
    --text-muted:    #8A6A4A;
    --accent:        #C44D5F;
    --accent-hover:  #E05A6E;
    --accent-light:  #3D1A20;
    --gold:          #DAA520;
    --gold-light:    #3A2D08;
    --success:       #52B788;
    --success-light: #0D2B1A;
    --danger:        #E05A6E;
    --danger-light:  #3D0E16;
    --info:          #64B5F6;
    --info-light:    #0D2238;

    --vinilo-color:  #E06070;
    --vinilo-bg:     #3D0E16;
    --dvd-color:     #64A0D0;
    --dvd-bg:        #0D1E30;
    --vhs-color:     #52B788;
    --vhs-bg:        #0D2B1A;

    --shadow-sm:  0 1px 4px rgba(0, 0, 0, 0.3);
    --shadow-md:  0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-lg:  0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-xl:  0 16px 50px rgba(0, 0, 0, 0.6);
  }
}

/* ─── RESET Y BASE ───────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Accesibilidad: foco visible */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Visually hidden (para screen readers) */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }

/* ─── HEADER ─────────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--gold);
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: var(--header-height);
  max-width: 1400px;
  margin: 0 auto;
}

/* Marca/Logo */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--accent);
  flex-shrink: 0;
}
.brand-icon { display: flex; color: var(--accent); }
.brand-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--accent);
  letter-spacing: -0.02em;
}

/* Tabs de tipo */
.type-tabs {
  display: flex;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.type-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all var(--transition);
  position: relative;
  top: 1px; /* alinearlo con el border-bottom del header */
}
.tab-btn:hover { color: var(--accent); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Acciones del header */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--gold);
  color: var(--accent);
}
.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}
.btn-danger:hover { opacity: 0.85; transform: translateY(-1px); }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.icon-btn:hover {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--gold);
}
.icon-btn.active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── BARRA DE BÚSQUEDA ─────────────────────────────────────────────────────── */
.search-bar {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 10px 20px;
  animation: slideDown 0.2s ease;
}
.search-bar.hidden { display: none !important; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}
.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 9px 36px 9px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color var(--transition);
}
.search-clear:hover { color: var(--accent); }

/* ─── MAIN ───────────────────────────────────────────────────────────────────── */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ─── STATS BAR ─────────────────────────────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 600px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-icon { color: var(--text-muted); flex-shrink: 0; }
.stat-icon.vinilo { color: var(--vinilo-color); }
.stat-icon.dvd    { color: var(--dvd-color); }
.stat-icon.vhs    { color: var(--vhs-color); }
.stat-info { display: flex; flex-direction: column; }
.stat-number {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* ─── VIEW CONTROLS ─────────────────────────────────────────────────────────── */
.view-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.view-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 32px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.view-btn:hover { background: var(--surface); color: var(--accent); }
.view-btn.active {
  background: var(--accent);
  color: white;
}

.result-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ─── TABLA ─────────────────────────────────────────────────────────────────── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1.5px solid var(--border-light);
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.items-table thead {
  background: var(--surface);
  position: sticky;
  top: var(--header-height);
  z-index: 10;
}
.items-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.items-table th.sortable {
  cursor: pointer;
  transition: color var(--transition);
}
.items-table th.sortable:hover { color: var(--accent); }
.items-table th .sort-icon {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.4;
  transition: opacity var(--transition), transform var(--transition);
}
.items-table th.sorted .sort-icon { opacity: 1; color: var(--accent); }
.items-table th.sorted.asc  .sort-icon { transform: rotate(0deg); }
.items-table th.sorted.desc .sort-icon { transform: rotate(180deg); }

.items-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}
.items-table tr:last-child td { border-bottom: none; }
.items-table tbody tr { background: var(--bg-primary); transition: background var(--transition); }
.items-table tbody tr:nth-child(even) { background: var(--bg-secondary); }
.items-table tbody tr:hover { background: var(--accent-light); cursor: pointer; }

/* Badge de tipo en tabla */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-vinilo { background: var(--vinilo-bg); color: var(--vinilo-color); }
.badge-dvd    { background: var(--dvd-bg);    color: var(--dvd-color); }
.badge-vhs    { background: var(--vhs-bg);    color: var(--vhs-color); }

/* Acciones en tabla */
.table-actions { display: flex; gap: 6px; }
.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
}
.action-btn:hover { background: var(--surface); }
.action-btn.edit:hover  { color: var(--gold); border-color: var(--gold); }
.action-btn.delete:hover { color: var(--danger); border-color: var(--danger); }

/* ─── CARDS VIEW ─────────────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.item-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.item-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

.card-media {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  background: var(--surface);
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.item-card:hover .card-media img { transform: scale(1.04); }
.card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%; height: 100%;
  color: var(--text-muted);
  opacity: 0.4;
}
.card-placeholder svg { width: 70%; height: 70%; max-width: 120px; }

.card-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
}

.card-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-author {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.card-meta {
  display: flex;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-secondary);
}
.card-estado {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ─── SKELETON LOADER ────────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--border-light) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-row { height: 44px; margin-bottom: 2px; border-radius: 0; }
.skeleton-card {
  height: 320px;
  border-radius: var(--radius-lg);
}

/* ─── EMPTY STATE ────────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state-icon {
  opacity: 0.3;
  margin-bottom: 20px;
}
.empty-state h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.empty-state p { font-size: 0.9rem; }

/* ─── PAGINACIÓN ─────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px; height: 36px;
  padding: 0 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.page-btn:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--gold);
  color: var(--accent);
}
.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 600;
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-ellipsis {
  color: var(--text-muted);
  padding: 0 4px;
  line-height: 36px;
}

/* ─── MODAL ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}
.modal-overlay.hidden { display: none !important; }
@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease;
  position: relative;
}
@media (min-width: 640px) {
  .modal {
    border-radius: var(--radius-xl);
    max-width: 640px;
    max-height: 88vh;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1.5px solid var(--border-light);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.modal-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}
.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.3rem;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--surface); color: var(--text-primary); }

.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1.5px solid var(--border-light);
  background: var(--bg-secondary);
  position: sticky;
  bottom: 0;
}

/* ─── FORMULARIO ─────────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 500px) { .form-grid { grid-template-columns: 1fr; } }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group.full { grid-column: 1 / -1; }

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-label .required { color: var(--accent); }

.form-input, .form-select, .form-textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  outline: none;
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B4F3A' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }

.form-section-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  margin-top: 4px;
}

/* Preview de foto */
.foto-preview {
  margin-top: 8px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid var(--border-light);
}
.foto-preview img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  display: block;
}

/* ─── CONFIRM DIALOG ─────────────────────────────────────────────────────────── */
.confirm-modal {
  max-width: 400px !important;
}
.confirm-body {
  padding: 24px;
  text-align: center;
}
.confirm-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}
.confirm-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.confirm-message {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ─── TOAST NOTIFICATIONS ────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 260px;
  max-width: 380px;
  pointer-events: all;
  animation: toastIn 0.25s ease;
  position: relative;
  overflow: hidden;
  font-size: 0.875rem;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(120%); }
}
.toast.removing { animation: toastOut 0.2s ease forwards; }

.toast-success { background: var(--success-light); border: 1.5px solid var(--success); color: var(--success); }
.toast-error   { background: var(--danger-light);  border: 1.5px solid var(--danger);  color: var(--danger); }
.toast-info    { background: var(--info-light);    border: 1.5px solid var(--info);    color: var(--info); }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.toast-content { flex: 1; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-message { opacity: 0.9; line-height: 1.4; font-size: 0.82rem; }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.4;
  animation: progress 4s linear forwards;
}
@keyframes progress { from { width: 100%; } to { width: 0%; } }

/* ─── DETAIL VIEW (modal de solo lectura) ───────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 500px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-field { display: flex; flex-direction: column; gap: 2px; }
.detail-field.full { grid-column: 1 / -1; }
.detail-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.detail-value {
  font-size: 0.9rem;
  color: var(--text-primary);
}
.detail-value.large {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
}
.detail-image {
  grid-column: 1 / -1;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 4px;
}
.detail-image img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
}

/* ─── ADMIN KEY MODAL ────────────────────────────────────────────────────────── */
.admin-key-modal { max-width: 400px !important; }
.admin-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.875rem;
  font-weight: 500;
}
.admin-status.active {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid var(--success);
}
.admin-status.inactive {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ─── EXPORT BUTTON LOADING ─────────────────────────────────────────────────── */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.75;
}
.btn-loading::after {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── TRACK LIST (lista de canciones lado A/B) ───────────────────────────────── */
.track-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
}
.track-item {
  font-size: 0.85rem;
  color: var(--text-primary);
  padding: 3px 10px;
  border-left: 2px solid var(--gold);
  line-height: 1.5;
}
.track-list-field {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 4px;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-inner { gap: 8px; padding: 0 12px; }
  .brand-text { font-size: 1.2rem; }
  .type-tabs { gap: 0; }
  .tab-btn { padding: 6px 10px; font-size: 0.8rem; }
  .btn { padding: 6px 10px; font-size: 0.8rem; }
  .btn span { display: none; }
  .main-content { padding: 16px 12px 60px; }
  .items-table th, .items-table td { padding: 9px 10px; }
}
@media (max-width: 480px) {
  .col-genero, .col-anio { display: none; }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
