/* PuntoReady — hoja de estilos compartida · SISTEMA DE DISEÑO v2 (2026-10-31).
   Una sola línea visual para Administración y los tres portales.
   Estilo elegido por Lester: barra lateral oscura + contenido claro,
   contraste premium (tipo Linear / Stripe Dashboard), unificado en las
   tres pantallas (Administración, portal de agencia y portal de agente).
   El acento es configurable por negocio con la variable --marca
   (por defecto, el azul de la casa #1e1830); la tienda pública la
   alimenta desde tenants.color, como ya hacía con su CSS propio.
   La barra lateral deriva de la marca: azul noche sobre --marca. */
:root {
  --marca: #1e1830;
  --marca-oscuro: #142c49;
  /* Barra lateral oscura (azul noche derivado de la marca) */
  --noche: #120c22;
  --noche-2: #241c40;
  --noche-3: #1a3355;
  --noche-texto: #d7e2ee;
  --noche-muted: #7f96ae;
  --noche-borde: rgba(255, 255, 255, .09);
  --ambar: #f59e0b;
  --fondo: #edf1f6;
  --tarjeta: #ffffff;
  --borde: #d9e2ec;
  --borde-suave: #e6edf3;
  --texto: #17293f;
  --muted: #5d7186;
  --ok-fondo: #e7f6ec;
  --ok-borde: #a3d9a5;
  --err-fondo: #fdecea;
  --err-borde: #f0a8a0;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(15, 34, 64, .05), 0 10px 30px rgba(15, 34, 64, .06);
  --top-h: 57px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0; color: var(--texto); background: var(--fondo);
  -webkit-font-smoothing: antialiased;
}
.ico { width: 19px; height: 19px; flex: none; }

/* ---- barra superior clásica (panel clásico, sin cambios) ---- */
header, .topbar {
  background: linear-gradient(120deg, var(--marca) 0%, var(--marca-oscuro) 100%);
  color: #fff; padding: .9rem 1.25rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center;
  box-shadow: 0 2px 12px rgba(15, 34, 64, .25);
}
header h1, .topbar h1 { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: .6rem; }
.marca-punto { width: .7rem; height: .7rem; border-radius: 50%; background: var(--ambar); display: inline-block; flex: none; }
#sesion { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: .92rem; }
#sesion-nombre { opacity: .92; }

/* ================================================================
   CARCASA DE APLICACIÓN v2 — barra lateral oscura + contenido claro
   Administración usa .layout > .sidebar; los portales, .app > .app-side.
   Ambas barras comparten exactamente el mismo sistema visual.
   ================================================================ */
.app { display: flex; align-items: stretch; min-height: 100vh; }
.app[hidden] { display: none; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-main main {
  flex: 1; width: 100%; max-width: 1180px; margin: 0 auto;
  padding: 1.3rem 1.4rem 2.5rem;
}
.layout { display: flex; align-items: stretch; min-height: 100vh; max-width: none; margin: 0; padding: 0; }
.layout main { flex: 1; min-width: 0; max-width: none; margin: 0; padding: 1.3rem 1.4rem 2.5rem; }
.layout main #app, .layout main > section { max-width: 1180px; margin-left: auto; margin-right: auto; }
.layout main > section.login-card { max-width: 470px; }

.app-side, .layout .sidebar {
  width: 252px; flex: none; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: .15rem;
  padding: 1.05rem .85rem 1rem;
  background: linear-gradient(180deg, var(--noche-3) 0%, var(--noche-2) 34%, var(--noche) 100%);
  color: var(--noche-texto);
  box-shadow: 2px 0 14px rgba(7, 17, 30, .22);
  overflow-y: auto;
}
.app-side[hidden], .layout .sidebar[hidden] { display: none; }
.side-marca {
  display: flex; align-items: center; gap: .65rem;
  padding: .15rem .5rem 1rem; margin-bottom: .55rem;
  border-bottom: 1px solid var(--noche-borde);
}
.side-marca .marca-punto { width: .78rem; height: .78rem; box-shadow: 0 0 0 4px rgba(245, 158, 11, .18); }
.side-marca strong { display: block; color: #fff; font-size: 1.06rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.side-marca .side-sub { display: block; color: var(--noche-muted); font-size: .8rem; font-weight: 600; margin-top: .12rem; }
.app-side .side-etq, .layout .sidebar h3 {
  margin: .35rem .55rem .5rem; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--noche-muted);
}
.app-side #tabs, .layout .sidebar nav { display: flex; flex-direction: column; gap: .28rem; }
/* Secciones desplegables de la navegación (2026-11-16): el
   encabezado de cada grupo (Tienda, Viajes, Trámites…) es un botón
   sobrio y sus subsecciones viven en .grupo-cuerpo, indentadas bajo
   la sección. Sin «Más de…»: todo el grupo se despliega al clic. */
.app-side #tabs button.tab-grupo-btn, .layout .sidebar nav button.tab-grupo-btn {
  margin-top: .55rem; padding: .42rem .65rem; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--noche-muted);
}
.grupo-nav:first-child .tab-grupo-btn { margin-top: .1rem; }
.app-side #tabs button.tab-grupo-btn:hover, .layout .sidebar nav button.tab-grupo-btn:hover {
  background: var(--noche-2); color: #fff; filter: none;
}
.tab-grupo-btn .chev { font-size: .68rem; opacity: .85; }
.grupo-cuerpo { display: flex; flex-direction: column; gap: .28rem; padding-left: .5rem; }
.grupo-cuerpo[hidden] { display: none; }
/* Miniatura de producto en las listas del panel */
.prod-mini { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; vertical-align: middle; margin-right: .55rem; border: 1px solid #e3e9f0; background: #f8fafc; }
.prod-mini-vacia { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; background: #f1f5f9; border-radius: 8px; vertical-align: middle; margin-right: .55rem; font-size: 1.15rem; }
.app-side #tabs button, .layout .sidebar nav button {
  width: 100%; display: flex; align-items: center; gap: .62rem;
  background: transparent; color: var(--noche-texto); border: 0; margin: 0;
  text-align: left; padding: .56rem .65rem; border-radius: 10px;
  font-size: .94rem; font-weight: 600; cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.app-side #tabs button .ico, .layout .sidebar nav button .ico { opacity: .72; }
.app-side #tabs button:hover, .layout .sidebar nav button:hover {
  background: var(--noche-2); color: #fff; filter: none;
}
.app-side #tabs button:hover .ico, .layout .sidebar nav button:hover .ico { opacity: 1; }
.app-side #tabs button.activo, .layout .sidebar nav button.activo {
  background: linear-gradient(120deg, var(--marca) 0%, var(--marca-oscuro) 100%);
  color: #fff; box-shadow: inset 3px 0 0 var(--ambar), 0 4px 12px rgba(7, 17, 30, .35);
}
.app-side #tabs button.activo .ico, .layout .sidebar nav button.activo .ico { opacity: 1; }
.app-side #tabs button:focus-visible, .layout .sidebar nav button:focus-visible {
  outline: 3px solid rgba(245, 158, 11, .7); outline-offset: 1px;
}
.layout .sidebar .nota { margin: .85rem .55rem 0; font-size: .8rem; color: var(--noche-muted); line-height: 1.5; }
.side-pie { margin-top: auto; padding-top: .95rem; border-top: 1px solid var(--noche-borde); }
.side-pie #sesion { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: .5rem; font-size: .9rem; }
.side-pie #sesion-nombre {
  order: 0; opacity: 1; color: var(--noche-texto); font-size: .88rem; line-height: 1.4;
  padding: 0 .35rem; overflow-wrap: anywhere;
}
.side-pie #btn-push { order: 1; }
.side-pie #btn-salir { order: 2; }
.side-pie #sesion button.sec {
  background: rgba(255, 255, 255, .05); color: var(--noche-texto);
  border: 1px solid var(--noche-borde); margin: 0; width: 100%;
}
.side-pie #sesion button.sec:hover { background: var(--noche-2); color: #fff; filter: none; }

/* ---- barra superior clara de la carcasa ---- */
.topbar-clara {
  position: sticky; top: 0; z-index: 6; min-height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .65rem 1.4rem;
  background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--borde);
  box-shadow: 0 1px 8px rgba(15, 34, 64, .05);
}
.layout .topbar-clara { margin-bottom: 1.1rem; border: 1px solid var(--borde); border-radius: var(--radio); }
.topbar-negocio { font-weight: 800; font-size: 1.02rem; color: var(--marca); letter-spacing: -.01em; }
.topbar-sub { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: .05rem; }
.topbar-usuario { color: var(--muted); font-size: .9rem; font-weight: 600; white-space: nowrap; }

/* ---- acceso (login de los portales): fondo oscuro de marca ---- */
.acceso {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1rem;
  padding: 2.2rem 1rem;
  background: linear-gradient(150deg, var(--noche) 0%, var(--noche-2) 52%, var(--marca) 135%);
}
.acceso > section { width: 100%; max-width: 470px; margin-bottom: 0; }
.acceso[hidden] { display: none; }

/* ---- estructura clásica (panel) ---- */
main { max-width: 1120px; margin: 0 auto; padding: 1.25rem 1rem 2.5rem; }

/* ---- tarjetas y secciones ---- */
section, .card {
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 1.15rem 1.25rem; margin-bottom: 1.1rem; box-shadow: var(--sombra);
}
section h2, .card h2 { margin: 0 0 .9rem; color: var(--marca); font-size: 1.12rem; font-weight: 800; letter-spacing: -.01em; }
section h3, .card h3 { color: var(--marca); font-size: 1rem; margin: 1.1rem 0 .5rem; }
section h4, .card h4 { color: var(--texto); font-size: .95rem; margin: 1rem 0 .4rem; }
.panel-tab > h2 { font-size: 1.28rem; margin-bottom: 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .4rem; }
.card-head h2 { margin: 0; }

/* ---- métricas ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.1rem; }
.stat {
  background: var(--tarjeta); border: 1px solid var(--borde); border-top: 3px solid var(--marca);
  border-radius: var(--radio); box-shadow: var(--sombra); padding: 1rem 1.1rem;
}
.stat .num { font-size: 1.9rem; font-weight: 800; color: var(--marca); line-height: 1.1; letter-spacing: -.02em; }
.stat .etq { color: var(--muted); font-size: .88rem; margin-top: .15rem; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---- pestañas superiores clásicas (panel clásico) ---- */
.tabs { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.tabs button {
  border: 1px solid var(--borde); background: var(--tarjeta); color: var(--marca);
  border-radius: 8px; padding: .45rem .95rem; cursor: pointer; font-weight: 600; margin: 0;
  box-shadow: 0 1px 2px rgba(15, 34, 64, .05);
  display: inline-flex; align-items: center; gap: .45rem;
}
.tabs button .ico { width: 16px; height: 16px; }
.tabs button:hover { border-color: var(--marca); filter: none; }
.tabs button.activo { background: var(--marca); border-color: var(--marca); color: #fff; }

/* ---- tablas ---- */
.tabla-wrap { overflow-x: auto; margin: 0 -0.25rem; padding: 0 .25rem; }
.buscador-admin { margin: 0 0 .4rem; }
.buscador-admin input { width: 100%; font-size: 1rem; padding: .65rem .8rem; }
/* ==== Reorganización UX 2026-11-10 (Fase 1: panel) ==== */
.barra-acciones { display: flex; gap: .6rem; align-items: center; margin-bottom: .4rem; }
.barra-acciones > button { flex: none; font-size: 1rem; padding: .65rem 1.2rem; }
.tab-badge {
  margin-left: auto; background: #c0392b; color: #fff; font-size: .72rem; font-weight: 800;
  border-radius: 999px; padding: .08rem .5rem; line-height: 1.5;
}
.saludo-inicio { font-size: 1.06rem; color: var(--texto, #1c2733); margin: .1rem 0 .9rem; text-transform: capitalize; }
.sec-inicio { margin: 1.2rem 0 .6rem; font-size: .95rem; letter-spacing: .04em; text-transform: uppercase; color: var(--marca); }
.chip-inicio .resumen-num.alerta { color: #c0392b; }
.acc-rapidas { display: flex; gap: .7rem; flex-wrap: wrap; }
.acc-card {
  flex: 1 1 150px; display: flex; flex-direction: column; align-items: center; gap: .35rem;
  background: var(--marca); color: #fff; border: 0; border-radius: 14px; padding: 1rem .6rem;
  font-size: 1rem; font-weight: 700; cursor: pointer;
}
.acc-card .acc-ic { font-size: 1.6rem; }
.acc-card.oro { background: var(--ambar, #f2b63d); color: #241c40; }
.pend-lista { border: 1px solid #e3e9f0; border-radius: 14px; overflow: hidden; }
.pend-fila { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border-bottom: 1px solid #eef1f5; background: #fff; }
.pend-fila:last-child { border-bottom: 0; }
.pend-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pend-dot.rojo { background: #c0392b; }
.pend-dot.naranja { background: #e67e22; }
.pend-dot.verde { background: #2e7d32; }
.pend-tx { flex: 1; font-size: .97rem; }
.btn-pend { flex: none; background: #fff; border: 1.5px solid var(--marca); color: var(--marca); font-weight: 700; border-radius: 9px; padding: .45rem .95rem; cursor: pointer; }
.btn-pend.oro { background: var(--ambar, #f2b63d); border-color: var(--ambar, #f2b63d); color: #241c40; }
.chip-estado { display: inline-block; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: .14rem .6rem; white-space: nowrap; }
.chip-estado.pend { background: #fdf0e0; color: #9a5b00; }
.chip-estado.proc { background: #e6e3f5; color: #1e1830; }
.chip-estado.ok { background: #e2f2e4; color: #146c2e; }
.chip-estado.mal { background: #fbe7e4; color: #a93226; }
/* Carga de inventario (Lester, 2026-11-06): la tabla se detiene al
   alto de la pantalla y se desplaza POR DENTRO — su barra de abajo
   queda siempre a la mano, no al final de todas las filas — y el
   encabezado queda fijo dentro de la caja (top:0 contra la caja,
   no contra la página: la regla general de .app-main no aplica). */
.inv-scroll { overflow: auto; max-height: calc(100vh - 180px); }
#inv-tabla .inv-scroll thead th { position: sticky; top: 0; z-index: 2; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th {
  text-align: left; padding: .7rem .8rem; color: var(--muted); font-size: .78rem;
  text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid var(--borde);
  background: transparent; white-space: nowrap;
}
.app-main th, .layout main th { position: sticky; top: var(--top-h); z-index: 2; }
/* Dentro de .tabla-wrap (overflow-x:auto) el ancestro con scroll es el propio
   contenedor: el th sticky se desplazaba 57px y tapaba la primera fila
   (el primer negocio no se veía). Ahí el encabezado va fijo en su sitio. */
.app-main .tabla-wrap th, .layout main .tabla-wrap th { position: static; }
td { text-align: left; padding: .8rem; border-bottom: 1px solid var(--borde-suave); vertical-align: middle; }
tbody tr:nth-child(even) td { background: #fbfcfe; }
tbody tr:hover td, table tr:hover td { background: #f2f7fc; }
/* Diseño simplificado del panel (maqueta aprobada 2026-11-06):
   precio protagonista en la lista y código atenuado. */
td.precio { font-weight: 800; color: var(--marca); white-space: nowrap; }
td.sku { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.pill { display: inline-block; padding: .14rem .6rem; border-radius: 8px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.pill-ok { background: var(--ok-fondo); color: #166534; border: 1px solid var(--ok-borde); }
.pill-off { background: #f1f5f9; color: var(--muted); border: 1px solid var(--borde); }
.pill-stock { background: #eef3f8; color: var(--marca); border: 1px solid var(--borde); }
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 8px; font-size: .76rem; font-weight: 700; background: #fdf3e0; color: #92580a; border: 1px solid #f0d98c; white-space: nowrap; margin-right: .25rem; }
.sub { color: var(--muted); font-size: .85rem; }

/* ---- estados vacíos ---- */
.vacio, #lista > p.muted, #lista-usuarios > p.muted {
  text-align: center; color: var(--muted);
  border: 1.5px dashed var(--borde); border-radius: var(--radio);
  background: #f8fafc; padding: 1.9rem 1.1rem; margin: .4rem 0;
}
.vacio .ico { width: 34px; height: 34px; opacity: .4; }
.vacio p { margin: .55rem 0 0; font-weight: 600; }
.vacio .sub { display: block; margin-top: .2rem; font-weight: 400; }

/* ---- botones ---- */
button {
  background: var(--marca); color: #fff; border: 0; border-radius: 10px;
  padding: .48rem .95rem; cursor: pointer; margin: .12rem; font-size: .93rem; font-weight: 600;
  transition: filter .12s ease, box-shadow .12s ease, background .12s ease;
}
button:hover { filter: brightness(1.13); }
button:active { transform: translateY(1px); }
button.sec { background: #fff; color: var(--marca); border: 1px solid var(--marca); }
button.sec:hover { background: #eef3f8; filter: none; }
/* Botones compactos de fila y acción de peligro (maqueta 2026-11-06). */
.btn-mini { padding: .32rem .75rem; font-size: .86rem; border-radius: 8px; margin: .06rem; }
button.peligro { background: #fff; color: #991b1b; border: 1px solid #f0a8a0; }
button.peligro:hover { background: #fdecea; filter: none; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(245, 158, 11, .65); outline-offset: 2px; }
header button.sec, .topbar button.sec { border-color: rgba(255, 255, 255, .65); color: #fff; background: transparent; }
header button.sec:hover, .topbar button.sec:hover { background: rgba(255, 255, 255, .14); }

/* ---- formularios ---- */
label { display: block; margin: .55rem 0 .25rem; font-weight: 600; font-size: .92rem; }
input, select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--borde); border-radius: 10px;
  font-size: 1rem; margin-bottom: .35rem; background: #f8fafc; color: var(--texto);
  font-family: inherit;
}
input[type="checkbox"] { width: auto; accent-color: var(--marca); }
input:focus, select:focus, textarea:focus {
  border-color: var(--marca); outline: none; background: #fff;
  box-shadow: 0 0 0 3px rgba(30, 24, 48, .16);
}
/* Título de formulario y ayudita bajo el campo (maqueta 2026-11-06). */
.form-titulo { display: flex; align-items: center; gap: .6rem; margin: 1.2rem 0 .4rem; color: var(--marca); font-weight: 800; font-size: 1rem; }
.form-titulo::after { content: ''; flex: 1; border-top: 1px solid var(--borde-suave); }
.ayuda { display: block; color: var(--muted); font-size: .83rem; margin-top: .15rem; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem 1.1rem; }
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; } }

/* ---- avisos ---- */
.error { background: var(--err-fondo); border: 1px solid var(--err-borde); border-radius: 10px; padding: .8rem; margin-top: .8rem; }
.ok { background: var(--ok-fondo); border: 1px solid var(--ok-borde); border-radius: 10px; padding: .8rem; margin-top: .8rem; }
.muted { color: var(--muted); font-size: .9rem; }
a { color: var(--marca); }

/* ---- resumen del portal (dashboard de agencia y de agente) ---- */
.resumen-num { font-size: 2.1rem; font-weight: 800; color: var(--marca); line-height: 1.1; letter-spacing: -.02em; }
.dash-ico {
  width: 40px; height: 40px; border-radius: 12px; margin-bottom: .6rem;
  display: flex; align-items: center; justify-content: center;
  background: #eef3f8; color: var(--marca);
}
.dash-ico .ico { width: 21px; height: 21px; }

/* ---- login: tarjeta con cabecera oscura de marca ---- */
.login-card { max-width: 460px; margin: 2.2rem auto; padding: 0; overflow: hidden; }
.acceso .login-card { margin: 0 auto; }
.login-card h2 { font-size: 1.3rem; }
.login-head {
  display: flex; align-items: center; gap: .65rem;
  background: linear-gradient(120deg, var(--noche-3) 0%, var(--noche) 100%);
  color: #fff; padding: 1rem 1.25rem;
}
.login-head .marca-punto { width: .78rem; height: .78rem; box-shadow: 0 0 0 4px rgba(245, 158, 11, .18); }
.login-head strong { display: block; font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.login-head span { display: block; color: var(--noche-muted); font-size: .8rem; font-weight: 600; margin-top: .12rem; }
.login-body { padding: 1.15rem 1.25rem 1.25rem; }
.login-body h2 { margin-top: 0; }
/* El paso de 2FA se agrega a la tarjeta de acceso fuera de .login-body:
   lleva su mismo margen interno para no pegarse a los bordes. */
#paso-2fa { padding: 0 1.25rem 1.25rem; }
#paso-2fa h2, #paso-2fa h3 { margin-top: 0; }

/* ---- responsive: la barra lateral pasa arriba, navegación desplazable ---- */
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .layout { flex-direction: column; }
  .app-side, .layout .sidebar {
    width: 100%; height: auto; position: static; overflow-y: visible;
    padding: .8rem .85rem .85rem;
  }
  .side-marca { border-bottom: 0; margin-bottom: .35rem; padding-bottom: .1rem; }
  .app-side .side-etq { display: none; }
  .layout .sidebar h3 { display: none; }
  .app-side #tabs, .layout .sidebar nav {
    flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding-bottom: .35rem;
  }
  .app-side #tabs button, .layout .sidebar nav button { width: auto; flex: none; white-space: nowrap; }
  /* En la fila móvil no hay secciones que desplegar: los grupos se
     aplanan (display:contents) y TODAS las opciones quedan visibles
     en la fila desplazable, sin encabezados. */
  .grupo-nav { display: contents; }
  .app-side #tabs .grupo-cuerpo, .layout .sidebar nav .grupo-cuerpo { display: contents; }
  .app-side #tabs button.tab-grupo-btn, .layout .sidebar nav button.tab-grupo-btn { display: none; }
  .layout .sidebar .nota { display: none; }
  .side-pie { margin-top: .55rem; padding-top: .7rem; }
  .side-pie #sesion { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .side-pie #sesion-nombre { padding: 0; margin-right: auto; }
  .side-pie #sesion button.sec { width: auto; }
  .topbar-clara { position: static; padding: .65rem 1rem; }
  .app-main main, .layout main { padding: 1rem .8rem 2.2rem; }
  .app-main th, .layout main th { top: 0; }
}

/* Ventana de edición en 3 zonas (verificación con navegador 2026-11-06):
   abrirModalEdicion deja la cabecera y el pie fuera del área con
   desplazamiento (.modal-cuerpo); así título/✕ y Guardar/Cancelar están
   siempre visibles. (El intento con position:sticky no se sostuvo en vivo.) */
#modal-edicion-contenido.modal-flex { display: flex; flex-direction: column; max-height: calc(92vh - 40px); }
#modal-edicion-contenido.modal-flex > .modal-cuerpo { overflow-y: auto; min-height: 0; padding-right: .2rem; }
#modal-edicion-contenido.modal-flex > :not(.modal-cuerpo) { flex: 0 0 auto; }

/* ============================================================
   Diseño maestro de acceso (2026-11-17) — Vista A (acceso) y
   Vista B (selector de rol). Variables y piezas portadas del
   diseño aprobado; el color de PuntoReady es el azul #1e1830.
   Ámbito propio (.diseno-acceso / .roles-diseno) para no tocar
   los demás portales que comparten esta hoja.
   ============================================================ */
.diseno-acceso, .roles-diseno, .modal-rol-diseno {
  --marca:#1e1830; --marca-oscuro:#171126;
  --marca-tinte:#eceaf6; --marca-tinte-suave:#f3f6fa;
  --ink:#17222d; --ink-2:#51626f; --ink-3:#8494a3; --linea:#d9e1e9;
}
.acceso-tinte { background:#eceaf6; }
.login-diseno {
  width:400px; max-width:100%; background:#fff; border-radius:14px;
  box-shadow:0 6px 16px rgba(23,34,45,.10), 0 2px 5px rgba(23,34,45,.05);
  padding:36px 36px 30px; color:var(--ink, #17222d);
}
.login-diseno .login-marca { display:flex; align-items:center; gap:13px; margin-bottom:6px; }
.login-diseno .logo-caja {
  width:46px; height:46px; border-radius:12px; background:#1e1830;
  display:flex; align-items:center; justify-content:center; flex:none;
}
.login-diseno .login-marca .nombre { font-size:21px; font-weight:700; letter-spacing:-.01em; line-height:1.1; color:#17222d; }
.login-diseno .login-marca .sub { font-size:13px; color:#51626f; }
.login-diseno h3 { font-size:17px; font-weight:700; margin:22px 0 4px; color:#17222d; }
.login-diseno .ayuda { font-size:13.5px; color:#51626f; margin-bottom:20px; }
.login-diseno .campo { margin-bottom:16px; }
.login-diseno .campo label { display:block; font-size:13px; font-weight:600; margin-bottom:7px; color:#17222d; }
.login-diseno .campo .envoltura { position:relative; }
.login-diseno .campo input {
  width:100%; font:inherit; font-size:15px; color:#17222d;
  border:1.5px solid #d9e1e9; border-radius:10px;
  padding:12px 44px 12px 14px; background:#fff; outline:none;
}
.login-diseno .campo input:focus { border-color:#1e1830; box-shadow:0 0 0 3px #eceaf6; }
.login-diseno .ojito {
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  width:34px; height:34px; border:none; background:transparent; cursor:pointer;
  display:flex; align-items:center; justify-content:center; border-radius:8px;
}
.login-diseno .fila-opciones { display:flex; align-items:center; justify-content:space-between; margin:2px 0 20px; }
.login-diseno .recordarme { display:flex; align-items:center; gap:8px; font-size:13.5px; color:#51626f; cursor:pointer; position:relative; }
.login-diseno .recordarme input { position:absolute; opacity:0; width:17px; height:17px; margin:0; cursor:pointer; }
.login-diseno .recordarme .caja { width:17px; height:17px; border:1.5px solid #8494a3; border-radius:5px; background:#fff; flex:none; }
.login-diseno .recordarme input:checked + .caja { background:#1e1830; border-color:#1e1830; }
.login-diseno .fila-opciones a { color:#1e1830; font-weight:600; text-decoration:none; font-size:13.5px; }
.login-diseno .fila-opciones a:hover { text-decoration:underline; }
.btn-diseno {
  display:block; width:100%; border:none; cursor:pointer;
  background:#1e1830; color:#fff; font:inherit; font-size:15.5px; font-weight:700;
  border-radius:10px; padding:13px 18px; text-align:center; white-space:nowrap;
}
.btn-diseno:hover { background:#171126; }
.login-diseno .aviso-acceso { margin-top:24px; border-top:1px solid #d9e1e9; padding-top:20px; display:flex; gap:12px; }
.login-diseno .aviso-acceso .icono {
  width:34px; height:34px; border-radius:9px; background:#eceaf6;
  display:flex; align-items:center; justify-content:center; flex:none;
}
.login-diseno .aviso-acceso p { font-size:13.5px; color:#51626f; line-height:1.5; margin:0; }
.login-diseno .aviso-acceso p strong { color:#17222d; display:block; font-size:13.5px; margin-bottom:2px; }

/* Vista B — selector de rol en dos tarjetas (Equipo y Administración) */
.roles-diseno { display:flex; gap:16px; }
.roles-diseno .rol-d { flex:1; position:relative; display:block; cursor:pointer; }
.roles-diseno > .rol-tarjeta-d { flex:1; cursor:pointer; }
.roles-diseno .rol-d > input { position:absolute; opacity:0; pointer-events:none; }
.rol-tarjeta-d {
  height:100%; border:1.5px solid #d9e1e9; border-radius:12px; padding:18px; background:#fff;
}
.roles-diseno .rol-d > input:checked + .rol-tarjeta-d, .rol-tarjeta-d.sel {
  border-color:#1e1830;
  box-shadow:0 0 0 1px #1e1830 inset, 0 8px 20px rgba(23,34,45,.07);
  background:#f3f6fa;
}
.rol-tarjeta-d .rol-cab { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.rol-tarjeta-d .rol-cab .icono {
  width:38px; height:38px; border-radius:10px; background:#eceaf6;
  display:flex; align-items:center; justify-content:center; flex:none;
}
.rol-tarjeta-d .sello-d {
  width:22px; height:22px; border-radius:50%; border:2px solid #d9e1e9; flex:none;
  display:flex; align-items:center; justify-content:center; background:#fff;
}
.rol-tarjeta-d .sello-d svg { opacity:0; }
.roles-diseno .rol-d > input:checked + .rol-tarjeta-d .sello-d, .rol-tarjeta-d.sel .sello-d { background:#1e1830; border-color:#1e1830; }
.roles-diseno .rol-d > input:checked + .rol-tarjeta-d .sello-d svg, .rol-tarjeta-d.sel .sello-d svg { opacity:1; }
.rol-tarjeta-d h4 { font-size:15.5px; font-weight:700; margin:12px 0 4px; color:#17222d; }
.rol-tarjeta-d .desc { font-size:13px; color:#51626f; margin-bottom:12px; }
.rol-tarjeta-d ul { list-style:none; margin:0; padding:0; }
.rol-tarjeta-d li {
  font-size:13px; color:#51626f; padding:5px 0 5px 22px; position:relative;
  border-top:1px dashed #d9e1e9;
}
.rol-tarjeta-d li:first-child { border-top:none; }
.rol-tarjeta-d li::before {
  content:""; position:absolute; left:2px; top:11px; width:7px; height:7px;
  border-radius:50%; background:#1e1830;
}
.rol-tarjeta-d li.no { color:#8494a3; }
.rol-tarjeta-d li.no::before { background:#8494a3; }
@media (max-width:640px) { .roles-diseno { flex-direction:column; } }
.modal-rol-diseno .pie-rol {
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  margin-top:26px; padding-top:22px; border-top:1px solid #d9e1e9; flex-wrap:wrap;
}
.modal-rol-diseno .pie-rol .cierre { font-size:13px; color:#51626f; display:flex; gap:9px; align-items:center; max-width:350px; }
.modal-rol-diseno .pie-rol .cierre .icono {
  width:30px; height:30px; border-radius:8px; background:#eceaf6;
  display:flex; align-items:center; justify-content:center; flex:none;
}
.modal-rol-diseno .nota-temporal { font-size:12.5px; color:#8494a3; margin-top:6px; }

/* ============ Dashboard maestro (2026-11-18) ============
   Diseño maestro aprobado por Lester: fondo claro (60), tarjetas
   blancas (30) y el coral SOLO en el botón de acción principal y el
   contador de nuevos (10). Entrada con escalonamiento usando solo
   transform y opacidad; se apaga con «movimiento reducido». */
.dash {
  --d-suave: #e8eef5; --d-acento: #ff6b4a; --d-borde: #e3e7ec;
  --d-suave-txt: #6b7684; --d-verde: #1d9e75; --d-verde-suave: #e3f5ee;
  --d-ambar: #b97d10; --d-ambar-suave: #fdf3e0;
  background: #f3f5f7; border-radius: 18px; padding: 20px 20px 6px;
}
.dash-tope { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-saludo h1 { font-size: 23px; font-weight: 700; margin: 0; }
.dash-saludo p { color: var(--d-suave-txt); font-size: 13.5px; margin: 2px 0 0; text-transform: capitalize; }
.dash-acciones { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-buscador { position: relative; }
.dash-buscador input {
  background: #fff; border: 1px solid var(--d-borde); border-radius: 999px;
  padding: 9px 16px; font-size: 13.5px; width: 320px; color: var(--texto);
}
.dash-resultados {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: #fff; border: 1px solid var(--d-borde); border-radius: 12px;
  box-shadow: 0 14px 34px rgba(7, 17, 30, .16); padding: 6px; max-height: 320px; overflow: auto;
}
.dash-res-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 8px 10px; border-radius: 8px; font-size: 13.5px; cursor: pointer; color: var(--texto);
}
.dash-res-item:hover { background: var(--d-suave); }
.dash-res-vacio { margin: 6px 10px; font-size: 13px; color: var(--d-suave-txt); }
.dash-usuario {
  display: flex; align-items: center; gap: 9px; background: #fff;
  border: 1px solid var(--d-borde); border-radius: 999px; padding: 5px 14px 5px 5px;
  font-size: 13.5px; font-weight: 600;
}
.dash-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--marca); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700;
}
.dash-btn-acento {
  background: var(--d-acento); color: #fff; border: none; font-weight: 700;
  font-size: 14px; padding: 11px 20px; border-radius: 999px; cursor: pointer;
  display: inline-block; text-decoration: none; white-space: nowrap;
}
.dash-kpis { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.dash-kpi { background: #fff; border: 1px solid var(--d-borde); border-radius: 16px; padding: 17px 18px; flex: 1 1 180px; }
.dash-kpi-fila { display: flex; align-items: center; gap: 10px; }
.dash-kpi-icono {
  width: 38px; height: 38px; border-radius: 11px; background: var(--d-suave);
  display: flex; align-items: center; justify-content: center; flex: none; font-size: 17px;
}
.dash-kpi-etq { font-size: 12.5px; color: var(--d-suave-txt); font-weight: 600; }
.dash-delta { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 8px; margin-left: auto; color: var(--d-suave-txt); background: #eef1f4; }
.dash-delta.up { color: var(--d-verde); background: var(--d-verde-suave); }
.dash-delta.warn { color: var(--d-ambar); background: var(--d-ambar-suave); }
.dash-kpi-valor { font-size: 27px; font-weight: 800; margin-top: 8px; letter-spacing: -.02em; }
.dash-kpi-nota { font-size: 12px; color: var(--d-suave-txt); margin-top: 3px; }
.dash-fila2 { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.dash-tarjeta { background: #fff; border: 1px solid var(--d-borde); border-radius: 16px; padding: 19px 20px; margin-bottom: 16px; }
.dash-fila2 .dash-tarjeta { margin-bottom: 0; }
.dash-tarjeta h2 { font-size: 15.5px; font-weight: 700; margin: 0; }
.dash-sub { font-size: 12.5px; color: var(--d-suave-txt); margin-top: 2px; }
.dash-grafica { flex: 1.9 1 320px; }
.dash-barras { display: flex; align-items: flex-end; gap: 14px; height: 148px; margin-top: 18px; padding: 0 4px; }
.dash-barra { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.dash-col { width: 100%; max-width: 44px; border-radius: 8px 8px 3px 3px; background: var(--marca); opacity: .28; }
.dash-col.hoy { opacity: 1; }
.dash-dia { font-size: 11.5px; color: var(--d-suave-txt); font-weight: 600; }
.dash-monto { font-size: 11px; color: var(--d-suave-txt); }
.dash-act { flex: 1 1 260px; }
.dash-act ul { list-style: none; margin: 13px 0 0; padding: 0; }
.dash-act li { display: flex; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--d-borde); font-size: 13px; line-height: 1.4; }
.dash-act li:last-child { border-bottom: none; }
.dash-punto { width: 9px; height: 9px; border-radius: 50%; background: var(--marca); margin-top: 5px; flex: none; }
.dash-hora { margin-left: auto; color: var(--d-suave-txt); font-size: 11.5px; flex: none; }
.dash-ped { flex: 1.9 1 320px; }
.dash-tabla { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13.5px; }
.dash-tabla th { text-align: left; color: var(--d-suave-txt); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 7px 8px; border-bottom: 1px solid var(--d-borde); }
.dash-tabla td { padding: 10px 8px; border-bottom: 1px solid var(--d-borde); }
.dash-tabla td:first-child { white-space: nowrap; }
.dash-tabla tr:last-child td { border-bottom: none; }
.dash-estado { font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.dash-estado.ok { color: var(--d-verde); background: var(--d-verde-suave); }
.dash-estado.curso { color: var(--d-ambar); background: var(--d-ambar-suave); }
.dash-estado.listo { color: var(--marca); background: var(--d-suave); }
.dash-estado.off { color: var(--d-suave-txt); background: #eef1f4; }
.dash-pend { flex: 1 1 260px; }
.dash-pend ul { list-style: none; margin: 12px 0 0; padding: 0; }
.dash-pend li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 9px 0; border-bottom: 1px solid var(--d-borde); }
.dash-pend li:last-child { border-bottom: none; }
.dash-n { background: var(--d-ambar-suave); color: var(--d-ambar); font-weight: 800; font-size: 12.5px; border-radius: 8px; padding: 3px 9px; }
.dash-ir { margin-left: auto; background: none; border: none; color: var(--marca); font-weight: 700; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.dash-top { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; font-size: 13.5px; }
@keyframes dash-subir { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.dash-anim { animation: dash-subir .45s ease-out backwards; }
@media (prefers-reduced-motion: reduce) { .dash-anim { animation: none; } }
@media (max-width: 700px) {
  .dash { padding: 14px 12px 2px; }
  .dash-buscador { flex: 1 1 200px; }
  .dash-buscador input { width: 100%; }
  .dash-barras { gap: 8px; }
}
/* Tarjeta de estado en la barra lateral (datos del Dashboard) */
.side-estado {
  margin-top: 14px; background: rgba(255, 255, 255, .09); border-radius: 12px;
  padding: 13px 14px; font-size: 12px; line-height: 1.45; color: var(--noche-texto);
}
.side-estado strong { color: #fff; display: block; font-size: 12.5px; margin-bottom: 2px; }
.side-estado span { display: block; opacity: .85; }

/* ================================================================
   BARRA LATERAL MINI — pieza 1 del kit de piezas vivas (2026-11-24)
   El panel puede contraer su barra a solo iconos; el nombre de
   cada sección queda en el title del botón. Solo escritorio: en
   móvil la barra ya es una fila superior. El ancho cambia sin
   transición (regla del kit: solo transform/opacity se animan).
   ================================================================ */
.side-toggle {
  display: flex; align-items: center; gap: .5rem; width: 100%;
  margin: .1rem 0 .4rem; padding: .45rem .65rem;
  background: transparent; color: var(--noche-muted);
  border: 1px solid var(--noche-borde); border-radius: 10px;
  font-size: .82rem; font-weight: 700; cursor: pointer;
}
.side-toggle:hover { background: var(--noche-2); color: #fff; }
@media (min-width: 861px) {
  .app.mini .app-side { width: 68px; padding-left: .55rem; padding-right: .55rem; }
  .app.mini .side-marca { justify-content: center; padding-left: 0; padding-right: 0; }
  .app.mini .side-marca > div,
  .app.mini .side-etq,
  .app.mini .side-estado,
  .app.mini .tab-grupo-btn,
  .app.mini .side-pie #sesion-nombre { display: none; }
  .app.mini .grupo-cuerpo { display: flex; padding-left: 0; }
  .app.mini .grupo-cuerpo[hidden] { display: flex; }
  .app.mini #tabs button { justify-content: center; padding-left: 0; padding-right: 0; }
  .app.mini #tabs button > span { display: none; }
  .app.mini .side-toggle { justify-content: center; }
  .app.mini .side-toggle .side-toggle-txt { display: none; }
  .app.mini .side-pie #sesion { align-items: center; }
  .app.mini .side-pie button { font-size: .78rem; padding: .42rem .2rem; }
}
