/* Panel de PayLock (D48, D50): azul PayLock, el mismo de las apps; barra lateral azul profundo y estilo redondeado.
   Cada persona elige claro u oscuro. */
@font-face { font-family: 'Barlow'; font-weight: 400; src: url('../fuentes/barlow-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow'; font-weight: 500 600; src: url('../fuentes/barlow-latin-500-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow'; font-weight: 700 800; src: url('../fuentes/barlow-latin-700-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 600; src: url('../fuentes/barlow-semi-condensed-latin-600-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 700; src: url('../fuentes/barlow-semi-condensed-latin-700-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 800; src: url('../fuentes/barlow-semi-condensed-latin-800-normal.woff2') format('woff2'); font-display: swap; }

:root {
  --fondo: #F5F7FB; --panel: #FFFFFF; --panel2: #EEF2FA; --linea: #DCE1EA; --texto: #0F1B3D; --tenue: #4A5675; --suave: #2E3A5C;
  --acento: #083AB6; --acento-texto: #FFFFFF; --ok: #0B7A43; --ok-fondo: #E3F2EC; --av: #0F1B3D; --av-fondo: #FFF4D6; --av-borde: #E0A21F;
  --er: #B3261E; --er-fondo: #FBE4E2; --lat: #06287E; --lat-2: #0B3BA8; --lat-linea: #1B49B5; --lat-texto: #C9D6F7; --oro: #FFFFFF;
  --contador: #E0A21F; --contador-texto: #0F1B3D; --lat-claro: #F2F5FB; --lat-claro-texto: #06287E;
  --degradado: linear-gradient(135deg, #083AB6, #087A76);
  --sombra: 0 2px 10px rgba(15, 27, 61, .07);
  color-scheme: light;
}
:root[data-tema="oscuro"] {
  --fondo: #0D1630; --panel: #16234A; --panel2: #121D3D; --linea: #283A66; --texto: #F2F5FB; --tenue: #A9B6D8; --suave: #D3DCF0;
  --acento: #8FB0FF; --acento-texto: #0D1630; --ok: #7BE0B5; --ok-fondo: #12392E; --av: #F5C66A; --av-fondo: #1E2B52; --av-borde: #C98A1B;
  --er: #FF8A7F; --er-fondo: #3B1E1C; --lat: #081129; --lat-2: #16234A; --lat-linea: #283A66; --lat-texto: #A9B6D8; --oro: #8FB0FF;
  --lat-claro: #8FB0FF; --lat-claro-texto: #0D1630; --degradado: linear-gradient(135deg, #123A9E, #0E5A57); --sombra: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 'Barlow', system-ui, sans-serif; background: var(--fondo); color: var(--texto); }
a { color: var(--acento); font-weight: 700; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, .titulo { font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 800; font-size: 34px; line-height: 1.1; margin: 0; }
h2 { font-size: 19px; font-weight: 700; margin: 0; }
.num { font-family: 'Barlow Semi Condensed', sans-serif; font-variant-numeric: tabular-nums; }
.tenue { color: var(--tenue); }
.sub { color: var(--tenue); font-size: 14px; }
[hidden] { display: none !important; }

/* Botones y campos */
button, .btn { font: inherit; font-weight: 700; font-size: 15px; height: 42px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--linea); background: var(--panel); color: var(--texto); display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
button:disabled { opacity: .55; cursor: default; }
button.prim, .btn.prim { background: var(--acento); border-color: var(--acento); color: var(--acento-texto); }
button.peligro { color: var(--er); }
button.chico { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
button.chip { height: 38px; border-radius: 999px; }
button.chip.on { background: var(--texto); color: var(--panel); border-color: var(--texto); }
button.chip.aviso { background: var(--av-fondo); color: var(--av); border-color: var(--av-borde); }
label.etq { display: block; font-size: 14px; font-weight: 700; color: var(--suave); margin: 14px 0 6px; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--texto); background: var(--panel); border: 1.5px solid var(--linea); border-radius: 12px; padding: 0 14px; height: 46px; width: 100%; }
textarea { height: auto; padding: 10px 14px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--acento); outline-offset: 1px; }
.error { color: var(--er); font-weight: 700; min-height: 1.2em; margin: 8px 0 0; }
.aviso { padding: 12px 14px; border-radius: 12px; background: var(--av-fondo); color: var(--av); font-size: 14px; line-height: 1.45; }
.nota { padding: 12px 14px; border-radius: 12px; background: var(--panel2); color: var(--suave); font-size: 14px; line-height: 1.45; }

/* Ingreso */
.ingreso { display: flex; min-height: 100vh; }
.ingreso .marca { flex: 1; background: var(--degradado); border-radius: 0 40px 40px 0; color: #F2F4F5; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.ingreso .marca .grande { font-family: 'Barlow Semi Condensed', sans-serif; font-size: 52px; font-weight: 800; line-height: 1.05; }
.ingreso .marca p { font-size: 20px; color: var(--lat-texto); max-width: 520px; }
.ingreso .forma { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.ingreso .tarjeta { width: 100%; max-width: 440px; padding: 34px 32px; }
.logo { display: flex; align-items: center; gap: 12px; font-family: 'Barlow Semi Condensed', sans-serif; font-size: 28px; font-weight: 800; }
@media (max-width: 860px) { .ingreso { flex-direction: column; } .ingreso .marca { padding: 28px 20px; gap: 18px; } .ingreso .marca .grande { font-size: 36px; } }

/* Estructura */
.app { display: flex; min-height: 100vh; }
.lateral { flex: none; width: 248px; background: var(--lat); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.lateral .logo { color: #F2F4F5; padding: 0 10px 22px; font-size: 21px; }
.lateral .logo small { display: block; font-family: 'Barlow', sans-serif; font-weight: 500; font-size: 13px; color: var(--lat-texto); }
.nav { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--lat-texto); font-weight: 600; font-size: 16px; background: none; border: 0; height: auto; justify-content: flex-start; width: 100%; }
.nav:hover { color: #F2F4F5; background: rgba(255, 255, 255, .06); }
.nav.on { background: var(--lat-2); color: var(--oro); }
.nav .contador { margin-left: auto; background: var(--contador, #E0A21F); color: var(--contador-texto, #13222B); border-radius: 999px; padding: 0 9px; font-size: 14px; font-weight: 800; }
.tema { display: flex; background: var(--lat-2); border-radius: 10px; padding: 3px; margin: 0 8px 10px; }
.tema button { flex: 1; height: 32px; border: 0; background: none; color: var(--lat-texto); font-size: 13px; border-radius: 8px; }
.tema button.on { background: var(--lat-claro); color: var(--lat-claro-texto); }
.yo { border-top: 1px solid var(--lat-linea); padding: 14px 10px 0; display: flex; align-items: center; gap: 10px; color: #F2F4F5; }
.yo .inicial { width: 36px; height: 36px; border-radius: 50%; background: var(--lat-2); color: var(--oro); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.yo small { display: block; color: var(--lat-texto); font-size: 12px; }
.yo button { margin-left: auto; background: none; border: 0; color: var(--lat-texto); height: 36px; padding: 0 6px; }
.version { color: var(--lat-texto); font-size: 12px; padding: 8px 10px 0; }
main.contenido { flex: 1; min-width: 0; padding: 28px 36px 48px; }
.ancho { max-width: 1200px; margin: 0 auto; }
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .lateral { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .lateral .logo, .lateral .espacio, .tema, .version { display: none; }
  .nav { width: auto; padding: 8px 10px; font-size: 14px; }
  .yo { border: 0; padding: 0; margin-left: auto; }
  main.contenido { padding: 18px 16px 40px; }
}

/* Piezas */
.card { background: var(--panel); border: 1px solid var(--linea); border-radius: 24px; box-shadow: var(--sombra); }
.pad { padding: 18px 20px; }
.fila { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.kpis { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 22px; }
.kpi { flex: 1; min-width: 180px; padding: 16px 18px; }
.kpi .k { font-size: 14px; color: var(--tenue); font-weight: 600; }
.kpi .v { font-family: 'Barlow Semi Condensed', sans-serif; font-size: 38px; font-weight: 800; line-height: 1.1; }
.kpi .d { font-size: 13px; color: var(--tenue); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-fondo); color: var(--ok); }
.pill.av { background: var(--av-fondo); color: var(--av); }
.pill.er { background: var(--er-fondo); color: var(--er); }
.pill.tenue { background: var(--panel2); color: var(--tenue); }
.barra { height: 8px; border-radius: 999px; background: var(--panel2); overflow: hidden; margin-top: 6px; width: 140px; max-width: 100%; }
.barra b { display: block; height: 100%; border-radius: 999px; }
.tabla { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 13px; color: var(--tenue); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--linea); background: var(--panel2); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid var(--linea); font-size: 15px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.der, th.der { text-align: right; }
.pestanas { display: flex; gap: 26px; border-bottom: 1px solid var(--linea); margin-top: 18px; overflow-x: auto; }
.pestanas button { background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 0 2px; height: 46px; color: var(--tenue); font-size: 16px; }
.pestanas button.on { color: var(--texto); border-bottom-color: var(--acento); }
.segmento { display: flex; background: var(--panel2); border-radius: 12px; padding: 4px; }
.segmento button { flex: 1; border: 0; background: none; height: 38px; color: var(--tenue); }
.segmento button.on { background: var(--panel); color: var(--texto); box-shadow: var(--sombra); }
.interruptor { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--linea); }
.interruptor:first-of-type { border-top: 0; }
.switch { position: relative; flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--linea); border: 0; padding: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; transition: left .15s; }
.switch[aria-checked="true"] { background: var(--acento); }
.switch[aria-checked="true"]::after { left: 23px; }
.lista-fila { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--linea); flex-wrap: wrap; }
.lista-fila:first-child { border-top: 0; }
.banner-ok { padding: 16px 18px; border-radius: 24px; background: var(--ok-fondo); border: 1.5px solid var(--ok); }
.banner-ok strong { color: var(--ok); font-size: 17px; }
dialog { border: 1px solid var(--linea); border-radius: 16px; padding: 22px; width: min(460px, calc(100vw - 32px)); background: var(--panel); color: var(--texto); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.acciones { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.aviso-flotante { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--texto); color: var(--panel); padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 20; max-width: calc(100vw - 32px); }

/* Guía de la app del dueño (soporte) */
.con-guia { display: flex; gap: 18px; align-items: flex-start; }
.con-guia > .grow { min-width: 0; }
.guia { flex: none; width: 360px; position: sticky; top: 16px; }
.guia .telefono { width: 300px; margin: 12px auto 0; border-radius: 34px; background: #06287E; padding: 9px; }
.guia .pantalla { position: relative; border-radius: 26px; overflow: hidden; background: #FFFFFF; aspect-ratio: 390 / 844; }
.guia .pantalla img { display: block; width: 100%; height: 100%; object-fit: cover; }
.guia .marca-toque { position: absolute; border: 4px solid #E0A21F; border-radius: 14px; box-shadow: 0 0 0 6px rgba(224, 162, 31, .25); pointer-events: none; }
@media (max-width: 1100px) { .con-guia { flex-direction: column; } .guia { width: 100%; position: static; } }

/* D50: marca, paletas, bloqueo y bitácora */
.logo-marca { display: inline-flex; align-items: center; justify-content: center; flex: none; background: #FFFFFF; border-radius: 28%; padding: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.logo-marca img { width: 100%; height: 100%; object-fit: contain; display: block; }
.banner-prop { padding: 16px 18px; border-radius: 24px; background: var(--panel2); border: 1.5px solid var(--acento); }
.banner-prop strong { color: var(--acento); font-size: 17px; }
.paletas { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 14px; }
.paleta { height: auto; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 4px; padding: 12px; border-radius: 20px; text-align: left; white-space: normal; }
.paleta.on { border-color: var(--acento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 30%, transparent); }
.paleta .puntos { display: flex; gap: 4px; }
.paleta .puntos i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .12); }
.paleta .nombre { margin-top: 6px; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.colores { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-top: 14px; }
.color { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--linea); border-radius: 18px; cursor: pointer; }
.color input[type="color"] { flex: none; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 14px; background: none; cursor: pointer; }
.color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(0, 0, 0, .15); border-radius: 14px; }
.color > span { display: flex; flex-direction: column; }
.rejilla-paleta { display: grid; grid-template-columns: auto 1fr; gap: 22px; margin-top: 18px; align-items: start; }
@media (max-width: 900px) { .rejilla-paleta { grid-template-columns: 1fr; } }
.muestras { display: flex; gap: 14px; flex-wrap: wrap; }
.muestra-cel { width: 210px; border-radius: 30px; padding: 0 0 12px; overflow: hidden; border: 6px solid #0F1B3D; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.muestra-cel .m-enc { color: #FFFFFF; padding: 14px 12px 16px; border-radius: 0 0 22px 22px; display: flex; gap: 10px; align-items: flex-start; }
.muestra-cel .m-enc b { display: block; font-size: 14px; }
.muestra-cel .m-enc small { display: block; opacity: .95; }
.muestra-cel .m-enc strong { display: block; font-family: 'Barlow Semi Condensed', sans-serif; font-size: 24px; line-height: 1.1; }
.muestra-cel .m-banda { color: #FFFFFF; margin: 0 10px; border-radius: 16px; padding: 8px 12px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; }
.muestra-cel .m-banda b { font-family: 'Barlow Semi Condensed', sans-serif; font-size: 19px; }
.muestra-cel .m-fila { margin: 0 10px; border: 1px solid; border-radius: 14px; padding: 8px 12px; font-weight: 700; display: flex; justify-content: space-between; }
.muestra-cel .m-fila i { font-style: normal; font-weight: 500; }
.muestra-cel .m-aviso { margin: 0 10px; border: 1.5px solid; border-radius: 14px; padding: 8px 12px; font-weight: 700; }
.muestra-cel .m-boton { margin: 0 10px; border-radius: 999px; padding: 9px 12px; font-weight: 700; text-align: center; }
.muestra-cel .m-pie { text-align: center; font-size: 12px; font-weight: 600; }
.revision { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.revision li { padding: 8px 12px; border-radius: 12px; font-weight: 600; }
.revision li.ok { background: var(--ok-fondo); color: var(--ok); }
.revision li.mal { background: var(--er-fondo); color: var(--er); }
.subir { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1.5px dashed var(--linea); border-radius: 20px; }
.subir .vista-img { flex: none; width: 76px; height: 76px; border-radius: 20px; background: #FFFFFF; border: 1px solid var(--linea); display: flex; align-items: center; justify-content: center; padding: 8px; }
.subir .vista-img.logo { width: 150px; }
.subir .vista-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
label.btn { cursor: pointer; }
.casilla { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--linea); cursor: pointer; }
.casilla input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--acento); flex: none; }
.casilla > span { display: flex; flex-direction: column; }
.icono-redondo { width: 48px; height: 48px; border-radius: 16px; background: var(--panel2); display: inline-flex; align-items: center; justify-content: center; }
.filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; }
table.bitacora td { font-size: 14px; vertical-align: top; }
table.bitacora .cambio { max-width: 320px; word-break: break-word; }
table.bitacora .antes { color: var(--tenue); text-decoration: line-through; }
table.bitacora .despues { font-weight: 700; }
