/* Panel de operación. Denso a propósito: se usa de pie, con prisa, durante el evento. */

.admin {
  --bg: #0d1117;
  --text: #e8ecf4;
  min-height: 100vh;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.login-card {
  width: min(400px, 92vw);
  padding: 1.8rem;
  display: grid;
  gap: 0.8rem;
}

.error {
  color: #ff9a8f;
  font-size: 0.9rem;
}

.shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

/* ─────────────────────────────── sidebar ─────────────────────────────── */
.side {
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand {
  display: grid;
  line-height: 1.2;
}

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

.brand span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.side-block {
  display: grid;
  gap: 0.45rem;
}

.lbl {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.tabs {
  display: grid;
  gap: 2px;
}

.tab {
  text-align: left;
  padding: 0.6em 0.8em;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-weight: 600;
  color: var(--muted);
}

.tab:hover {
  background: var(--surface-2);
  color: var(--text);
}

.tab.on {
  background: color-mix(in srgb, var(--brand-primary) 26%, transparent);
  color: var(--text);
}

.links {
  font-size: 0.85rem;
}

.links a {
  color: var(--text);
  text-decoration: none;
  opacity: 0.8;
}

.links a:hover {
  opacity: 1;
  color: var(--brand-accent);
}

.side-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.status.online {
  color: #6ee7a8;
}

.status.offline {
  color: #ff8b8b;
}

/* ───────────────────────────────── main ──────────────────────────────── */
.main {
  padding: 1.2rem;
  min-width: 0;
}

.tabview {
  display: none;
}

.tabview.on {
  display: block;
}

.card.pad {
  padding: 1.1rem;
}

.mt {
  margin-top: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  align-items: start;
}

.row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.row.gap {
  gap: 0.5rem;
}

.row.wrap {
  flex-wrap: wrap;
}

.row.between {
  justify-content: space-between;
  align-items: flex-start;
}

.right {
  text-align: right;
}

h2 {
  font-size: 1.15rem;
}

h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--brand-accent);
  font-weight: 700;
}

.big-timer {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.controls .btn {
  font-size: 0.9rem;
}

.small-note {
  font-size: 0.78rem;
  margin-top: 0.6rem;
  line-height: 1.4;
}

.btn.small {
  padding: 0.45em 0.7em;
  font-size: 0.82rem;
}

a.btn {
  text-decoration: none;
}

/* ──────────────────────────────── forms ─────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.7rem;
}

.f {
  display: grid;
  gap: 0.25rem;
}

.f label {
  font-size: 0.74rem;
  color: var(--muted);
}

.f .help {
  font-size: 0.68rem;
  color: color-mix(in srgb, var(--text) 45%, transparent);
  line-height: 1.35;
}

.f.wide {
  grid-column: 1 / -1;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.toggles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.4rem;
}

.rows {
  display: grid;
  gap: 0.45rem;
}

.rowitem {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)) auto;
  gap: 0.4rem;
  align-items: center;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.rowitem input[type='text'],
.rowitem select {
  font-size: 0.85rem;
  padding: 0.4em 0.5em;
}

/* Bloque de ayuda dentro de un formulario del admin. */
.guide {
  border-left: 3px solid var(--brand-primary);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.7rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.guide p {
  margin-bottom: 0.5rem;
  color: var(--muted);
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.55rem;
}

.guide-table th {
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0.2em 0.5em 0.3em 0;
  border-bottom: 1px solid var(--line);
}

.guide-table td {
  padding: 0.35em 0.5em 0.35em 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.guide-table td:nth-child(2) {
  font-weight: 700;
  color: var(--brand-accent);
  text-align: center;
  width: 4.5rem;
}

.guide-table td span {
  color: var(--muted);
  font-size: 0.9em;
}

.guide ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.guide li {
  margin-bottom: 0.2rem;
}

.guide code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: #ffffff12;
  padding: 0.05em 0.3em;
  border-radius: 3px;
}

/* Fila de personaje: miniatura, emoji, nombre, id, imagen, cuadros, subida, borrar. */
.char-row {
  grid-template-columns: 2.6rem 4rem 1fr 6rem 2fr 4.5rem auto auto;
}

.char-row .thumb {
  height: 2.2rem;
  width: 2.4rem;
  object-fit: contain;
  background: #ffffff10;
  border-radius: 4px;
}

.char-row input[type='file'] {
  width: 6.5rem;
}

.rowitem .del {
  background: transparent;
  border: 0;
  color: #ff8b8b;
  font-size: 1rem;
  padding: 0.2em 0.4em;
}

.saved {
  color: #6ee7a8;
  font-size: 0.85rem;
  font-weight: 700;
}

.upload {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.upload input[type='file'] {
  font-size: 0.75rem;
  padding: 0.3em;
}

.thumb {
  height: 2.4rem;
  max-width: 6rem;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff14;
}

/* ──────────────────────────────── tablas ────────────────────────────── */
.table-wrap {
  overflow: auto;
  max-height: 46vh;
  margin-top: 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.table-wrap.tall {
  max-height: 68vh;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.tbl th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0.5em;
  white-space: nowrap;
  z-index: 1;
}

.tbl td {
  padding: 0.42em 0.5em;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tbl tr.off td {
  opacity: 0.45;
}

.tbl tr.p1 td {
  color: var(--brand-accent);
  font-weight: 700;
}

.tbl .actions {
  display: flex;
  gap: 0.25rem;
}

.tbl .actions button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.15em 0.4em;
  font-size: 0.75rem;
}

.bar {
  position: relative;
  height: 0.55rem;
  min-width: 6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  overflow: hidden;
}

.bar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
}

.flag {
  display: inline-block;
  font-size: 0.68rem;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  background: #ffb86b26;
  color: #ffb86b;
  margin-right: 0.2rem;
}

.pick-list {
  max-height: 220px;
  overflow: auto;
  margin-top: 0.5rem;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
}

.pick {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  padding: 0.15em 0.25em;
}

.pick input {
  width: auto;
}

.search {
  max-width: 220px;
}

.history {
  display: grid;
  gap: 0.35rem;
  max-height: 30vh;
  overflow: auto;
  font-size: 0.82rem;
}

.hist {
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.hist strong {
  color: var(--brand-accent);
}

/* ──────────────────────────────── toast ─────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  z-index: 40;
  padding: 0.7em 1.2em;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  font-weight: 600;
}

.toast.bad {
  border-color: #ff8b8b66;
  color: #ff9a8f;
}

.toast.good {
  border-color: #6ee7a866;
  color: #8ef0bb;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .side {
    position: static;
    height: auto;
  }

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