:root {
  --color-bg: #0b1020;
  --bg-gradient: radial-gradient(circle at top, #ffffff 0, #040612 200%, #000 100%);
  --color-primary: #6c63ff;
  --color-primary-soft: rgba(108, 99, 255, 0.15);
  --color-accent: #ffb347;
  --color-text: #f5f5ff;
  --color-text-soft: #c3c6ff;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.45);
  --shadow-light: 0 8px 24px rgba(0, 0, 0, 0.35);
  --transition-fast: 0.18s ease-out;
  --transition-med: 0.25s ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-gradient);
  color: var(--color-text);
  min-height: 100vh;
}

body.theme-white-bg {
  background: var(--bg-gradient);
  color: #1f1f1f; /* mais escuro */
  --color-text: #1f1f1f;
  --color-text-soft: #3f3f46; /* textos secundários */
  --color-primary-soft: rgba(184, 155, 47, 0.14);
}

body.theme-white-bg .card,
body.theme-white-bg .panel,
body.theme-white-bg .section {
  color: #1a1a1a;
}

body.theme-white-bg p,
body.theme-white-bg .field-label,
body.theme-white-bg .settings-section-title,
body.theme-white-bg .theme-chip,
body.theme-white-bg .section-title,
body.theme-white-bg .text-small {
  color: #3f3f46;
}

body.theme-white-bg h1,
body.theme-white-bg h2,
body.theme-white-bg h3,
body.theme-white-bg h4 {
  color: #1f1f1f;
}

body.theme-white-bg .muted,
body.theme-white-bg .subtitle,
body.theme-white-bg small {
  color: #5c5c5c;
}

body.theme-white-bg #library-song-title-suggestions {
  background: #fffdf5;
  border: 1px solid rgba(201, 162, 58, 0.35);
  box-shadow: 0 12px 28px rgba(120, 95, 20, 0.18);
}

body.theme-white-bg #library-song-title-suggestions .suggestion-item {
  color: #1f1f1f;
}

body.theme-white-bg #library-song-title-suggestions .suggestion-item:hover {
  background: rgba(201, 162, 58, 0.16);
  color: #1f1f1f;
}

#app {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 24px 16px;
}

/* Shared layout */

.hidden {
  display: none !important;
}

.card {
  /*background: linear-gradient(145deg, rgba(21, 27, 47, 0.9), rgba(7, 10, 22, 0.95));*/
  /*background: linear-gradient(145deg, rgba(117, 133, 186, 0.9), rgba(7, 10, 22, 0.95));*/
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

body.theme-white-bg .card {
  background: #ffffff;
  border: 1px solid #ddd;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.08);
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.app-logo-icon {
  /*width: 40px;*/
  width: 100px;
  height: 40px;
  /*border-radius: 14px;
  background: radial-gradient(circle at 30% 0%, #ffecb3 0, #ffb347 35%, #ff6f61 100%);*/
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2b0b0b;
  font-weight: 700;
  font-size: 20px;
  /*box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);*/
}

.app-logo-text-title {
  font-size: 20px;
}

.app-logo-text-subtitle {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-soft);
}

/* Typography & utilities */

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.02em;
}

p {
  margin: 0;
  line-height: 1.5;
  color: var(--color-text-soft);
}

.text-small {
  font-size: 12px;
}
.text-right { text-align: right; }

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }

/* Inputs */

.field-group {
  margin-top: 18px;
}

.field-label {
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--color-text-soft);
}

.field-input,
select,
textarea {
  width: 100%;
  padding: 10px 11px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--color-text);
  font-size: 14px;
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast),
    transform 0.12s ease-out;
}

.field-input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(108, 99, 255, 0.35);
  background: rgba(0, 0, 0, 0.6);
  transform: translateY(-1px);
}

body.theme-white-bg .field-input,
body.theme-white-bg select,
body.theme-white-bg textarea {
  background: #fafafa;
  border-color: #ccc;
  color: #222;
}

textarea {
  resize: vertical;
  min-height: 80px;
  max-height: 520px; /* 260px; */
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--color-primary), #8e86ff);
  color: #fdfbff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 10px 22px rgba(80, 64, 10, 0.24);
}

body.theme-white-bg .btn {
  background: linear-gradient(135deg, #d7bd68 0%, #ffffff 110%);
  color: #3a2e05;
  border: 1px solid rgba(183, 150, 45, 0.25);
  box-shadow: 0 6px 14px rgba(120, 95, 20, 0.18);
}

body.theme-white-bg .btn:hover {
  filter: brightness(1.02);
  box-shadow: 0 10px 22px rgba(120, 95, 20, 0.26);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
}

.btn-ghost {
  background: transparent;
  border-radius: 999px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--color-text-soft);
  text-transform: none;
  font-size: 13px;
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-light);
}

body.theme-white-bg .btn-ghost {
  border-color: #ccc;
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0.02em;
  box-shadow: none;
}

/* Login */

#login-view {
  max-width: 420px;
  width: 100%;
  margin: auto;
}

.login-footer {
  margin-top: 14px;
  font-size: 12px;
  color: var(--color-text-soft);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* App shell */

#app-shell {
  max-width: 1180px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(108, 99, 255, 0.18), rgba(7, 10, 24, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-soft);
}

body.theme-white-bg .topbar {
  background: #ffffff;
  border-color: #ddd;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title {
  font-size: 17px;
}

.topbar-subtitle {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-text-soft);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--color-text-soft);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, #ffe0b2 0, #ffb347 45%, #f57c00 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #3d1700;
}

/* Nav tabs */

.nav-tabs {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(3, 6, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-white-bg .nav-tabs {
  background: #f4f4f7;
  border-color: #ddd;
}

.nav-tab {
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  border: none;
  background: transparent;
  color: var(--color-text-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    transform 0.12s ease-out;
}

.nav-tab span.icon {
  font-size: 15px;
}

.nav-tab.active {
  background: radial-gradient(circle at top, var(--color-primary-soft), transparent 75%);
  color: #ffffff;
  transform: translateY(-1px);
}

body.theme-white-bg .nav-tab.active {
  background: rgba(184, 155, 47, 0.14);
  color: var(--color-accent);
}

body.theme-white-bg .nav-tab:hover {
  background: rgba(214, 184, 90, 0.18);
}

/* Views */

#views-container {
  margin-top: 10px;
}

.view {
  display: block;
}

/* Destaques Paroquiais & Agenda */

.parish-highlights {
  position: relative;
  overflow: hidden;
}

.parish-highlights::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.1), transparent 60%),
    radial-gradient(circle at 90% 120%, rgba(255, 255, 255, 0.15), transparent 65%);
  opacity: 0.8;
  pointer-events: none;
}

.parish-highlights-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.parish-highlights-title {
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.parish-highlights-subtitle {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-text-soft);
}

.parish-highlights-body {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  font-size: 14px;
}

.parish-highlights-footer {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-text-soft);
}

/* Agenda */

.schedule-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.schedule-list {
  margin-top: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.agenda-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 10px;
  cursor: pointer; /* clicável para ir pro repertório */
}

body.theme-white-bg .agenda-item {
  border-color: #eee;
}

.agenda-item:last-child {
  border-bottom: none;
}

.agenda-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.agenda-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

body.theme-white-bg .agenda-title {
  color: #222;
}

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

.agenda-pill {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-text-soft);
  white-space: nowrap;
}

body.theme-white-bg .agenda-pill {
  border-color: #ddd;
}

/* Badge */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-text-soft);
}

body.theme-white-bg .badge {
  background: #f7f7fa;
  border-color: #ddd;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--color-primary);
}

/* Repertório grid */

.repertoire-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.9fr);
  gap: 16px;
}

/* Detalhe do repertório ocupa toda a altura possível */
.repertoire-detail-panel {
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.repertoire-list-panel {
  min-height: 280px;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-item {
  flex: 1 1 150px;
}

.filter-item-button {
  align-self: flex-end;
}

.pill-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-text-soft);
  margin-bottom: 4px;
}

/* Lista de seções */

.section-list {
  margin-top: 8px;
  /*max-height: 260px;*/
  max-height: 860px;
  overflow-y: auto;
  padding-right: 4px;
}

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-top: 10px;
  margin-bottom: 4px;
  color: var(--color-text-soft);
}

.song-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;          /* deixa quebrar em duas linhas em tela pequena */
  gap: 8px;

  padding: 6px 9px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.35);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 4px;
  transition: background var(--transition-fast), transform 0.1s ease-out;
}

.song-pill-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.song-pill-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-pill-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11px;
  color: var(--color-text-soft);
}

.song-pill-version {
  white-space: nowrap;
}

.song-pill-sep {
  white-space: nowrap;
}

/* deixá-la mais "tom" */
.song-pill-key {
  font-size: 11px;
  color: var(--color-text-soft);
  text-transform: uppercase;
  font-weight: 700;
}

@media (max-width: 480px) {
  .song-pill {
    align-items: flex-start;
  }
}

.song-pill-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}


.song-pill:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

body.theme-white-bg .song-pill {
  background: #fafafa;
  border-color: #ddd;
}

.song-pill-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* Coluna do título – ocupa mais espaço e pode cortar com "..." */
.song-col-title {
  flex: 2 1 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

/* Coluna da versão – texto curto, sem quebrar */
.song-col-version {
  flex: 1 0 auto;
  white-space: nowrap;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Coluna do tom – grudadinho à direita, igual a agenda */
.song-col-key {
  flex: 0 0 auto;
  white-space: nowrap;
  font-weight: bold;
  text-align: right;
}

@media (max-width: 480px) {
  .song-pill-row {
    flex-wrap: wrap;
  }

  /* Título ocupa a linha inteira */
  .song-col-title {
    flex: 1 0 100%;
  }

  /* Versão e Tom ficam na linha de baixo, lado a lado */
  .song-col-version {
    flex: 0 0 auto;
  }

  .song-col-key {
    flex: 0 0 auto;
    margin-left: auto; /* empurra o tom pro canto direito */
  }
}

/* Detalhe da música */

.song-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.song-detail-title {
  font-size: 15px;
}

.song-detail-meta {
  font-size: 11px;
  color: var(--color-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* Toolbar da música (grupos) */

.song-detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--color-text-soft);
  flex-shrink: 0;
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.toolbar-group span {
  white-space: nowrap;
}

.toolbar-scroll input[type="range"] {
  width: 130px;
  max-width: 55vw;
}

.spacer {
  flex: 1;
}

.song-lyrics-container {
  flex: 1;
  min-height: 0;
  max-height: 520px;
  overflow-y: auto;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.5);
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 18px;
  white-space: pre-wrap;
}

.chord {
  color: rgba(255, 214, 102, 0.92);
  font-weight: 600;
  background: rgba(255, 214, 102, 0.08);
  padding: 0 2px;
  border-radius: 3px;
}

.song-lyrics-container .chord {
  color: rgba(255, 214, 102, 0.92); /* dourado suave */
  font-weight: 600;
  font-size: 1.15em; /* sempre proporcional à letra */
}


body.theme-white-bg .song-lyrics-container {
  background: #ffffff;
  border-color: #ddd;
}

/* Quando uma música é selecionada, usar o máximo da tela para o detalhe */
/*#repertoire-view.song-selected {
  grid-template-columns: minmax(0, 1fr);
  height: calc(100vh - 190px);*/ /* ajusta para caber dentro da área abaixo dos menus */
}
/*
#repertoire-view.song-selected .repertoire-list-panel {
  display: none;
}

#repertoire-view.song-selected .repertoire-detail-panel {
  grid-column: 1 / -1;
  height: 100%;
}*/

/* MODO FOCO (Iniciar rolagem) – ocupa ainda mais a tela e simplifica toolbar */
#repertoire-view.song-panel-fullscreen .repertoire-list-panel {
  display: none;
}

#repertoire-view.song-panel-fullscreen .repertoire-detail-panel {
  grid-column: 1 / -1;
  height: calc(100vh - 190px);
}

#repertoire-view.song-panel-fullscreen .song-lyrics-container {
  max-height: none;
  height: calc(100vh - 230px) !important;
}

#repertoire-view.reading-mode .repertoire-list-panel {
  display: none;
}

#repertoire-view.reading-mode .repertoire-detail-panel {
  grid-column: 1 / -1;
  height: calc(100vh - 190px);
}

#repertoire-view.reading-mode .song-lyrics-container {
  max-height: none;
  height: calc(100vh - 230px) !important;
}

/* no modo foco, mostramos só Anterior/Próxima/Parar + range */
/*#repertoire-view.reading-mode #btn-back-list,
#repertoire-view.reading-mode .toolbar-key,
#repertoire-view.reading-mode #scroll-label,
#repertoire-view.reading-mode #btn-scroll-start {
  display: none !important;
}*/

/* Cadastro */

.create-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.create-tab {
  border-radius: 999px;
  padding: 7px 16px;
  border: none;
  background: rgba(0, 0, 0, 0.3);
  color: var(--color-text-soft);
  cursor: pointer;
  font-size: 13px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

body.theme-white-bg .create-tab {
  background: #eee;
}

.create-tab.active {
  background: radial-gradient(circle at top, var(--color-primary-soft), transparent 75%);
  color: #fff;
}

body.theme-white-bg .create-tab.active {
  background: rgba(108, 99, 255, 0.1);
  color: #222;
}

.create-panel {
  margin-top: 8px;
}

.create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr);
  gap: 16px;
}

/* Reutilizar músicas */

.reutilizar-list {
  margin-top: 6px;
  max-height: 120px;
  overflow-y: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
  font-size: 13px;
}

body.theme-white-bg .reutilizar-list {
  background: #fafafa;
  border-color: #ddd;
}

.reutilizar-item {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

body.theme-white-bg .reutilizar-item {
  border-color: #eee;
}

.reutilizar-item:last-child {
  border-bottom: none;
}

.reutilizar-item-title {
  font-weight: 500;
}

.reutilizar-item-meta {
  font-size: 11px;
  color: var(--color-text-soft);
}

/* Lista de agendas no cadastro */

.schedule-list-create {
  margin-top: 8px;
  max-height: 260px;
  overflow-y: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 4px 0;
  background: rgba(0, 0, 0, 0.35);
  font-size: 12px;
}

body.theme-white-bg .schedule-list-create {
  background: #fafafa;
  border-color: #ddd;
}

.agenda-row,
.agenda-row-header {
  display: grid;
  grid-template-columns: 1.8fr 1.1fr 1fr minmax(120px, 0.5fr);
  gap: 8px;
  padding: 7px 10px;
  align-items: center;
}

.agenda-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

body.theme-white-bg .agenda-row:nth-child(odd) {
  background: #f1f1f7;
}

.agenda-row:last-child {
  border-bottom: none;
}

.agenda-row-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-soft);
  font-weight: 500;
}

/* borda só nas linhas de dados */
.agenda-row:not(.agenda-row-header) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* tudo alinhado à esquerda */
.agenda-row > div,
.agenda-row-header > div {
  text-align: left;
}

/* última coluna (Ações) alinhada à direita */
.agenda-row > div:last-child,
.agenda-row-header > div:last-child {
  text-align: right;
}

.list-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* Barra de busca da agenda + paginação */

.schedule-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-top: 6px;
}

.schedule-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.autocomplete-list {
  margin-top: 4px;
  background: rgba(10, 10, 20, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
  display: none;             /* começa escondido */
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  z-index: 20;
}

.autocomplete-item {
  padding: 6px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Lista de músicas (biblioteca) */

.songs-list {
  margin-top: 8px;
  max-height: 260px;
  overflow-y: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 4px 0;
  background: rgba(0, 0, 0, 0.35);
  font-size: 12px;
}

body.theme-white-bg .songs-list {
  background: #fafafa;
  border-color: #ddd;
}

.musica-row,
.musica-row-header {
  display: grid;
  grid-template-columns: 1.6fr 1fr 0.7fr minmax(120px, 1fr); /* título | versão | tom | ações */
  gap: 8px;
  padding: 7px 10px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.musica-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

body.theme-white-bg .musica-row:nth-child(odd) {
  background: #f1f1f7;
}

.musica-row:last-child {
  border-bottom: none;
}

/* Faz o header usar o mesmo grid, sem mudar cores */
.musica-row-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-soft);
  font-weight: 500;
}

/* borda apenas nas linhas de dados */
.musica-row:not(.musica-row-header) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* texto de todas as colunas alinhado à esquerda */
.musica-row > div,
.musica-row-header > div {
  text-align: left !important;
}

/* última coluna (AÇÕES) alinhada à direita */
.musica-row > div:last-child,
.musica-row-header > div:last-child {
  text-align: right !important;
}

/* Pessoas */

.people-list {
  margin-top: 8px;
  max-height: 260px;
  overflow-y: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 4px 0;
  background: rgba(0, 0, 0, 0.35);
}

body.theme-white-bg .people-list {
  background: #fafafa;
  border-color: #ddd;
}

.people-row {
  padding: 7px 10px;
  display: grid;
  grid-template-columns: 1.3fr 1.4fr 1fr auto;
  gap: 8px;
  font-size: 12px;
  align-items: center;
}

.people-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

body.theme-white-bg .people-row:nth-child(odd) {
  background: #f1f1f7;
}

.people-row-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-soft);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
  font-weight: 500;
}

body.theme-white-bg .people-row-header {
  background: #ececf3;
  border-color: #ddd;
}

.people-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.people-page-size {
  flex: 0 0 140px;
}

.people-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

/* multi-grupo em pessoas */

#person-groups-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.person-group-row {
  width: 100%;
}

.person-group-input {
  width: 100%;
}

.person-groups-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 6px; /* espaço entre as linhas */
}

.person-groups-checkboxes label {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Settings */

.settings-section-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-text-soft);
  margin-bottom: 8px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr);
  gap: 16px;
}

.theme-preview {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}

.theme-chip {
  border-radius: var(--radius-md);
  padding: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.45));
  font-size: 12px;
}

body.theme-white-bg .theme-chip {
  background: #fafafa;
}

.theme-chip-colors {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.4);
}

.checkbox-group label {
  font-size: 13px;
  color: var(--color-text-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Mobile tweaks */

.mobile-only {
  display: none;
}

@media (max-width: 880px) {
  #app {
    padding: 16px 10px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-right {
    width: 100%;
    /*justify-content: space-between;*/
    justify-content: right;
  }

  .nav-tabs {
    flex-wrap: wrap;
  }

  .repertoire-grid,
  .create-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .song-lyrics-container {
    max-height: 520px;
  }

  .song-detail-toolbar {
    /* flex-direction: column; */
    align-items: flex-start;
  }

  .toolbar-group {
    /* width: 100%; */
    justify-content: flex-start;
  }
}

/* Em telas menores, podemos exibir elementos marcados como mobile-only */
@media (max-width: 768px) {
  .mobile-only {
    display: inline-flex;
  }
}

#btn-create-person {
  display: block;
  margin: 12px auto 0; /* topo 12px, centraliza na horizontal */
}

#signup-back-btn {
  display: block;
  margin: 12px auto 0; /* topo 12px, centraliza na horizontal */
}

/* ===== Password field with toggle button ===== */
.password-wrapper {
  position: relative;
}

.password-wrapper .field-input {
  padding-right: 70px; /* espaço pro botão "Mostrar" */
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--color-text-soft);
  font-size: 12px;
  cursor: pointer;
  padding: 3px 0;
}

.password-toggle:hover {
  text-decoration: underline;
}

/* Estado de sucesso (senha + confirmação corretas) */
.field-input.is-valid {
  border-color: rgba(0, 200, 83, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 200, 83, 0.35);
}

/* Fallback: foca só no painel detalhe, escondendo a lista */
#repertoire-view.song-panel-fullscreen .repertoire-list-panel {
  display: none !important;
}

#repertoire-view.song-panel-fullscreen .repertoire-detail-panel {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  border-radius: 0 !important;
  z-index: 9999 !important;
}

/* Quando o painel estiver em fullscreen nativo, o browser pode aplicar fundo padrão.
   Forçamos o mesmo fundo do app (var(--bg-gradient)) */
.repertoire-detail-panel:fullscreen {
  background: var(--bg-gradient) !important;
  color: var(--color-text) !important;
}

/* Classe que aplica via JS ao entrar em fullscreen */
.repertoire-detail-panel.song-panel-fs-active {
  background: var(--bg-gradient) !important;
  color: var(--color-text) !important;
}

/* Garante que o container interno continue com o "card feel" e não fique transparente/estranho */
.repertoire-detail-panel.song-panel-fs-active .song-lyrics-container {
  background: rgba(0, 0, 0, 0.5) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  max-height: none !important;
  height: calc(100vh - 230px) !important !important;
}

body.theme-white-bg .repertoire-detail-panel.song-panel-fs-active .song-lyrics-container {
  background: #f7f4ea !important;
  border-color: rgba(184, 155, 47, 0.28) !important;
  color: #1f1f1f !important;
}

body.theme-white-bg
.repertoire-detail-panel.song-panel-fs-active
.song-lyrics-container .chord {
  color: #8a6a12 !important; /* dourado mais escuro */
  font-weight: 600;
}

.library-filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-top: 8px;
}

.library-search-input {
  flex: 1 1 280px;
}

.library-advanced-filters {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  /*grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;*/
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.library-advanced-filters .btn-ghost {
  grid-column: 1 / -1;
  justify-self: end;
  height: 40px;
  padding: 0 18px;
}

.library-advanced-filters button {
  justify-self: end;
}

body.theme-white-bg .library-advanced-filters {
  background: #fafafa;
  border-color: #dddddd;
}

.library-advanced-filters.hidden {
  display: none;
}

.library-filter-btn {
  height: 42px; /* mesma altura do input */
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .library-advanced-filters {
    grid-template-columns: 1fr;
  }
  .library-advanced-filters .btn-ghost {
    justify-self: stretch;
  }
}

/* iPhone */
@media (max-width: 425px) {
  input[type="date"],
  input[type="time"] {
    width: 92%;
  }
}

/*working only in ipad portrait device*/
@media all and (device-width: 768px) {
  input[type="date"],
  input[type="time"] {
    width: 50% !important;
  }
}

/*working only in ipad landscape device*/
@media all and (device-width: 1024px){
  input[type="date"],
  input[type="time"] {
    width: 50% !important;
  }
}

/*
@media (min-width: 426px) and (max-width: 1024px) and (orientation: portrait) {
  input[type="date"],
  input[type="time"] {
    width: 50%;
  }
}

/* iOS / iPadOS Safari (detecta WebKit touch) 
@supports (-webkit-touch-callout: none) {

  input[type="date"],
  input[type="time"] {
    width: 50% !important;
  }

}

/* iPhone + iPad (telas touch): corrige o overflow do date/time no Safari 
@media (pointer: coarse) {
  input[type="date"],
  input[type="time"] {
    width: 50% !important;
  }
}

@supports (-webkit-overflow-scrolling: touch) {
  input[type="date"],
  input[type="time"] {
    width: 50% !important;
  }
}
*/