:root { 
    --bg-body: #F8FAFC; --bg-sidebar: #FFFFFF; --bg-card: #FFFFFF; 
    --text-main: #1E293B; --text-muted: #64748B; --text-sidebar: #475569; 
    --primary: #F59E0B; --primary-hover: #D97706; --border-color: #E2E8F0; 
    --chord-color: #ef4444; --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05); 
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1); 
    --hover-bg: rgba(0,0,0,0.05); --hover-text: #1E293B;
}

[data-theme="dark"] { 
    --bg-body: #0B1120; --bg-sidebar: #0F172A; --bg-card: #1E293B; 
    --text-main: #F8FAFC; --text-muted: #94A3B8; --text-sidebar: #94A3B8; 
    --primary: #FBBF24; --border-color: #334155; 
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4); 
    --chord-color: #ef4444; 
    --hover-bg: rgba(255,255,255,0.05); --hover-text: #ffffff;
}

html, body { width: 100%; max-width: 100%; height: 100%; overflow: hidden; margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; -webkit-tap-highlight-color: transparent; outline: none; background-color: var(--bg-body); color: var(--text-main); transition: background-color 0.3s, color 0.3s; }
* { box-sizing: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Z-INDEX MODAL (3000) */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 3000; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-overlay.active { display: flex; }
.modal-small { background: var(--bg-card); width: 100%; max-width: 400px; padding: 30px; border-radius: 16px; border: 1px solid var(--border-color); box-shadow: var(--shadow-md); text-align: center; }

#custom-alert-overlay { z-index: 4000; }
#custom-alert-input-container { margin-bottom: 20px; }
#custom-alert-input { width: 100%; padding: 12px; border-radius: 8px; border: 2px solid var(--primary); background: var(--bg-body); color: var(--text-main); outline: none; font-size: 15px; }

/* Z-INDEX LOGIN (999999) - Rei absoluto */
#login-view { position: fixed; inset: 0; background: var(--bg-body); z-index: 999999; display: flex; justify-content: center; align-items: center; transition: opacity 0.3s; padding: 15px; overflow-y: auto;}
.login-card { background: var(--bg-card); width: 100%; max-width: 360px; padding: 25px 25px; border-radius: 20px; border: 1px solid var(--border-color); box-shadow: var(--shadow-md); text-align: center; margin: auto; }
.login-logo { width: 100%; display: flex; justify-content: center; align-items: center; margin-bottom: 20px; border: none; }
.login-logo img { width: 100%; max-width: 280px; max-height: 35vh; height: auto; object-fit: contain; } 

.form-group { display: flex; flex-direction: column; text-align: left; margin-bottom: 12px; width: 100%; }
.form-group label { margin-bottom: 4px; font-weight: 600; font-size: 13px; color: var(--text-main); }
.form-group input, .form-group select, .form-group textarea { padding: 10px; border-radius: 8px; border: 1px solid var(--border-color); background-color: var(--bg-body); color: var(--text-main); font-size: 15px; outline: none; transition: all 0.3s ease; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2); }

.app-container { display: flex; width: 100%; height: 100%; overflow: hidden; }

#mobile-sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 900; backdrop-filter: blur(2px); transition: 0.3s;}
#mobile-sidebar-overlay.active { display: block; }

/* Z-INDEX SIDEBAR DESKTOP (100) - Humilde, fica atrás de tudo */
.sidebar { width: 260px; background-color: var(--bg-sidebar); display: flex; flex-direction: column; padding: 20px; border-right: 1px solid var(--border-color); z-index: 100; transition: left 0.3s ease, background-color 0.3s; flex-shrink: 0;}
.brand { margin-bottom: 0px; display: flex; justify-content: center; width: 100%; cursor: pointer; } 
.brand-placeholder { width: 100%; display: flex; justify-content: center; align-items: center; border: none; padding: 0; margin-top: -10px; }
.brand-placeholder img { width: 100%; max-width: 250px; height: auto; object-fit: contain; transform: scale(1.6); }

.btn-nova-musica-side { position: relative; z-index: 10; background: var(--primary); color: #fff; border: none; padding: 12px; border-radius: 8px; font-weight: 700; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: var(--shadow-md); transition: 0.2s; width: 100%; margin-top: 15px; margin-bottom: 20px;}
.btn-nova-musica-side:hover { background: var(--primary-hover); transform: translateY(-2px); }

.nav-menu { display: flex; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto;}
.nav-item { color: var(--text-sidebar); text-decoration: none; padding: 12px 16px; border-radius: 8px; display: flex; align-items: center; gap: 12px; transition: 0.2s; font-weight: 500; cursor: pointer;}
.nav-item:hover { background-color: var(--hover-bg); color: var(--hover-text); }
.nav-item.active { background-color: rgba(245, 158, 11, 0.1); color: var(--primary); }

.sidebar-header { display: flex; justify-content: space-between; align-items: center; width: 100%;}
.btn-mobile-close { display: none; background: transparent; border: none; color: var(--text-sidebar); font-size: 24px; cursor: pointer; padding: 4px; border-radius: 6px; }
.btn-mobile-close:hover { color: var(--hover-text); background: var(--hover-bg);}

.sidebar-footer { margin-top: auto; padding-top: 15px; border-top: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 5px; }
.btn-theme-side { background: transparent; color: var(--text-sidebar); border: none; cursor: pointer; display: flex; align-items: center; gap: 12px; font-weight: 500; padding: 12px 16px; border-radius: 8px; width: 100%; font-size: 16px; transition: 0.2s;}
.btn-theme-side:hover { background-color: var(--hover-bg); color: var(--hover-text); }

.mobile-header { display: none; background: var(--bg-card); padding: 15px 20px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-color); z-index: 10;}
.btn-mobile-menu { background: rgba(245, 158, 11, 0.05); border: 1px solid var(--border-color); color: var(--primary); width: 40px; height: 40px; border-radius: 8px; display: flex; justify-content: center; align-items: center; font-size: 22px; cursor: pointer;}

.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; max-width: 100%; overflow-y: auto; overflow-x: hidden; position: relative; scroll-behavior: smooth; }

.btn-primary { background: var(--primary); color: #fff; border: none; padding: 10px 18px; border-radius: 8px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-sm); transition: 0.2s; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.page-container { padding: 40px; max-width: 1200px; width: 100%; margin: 0 auto; display: block; overflow-x: hidden;}

.dashboard-hero { background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, transparent 100%); border: 1px solid var(--border-color); padding: 30px 40px; border-radius: 16px; margin-bottom: 30px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px;}
.hero-text { flex: 1; min-width: 300px; }
.hero-text h1 { font-size: 28px; font-weight: 800; color: var(--text-main); margin-bottom: 8px; }
.hero-text p { color: var(--text-muted); font-size: 15px; margin-bottom: 20px; }
.hero-search-box { position: relative; max-width: 500px; width: 100%; }
.hero-search-box i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--primary); font-size: 20px; }
.hero-search-box input { width: 100%; padding: 14px 20px 14px 48px; border-radius: 50px; border: 2px solid var(--primary); background-color: var(--bg-card); color: var(--text-main); font-size: 16px; outline: none; box-shadow: var(--shadow-sm); transition: 0.2s; }
.hero-search-box input:focus { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2); }
.hero-stats { display: flex; gap: 20px; }
.stat-box { background: var(--bg-body); padding: 15px 25px; border-radius: 12px; border: 1px solid var(--border-color); text-align: center; }
.stat-num { display: block; font-size: 24px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }

.acervo-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.view-toggles { display: flex; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.btn-view { background: transparent; border: none; padding: 8px 12px; color: var(--text-muted); cursor: pointer; transition: 0.2s; font-size: 18px; }
.btn-view.active { background: rgba(245, 158, 11, 0.1); color: var(--primary); }

.songs-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.songs-container.list-view { grid-template-columns: 1fr; gap: 10px; }
.songs-container.list-view .song-card { flex-direction: row; justify-content: space-between; align-items: center; padding: 12px 20px; }
.songs-container.list-view .song-header { width: 40%; margin-bottom: 0; }
.songs-container.list-view .tags-display { flex: 1; margin-top: 0; justify-content: flex-start; }

.song-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; box-shadow: var(--shadow-sm); transition: 0.2s; display: flex; flex-direction: column; cursor: pointer; }
.song-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.song-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;}
.song-header h4 { font-size: 16px; color: var(--text-main); margin-bottom: 4px; font-weight: 700; word-break: break-word;}
.song-artist { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.card-actions { display: flex; gap: 8px; flex-shrink: 0;}
.btn-action { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 6px; padding: 6px; font-size: 16px; cursor: pointer; transition: 0.2s; color: var(--text-muted); display: flex; align-items: center; justify-content: center;}
.btn-action:hover { background: var(--bg-card); }
.btn-edit { color: var(--text-muted); } 
.btn-edit:hover { color: var(--primary) !important; border-color: var(--primary) !important; }
.btn-delete:hover { color: #ef4444; border-color: #ef4444; }
.tags-display { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.badge-tag { background: rgba(245, 158, 11, 0.1); color: var(--primary); font-size: 11px; padding: 4px 8px; border-radius: 6px; font-weight: 600; text-transform: uppercase; }

.repertorios-layout { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; margin-top: 20px; }
.rep-list-col { background: var(--bg-card); border-radius: 16px; border: 1px solid var(--border-color); padding: 20px; box-shadow: var(--shadow-sm); min-height: 500px; display: flex; flex-direction: column; gap: 10px; }
.rep-item { padding: 16px; border-radius: 12px; border: 1px solid transparent; background: var(--bg-body); cursor: pointer; transition: 0.2s; display: flex; justify-content: space-between; align-items: center; gap: 10px;}
.rep-item:hover { border-color: var(--border-color); transform: translateY(-1px); }
.rep-item.active { border-color: var(--primary); background: rgba(245, 158, 11, 0.05); }
.rep-item h4 { font-size: 15px; color: var(--text-main); margin-bottom: 4px; font-weight: 700; word-break: break-word;}
.rep-item p { font-size: 12px; color: var(--text-muted); }
.rep-detail-col { background: var(--bg-card); border-radius: 16px; border: 1px solid var(--border-color); padding: 30px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; min-width: 0; overflow: hidden;}
.rep-detail-header { margin-bottom: 24px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }
.rep-detail-title { font-size: 28px; font-weight: 800; color: var(--text-main); margin-bottom: 8px; word-break: break-word;}
.rep-detail-meta { font-size: 14px; color: var(--text-muted); display: flex; gap: 16px; align-items: center; }

.rep-detail-col .btn-primary, .rep-detail-col .btn-theme-side { padding: 8px 12px; font-size: 14px; }

.rep-song-item { display: flex; align-items: center; justify-content: space-between; padding: 16px; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 12px; margin-bottom: 10px; transition: background 0.2s, border 0.2s; cursor: grab; gap: 10px;}
.rep-song-item:active { cursor: grabbing; }
.rep-song-item:hover { border-color: var(--primary); }
.drag-handle { color: var(--text-muted); font-size: 20px; padding-right: 5px; display: flex; align-items: center; cursor: inherit; }
.sortable-ghost { opacity: 0.4; background-color: rgba(245, 158, 11, 0.1) !important; border: 2px dashed var(--primary) !important; }

.rep-song-info { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; cursor: pointer;}
.rep-song-info div { flex: 1; min-width: 0; }
.rep-song-info h5 { font-size: 15px; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.rep-song-info span { font-size: 13px; color: var(--text-muted); }

.btn-diretor { color: var(--text-muted); transition: 0.2s; }
.btn-diretor:hover { color: #8b5cf6 !important; border-color: #8b5cf6 !important; background: rgba(139, 92, 246, 0.1); }

.cat-layout, .config-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.cat-card, .config-panel { background: var(--bg-card); border-radius: 16px; border: 1px solid var(--border-color); padding: 30px; box-shadow: var(--shadow-sm); }
.cat-input-group { display: flex; gap: 10px; margin-bottom: 20px; }
.cat-input-group input { flex: 1; background: var(--bg-body); border: 1px solid var(--border-color); color: var(--text-main); padding: 10px 14px; border-radius: 8px; outline: none; min-width: 0;}
.cat-list { display: flex; flex-direction: column; gap: 10px; }
.cat-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--bg-body); border-radius: 8px; border: 1px solid var(--border-color); word-break: break-all;}
.config-panel h3 { font-size: 18px; color: var(--text-main); margin-bottom: 20px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 15px;}
.profile-mock { display: flex; gap: 20px; align-items: center; margin-bottom: 24px; }
.profile-avatar { width: 70px; height: 70px; background: rgba(245, 158, 11, 0.1); color: var(--primary); border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 28px; font-weight: bold; flex-shrink: 0;}
.profile-info h4 { font-size: 20px; color: var(--text-main); margin-bottom: 4px; font-weight: 800; word-break: break-word;}
.btn-backup-action { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-radius: 12px; font-weight: 600; cursor: pointer; transition: 0.2s; border: 1px solid; margin-bottom: 10px; width: 100%;}
.btn-export { background: rgba(245, 158, 11, 0.1); color: var(--primary); border-color: rgba(245, 158, 11, 0.2); }
.btn-import { background: var(--bg-body); color: var(--text-main); border-color: var(--border-color); }

/* Z-INDEX STAGE (2000) */
#stage-view { position: fixed; inset: 0; background-color: var(--bg-body); z-index: 2000; overflow-y: auto; scroll-behavior: smooth; display: none; overflow-x: hidden; width: 100%; height: 100%; transition: background-color 0.3s;}

/* Z-INDEX COVER (5000) */
#stage-cover { display: none; position: fixed; inset: 0; background-color: #0B1120; z-index: 5000; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
#cover-title { font-size: 6vw; font-weight: 900; color: #fff; margin-bottom: 20px; padding: 0 20px; line-height: 1.1; word-break: break-word;}
#cover-subtitle { font-size: 2vw; color: var(--primary); text-transform: uppercase; letter-spacing: 3px; font-weight: 600;}

.mobile-stage-toggle { display: none; }
.btn-close-stage-mobile { display: none; }

.stage-toolbar { position: fixed; top: 0; left: 0; display: flex; gap: 15px; align-items: center; justify-content: center; background-color: var(--bg-sidebar); padding: 12px 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); border-bottom: 1px solid rgba(255,255,255,0.1); z-index: 2010; width: 100%; flex-wrap: wrap; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
#stage-view.toolbar-hidden .stage-toolbar { transform: translateY(-100%); }

.tool-group { display: flex; align-items: center; gap: 8px; padding: 0 15px; border-right: 1px solid rgba(255,255,255,0.1); }
.tool-group:last-child { border-right: none; }
.tool-label { font-size: 12px; color: #94A3B8; font-weight: 600; display: flex; align-items: center; gap: 4px; }

.tool-value { font-size: 18px; font-weight: 900; color: #fff; min-width: 40px; text-align: center; }
.btn-tool-circle { width: 44px; height: 44px; border-radius: 50%; background: transparent; border: 1px solid rgba(255,255,255,0.2); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; flex-shrink: 0; font-size: 18px;}
.btn-tool-circle:hover { background: rgba(255,255,255,0.1); color: var(--primary); border-color: var(--primary); }
.btn-close-stage { width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #0F172A; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; font-size: 20px; flex-shrink: 0;}
.btn-close-stage:hover { background: var(--primary); }
.btn-pill { border-radius: 30px; padding: 10px 20px; display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; cursor: pointer; transition: 0.2s; background: transparent; border: 1px solid rgba(255,255,255,0.2); color: #fff; white-space: nowrap;}
.btn-pill:hover { background: rgba(255,255,255,0.1); }
.btn-pill.active { background: rgba(255,255,255,0.15); }
.btn-pill-yellow { border-color: var(--primary); color: var(--primary); }
.btn-pill-yellow:hover { background: rgba(245, 158, 11, 0.1); }
.btn-pill-blue { border-color: #3b82f6; color: #3b82f6; }
.btn-pill-blue:hover { background: rgba(59, 130, 246, 0.1); }
.btn-pill-blue.active { background: #3b82f6; color: #fff; }

.stage-main-layout { display: flex; width: 100%; max-width: 1400px; margin: 0 auto; align-items: flex-start; gap: 20px; padding: 10px 20px 50vh 20px; margin-top: 75px; transition: margin-top 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow-x: hidden;}
#stage-view.toolbar-hidden .stage-main-layout { margin-top: 10px; }

.stage-inner { flex: 1; width: 100%; min-width: 0; display: block; }

.stage-sidebar { width: 240px; flex-shrink: 0; background: var(--bg-card); border-radius: 16px; border: 1px solid var(--border-color); padding: 20px; position: sticky; top: 100px; display: none; flex-direction: column; max-height: calc(100vh - 120px); overflow-y: auto; box-shadow: var(--shadow-sm); }
.stage-sidebar-header { display: flex; justify-content: space-between; align-items: center; color: var(--primary); margin-bottom: 20px; font-size: 18px; font-weight: 800;}
.fretboard { display: flex; justify-content: space-between; width: 90px; height: 100px; margin: 0 auto; position: relative; border-top: 4px solid var(--text-main); background: repeating-linear-gradient(to bottom, transparent, transparent 23px, #475569 23px, #475569 25px); margin-bottom: 10px;}
.fret-string { width: 2px; background: #475569; height: 100%; position: relative; display: inline-block; }
.finger-dot { width: 14px; height: 14px; background: var(--primary); border-radius: 50%; position: absolute; transform: translate(-50%, -50%); left: 50%; z-index: 2; }
.finger-muted, .finger-open { font-size: 12px; font-weight: 800; color: var(--text-muted); position: absolute; top: -22px; left: 50%; transform: translateX(-50%); display: inline-block; }

.stage-header { text-align: center; margin-bottom: 10px; margin-top: 0; width: 100%; word-break: break-word;}
.stage-title { font-size: 20px; font-weight: 900; color: var(--text-main); margin-bottom: 2px; letter-spacing: -0.5px; }
.stage-artist { font-size: 12px; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

.cifra-area-wrapper { width: 100%; overflow-x: auto; padding-bottom: 30px; -webkit-overflow-scrolling: touch; display: flex; justify-content: center;}
.cifra-content { background: var(--bg-card); border-radius: 16px; border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); margin: 0 auto; width: max-content; min-width: 100%; min-height: 50vh; text-align: left; padding: 20px; transition: background-color 0.3s; }
.cifra-text-wrapper { display: inline-block; text-align: left; position: relative; z-index: 1; line-height: 1.45; min-width: 100%; padding-right: 150px; }

.line-pair { break-inside: avoid; page-break-inside: avoid; display: block; margin-bottom: 2px; position: relative; z-index: 2; pointer-events: none;}
.chord-line, .lyric-line { white-space: pre !important; word-break: normal !important; overflow-wrap: normal !important; font-family: 'Roboto Mono', monospace; min-height: 1.45em; font-size: inherit; } 
.chord-line span.chord { color: var(--chord-color); font-weight: 700; font-size: inherit;} 
.lyric-line { color: var(--text-main); font-size: inherit;}
.lyrics-only-mode .chord-line span.chord { visibility: hidden; } 

#stage-view.avulsa-lyrics-center .cifra-content { width: 100%; text-align: center; }
#stage-view.avulsa-lyrics-center .cifra-text-wrapper { text-align: center; padding-right: 0; padding-left: 0; display: block;}
#stage-view.avulsa-lyrics-center .line-pair { text-align: center; }
#stage-view.avulsa-lyrics-center .lyric-line { text-align: center; display: inline-block; width: 100%; }

.stage-element { position: absolute; pointer-events: none; z-index: 10; } 
.stage-postit { background: #fef08a; color: #1e293b; padding: 0.8em; border-radius: 0.1em; box-shadow: 0.1em 0.2em 0.5em rgba(0,0,0,0.3); font-size: 0.8em; font-weight: 600; text-align: center; line-height: 1.3; transform: rotate(-2deg); border-top: 0.8em solid #fde047; min-width: 8em; }
.stage-highlight { border-radius: 4px; pointer-events: none; }
.hl-red { background-color: rgba(239, 68, 68, 0.3); border-left: 4px solid #ef4444; }
.hl-blue { background-color: rgba(59, 130, 246, 0.3); border-left: 4px solid #3b82f6; }
.hl-purple { background-color: rgba(139, 92, 246, 0.3); border-left: 4px solid #8b5cf6; }

/* DIRETOR DE PALCO (Z-INDEX 5000) */
#director-overlay { display: none; position: fixed; inset: 0; background: #0B1120; z-index: 5000; flex-direction: column; padding: 0;}
#director-overlay.active { display: flex; }
.director-topbar { background: #0F172A; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #334155; width: 100%; box-shadow: 0 4px 20px rgba(0,0,0,0.5); z-index: 10;}
.director-body { flex: 1; width: 100%; overflow: auto; display: flex; justify-content: center; padding: 50px 20px;}

.director-canvas { background: #1E293B; padding: 60px 80px; border-radius: 16px; border: 1px solid #334155; position: relative; min-width: 800px; width: max-content; height: max-content; min-height: 100%; box-shadow: 0 10px 30px rgba(0,0,0,0.5);}
.director-text-wrapper { display: inline-block; text-align: left; position: relative; color: #F8FAFC; z-index: 1; line-height: 1.45; min-width: max-content;}

.draggable-element { cursor: grab; user-select: none; position: absolute; pointer-events: auto;}
.draggable-element:active { cursor: grabbing; }
.btn-delete-el { position: absolute; top: -12px; right: -12px; background: #ef4444; color: #fff; border: none; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; cursor: pointer; align-items: center; justify-content: center; z-index: 20;}

/* ESTÚDIO */
.workspace { background: var(--bg-card); width: 90vw; max-width: 1200px; height: 90vh; border-radius: 16px; border: 1px solid var(--border-color); box-shadow: var(--shadow-md); display: flex; flex-direction: column; overflow: hidden; }
.workspace-header { padding: 20px 30px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; background: #0F172A; }
.workspace-header h3 { color: #fff; font-size: 18px; display: flex; align-items: center; gap: 8px; margin: 0;}
.workspace-body { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding: 30px; flex: 1; overflow: hidden; }
.editor-col { display: flex; flex-direction: column; overflow-y: auto; padding-right: 10px; }
.preview-col { background: var(--bg-body); padding: 30px; border-radius: 12px; border: 1px solid var(--border-color); overflow-y: auto; overflow-x: auto;}
.compact-form-row { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 15px; width: 100%; }
.compact-form-row .form-group { flex: 1; min-width: 120px; margin-bottom: 0; }
.textarea-group { display: flex; flex-direction: column; flex: 1; min-height: 300px; }

.editor-textarea { flex: 1; width: 100%; resize: none; padding: 15px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-body); color: var(--text-main); font-family: 'Roboto Mono', monospace; font-size: 15px; line-height: 1.5; outline: none; transition: 0.2s; white-space: pre; overflow-x: auto; }
.editor-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2); }
.preview-cifra { font-family: 'Roboto Mono', monospace; font-size: 16px; line-height: 1.45; white-space: pre; padding-bottom: 15px; }
.preview-cifra .chord { color: var(--chord-color); font-weight: bold; }

/* MODAL DE ADICIONAR MÚSICAS NO REPERTÓRIO */
.modal-search { position: relative; margin-bottom: 15px; }
.modal-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.modal-search input { width: 100%; padding: 10px 10px 10px 35px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-body); color: var(--text-main); outline: none; }
.select-songs-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; text-align: left; }
.select-song-row { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--bg-body); border-radius: 8px; cursor: pointer; border: 1px solid var(--border-color); transition: 0.2s; }
.select-song-row:not(.disabled-row):hover { border-color: var(--primary); }
.select-song-row input { accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer;}
.select-song-row p { font-size: 12px; color: var(--text-muted); }

/* RESPONSIVO MOBILE */
@media (max-width: 1024px) {
    .btn-diretor { display: none !important; } 
    /* Sidebar Z-INDEX no Mobile ajustado para 1000 */
    .sidebar { position: fixed; left: -320px; width: 280px; height: 100%; z-index: 1000; box-shadow: var(--shadow-md); border-right: none; transition: left 0.3s ease; }
    .sidebar.open { left: 0; }
    .sidebar-header { margin-bottom: 30px; }
    .btn-mobile-close { display: flex; } 
    
    .mobile-header { display: flex; }

    .page-container { padding: 20px; }
    .hero-text { min-width: 100%; } 
    .dashboard-hero { padding: 20px; flex-direction: column; text-align: center; gap: 15px; background: var(--bg-card); border-width: 2px;}
    .hero-search-box { width: 100%; max-width: 100%; margin: 0; }
    .hero-search-box input { width: 100% !important; max-width: 100% !important; min-width: 0;}
    .hero-stats { width: 100%; justify-content: center; gap: 10px; flex-wrap: wrap;}
    .songs-container { grid-template-columns: 1fr; }
    .repertorios-layout, .cat-layout, .config-layout, .workspace-body { grid-template-columns: 1fr; gap: 15px;}
    .rep-detail-col { padding: 20px;}
    .preview-col { display: none; }
    .workspace { width: 100vw; height: 100vh; border-radius: 0; }
    .workspace-body { grid-template-columns: 1fr; overflow-y: auto; padding: 20px;}
    .preview-col { display: block !important; min-height: 400px; margin-top: 20px;}

    .stage-main-layout { margin-top: 15px; padding-top: 50px; } 
    #stage-view.toolbar-hidden .stage-main-layout { margin-top: 15px; }

    .mobile-stage-toggle { display: flex; position: fixed; top: 15px; right: 15px; width: 44px; height: 44px; border-radius: 50%; background: rgba(15, 23, 42, 0.8); color: #fff; border: 1px solid rgba(255,255,255,0.2); z-index: 2020; align-items: center; justify-content: center; font-size: 24px; backdrop-filter: blur(4px);}
    .btn-close-stage-mobile { display: flex; position: fixed; top: 15px; left: 15px; z-index: 2020; background: #ef4444; color: #fff; }
    .stage-toolbar .btn-close-stage { display: none; } 
    
    .stage-toolbar { position: fixed; top: auto; bottom: 0; left: 0; width: 100%; background: var(--bg-sidebar); padding: 20px 20px 40px 20px; border-radius: 24px 24px 0 0; flex-direction: column; transform: translateY(120%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 2015; border-bottom: none;}
    .stage-toolbar.open { transform: translateY(0); }
    #stage-view.toolbar-hidden .stage-toolbar { transform: translateY(120%); } 

    .tool-group { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); padding: 12px 0; width: 100%; justify-content: space-between; flex-shrink: 0;}
    .tool-group:last-child { border-bottom: none; justify-content: center; flex-wrap: wrap; gap: 10px; }
    .cifra-area-wrapper { justify-content: flex-start; } 
    .cifra-content { padding: 15px 0; border-radius: 0; border: none; margin: 0;}
    .stage-sidebar { position: fixed; top: auto; bottom: 0; left: 0; width: 100%; max-height: 50vh; z-index: 2200; border-radius: 24px 24px 0 0; box-shadow: 0 -10px 25px rgba(0,0,0,0.5); padding: 30px 20px; }
}