:root {
  --admin-max: 1040px;
}

.admin-body {
  min-height: 100vh;
}

.admin-container {
  width: min(100% - 28px, var(--admin-max));
  margin-inline: auto;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 80% 10%, rgba(212,170,99,.2), transparent 26rem),
    linear-gradient(145deg, var(--forest-950), var(--forest-800));
}

.login-card {
  position: relative;
  width: min(100%, 440px);
  overflow: hidden;
  padding: 34px;
  border-radius: 26px;
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(4, 18, 14, .35);
}

.login-card h1,
.admin-welcome h1 {
  margin-bottom: 10px;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(2.2rem, 10vw, 3.5rem);
  font-weight: 400;
  line-height: 1;
}

.login-card > p {
  margin-bottom: 24px;
  color: var(--muted);
}

.admin-mark {
  position: absolute;
  top: -45px;
  right: -8px;
  color: rgba(23,59,50,.06);
  font-family: Georgia, serif;
  font-size: 180px;
  line-height: 1;
  transform: rotate(-8deg);
}

.back-link {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin-bottom: 36px;
  color: var(--forest-800);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
}

.admin-form,
.field-grid {
  display: grid;
  gap: 16px;
}

.admin-form label,
.field-label,
.search-field {
  display: grid;
  gap: 7px;
}

.admin-form label > span,
.field-label > span,
.search-field > span {
  color: var(--forest-900);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 92px;
}


.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 59, 50, .08);
  color: var(--forest-900);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: rgba(23, 59, 50, .14);
}

.password-toggle:focus-visible {
  outline: 3px solid rgba(32, 80, 68, .18);
  outline-offset: 2px;
}

.password-toggle__icon {
  position: absolute;
  width: 24px;
  height: 24px;
  opacity: 0;
  transform: scale(.92);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.password-toggle__icon--hide {
  opacity: 1;
  transform: scale(1);
}

.password-toggle[aria-pressed="true"] .password-toggle__icon--show {
  opacity: 1;
  transform: scale(1);
}

.password-toggle[aria-pressed="true"] .password-toggle__icon--hide {
  opacity: 0;
  transform: scale(.92);
}

.password-toggle[aria-pressed="false"] .password-toggle__icon--show {
  opacity: 0;
  transform: scale(.92);
}

.password-toggle[aria-pressed="false"] .password-toggle__icon--hide {
  opacity: 1;
  transform: scale(1);
}

.admin-form input,
.admin-form textarea,
.admin-form select,
.field-control,
.search-field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: .93rem;
}

.admin-form textarea,
.field-control[type="textarea"] {
  min-height: 94px;
  resize: vertical;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus,
.field-control:focus,
.search-field input:focus {
  border-color: var(--forest-800);
  box-shadow: 0 0 0 3px rgba(32,80,68,.1);
}

.primary-button,
.ghost-button,
.danger-button,
.small-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  background: var(--forest-900);
  color: white;
}

.primary-button:hover {
  background: var(--forest-800);
}

.primary-button:disabled,
.ghost-button:disabled,
.small-button:disabled {
  cursor: wait;
  opacity: .58;
}

.ghost-button,
.small-button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.7);
  color: var(--forest-800);
}

.danger-button {
  background: #8f3434;
  color: white;
}

.form-error {
  margin: 0;
  color: #9e2e2e;
  font-size: .83rem;
}

.admin-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(16,38,31,.95);
  color: white;
  backdrop-filter: blur(14px);
}

.admin-header__content {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.brand__icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: var(--forest-950);
  font-size: 1.15rem;
}

.brand small,
.brand strong {
  display: block;
}

.brand small {
  color: rgba(255,255,255,.58);
  font-size: .67rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.brand strong {
  font-size: .92rem;
}

.admin-header .ghost-button {
  border-color: rgba(255,255,255,.13);
  background: rgba(255,255,255,.07);
  color: white;
}

.admin-header__actions {
  display: flex;
  gap: 8px;
}

.admin-main {
  padding-block: 34px 72px;
}

.admin-welcome,
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
}

.admin-welcome {
  margin-bottom: 24px;
}

.admin-welcome p,
.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.metric {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,253,249,.84);
}

.metric small,
.metric strong,
.metric span {
  display: block;
}

.metric small {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.metric strong {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
}

.metric span {
  margin-top: 5px;
  color: var(--muted);
  font-size: .75rem;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.6);
}

.admin-tab {
  flex: 1;
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .83rem;
  font-weight: 700;
  cursor: pointer;
}

.admin-tab.is-active {
  background: var(--forest-900);
  color: white;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin-bottom: 4px;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
}

.search-field {
  margin-bottom: 16px;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,253,249,.9);
  box-shadow: 0 8px 30px rgba(19,46,38,.05);
}

.admin-list-item__main {
  min-width: 0;
}

.admin-list-item__main strong,
.admin-list-item__main small {
  display: block;
}

.admin-list-item__main strong {
  margin-bottom: 5px;
}

.admin-list-item__main small {
  color: var(--muted);
}

.admin-list-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.data-chip {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--forest-100);
  color: var(--forest-800);
  font-size: .68rem;
  font-weight: 700;
}

.admin-list-item__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.empty-admin-list {
  padding: 38px 20px;
  border: 1px dashed var(--line);
  border-radius: 17px;
  color: var(--muted);
  text-align: center;
}

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  align-items: end;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8,22,17,.58);
  backdrop-filter: blur(3px);
}

.modal__dialog {
  position: relative;
  width: min(100%, 880px);
  max-height: 94vh;
  margin-inline: auto;
  overflow: auto;
  border-radius: 25px 25px 0 0;
  background: var(--cream);
  box-shadow: 0 -20px 70px rgba(4,18,14,.3);
}

.modal__header {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(244,240,231,.96);
  backdrop-filter: blur(12px);
}

.modal__header h2 {
  margin: 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
}

.modal__content {
  padding: 22px;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--forest-900);
  font: inherit;
  font-size: 1.4rem;
  cursor: pointer;
}

.editor-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.editor-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.editor-section__heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.editor-section h3 {
  margin: 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 400;
}

.field-grid--two {
  grid-template-columns: repeat(2, minmax(0,1fr));
}

.assignment-list,
.selected-song-list {
  display: grid;
  gap: 9px;
}

.assignment-row {
  display: grid;
  grid-template-columns: minmax(0,1.2fr) minmax(0,1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.7);
}

.moment-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,253,249,.72);
}

.moment-card h4 {
  margin-bottom: 11px;
  color: var(--forest-800);
  font-size: .76rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.song-picker {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

.selected-song {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.selected-song strong {
  display: block;
  font-size: .86rem;
}

.selected-song small {
  color: var(--muted);
}

.row-actions {
  display: flex;
  gap: 5px;
}

.row-action {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--forest-800);
  cursor: pointer;
}

.modal-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin: 26px -22px -22px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: rgba(244,240,231,.96);
  backdrop-filter: blur(12px);
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 9px;
}

.check-option {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.check-option input {
  width: 18px;
  height: 18px;
}

.toast {
  position: fixed;
  z-index: 150;
  right: 18px;
  bottom: 18px;
  max-width: min(380px, calc(100% - 36px));
  padding: 13px 16px;
  border-radius: 13px;
  background: var(--forest-950);
  color: white;
  box-shadow: 0 15px 45px rgba(4,18,14,.28);
  font-size: .86rem;
}

.toast--error {
  background: #843333;
}

.admin-loading {
  position: fixed;
  z-index: 160;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  background: rgba(244,240,231,.76);
  color: var(--forest-900);
  font-weight: 700;
  backdrop-filter: blur(3px);
}

@media (min-width: 760px) {
  .modal {
    align-items: center;
    padding: 24px;
  }

  .modal__dialog {
    border-radius: 25px;
  }
}

@media (max-width: 680px) {
  .admin-container {
    width: min(100% - 20px, var(--admin-max));
  }

  .admin-header__content {
    min-height: 66px;
  }

  .brand small {
    display: none;
  }

  .admin-header__actions .ghost-button:first-child {
    display: none;
  }

  .admin-welcome,
  .panel-heading {
    align-items: flex-start;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .admin-list-item {
    grid-template-columns: 1fr;
  }

  .admin-list-item__actions {
    justify-content: flex-start;
  }

  .field-grid--two {
    grid-template-columns: 1fr;
  }

  .assignment-row {
    grid-template-columns: 1fr 1fr;
  }

  .assignment-row .row-action {
    grid-column: 1 / -1;
    width: 100%;
    border-radius: 10px;
  }

  .role-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .login-card {
    padding: 26px 21px;
  }

  .admin-welcome {
    display: grid;
  }

  .admin-tabs {
    border-radius: 16px;
  }

  .admin-tab {
    padding-inline: 7px;
    border-radius: 12px;
  }

  .panel-heading {
    display: grid;
  }

  .panel-heading .primary-button {
    justify-self: start;
  }

  .song-picker {
    grid-template-columns: 1fr;
  }

  .selected-song {
    grid-template-columns: 1fr;
  }

  .row-actions {
    justify-content: flex-start;
  }
}


.admin-data-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 26px;
  padding: 18px 20px;
  border: 1px solid rgba(156, 44, 38, 0.24);
  border-radius: 18px;
  background: rgba(255, 245, 243, 0.94);
  color: #7d211d;
}

.admin-data-error strong,
.admin-data-error p {
  display: block;
  margin: 0;
}

.admin-data-error p {
  margin-top: 4px;
  color: #8a3a35;
}

@media (max-width: 680px) {
  .admin-data-error {
    align-items: stretch;
    flex-direction: column;
  }
}


/* Campo de data com apresentação brasileira (DD/MM/AAAA). */
.date-control {
  position: relative;
  display: block;
}

.date-control__display {
  padding-right: 52px !important;
}

.date-control__icon {
  position: absolute;
  top: 50%;
  right: 14px;
  display: grid;
  place-items: center;
  color: var(--forest-900);
  pointer-events: none;
  transform: translateY(-50%);
}

.date-control__native {
  position: absolute;
  top: 0;
  right: 0;
  width: 52px !important;
  height: 100%;
  min-height: 46px;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  cursor: pointer;
}

.date-control__native::-webkit-calendar-picker-indicator {
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.field-hint {
  color: var(--muted);
  font-size: .74rem;
}

/* Configuração de lembretes Web Push */
.notification-settings-card {
  display: grid;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 253, 249, .92);
}

.notification-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.notification-toggle input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--forest-900);
}

.notification-toggle span,
.notification-toggle strong,
.notification-toggle small {
  display: block;
}

.notification-toggle small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.notification-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.notification-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-radius: 16px;
  background: var(--forest-100);
}

.notification-summary__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold);
}

.notification-summary strong,
.notification-summary small {
  display: block;
}

.notification-summary small {
  margin-top: 2px;
  color: var(--muted);
}

.notification-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 720px) {
  .notification-settings-grid {
    grid-template-columns: 1fr;
  }

  .notification-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .notification-actions button {
    width: 100%;
  }
}
