/* Panel de administración de Sphere: la paleta y la tipografía de la web de Sphere (apps/web/src/estilos.css). */
:root {
  --indigo: #2b1f5b; --tinta-2: #4a3f75; --tinta-3: #625685; --azul: #3b6bff; --azul-oscuro: #2a52d9; --violeta: #a855f7;
  --lila: #f3e8ff; --suelo: #fbf9ff; --blanco: #fff; --borde: #e6dcfa; --borde-suave: #f2ebfd;
  --hecho-fondo: #e3f9ff; --hecho-tinta: #06627a; --aviso-fondo: #fff4e0; --aviso-tinta: #8a5300;
  --error: #b4234f; --error-fondo: #fdeef3; --gris-fondo: #f1eff6; --gris-tinta: #5d5875;
  --degradado: linear-gradient(135deg, #3ccffa, #2c89f9 48%, #ac42f7);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body { background: var(--suelo); color: var(--indigo); font-family: Nunito, ui-rounded, system-ui, sans-serif; font-weight: 600; line-height: 1.45; }
button, input { font: inherit; color: inherit; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: var(--azul-oscuro); }
.oculto { display: none !important; }

/* Entrada */
.entrada { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.entrada-caja { width: min(100%, 420px); background: var(--blanco); border-radius: 26px; padding: 30px 28px; box-shadow: 0 30px 60px -36px rgba(43,31,91,.5), inset 0 0 0 1px var(--borde); }
.entrada-caja .logo { height: 38px; display: block; margin-bottom: 18px; }
.entrada-caja h1 { font-size: 26px; font-weight: 900; letter-spacing: -.01em; }
.entrada-caja p.sub { color: var(--tinta-2); margin: 4px 0 18px; }
.campo { display: grid; gap: 6px; margin-bottom: 14px; }
.campo label { font-weight: 800; font-size: 14px; }
.campo input { height: 46px; padding: 0 14px; border: 0; border-radius: 14px; background: var(--suelo); box-shadow: inset 0 0 0 1.5px var(--borde); font-size: 16px; }
.campo input:focus { outline: 2.5px solid var(--azul); outline-offset: 1px; }
.campo input.codigo { letter-spacing: .3em; font-size: 22px; text-align: center; font-weight: 800; }
.qr { display: grid; justify-items: center; gap: 8px; margin: 6px 0 16px; }
.qr canvas, .qr img { width: 180px; height: 180px; image-rendering: pixelated; }
.qr code { font-size: 12.5px; color: var(--tinta-3); word-break: break-all; text-align: center; }
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--lila); color: var(--indigo); font-weight: 800; font-size: 15px; transition: transform 140ms cubic-bezier(.23,1,.32,1); }
.boton:active { transform: scale(.97); }
.boton:focus-visible { outline: 2.5px solid var(--azul); outline-offset: 2px; }
.boton:disabled { opacity: .55; cursor: default; }
.boton.primario { width: 100%; border: 2px solid transparent; background: linear-gradient(135deg, #e6f7ff, #f1e8ff) padding-box, var(--degradado) border-box; }
.boton.chico { min-height: 34px; padding: 0 14px; font-size: 13.5px; }
.mensaje { margin-bottom: 14px; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 700; }
.mensaje.error { background: var(--error-fondo); color: var(--error); }
.mensaje.info { background: var(--hecho-fondo); color: var(--hecho-tinta); }

/* Cabecera */
.cab { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px; padding: 12px 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1.5px solid var(--borde); }
.cab .logo { height: 32px; }
.cab .que { font-weight: 800; color: var(--tinta-3); font-size: 15px; padding-left: 16px; border-left: 1.5px solid var(--borde); white-space: nowrap; }
.pestanas { display: flex; gap: 4px; margin-left: 18px; }
.pestanas button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: 0; border-radius: 999px; background: none; color: var(--tinta-2); font-weight: 800; font-size: 15px; cursor: pointer; }
.pestanas button:hover { background: var(--suelo); }
.pestanas button.on { background: var(--lila); color: var(--indigo); box-shadow: inset 0 0 0 1.5px #d9c3fb; }
.cab .yo { margin-left: auto; display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 14px; color: var(--tinta-2); }
.cab .yo .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--degradado); }
.cab .yo button { border: 0; background: none; color: var(--tinta-3); cursor: pointer; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; }
.cab .yo button:hover { background: var(--suelo); color: var(--indigo); }
main { max-width: 1240px; margin: 0 auto; padding: 20px 28px 48px; }

/* Resumen */
.veredicto { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 20px; background: var(--blanco); box-shadow: 0 14px 30px -24px rgba(43,31,91,.45), inset 0 0 0 1px var(--borde); }
.veredicto .sello { flex: none; width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: var(--degradado); box-shadow: 0 12px 22px -14px rgba(44,137,249,.7); }
.veredicto .sello svg.i { width: 26px; height: 26px; stroke-width: 2.4; }
.veredicto.aviso .sello { background: linear-gradient(135deg, #ffc35a, #f08a24); }
.veredicto.critico .sello { background: linear-gradient(135deg, #ff6b8a, #e2335f); }
.veredicto > div:not(.act) { flex: 1; min-width: 0; }
.veredicto h1 { font-size: 23px; font-weight: 900; letter-spacing: -.01em; }
.veredicto p { color: var(--tinta-2); font-size: 15px; }
.veredicto .act { margin-left: auto; display: grid; justify-items: end; gap: 6px; font-size: 13px; color: var(--tinta-3); text-align: right; }
.veredicto.aviso h1 { color: var(--aviso-tinta); }
.veredicto.critico h1 { color: var(--error); }
.cifras { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 16px 0; }
.cifra { padding: 14px 16px; border-radius: 18px; background: var(--blanco); box-shadow: inset 0 0 0 1px var(--borde); }
.cifra small { display: flex; align-items: center; gap: 6px; color: var(--tinta-3); font-size: 13px; font-weight: 800; }
.cifra b { display: block; font-size: 28px; font-weight: 900; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cifra span { font-size: 12.5px; color: var(--tinta-3); }
.rejilla { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; }
.columna { display: grid; gap: 16px; }
.caja { background: var(--blanco); border-radius: 20px; padding: 16px 18px; box-shadow: inset 0 0 0 1px var(--borde); }
.caja h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 900; margin-bottom: 8px; }
.caja h2 .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--lila); color: var(--tinta-2); }
.caja h2 .mas { margin-left: auto; border: 0; background: none; font-size: 13.5px; color: var(--azul-oscuro); font-weight: 800; cursor: pointer; }
.fila { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1.5px solid var(--borde-suave); font-size: 14.5px; }
.fila:first-of-type { border-top: 0; }
.fila .n { flex: 1; min-width: 0; }
.fila .n b { display: block; font-weight: 800; }
.fila .n small { display: block; color: var(--tinta-3); font-size: 12.5px; }
.fila .n small.si { color: var(--tinta-2); margin-top: 2px; }
.est { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.est svg.i { width: 15px; height: 15px; }
.est.ok { background: var(--hecho-fondo); color: var(--hecho-tinta); }
.est.aviso { background: var(--aviso-fondo); color: var(--aviso-tinta); }
.est.critico { background: var(--error-fondo); color: var(--error); }
.est.desconocido { background: var(--gris-fondo); color: var(--gris-tinta); }
.pie { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
a.boton { text-decoration: none; }
.boton.peligro { background: var(--error-fondo); color: var(--error); box-shadow: inset 0 0 0 1.5px #f3c4d3; }
.caja.destacada { margin: 16px 0 0; box-shadow: inset 0 0 0 2px #d9c3fb, 0 14px 30px -24px rgba(43,31,91,.45); }
.caja .explica { color: var(--tinta-2); font-size: 14.5px; margin-bottom: 4px; }
dialog.ventana.peligro h2 { color: var(--error); }
.nota { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding-top: 12px; border-top: 1.5px solid var(--borde); color: var(--hecho-tinta); font-size: 14px; font-weight: 700; }

/* Cuentas */
.busca { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--suelo); box-shadow: inset 0 0 0 1.5px var(--borde); color: var(--tinta-3); margin-bottom: 6px; }
.busca input { flex: 1; border: 0; background: none; height: 100%; font-size: 15px; color: var(--indigo); }
.busca input:focus { outline: none; }
.busca:focus-within { box-shadow: inset 0 0 0 2px var(--azul); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--tinta-3); font-size: 12.5px; font-weight: 800; padding: 6px 8px; border-bottom: 1.5px solid var(--borde); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1.5px solid var(--borde-suave); vertical-align: middle; }
td small { display: block; color: var(--tinta-3); font-size: 12px; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.persona { display: flex; align-items: center; gap: 9px; min-width: 0; }
.persona .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; background: linear-gradient(135deg, #ff8fb3, #e2337f); flex: none; }
.persona div { min-width: 0; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.chip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--suelo); box-shadow: inset 0 0 0 1px var(--borde); font-size: 11.5px; font-weight: 800; color: var(--tinta-2); }
.chip.mal { color: var(--error); box-shadow: inset 0 0 0 1px #f3c4d3; }
.vacio { padding: 18px 4px; color: var(--tinta-3); }

/* Actividad */
.registro { margin-top: 10px; max-height: 360px; overflow: auto; overscroll-behavior: contain; padding: 12px; border-radius: 12px; background: #1d1640; color: #e9e3ff; font: 12.5px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; }

/* Ventana del código (confirmación) */
dialog.ventana { margin: auto; width: min(calc(100% - 32px), 400px); border: 0; border-radius: 24px; padding: 24px; color: var(--indigo); box-shadow: 0 34px 70px -38px rgba(43,31,91,.5); }
dialog.ventana::backdrop { background: rgba(43,31,91,.42); backdrop-filter: blur(3px); }
dialog.ventana h2 { font-size: 21px; font-weight: 900; margin-bottom: 6px; }
dialog.ventana p { color: var(--tinta-2); margin-bottom: 14px; }
dialog.ventana .botones { display: flex; gap: 8px; justify-content: flex-end; }
html:has(dialog[open]) { overflow: hidden; }
.aviso-flotante { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 30; padding: 10px 16px; border-radius: 14px; background: var(--indigo); color: #fff; font-weight: 800; box-shadow: 0 16px 30px -16px rgba(0,0,0,.5); }

.nav-movil { display: none; }
@media (max-width: 980px) {
  .cifras { grid-template-columns: repeat(3, 1fr); }
  .rejilla { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .cab { padding: 10px 16px; gap: 10px; }
  .cab .logo { height: 28px; }
  .cab .que, .pestanas, .cab .yo .quien { display: none; }
  main { padding: 14px 16px 96px; }
  .veredicto { padding: 14px; gap: 12px; flex-wrap: wrap; }
  .veredicto .sello { width: 42px; height: 42px; border-radius: 14px; }
  .veredicto h1 { font-size: 19px; }
  .veredicto .act { margin-left: 0; justify-items: start; text-align: left; width: 100%; }
  .cifras { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cifras .cifra:last-child { grid-column: span 2; }
  .solo-ancho { display: none; }
  .nav-movil { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; justify-content: space-around; padding: 8px 4px calc(10px + env(safe-area-inset-bottom)); background: var(--blanco); border-top: 1.5px solid var(--borde); }
  .nav-movil button { display: grid; justify-items: center; gap: 2px; border: 0; background: none; font-size: 11.5px; font-weight: 800; color: var(--tinta-3); cursor: pointer; padding: 2px 6px; }
  .nav-movil button.on { color: var(--azul); }
}
@media (prefers-reduced-motion: reduce) { .boton { transition: none; } }
