/* ═══════════════════════════════════════════════════════════════
   ADMIN 🔑 — control room
   Mobile: title → ticket stats (2×2) → gastos editor → user cards.
   Desktop: tickets in a row, spread — gastos (left page) / users table (right page).
   ═══════════════════════════════════════════════════════════════ */

/* ── stats tickets ── */
.adm-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 10px 0 18px; }
.adm-ticket {
  position: relative; overflow: hidden;
  background: var(--paper-2);
  border: var(--border-ink); border-radius: 12px;
  box-shadow: var(--shadow-hard);
  padding: 12px 16px 10px;
  text-align: center;
}
/* ticket punch holes */
.adm-ticket::before, .adm-ticket::after {
  content: ''; position: absolute; top: 50%;
  width: 16px; height: 16px; margin-top: -8px; border-radius: 50%;
  background: var(--paper); border: 2.5px solid var(--ink-line);
}
.adm-ticket::before { left: -10px; }
.adm-ticket::after { right: -10px; }
.adm-stats .adm-ticket:nth-child(odd) { transform: rotate(-1deg); }
.adm-stats .adm-ticket:nth-child(even) { transform: rotate(1deg); }
.adm-ticket-num { font-size: 28px; font-weight: 700; line-height: 1.1; }
.adm-ticket-num span { display: inline-block; }
.adm-ticket-label {
  font-family: var(--f-head); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--newsprint-mute); margin-top: 2px;
}

/* ── GASTOS PER GAWA editor ── */
.adm-cost-rows { display: flex; flex-direction: column; }
.adm-cost-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0;
  border-bottom: 2px dashed rgba(26, 23, 18, 0.15);
}
.adm-cost-row:last-child { border-bottom: none; }
.adm-cost-label {
  font-family: var(--f-head); font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.adm-soon {
  font-family: var(--f-display); font-size: 10px; letter-spacing: 0.08em;
  background: var(--riso-pink); color: #fff;
  border: 2px solid var(--ink-line); border-radius: 6px;
  padding: 0 6px; transform: rotate(-4deg); flex: 0 0 auto;
}
.adm-stepper { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.adm-step {
  width: 32px; height: 32px; border-radius: 10px; padding: 0;
  border: 2px solid var(--ink-line); background: var(--speech-fill);
  font-family: var(--f-display); font-size: 17px; line-height: 1;
  box-shadow: 2px 2px 0 var(--panel-shadow);
  display: flex; align-items: center; justify-content: center;
}
.adm-step:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--panel-shadow); }
.adm-step:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.adm-val { min-width: 34px; text-align: center; font-size: 18px; font-weight: 700; }
.adm-val.is-dirty { color: var(--riso-blue); }
.adm-save { margin-top: 14px; }
.adm-dirty { font-family: var(--f-mono); font-size: 13px; }

/* ── model on/off ── */
.adm-models { margin-bottom: 18px; }
.adm-model-rows { display: flex; flex-direction: column; gap: 8px; }
.adm-model-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--speech-fill);
  border: 2px solid var(--ink-line); border-radius: 12px;
  padding: 9px 12px;
  box-shadow: 2px 2px 0 var(--panel-shadow);
  transition: opacity 0.15s, filter 0.15s;
}
.adm-model-row.is-off { opacity: 0.55; filter: saturate(0.3); }
.adm-model-no { font-family: var(--f-display); font-size: 20px; color: var(--newsprint-mute); }
.adm-model-name { font-family: var(--f-head); font-weight: 700; font-size: 14px; }
.adm-model-hint { font-size: 11px; color: var(--newsprint-mute); }
.adm-toggle {
  flex: 0 0 auto; min-width: 54px;
  font-family: var(--f-display); font-size: 14px; letter-spacing: 0.06em;
  background: var(--locked); color: var(--paper-2);
  border: 2px solid var(--ink-line); border-radius: 999px;
  padding: 4px 12px;
  box-shadow: 2px 2px 0 var(--panel-shadow);
  transition: background 0.12s, transform 0.08s;
}
.adm-toggle.is-on { background: var(--riso-teal); color: #fff; }
.adm-toggle.is-dirty { box-shadow: 2px 2px 0 var(--riso-blue); }
.adm-toggle:active { transform: translate(2px, 2px); box-shadow: none; }
.adm-toggle:disabled { opacity: 0.5; cursor: not-allowed; }
.adm-toggle.wobble { animation: shake 0.3s; }

/* ── users ── */
.adm-search { margin-bottom: 12px; }
.adm-users { display: flex; flex-direction: column; gap: 10px; }
.adm-skel { min-height: 120px; }
.adm-err { align-items: center; padding: 16px 0; }
.adm-uhead { display: none; }

.adm-user {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    'info credits'
    'joined joined'
    'actions actions';
  gap: 4px 10px;
  background: var(--speech-fill);
  border: 2px solid var(--ink-line); border-radius: 12px;
  box-shadow: 2px 2px 0 var(--panel-shadow);
  padding: 10px 12px;
}
.adm-user.is-busy { opacity: 0.55; pointer-events: none; }
.adm-uinfo { grid-area: info; min-width: 0; }
.adm-uname {
  font-family: var(--f-head); font-weight: 700; font-size: 15px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.adm-ukey { font-size: 12px; }
.adm-uemail { font-size: 12px; overflow-wrap: anywhere; }
.adm-ucredits {
  grid-area: credits; justify-self: end; align-self: start;
  display: inline-block; font-weight: 700; font-size: 18px;
}
.adm-ucredits::after { content: ' ₵'; font-size: 11px; color: var(--newsprint-mute); }
.adm-ucredits.adm-bump { animation: adm-bump 0.4s ease; }
.adm-ujoined { grid-area: joined; font-size: 11px; }
.adm-uactions { grid-area: actions; display: flex; gap: 8px; margin-top: 6px; }
.adm-uactions .chip { padding: 4px 12px; font-size: 12px; font-family: var(--f-mono); font-weight: 700; }
.adm-chip-plus { color: var(--success-ink); }
.adm-chip-minus { color: var(--danger-ink); }

@keyframes adm-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.35) rotate(-3deg); color: var(--riso-blue); }
  100% { transform: scale(1); }
}

/* ── mobile: gap between the two stacked "pages" ── */
@media (max-width: 1023.98px) {
  .adm-right { margin-top: 16px; }
}

/* ═══ DESKTOP ≥1024px — control-room spread ═══ */
@media (min-width: 1024px) {
  .adm-stats { grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
  .adm-ticket-num { font-size: 34px; }

  /* users side wider than costs side */
  .spread.adm-spread { grid-template-columns: 5fr 7fr; }
  /* the spread pages ARE the frames — strip inner panel chrome */
  .adm-spread .panel { border: none; box-shadow: none; background: transparent; padding: 0; transform: none; }

  /* users become a table */
  .adm-users { gap: 8px; }
  .adm-uhead {
    display: grid;
    grid-template-columns: 1fr 90px 110px 200px;
    gap: 10px; padding: 0 12px 4px;
    font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--newsprint-mute);
  }
  .adm-user {
    grid-template-columns: 1fr 90px 110px 200px;
    grid-template-areas: 'info credits joined actions';
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    box-shadow: none;
    transition: transform 0.12s, box-shadow 0.12s;
  }
  .adm-user:hover { transform: translateY(-1px); box-shadow: 3px 3px 0 var(--panel-shadow); }
  .adm-ucredits { justify-self: start; align-self: center; }
  .adm-ujoined { font-size: 11px; }
  .adm-uactions { margin-top: 0; justify-content: flex-end; }
}

/* provider hint under a cost row label */
.adm-cost-hint { font-size: 10px; color: var(--newsprint-mute); margin-top: 1px; }
