/* Admin Kaizen: el shell. Login + barra superior con 3 pestañas; cada pestaña es un iframe a pantalla completa.
   Mismo lenguaje que el panel de estados ("sala de control", oscuro): Archivo, líneas de 1px, acento azul. */
:root {
  --ground: #171719; --surface: #131217; --raised: #212023; --border: #222224; --control: #3a3a3e;
  --text: #ffffff; --muted: #8a8c92; --accent: #4a8ad6; --falla: #e5566f;
  --barra: 48px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body { margin: 0; height: 100%; overflow: hidden; background: var(--ground); color: var(--text); font: 400 14px/1.45 "Archivo", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
h1, p { margin: 0; }
button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* ---------- login */
.login { height: 100%; overflow: auto; display: grid; place-items: center; padding: 16px; }
.login-caja { width: min(360px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 28px; display: grid; gap: 10px; }
.login-caja img { border-radius: 7px; }
.login-caja h1 { font-size: 22px; font-weight: 700; margin-top: 6px; }
.login-caja p { color: var(--muted); margin-bottom: 8px; }
.login-caja label { font-weight: 600; font-size: 13px; }
.login-caja input { height: 40px; padding: 0 12px; border: 1px solid var(--control); border-radius: 6px; background: var(--ground); width: 100%; font-size: 16px; }
.login-caja input:focus-visible { outline: 0; border-color: var(--accent); }
.login-caja input[aria-invalid="true"] { border-color: var(--falla); }
.login-caja button { margin-top: 6px; height: 40px; border: 0; border-radius: 999px; background: var(--text); color: var(--ground); font-weight: 650; cursor: pointer; }
.login-caja button:hover { background: #dcdcdf; }
.login-caja button:disabled { opacity: .6; cursor: progress; }
.login-caja .login-error { color: var(--falla); min-height: 1.45em; margin: 0; font-weight: 500; }

/* ---------- shell */
.shell { height: 100%; display: grid; grid-template-rows: var(--barra) minmax(0, 1fr); }
.barra { display: flex; align-items: stretch; gap: 20px; padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--surface); min-width: 0; }
.marca { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: .01em; flex: none; }
.marca img { display: block; border-radius: 6px; }

.pestanias { display: flex; align-items: stretch; gap: 2px; min-width: 0; flex: 1; }
.pestanias a { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.pestanias a:hover { color: var(--text); background: var(--raised); }
.pestanias a[aria-current] { color: var(--text); }
.pestanias a[aria-current]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 1px; background: var(--accent); }
.barra svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.globito { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--falla); color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }

.cuenta-usr { display: flex; align-items: center; gap: 12px; flex: none; min-width: 0; }
.nombre-usr { color: var(--muted); font-weight: 600; font-size: 13px; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.salir { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--control); border-radius: 999px; background: none; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.salir:hover { color: var(--text); border-color: var(--muted); }
.salir svg { width: 16px; height: 16px; }

.contenido { position: relative; min-height: 0; min-width: 0; }
.contenido iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: var(--ground); }

/* ---------- celular: barra compacta, sin scroll horizontal */
@media (max-width: 760px) {
  .barra { gap: 6px; padding: 0 8px; }
  .marca-txt, .nombre-usr, .salir-txt { display: none; }
  .marca img { width: 24px; height: 24px; }
  .pestanias { justify-content: center; gap: 0; }
  .pestanias a { padding: 0 9px; gap: 6px; font-size: 13px; }
  .salir { width: 34px; height: 34px; padding: 0; justify-content: center; border-color: transparent; }
}
@media (max-width: 380px) {
  .pestanias a { padding: 0 7px; gap: 5px; font-size: 12.5px; }
  .pestanias a svg { width: 16px; height: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
