/* ==========================================================================
   Sistema de Promotores — Magia Latina Radio
   Móvil primero. Tema oscuro con acento dorado (marca de la radio).
   Los párrafos usan SIEMPRE todo el ancho disponible: ningún texto queda
   apretado en una columna angosta en el teléfono.
   ========================================================================== */

:root {
  --bg: #14110d;
  --surface: #221d17;
  --surface-2: #2c261e;
  --text: #f5ead6;
  --muted: #c9b896;
  --gold: #d4a017;
  --gold-soft: #e8c15a;
  --border: #4a3f30;
  --danger: #e0655a;
  --ok: #7fb069;
  --radius: 12px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

/* El contenido vive en una sola columna centrada, a lo ancho en el teléfono. */
.site-header,
main,
.site-footer {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header { padding-top: 1.5rem; }
.site-header .brand {
  margin: 0;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
}
.site-header h1 {
  margin: 0.25rem 0 0;
  font-size: 1.6rem;
  line-height: 1.2;
}
.tagline { color: var(--muted); margin: 0.25rem 0 0; }

main { padding-bottom: 2rem; }

h2 { font-size: 1.35rem; margin: 2rem 0 0.5rem; }
h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
h4 { font-size: 1rem; margin: 0 0 0.25rem; }
p { margin: 0.5rem 0; }

/* ------------------------------------------------------------------ hoja */
.subtitle { color: var(--muted); font-style: italic; }

.plans {
  display: grid;
  gap: 0.75rem;
  margin: 0.75rem 0;
}
.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}
.plan .real { color: var(--muted); font-weight: 400; font-size: 0.9rem; }

.promo {
  background: var(--surface-2);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin: 1rem 0;
}
.promo p { margin: 0; }
.promo strong { color: var(--gold-soft); }

.team-fixed,
.team-list {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}
.team-list:empty { display: none; }

/* ------------------------------------------------------- tablas (responsive)
   Escritorio: tabla normal. Teléfono (<=680px): cada fila se apila como
   tarjeta y cada celda muestra su etiqueta (data-label). El contenedor
   permite desplazamiento horizontal como respaldo. */
.table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.table-wrap:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
caption {
  text-align: left;
  padding: 0.75rem 0.75rem 0.25rem;
  color: var(--text);
  font-weight: 600;
}
th, td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-top: 1px solid var(--border);
  vertical-align: top;
}
thead th {
  border-top: none;
  color: var(--gold-soft);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
tbody th { white-space: nowrap; }

@media (max-width: 680px) {
  thead { display: none; }
  table, tbody, tr, th, td { display: block; width: 100%; }
  tbody tr {
    border-top: 1px solid var(--border);
    padding: 0.25rem 0;
  }
  tbody tr:first-child { border-top: none; }
  tbody th {
    border-top: none;
    padding-bottom: 0;
    color: var(--gold-soft);
  }
  td {
    border-top: none;
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
  }
  td::before {
    content: attr(data-label) ": ";
    font-weight: 700;
    color: var(--muted);
  }
  td.no-label::before { content: ""; }
}

/* ------------------------------------------------------------------ formularios */
form { margin: 0.5rem 0 1rem; }

label {
  display: block;
  font-weight: 600;
  margin: 1rem 0 0.3rem;
}
.hint-inline { font-weight: 400; color: var(--muted); font-size: 0.9rem; }

input, select, textarea {
  width: 100%;
  min-height: 3rem; /* objetivo táctil >= 48px */
  padding: 0.65rem 0.8rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}
input[type="file"] { padding: 0.5rem; }
input[type="checkbox"] { width: auto; min-height: auto; }

select:invalid { color: var(--muted); }

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  margin: 0.75rem 0;
}

button {
  min-height: 3rem; /* objetivo táctil >= 48px */
  padding: 0.65rem 1.25rem;
  margin-top: 1rem;
  font: inherit;
  font-weight: 700;
  color: #1a1409;
  background: var(--gold);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
}
button:hover { background: var(--gold-soft); }
button:disabled { opacity: 0.55; cursor: wait; }
button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 600;
}
button.small {
  width: auto;
  min-height: 2.5rem;
  padding: 0.4rem 0.8rem;
  margin: 0.15rem 0.15rem 0.15rem 0;
  font-size: 0.9rem;
}
button.danger { background: var(--danger); color: #fff; }
button.danger:hover { background: #ef7d72; }

@media (min-width: 681px) {
  button { width: auto; }
}

.field-error {
  color: #ffb3ab;
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
}
.field-error[hidden] { display: none; }

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

/* ------------------------------------------------------------------ reparto */
.split {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}
.split h3 { margin-top: 0; }
.split dl { margin: 0; }
.split dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0;
}
.split dt { color: var(--muted); }
.split dd { margin: 0; font-weight: 700; }

/* ------------------------------------------------------------------ recibo */
#receipt-text {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  margin: 0.5rem 0;
}

/* ------------------------------------------------------------------ estados */
.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge.pending { background: #4a3410; color: #f2c94c; }
.badge.confirmed { background: #234d2a; color: #9ed69a; }
.badge.new { background: var(--gold); color: #1a1409; }
.badge.off { background: #4a1f1c; color: #ffb3ab; }

/* ------------------------------------------------------------------ barra superior */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.topbar .user-line { margin: 0; font-weight: 600; }
.topbar button { margin-top: 0; width: auto; }

.site-footer {
  padding-bottom: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

[hidden] { display: none !important; }
