.admin-page {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: grid;
  gap: 1rem;
}

.admin-header {
  display: grid;
  gap: 0.75rem;
}

.admin-back {
  justify-self: start;
  color: var(--sage-deep);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
}

.admin-header__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-header__brand img {
  border-radius: 12px;
}

.admin-header__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--espresso);
}

.admin-header__who {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-card {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(92, 61, 46, 0.1);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.85rem;
  animation: fadeIn 0.35s ease both;
}

.admin-card[hidden],
.admin-gate[hidden],
#adminApp[hidden] {
  display: none;
}

#adminApp {
  display: grid;
  gap: 1rem;
}

.admin-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--espresso);
}

.admin-subtitle {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  color: var(--roast);
}

.admin-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.admin-warning {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(196, 120, 74, 0.14);
  color: var(--roast);
  font-size: 0.82rem;
}

.admin-warning[hidden] {
  display: none;
}

.admin-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.admin-tab {
  border: 1px solid rgba(63, 92, 74, 0.25);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.6);
  color: var(--sage-deep);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.admin-tab.is-active {
  background: var(--sage-deep);
  color: var(--foam);
}

.admin-page input,
.admin-page select {
  border: 1px solid rgba(92, 61, 46, 0.18);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
  min-width: 0;
}

.admin-page input:focus,
.admin-page select:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(111, 143, 122, 0.22);
}

.admin-btn {
  border: none;
  border-radius: 10px;
  padding: 0.5rem 0.9rem;
  background: var(--sage-deep);
  color: var(--foam);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.admin-btn--ghost {
  background: transparent;
  color: var(--sage-deep);
  border: 1px solid rgba(63, 92, 74, 0.35);
}

.admin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-field {
  display: grid;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--roast);
  max-width: 320px;
}

.admin-inline {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Usuarios */
.members {
  display: grid;
  gap: 0.45rem;
}

.member-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(170px, 1.6fr) 110px auto auto;
  gap: 0.45rem;
  align-items: center;
  position: relative;
}

.member-row--new {
  grid-template-columns: minmax(110px, 1fr) minmax(170px, 1.6fr) 110px auto;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed rgba(92, 61, 46, 0.18);
}

.member-row.is-inactive input,
.member-row.is-inactive select {
  opacity: 0.55;
}

.member-row__active {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--roast);
}

.member-row__me {
  position: absolute;
  right: -2.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--copper);
}

/* Recordatorios */
.notify-help {
  margin: 0 0 0.9rem;
  padding-left: 1.1rem;
}

.notify-row {
  display: grid;
  grid-template-columns: 90px minmax(160px, 1.4fr) minmax(130px, 1fr) minmax(110px, 0.8fr) auto auto;
  gap: 0.45rem;
  align-items: center;
}

.notify-row__name {
  font-size: 0.9rem;
  color: var(--espresso);
}

/* Orden */
.order-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.order-item {
  display: grid;
  grid-template-columns: 2rem 1fr auto auto auto;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.6rem;
  border-radius: 12px;
  background: rgba(111, 143, 122, 0.12);
}

.order-item__num {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sage-deep);
  color: var(--foam);
  font-size: 0.78rem;
  font-weight: 600;
}

.order-item__name {
  font-weight: 600;
}

.icon-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid rgba(63, 92, 74, 0.25);
  background: rgba(255, 255, 255, 0.8);
  color: var(--sage-deep);
  font-size: 1rem;
  cursor: pointer;
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.icon-btn--danger {
  color: #a3412f;
}

.preview-list,
.rotation-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
  font-size: 0.86rem;
}

.preview-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.rotation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
}

.rotation-item div {
  display: grid;
  gap: 0.15rem;
}

.rotation-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

/* Mover fechas */
.date-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.date-action {
  display: grid;
  gap: 0.45rem;
  align-content: start;
  padding: 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(92, 61, 46, 0.08);
}

.date-action .admin-subtitle {
  margin: 0;
}

.upcoming {
  display: grid;
  gap: 0.35rem;
}

.upcoming-row {
  display: grid;
  grid-template-columns: 150px 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.88rem;
}

.upcoming-row__date {
  color: var(--muted);
}

.badge {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(196, 120, 74, 0.16);
  color: var(--roast);
  font-size: 0.72rem;
  font-weight: 600;
}

.badge--off {
  background: rgba(92, 61, 46, 0.12);
}

@media (max-width: 720px) {
  .member-row,
  .member-row--new,
  .notify-row {
    grid-template-columns: 1fr 1fr;
  }

  .notify-row__name {
    grid-column: 1 / -1;
  }

  .member-row__me {
    position: static;
  }

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