/* Panel alineado al ancho amplio del sitio; la tabla necesita sitio */
.admin-page .page {
  width: min(92rem, 96vw);
  max-width: none;
}

.admin-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}

.admin-back:hover {
  color: var(--accent);
}

.admin-box {
  background: var(--bg-panel, #17090b);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(1.25rem, 4vw, 2rem);
  margin-bottom: 2rem;
}

.admin-box h1 {
  font-family: var(--font);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.admin-note {
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.admin-form-grid {
  display: grid;
  gap: 1rem;
  max-width: 22rem;
}

.admin-form-grid label {
  display: block;
}

.admin-form-grid .label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.admin-form-grid input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.admin-form-grid input:focus {
  outline: none;
  border-color: var(--accent);
}

.admin-error {
  color: #e8a598;
  font-size: 0.9rem;
  margin: 0;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-toolbar p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.admin-toolbar button {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.admin-toolbar button:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
}

@media (min-width: 1200px) {
  .admin-table-wrap {
    overflow-x: visible;
  }
}

.admin-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 0.85rem;
  table-layout: fixed;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.admin-table th {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  white-space: normal;
  background: rgba(20, 26, 33, 0.6);
}

/* Reparto de anchos: fecha y nombre más compactos; texto largo a las columnas anchas */
.admin-table th:nth-child(1),
.admin-table td:nth-child(1) {
  width: 11%;
}
.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
  width: 12%;
}
.admin-table th:nth-child(3),
.admin-table td:nth-child(3) {
  width: 10%;
}
.admin-table th:nth-child(4),
.admin-table td:nth-child(4) {
  width: 18%;
}
.admin-table th:nth-child(5),
.admin-table td:nth-child(5) {
  width: 22%;
}
.admin-table th:nth-child(6),
.admin-table td:nth-child(6) {
  width: 27%;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-cell-wrap {
  max-width: none;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.admin-empty {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

:root {
  --bg-panel: #17090b;
}

.admin-toolbar--global {
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.admin-tab {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.55rem 1.1rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.admin-tab:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.admin-tab.is-active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.admin-tab-panel {
  margin-bottom: 0;
}

.admin-subtitle {
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.admin-status-ok {
  color: var(--accent);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.admin-artist-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem 1.25rem;
  align-items: start;
  margin-top: 0.5rem;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-field--full {
  grid-column: 1 / -1;
}

.admin-field .label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-req {
  color: #e8a598;
}

.admin-field input,
.admin-field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  resize: vertical;
}

.admin-field input:focus,
.admin-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.admin-field input[type="file"] {
  padding: 0.45rem 0;
  font-size: 0.85rem;
  cursor: pointer;
}

.admin-song-field input[type="file"] {
  padding: 0.35rem 0;
  font-size: 0.82rem;
  max-width: 100%;
}

.admin-songs-block {
  grid-column: 1 / -1;
}

.admin-songs-block > .label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.admin-song-rows {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.admin-song-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(10rem, 1fr) auto;
  gap: 0.65rem 0.85rem;
  align-items: end;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 13, 0.45);
}

@media (max-width: 900px) {
  .admin-song-row {
    grid-template-columns: 1fr 1fr;
  }
  .admin-remove-song {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 520px) {
  .admin-song-row {
    grid-template-columns: 1fr;
  }
}

.admin-song-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.admin-song-field .label {
  font-size: 0.65rem;
}

.admin-song-field input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.admin-song-field input:focus {
  outline: none;
  border-color: var(--accent);
}

.admin-remove-song {
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.45rem 0.65rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  height: fit-content;
}

.admin-remove-song:hover {
  color: #e8a598;
  border-color: #e8a598;
}

.admin-add-song {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.85rem;
  background: transparent;
  color: var(--accent);
  border: 1px dashed var(--accent);
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 1rem;
}

.admin-add-song:hover {
  background: rgba(157, 207, 240, 0.08);
}

.admin-submit-artist {
  grid-column: 1 / -1;
  justify-self: start;
}

.admin-btn-danger {
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.55rem;
  background: transparent;
  color: #e8a598;
  border: 1px solid rgba(232, 165, 152, 0.5);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.admin-btn-danger:hover {
  background: rgba(232, 165, 152, 0.1);
}

.admin-td-thumb {
  width: 4rem;
  vertical-align: middle;
}

.admin-artist-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  border: 1px solid var(--line);
}

.admin-artist-thumb--empty {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(157, 207, 240, 0.12);
  border: 1px dashed var(--line);
}

.admin-table--artists {
  table-layout: auto;
}

.admin-table--artists th:nth-child(1),
.admin-table--artists td:nth-child(1) {
  width: 4.5rem;
}

.admin-table--artists th:nth-child(2),
.admin-table--artists td:nth-child(2) {
  width: 14%;
}

.admin-table--artists th:nth-child(3),
.admin-table--artists td:nth-child(3) {
  width: 12%;
}

.admin-table--artists th:nth-child(4),
.admin-table--artists td:nth-child(4) {
  min-width: 10rem;
}

.admin-table--artists th:nth-child(6),
.admin-table--artists td:nth-child(6) {
  white-space: nowrap;
  width: 8.5rem;
}

.admin-cell-bio {
  font-size: 0.8rem;
  max-width: 22rem;
}
