/* Resonans — panel de usuario. Complementa styles.css */

.panel-body { background: var(--bg); }

/* ── Puerta de entrada ──────────────────────────────────────────────── */

.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card {
  width: 100%; max-width: 420px;
  background: linear-gradient(160deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 38px; box-shadow: var(--shadow-lg);
}
.gate-card h1 { font-size: 1.6rem; text-align: center; margin-bottom: 8px; }
.gate-card .lead { text-align: center; font-size: .95rem; }

/* ── Estructura ─────────────────────────────────────────────────────── */

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
@media (max-width: 860px) { .shell { grid-template-columns: 1fr; } }

.side {
  border-right: 1px solid var(--border);
  padding: 26px 20px;
  display: flex; flex-direction: column;
  background: var(--bg-soft);
  position: sticky; top: 0; height: 100vh;
}
@media (max-width: 860px) { .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); } }

/* `flex: 1` hacía que el grid repartiera los enlaces por toda la altura.
   El espacio sobrante va abajo, no entre los elementos. */
.side-nav { display: grid; gap: 3px; align-content: start; flex: 1; }
.side-link {
  text-align: left; padding: 11px 14px; border-radius: var(--radius);
  background: transparent; border: 1px solid transparent;
  color: var(--text-2); font-size: .92rem; font-weight: 500;
  transition: all .18s var(--ease);
}
.side-link:hover { background: rgb(255 255 255 / .04); color: var(--text); }
.side-link.active {
  background: rgb(99 102 241 / .14); border-color: rgb(99 102 241 / .3);
  color: var(--brand-300); font-weight: 600;
}

.side-foot { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 18px; }
.who { margin-bottom: 12px; }
.who strong { display: block; font-size: .9rem; }
.who small { color: var(--text-3); font-size: .8rem; }

.main { padding: 34px 34px 70px; max-width: 1080px; }
@media (max-width: 700px) { .main { padding: 24px 18px 56px; } }
.main h1 { font-size: 1.8rem; margin-bottom: 10px; }
.view { display: none; }
.view.on { display: block; animation: fade-up .35s var(--ease-out); }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }

/* ── Fichas de resumen ──────────────────────────────────────────────── */

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 24px 0 28px; }
@media (max-width: 900px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tile {
  background: linear-gradient(160deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px;
}
.tile-lbl { font-size: .78rem; color: var(--text-3); margin-bottom: 7px; }
.tile-val { font-size: 1.7rem; font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: .78rem; color: var(--text-3); margin-top: 3px; }
.tile.money .tile-val { color: var(--accent-400); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.card h3 { font-size: 1rem; margin-bottom: 16px; }

/* ── Barras de consumo ──────────────────────────────────────────────── */

.meter-row { margin-bottom: 16px; }
.meter-top { display: flex; justify-content: space-between; font-size: .84rem; margin-bottom: 6px; }
.meter-top span:last-child { color: var(--text-3); font-variant-numeric: tabular-nums; }
.bar { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-500), var(--brand-400)); transition: width .5s var(--ease); }
.bar-fill.warn { background: linear-gradient(90deg, var(--accent-500), var(--accent-400)); }
.bar-fill.over { background: linear-gradient(90deg, #dc2626, #f87171); }

/* ── Lista de voces ─────────────────────────────────────────────────── */

.voice-row {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(160deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; margin-bottom: 12px;
  transition: border-color .25s;
}
.voice-row:hover { border-color: var(--border-lit); }
.voice-main { flex: 1; min-width: 0; }
.voice-main h4 { font-size: 1.02rem; margin-bottom: 4px; }
.voice-meta { font-size: .82rem; color: var(--text-3); }
.voice-acts { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) { .voice-row { flex-direction: column; align-items: stretch; } }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .74rem; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  border: 1px solid; white-space: nowrap;
}
.pill.draft     { color: var(--text-3);    border-color: var(--border);        background: rgb(255 255 255/.03); }
.pill.pending   { color: var(--warn-400);  border-color: rgb(251 191 36/.3);   background: rgb(251 191 36/.1); }
.pill.active    { color: var(--ok-400);    border-color: rgb(52 211 153/.3);   background: rgb(52 211 153/.1); }
.pill.published { color: var(--accent-400);border-color: rgb(245 158 11/.35);  background: rgb(245 158 11/.12); }
.pill.revoked   { color: #fca5a5;          border-color: rgb(248 113 113/.3);  background: rgb(248 113 113/.1); }

.btn-sm { padding: 8px 15px; font-size: .84rem; }

/* ── Grabadora ──────────────────────────────────────────────────────── */

.rec-box {
  border: 1px solid var(--border-lit); border-radius: var(--radius-lg);
  padding: 24px; background: rgb(0 0 0 / .3); text-align: center;
}
.vu { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 64px; margin-bottom: 18px; }
.vu span {
  width: 5px; height: 4px; border-radius: 999px;
  background: var(--brand-500); transition: height .07s linear, background .2s;
}
.vu span.hot { background: var(--accent-400); }
.rec-time { font-family: var(--mono); font-size: 1.9rem; font-weight: 500; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.rec-hint { font-size: .84rem; color: var(--text-3); margin-bottom: 18px; }

.rec-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: #ef4444; margin-right: 7px;
  animation: pulse 1.3s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .25; } }

/* ── Frase de consentimiento ────────────────────────────────────────── */

.challenge {
  padding: 20px; border-radius: var(--radius);
  background: rgb(99 102 241 / .1); border: 1px solid rgb(99 102 241 / .3);
  font-size: 1.06rem; line-height: 1.65; margin: 18px 0;
}

/* ── Ganancias ──────────────────────────────────────────────────────── */

.earn-head {
  background: linear-gradient(150deg, rgb(245 158 11 / .1), var(--surface));
  border: 1px solid rgb(245 158 11 / .25); border-radius: var(--radius-xl);
  padding: 30px; margin-bottom: 22px; text-align: center;
}
.earn-big {
  font-size: clamp(2.2rem, 6vw, 3.2rem); font-weight: 700; letter-spacing: -.045em;
  color: var(--accent-400); font-variant-numeric: tabular-nums;
}
.earn-note { font-size: .86rem; color: var(--text-2); margin-top: 10px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tbl th {
  text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border);
}
table.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--border); color: var(--text-2); }
table.tbl td:last-child, table.tbl th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl tr:last-child td { border-bottom: 0; }

/* ── Modal ──────────────────────────────────────────────────────────── */

.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgb(0 0 0 / .72); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px;
  animation: fade-up .22s var(--ease-out);
}
.modal-card {
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-lit); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 26px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface-2); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal-head h2 { font-size: 1.2rem; }
.modal-x { background: none; border: 0; color: var(--text-3); font-size: 1.6rem; line-height: 1; padding: 0 6px; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: 26px; }

/* ── Aviso flotante ─────────────────────────────────────────────────── */

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 90px);
  background: var(--surface-2); border: 1px solid var(--border-lit);
  border-radius: var(--radius); padding: 13px 22px; font-size: .9rem;
  box-shadow: var(--shadow-lg); z-index: 120; opacity: 0;
  transition: transform .32s var(--ease), opacity .32s;
  max-width: 90vw;
}
.toast.on { transform: translate(-50%, 0); opacity: 1; }
.toast.ok  { border-color: rgb(52 211 153 / .4); }
.toast.bad { border-color: rgb(248 113 113 / .4); }

/* ── Vacíos ─────────────────────────────────────────────────────────── */

.empty { text-align: center; padding: 52px 24px; color: var(--text-3); }
.empty h3 { color: var(--text-2); font-size: 1.05rem; margin-bottom: 8px; }
.empty p { font-size: .9rem; max-width: 42ch; margin: 0 auto 20px; }

.key-mono {
  font-family: var(--mono); font-size: .84rem; color: var(--brand-300);
  background: #06060a; border: 1px solid var(--border);
  padding: 10px 13px; border-radius: var(--radius-sm);
  word-break: break-all;
}
