/* ==========================================================================
   Himnario "Todo lo que respira" — Sistema de Diseño Institucional
   Iglesia Cristiana Belén • Estilo Litúrgico Formal & Ejecutivo
   ========================================================================== */

:root {
  /* Paleta Litúrgica Formal */
  --bg-main: #0a101d;
  --bg-secondary: #0f172a;
  --bg-card: #131e33;
  --bg-card-hover: #182640;
  --bg-surface: #111b2e;
  --bg-surface-elevated: #16233b;
  --bg-modal: #0f1829;

  /* Bordes de Precisión */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-focus: #3b82f6;

  /* Tipografía */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Acentos Clásicos */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-subtle: rgba(37, 99, 235, 0.15);

  --accent-gold: #c5a059;
  --accent-gold-hover: #b08d46;
  --accent-gold-subtle: rgba(197, 160, 89, 0.12);

  --accent-emerald: #10b981;
  --accent-emerald-subtle: rgba(16, 185, 129, 0.12);

  --accent-amber: #f59e0b;
  --accent-amber-subtle: rgba(245, 158, 11, 0.12);

  --accent-rose: #f43f5e;
  --accent-rose-subtle: rgba(244, 63, 94, 0.12);

  /* Fuentes */
  --font-brand: 'Cinzel', Georgia, serif;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Sombras Sobrias */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset Básico */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.formal-theme {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.05) 0%, transparent 60%),
    linear-gradient(180deg, #0b1220 0%, #080d17 100%);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Header Institucional
   ========================================================================== */
.app-header {
  background-color: rgba(11, 18, 32, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-institution {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--accent-gold);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-motto {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  font-family: Georgia, serif;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Indicador de estado de conexión */
.system-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background-color: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  color: #34d399;
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

/* Perfil de Usuario */
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  line-height: 1.1;
}

.user-role-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Contenedor Principal
   ========================================================================== */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* ==========================================================================
   Resumen Métrico (Stats Strip)
   ========================================================================== */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: var(--transition);
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.stat-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-val-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.stat-pill-sm {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.pill-emerald {
  background: var(--accent-emerald-subtle);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.pill-amber {
  background: var(--accent-amber-subtle);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.text-emerald { color: #34d399 !important; }
.text-amber { color: #fbbf24 !important; }
.text-gold { color: var(--accent-gold) !important; }

/* ==========================================================================
   Barra de Herramientas y Filtros
   ========================================================================== */
.toolbar-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.search-box {
  position: relative;
  flex: 1 1 360px;
  max-width: 480px;
}

.search-box input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px 38px 9px 36px;
  font-size: 13.5px;
  color: #fff;
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-surface-elevated);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-box input::placeholder {
  color: var(--text-dim);
}

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

.search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.btn-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 7px;
}

.filter-item label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 28px 7px 10px;
  color: #fff;
  font-size: 12.5px;
  cursor: pointer;
  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='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: var(--transition);
}

.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* ==========================================================================
   Tabla de Cantos
   ========================================================================== */
.songs-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table thead {
  background: rgba(11, 18, 32, 0.7);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.data-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background-color: var(--bg-card-hover);
}

.data-table td {
  padding: 11px 14px;
  vertical-align: middle;
}

/* Indicador de Número */
.song-order-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-gold);
  background: var(--accent-gold-subtle);
  border: 1px solid rgba(197, 160, 89, 0.25);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  min-width: 38px;
  text-align: center;
}

.song-name-cell {
  display: flex;
  flex-direction: column;
}

.song-title-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-weight: 600;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
}

.song-title-btn:hover {
  color: var(--primary);
  text-decoration: underline;
}

.song-meta-preview {
  font-size: 11px;
  color: var(--text-dim);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
}

.badge-key {
  background: rgba(37, 99, 235, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.25);
  font-family: var(--font-mono);
}

.badge-speed-L {
  background: rgba(197, 160, 89, 0.12);
  color: var(--accent-gold);
  border: 1px solid rgba(197, 160, 89, 0.3);
}

.badge-speed-M {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-speed-R {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Pastillas de Recursos */
.resource-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-dim);
  cursor: default;
}

.resource-pill.has-audio {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.25);
  cursor: pointer;
}

.resource-pill.has-sheet {
  background: rgba(197, 160, 89, 0.1);
  color: var(--accent-gold);
  border-color: rgba(197, 160, 89, 0.25);
  cursor: pointer;
}

.resource-pill.has-audio:hover,
.resource-pill.has-sheet:hover {
  filter: brightness(1.15);
}

/* ==========================================================================
   Badges y Switches de Estado (Activo / Inactivo)
   ========================================================================== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.status-pill.is-active {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-pill.is-inactive {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.status-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-pill.is-active .dot {
  background-color: var(--accent-emerald);
}

.status-pill.is-inactive .dot {
  background-color: #64748b;
}

/* Switch interactivo en tabla */
.table-status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 2px 4px;
}

.switch-track {
  width: 32px;
  height: 18px;
  background: #334155;
  border-radius: var(--radius-full);
  position: relative;
  transition: var(--transition);
}

.switch-thumb {
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: var(--transition);
}

.table-status-toggle.is-active .switch-track {
  background: var(--accent-emerald);
}

.table-status-toggle.is-active .switch-thumb {
  left: 16px;
}

/* ==========================================================================
   Botones de Acción
   ========================================================================== */
.action-btns {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1.2;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11.5px;
}

.btn-icon-only {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-only:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-danger-ghost:hover {
  color: var(--accent-rose);
  background: var(--accent-rose-subtle);
}

.btn-status-toggle:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

/* Paginación */
.table-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-indicator {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
}

/* ==========================================================================
   Modales (Atril Digital & Formularios)
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 18, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-modal);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.98);
  transition: transform 0.2s ease;
}

.modal-sm { max-width: 420px; }
.modal-md { max-width: 600px; }
.modal-lg { max-width: 860px; }

/* Modal del Atril y Partitura Litúrgica (Ajustado a escala de hoja real) */
#modal-song-detail .modal-dialog {
  max-width: 1040px;
  width: 95vw;
  max-height: 94vh;
}

#modal-song-detail .modal-content {
  max-height: 94vh;
}

.modal-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  min-height: 0;
}

.modal-content > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(17, 27, 46, 0.5);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-orden {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  background: var(--accent-gold-subtle);
  color: var(--accent-gold);
  border: 1px solid rgba(197, 160, 89, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.status-pill-modal {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  display: inline-block;
  margin-top: 2px;
}

.status-pill-modal.is-active {
  background: var(--accent-emerald-subtle);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-pill-modal.is-inactive {
  background: var(--accent-amber-subtle);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(17, 27, 46, 0.4);
}

.modal-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* Franja de Parámetros Musicales */
.song-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.meta-val {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
}

/* Pestañas */
.tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover {
  color: #fff;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Lectura de Letras (Atril Formal) */
.lyrics-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  max-height: 480px;
  overflow-y: auto;
}

.lyrics-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.8;
  color: #f1f5f9;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Visor de Partitura */
.sheet-container {
  background: #060911;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.sheet-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.sheet-view-modes, .sheet-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.zoom-level-badge {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  padding-left: 6px;
}

.sheet-image-wrapper {
  width: 100%;
  max-height: none;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.sheet-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: #ffffff;
  border: none;
  box-shadow: none;
}

.empty-state-card {
  padding: 40px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* Reproductor de Audio en Modal */
.modal-audio-player {
  margin-top: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.audio-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.modal-audio-player audio {
  width: 100%;
  height: 34px;
}

/* ==========================================================================
   Formulario de Creación / Edición
   ========================================================================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-9 { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-12 { grid-column: span 12; }

.form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-textarea {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  color: #fff;
  transition: var(--transition);
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-surface-elevated);
}

.lyrics-editor {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 14px;
  line-height: 1.7;
}

/* Caja de interruptor de estado activo */
.status-toggle-box {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.toggle-control-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.toggle-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch-visual {
  width: 38px;
  height: 22px;
  background: #334155;
  border-radius: var(--radius-full);
  position: relative;
  flex-shrink: 0;
  margin-top: 2px;
  transition: var(--transition);
}

.toggle-switch-visual::after {
  content: '';
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: var(--transition);
}

.toggle-checkbox:checked + .toggle-switch-visual {
  background: var(--accent-emerald);
}

.toggle-checkbox:checked + .toggle-switch-visual::after {
  left: 19px;
}

.toggle-text-wrap {
  display: flex;
  flex-direction: column;
}

.toggle-title {
  font-size: 13px;
  color: #fff;
}

.toggle-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
  margin-top: 2px;
}

/* Notificaciones Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 12.5px;
  color: #fff;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 400px;
}

.toast-success { border-left: 4px solid var(--accent-emerald); }
.toast-error { border-left: 4px solid var(--accent-rose); }
.toast-info { border-left: 4px solid var(--primary); }

.toast-icon {
  font-weight: 700;
  font-size: 14px;
}

/* Reproductor Global Flotante */
.global-player {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 600px;
  width: 90%;
}

.global-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.player-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.player-song-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-song-subtitle {
  font-size: 10.5px;
  color: var(--text-dim);
}

.global-player audio {
  height: 32px;
  max-width: 200px;
}

/* Spinners */
.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 10px;
}

.spinner-sm {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Clases Utilitarias */
.text-center { text-align: center; }
.text-right { text-align: right; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }

/* Responsive */
@media (max-width: 768px) {
  .header-container { flex-direction: column; align-items: stretch; }
  .toolbar-section { flex-direction: column; align-items: stretch; }
  .search-box { max-width: none; }
  .filters-bar { width: 100%; justify-content: space-between; }
  .song-meta-strip { grid-template-columns: repeat(2, 1fr); }
  .form-grid > [class*="col-"] { grid-column: span 12; }
  .role-selection-grid { grid-template-columns: 1fr; }
  .modal-dialog {
    max-height: 94vh;
    margin: 8px;
    width: calc(100% - 16px);
  }
  .modal-content {
    max-height: 94vh;
  }
  .modal-footer {
    flex-wrap: wrap;
    padding: 12px 16px;
  }
  .modal-footer .btn {
    flex: 1 1 120px;
    min-height: 42px;
  }
}

/* ==========================================================================
   Módulo de Navegación por Pestañas Principales
   ========================================================================== */
.app-nav-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 61px;
  z-index: 90;
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-tabs {
  display: flex;
  gap: 8px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.nav-tab.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
  font-weight: 600;
}

.badge-pill-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-rose);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
}

/* Badges de Roles y Estados */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 2px;
}

.role-admin { background: rgba(244, 63, 94, 0.15); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.3); }
.role-director { background: rgba(197, 160, 89, 0.15); color: #fde68a; border: 1px solid rgba(197, 160, 89, 0.3); }
.role-coro { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.role-orquesta { background: rgba(59, 130, 246, 0.15); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.3); }
.role-cantor { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, 0.3); }
.role-user { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

.status-pill-user {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
}

.status-pending { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.status-active { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-rejected { background: rgba(100, 116, 139, 0.2); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }
.status-suspended { background: rgba(244, 63, 94, 0.15); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.3); }

/* Checkbox Cards para Selección de Roles */
.role-selection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.role-checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.role-checkbox-card:hover {
  border-color: var(--accent-gold);
  background: rgba(197, 160, 89, 0.04);
}

.role-checkbox-card:has(input:checked) {
  border-color: rgba(197, 160, 89, 0.5);
  background: rgba(197, 160, 89, 0.07);
}

.role-card-full-width {
  grid-column: 1 / -1;
}

.role-checkbox-card input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--accent-gold);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.role-card-content {
  display: flex;
  flex-direction: column;
}

.role-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.role-card-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.subnav-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.subnav-tab {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.subnav-tab:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.subnav-tab.active {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ==========================================================================
   SISTEMA DE PARTITURAS MUSICXML Y ATRIL DIGITAL VECTORIAL
   ========================================================================== */

.sheet-cap-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 16px;
}

.cap-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cap-downloads {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-pill-gold {
  background: rgba(212, 175, 55, 0.15);
  color: #d4af37;
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-pill-success {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

.sheet-advanced-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 16px;
}

.ctrl-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-val {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  min-width: 80px;
  text-align: center;
}

.playback-group {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.playback-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tempo-control {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bpm-input {
  width: 58px;
  padding: 4px 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.bpm-label {
  font-size: 11px;
  color: var(--text-muted);
}

.metronome-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

/* --- Superficie de Hoja de Papel de Partitura (Atril Electrónico) --- */

/* Superficie de Hoja de Papel de Partitura (Estilo Libro de Himnario Real) */
.sheet-paper-viewport {
  width: 100%;
  min-height: 520px;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: auto;
  background: #080d18;
  border-radius: var(--radius-sm, 6px);
  padding: 30px 16px 40px;
  display: flex;
  justify-content: center;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.7);
}

.sheet-paper-card {
  width: 100%;
  max-width: 920px;
  background: #ffffff;
  color: #111827;
  border-radius: 4px;
  padding: 40px 32px 52px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15), 0 24px 38px -6px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.08);
  margin: 0 auto;
  min-height: 540px;
  transition: transform 0.2s ease, max-width 0.2s ease;
  position: relative;
  font-family: 'Sylfaen', 'Crimson Pro', 'Georgia', serif;
}

/* Encabezado Editorial de Partitura - Idéntico a libro de himnos */
.sheet-paper-page-header {
  margin-bottom: 24px;
  padding-bottom: 4px;
  border-bottom: none;
  font-family: 'Sylfaen', 'Crimson Pro', 'Georgia', serif;
}

.score-header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 30px;
}

.score-header-right {
  text-align: right;
  line-height: 1.35;
}

.score-inst-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #1f2937;
}

.score-inst-subtitle {
  font-size: 12.5px;
  color: #4b5563;
}

.score-header-main-center {
  text-align: center;
  margin-top: 4px;
}

.score-song-title {
  font-size: 30px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 4px 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.score-song-subtitle {
  font-size: 16px;
  font-style: italic;
  color: #374151;
  margin: 0 0 5px 0;
}

.score-song-meta {
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  letter-spacing: 0.02em;
}

.sheet-osmd-wrapper {
  position: relative;
  width: 100%;
  min-height: 380px;
  background: #ffffff;
  color: #111827;
}

.osmd-sheet-surface {
  width: 100%;
  margin: 0 auto;
}

.osmd-sheet-surface svg {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

.sheet-loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  color: #64748b;
  font-size: 13.5px;
}

.sheet-paper-card.is-image-score {
  padding: 16px 20px 24px;
}

.sheet-image-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  background: transparent;
}

.sheet-image-wrapper .sheet-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 2px;
  box-shadow: none;
  border: none;
}

/* Modo Atril / Pantalla Completa */
.modal.active:has(.is-fullscreen) {
  padding: 0 !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}

.modal:has(.is-fullscreen) .modal-dialog {
  transform: none !important;
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

.sheet-container.is-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  background: #060911;
  border-radius: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.sheet-container.is-fullscreen .sheet-paper-viewport {
  flex: 1;
  max-height: calc(100vh - 120px);
}

/* Estilos de Impresión Fiel */
@media print {
  body * {
    visibility: hidden;
  }
  .sheet-paper-card, .sheet-paper-card * {
    visibility: visible;
  }
  .sheet-paper-card {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }
}

/* --- Modal de Gestión de Archivos Musicales Rediseñado --- */
.file-summary-strip {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.summary-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 12.5px;
  flex: 1;
  min-width: 120px;
}

.summary-chip.is-active {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.chip-icon {
  font-size: 16px;
}

.chip-label {
  color: var(--text-muted);
}

.chip-status {
  font-weight: 600;
  color: var(--text-main);
  margin-left: auto;
}

.summary-chip.is-active .chip-status {
  color: #34d399;
}

.unified-upload-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.section-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 14px 0;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.files-count-badge {
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px 8px;
}

/* Modal Gestión de Archivos Mejorado */
.modal-files-dialog {
  max-width: 820px;
  width: 95%;
}

.modal-files-body {
  max-height: 84vh;
  overflow-y: auto;
  padding: 20px 24px;
}

.file-summary-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
}

.file-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-title-col {
  display: flex;
  flex-direction: column;
}

.summary-song-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.summary-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.summary-chips-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.resource-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.resource-chip.is-active {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text-main);
}

.resource-chip.chip-mxml.is-active { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.1); color: #fde68a; }
.resource-chip.chip-pdf.is-active { border-color: rgba(244, 63, 94, 0.4); background: rgba(244, 63, 94, 0.1); color: #fda4af; }
.resource-chip.chip-svg.is-active { border-color: rgba(6, 182, 212, 0.4); background: rgba(6, 182, 212, 0.1); color: #a5f3fc; }
.resource-chip.chip-audio.is-active { border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.1); color: #6ee7b7; }
.resource-chip.chip-midi.is-active { border-color: rgba(168, 85, 247, 0.4); background: rgba(168, 85, 247, 0.1); color: #e9d5ff; }

.chip-status {
  font-weight: 700;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
}

.resource-chip.is-active .chip-status {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
.resource-chip:not(.is-active) .chip-status {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
}

/* Banner de Recompilación */
.regen-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  margin-top: 14px;
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.15) 0%, rgba(180, 83, 9, 0.08) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  animation: fadeIn 0.3s ease;
}

.regen-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.regen-banner-icon {
  font-size: 20px;
  line-height: 1;
}

.regen-banner-text strong {
  display: block;
  font-size: 13px;
  color: #fef3c7;
}

.regen-banner-text span {
  font-size: 11.5px;
  color: #d1d5db;
}

.btn-regen-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
  transition: all 0.2s ease;
}

.btn-regen-score:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.45);
}

/* Zona Drag & Drop */
.file-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 22px 16px;
  text-align: center;
  background: rgba(15, 23, 42, 0.4);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  outline: none;
  margin-bottom: 14px;
}

.file-dropzone:hover,
.file-dropzone.is-dragover {
  border-color: var(--accent-gold);
  background: rgba(197, 160, 89, 0.08);
  box-shadow: 0 0 16px rgba(197, 160, 89, 0.15);
}

.dropzone-content-default {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dropzone-icon {
  font-size: 30px;
  margin-bottom: 2px;
}

.dropzone-text {
  font-size: 13.5px;
  color: var(--text-main);
  font-weight: 500;
}

.dropzone-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-dropzone-browse {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-dropzone-browse:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.dropzone-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  margin-top: 4px;
}

.preview-left {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  overflow: hidden;
}

.preview-file-icon {
  font-size: 22px;
}

.preview-file-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-file-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 440px;
}

.preview-file-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.preview-type-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(197, 160, 89, 0.2);
  color: #fde68a;
}

.btn-clear-preview {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-clear-preview:hover {
  color: #fb7185;
  background: rgba(244, 63, 94, 0.15);
}

/* Lista de Tarjetas de Archivos */
.files-cards-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-card-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.file-card-item:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.file-card-main-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.file-type-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.icon-mxml { background: rgba(245, 158, 11, 0.15); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.35); }
.icon-pdf { background: rgba(244, 63, 94, 0.15); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.35); }
.icon-svg { background: rgba(6, 182, 212, 0.15); color: #a5f3fc; border: 1px solid rgba(6, 182, 212, 0.35); }
.icon-audio { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.35); }
.icon-midi { background: rgba(168, 85, 247, 0.15); color: #e9d5ff; border: 1px solid rgba(168, 85, 247, 0.35); }
.icon-image { background: rgba(59, 130, 246, 0.15); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.35); }

.file-card-body {
  flex: 1;
  min-width: 0;
}

.file-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}

.file-type-pill {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.pill-mxml { background: rgba(245, 158, 11, 0.2); color: #fde68a; }
.pill-pdf { background: rgba(244, 63, 94, 0.2); color: #fda4af; }
.pill-svg { background: rgba(6, 182, 212, 0.2); color: #a5f3fc; }
.pill-audio { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.pill-midi { background: rgba(168, 85, 247, 0.2); color: #e9d5ff; }
.pill-image { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }

.file-name-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.file-primary-tag {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent-gold);
}

.file-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.meta-separator {
  margin: 0 4px;
  opacity: 0.5;
}

.file-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.file-btn-preview {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #a5f3fc;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.file-btn-preview:hover {
  background: rgba(6, 182, 212, 0.22);
  border-color: rgba(6, 182, 212, 0.5);
  color: #fff;
}

.file-btn-download {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  font-size: 12px;
  text-decoration: none;
  transition: var(--transition);
}

.file-btn-download:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.file-btn-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.file-btn-delete:hover {
  color: #fb7185;
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.2);
}

.file-card-player-row {
  width: 100%;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.file-inline-audio {
  width: 100%;
  height: 32px;
  border-radius: var(--radius-sm);
  outline: none;
}

/* Modal Visor de Archivos (PDF / SVG / Imagen) */
.modal-viewer-dialog {
  max-width: 960px;
  width: 95%;
  height: 88vh;
  display: flex;
  flex-direction: column;
}

.modal-viewer-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b0f19;
}

.viewer-frame {
  width: 100%;
  height: 100%;
  border: none;
}

.viewer-img-container {
  width: 100%;
  height: 100%;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 24px rgba(0,0,0,0.6);
}

.resource-pill.has-mxml {
  background: rgba(212, 175, 55, 0.15);
  color: #d4af37;
  border: 1px solid rgba(212, 175, 55, 0.35);
  font-weight: 600;
}

/* =============================================================================
   SISTEMA DE AVISOS Y COMUNICADOS GLOBALES DEL SERVIDOR
   ============================================================================= */

.announcements-banner-wrapper {
  max-width: 1300px;
  margin: 14px auto 0;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.announcement-banner-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  line-height: 1.45;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  animation: bannerSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

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

.announcement-banner-item.type-info {
  background: linear-gradient(90deg, rgba(14, 116, 144, 0.28) 0%, rgba(15, 23, 42, 0.75) 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
}

.announcement-banner-item.type-update {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.25) 0%, rgba(15, 23, 42, 0.75) 100%);
  border: 1px solid rgba(52, 211, 153, 0.38);
  color: #d1fae5;
}

.announcement-banner-item.type-maintenance {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.28) 0%, rgba(15, 23, 42, 0.75) 100%);
  border: 1px solid rgba(251, 191, 36, 0.42);
  color: #fef3c7;
}

.announcement-banner-item.type-warning {
  background: linear-gradient(90deg, rgba(234, 88, 12, 0.26) 0%, rgba(15, 23, 42, 0.75) 100%);
  border: 1px solid rgba(251, 146, 60, 0.4);
  color: #ffedd5;
}

.announcement-banner-item.type-urgent {
  background: linear-gradient(90deg, rgba(225, 29, 72, 0.32) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(251, 113, 133, 0.5);
  color: #ffe4e6;
}

.announcement-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.announcement-banner-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.announcement-banner-text {
  flex: 1;
}

.announcement-banner-title {
  font-weight: 700;
  margin-right: 6px;
  color: #ffffff;
}

.announcement-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.announcement-btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.announcement-btn-link:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.announcement-btn-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.announcement-btn-dismiss:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Badges de Estado para tabla de administración */
.badge-status-activo {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-status-programado {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-status-vencido {
  background: rgba(100, 116, 139, 0.18);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-status-inactivo {
  background: rgba(225, 29, 72, 0.15);
  color: #fb7185;
  border: 1px solid rgba(251, 113, 133, 0.3);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Badges de Tipo para tabla de administración */
.badge-type-info {
  background: rgba(14, 116, 144, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
}

.badge-type-update {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
}

.badge-type-maintenance {
  background: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
}

.badge-type-warning {
  background: rgba(234, 88, 12, 0.2);
  color: #fb923c;
  border: 1px solid rgba(251, 146, 60, 0.3);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
}

.badge-type-urgent {
  background: rgba(225, 29, 72, 0.2);
  color: #fb7185;
  border: 1px solid rgba(251, 113, 133, 0.3);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
}

/* Badges para el sistema de reportes de partituras */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-status.badge-pending {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.35);
}
.badge-status.badge-active {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

/* ============================================================ */
/* BARRA DE FILTRO ALFABÉTICO (A - Z)                          */
/* ============================================================ */
.alphabet-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  scrollbar-width: thin;
}

.alphabet-bar::-webkit-scrollbar {
  height: 4px;
}
.alphabet-bar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.alphabet-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.alphabet-track {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.alphabet-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.alphabet-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.alphabet-btn.active {
  background: var(--accent-gold, #f59e0b);
  color: #070b14;
  font-weight: 800;
  border-color: var(--accent-gold, #f59e0b);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

/* ==========================================================================
   Subida Masiva Inteligente de Partituras MusicXML
   ========================================================================== */
.batch-dropzone.dragover {
  border-color: var(--accent-gold, #f59e0b) !important;
  background: rgba(245, 158, 11, 0.12) !important;
  transform: scale(1.008);
}

.badge-match-high {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
}

.badge-match-med {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
}

.badge-match-low {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
}

.badge-existing-xml {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(234, 179, 8, 0.1);
  color: #eab308;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(234, 179, 8, 0.25);
  margin-left: 6px;
  white-space: nowrap;
}





