:root {
  --bg-main: #070b14;
  --bg-card: #0d1629;
  --bg-card-hover: #13203b;
  --bg-surface: #0a1122;
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(212, 175, 55, 0.3);
  --accent: #d4af37;
  --accent-light: #fce58a;
  --accent-glow: rgba(212, 175, 55, 0.25);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --danger: #ef4444;
  --success: #10b981;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* TOP NAVBAR */
.topbar {
  background: rgba(13, 22, 41, 0.95);
  border-bottom: 1px solid var(--border-accent);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 100;
}

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

.brand-symbol {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22), rgba(212, 175, 55, 0.05));
  border: 1px solid rgba(212, 175, 55, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 19px;
  font-weight: 900;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.2);
  flex-shrink: 0;
}

.brand-logo {
  display: none;
}

.brand-info h1 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  line-height: 1.1;
}

.brand-info span {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

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

.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.btn-action {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
}

.btn-action.primary {
  background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
  color: #070b14;
  font-weight: 800;
  border: none;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.btn-action.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-action.danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.btn-action.danger.active {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

/* MAIN LAYOUT */
.main-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 220px 1fr 340px;
  height: calc(100vh - 61px);
  overflow: hidden;
}

/* SIDEBAR TABS */
.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  gap: 6px;
  overflow-y: auto;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  width: 100%;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.nav-tab.active {
  background: rgba(212, 175, 55, 0.14);
  color: var(--accent-light);
  border: 1px solid var(--border-accent);
  font-weight: 700;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 0;
}

/* CONTENT VIEWPORT */
.content-area {
  background: var(--bg-main);
  padding: 16px;
  overflow-y: auto;
  position: relative;
}

.view-section {
  display: none;
  animation: fadeIn 0.2s ease;
}

.view-section.active {
  display: block;
}

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

/* VIEW: CANTOS */
.cantos-header {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.search-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.cantos-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  height: calc(100vh - 170px);
}

.songs-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.song-card {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.song-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.song-card.active {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--border-accent);
}

.song-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.song-card.active .song-card-title {
  color: var(--accent-light);
}

.song-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* STANZAS ACTION GRID */
.stanzas-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.stanzas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.stanzas-song-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.stanzas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.stanza-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.stanza-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 175, 55, 0.4);
  transform: translateY(-1px);
}

.stanza-card.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18) 0%, rgba(184, 134, 11, 0.25) 100%);
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.stanza-card.active::before {
  content: '● EN PANTALLA';
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-light);
  letter-spacing: 0.5px;
}

.stanza-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stanza-text-preview {
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.45;
  white-space: pre-line;
}

/* VIEW: BIBLIA */
.bible-nav-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.select-custom {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.select-custom:focus {
  border-color: var(--accent);
}

.verses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.verse-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: #fff;
  padding: 10px 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.verse-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
}

.verse-btn.active {
  background: var(--accent);
  color: #070b14;
  border-color: var(--accent);
  font-weight: 800;
}

.verse-display-box {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  padding: 24px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.verse-text-large {
  font-size: 18px;
  line-height: 1.6;
  color: #fff;
  margin-bottom: 14px;
}

.verse-citation {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent-light);
  text-align: right;
}

/* VIEW: FONDOS */
.backgrounds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.bg-thumb-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.bg-thumb-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.bg-thumb-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.bg-preview-box {
  height: 110px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.bg-thumb-name {
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  background: rgba(0, 0, 0, 0.4);
}

/* VIEW: IMPORTADOR */
.dropzone {
  border: 2px dashed var(--border-accent);
  background: rgba(13, 22, 41, 0.6);
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.dropzone:hover, .dropzone.dragover {
  background: rgba(212, 175, 55, 0.08);
  border-color: var(--accent);
}

.dropzone-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.dropzone h3 {
  font-size: 18px;
  color: #fff;
  margin-bottom: 6px;
}

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

/* RIGHT MONITOR (LIVE PREVIEW) */
.right-monitor {
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

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

.monitor-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--success);
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
}

.screen-preview-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.screen-preview-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screen-preview-content {
  position: relative;
  z-index: 2;
  padding: 16px;
  text-align: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.4;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  white-space: pre-line;
  max-height: 100%;
  overflow: hidden;
}

.screen-preview-citation {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  z-index: 3;
}

.blackout-cover {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 10;
  display: none;
}

.blackout-cover.active {
  display: block;
}

/* LIVE HOTKEYS / CONTROLS */
.quick-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-ctrl {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-ctrl:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
}

.next-preview-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.next-preview-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.next-preview-text {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.4;
  white-space: pre-line;
}

/* COLOR SWATCHES FOR FONT FORMATTING */
.btn-color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.btn-color-swatch:hover {
  transform: scale(1.15);
  border-color: #fff;
}

.btn-color-swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* CHURCH SESSION BADGE (TOPBAR) */
.church-session-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.church-session-badge:hover {
  background: rgba(212, 175, 55, 0.18);
  border-color: var(--accent);
}

.church-badge-icon {
  font-size: 16px;
}

.church-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.church-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
}

.church-code {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.church-switch-icon {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* LOGIN MODAL TABS & INPUTS */
.login-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.login-tab-btn.active {
  background: var(--accent);
  color: #070b14;
}

.form-select, .form-input {
  width: 100%;
  background: #070b14;
  border: 1px solid var(--border);
  color: #fff;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}

.form-select:focus, .form-input:focus {
  border-color: var(--accent);
}

/* GATEKEEPER PORTAL (LOGIN INICIAL OBLIGATORIO) */
.gatekeeper-portal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: radial-gradient(circle at 50% 40%, #0d1e3d 0%, #070b14 85%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
}

.gatekeeper-card {
  width: 100%;
  max-width: 500px;
  background: rgba(13, 22, 41, 0.96);
  border: 1px solid var(--border-accent);
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(212, 175, 55, 0.15);
  padding: 28px 24px;
}

.gatekeeper-brand {
  text-align: center;
  margin-bottom: 20px;
}

.gatekeeper-badge-symbol {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px auto;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(212, 175, 55, 0.05));
  border: 1px solid rgba(212, 175, 55, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 26px;
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.25);
}

.gatekeeper-logo {
  display: none;
}

.gatekeeper-brand h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 2px;
}

.gatekeeper-brand span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gatekeeper-tabs {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 5px;
  border-radius: 10px;
  margin-bottom: 18px;
}

.gate-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.gate-tab-btn.active {
  background: var(--accent);
  color: #070b14;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

.gate-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 5px;
}

.access-code-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  padding: 6px 12px;
}

.btn-pill-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 11px;
}

.btn-pill-action:hover {
  background: var(--accent);
  color: #070b14;
}

/* GESTIÓN DE EVENTOS Y LISTAS DE CULTO */
.events-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 14px;
}

.events-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.events-bar-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.events-select {
  background: var(--bg-main);
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  min-width: 220px;
  max-width: 320px;
}

.events-select:focus {
  border-color: var(--accent);
}

.events-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.event-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.event-item-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(212, 175, 55, 0.3);
}

.event-song-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  user-select: none;
}

.event-song-checkbox-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.event-song-checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

