/* aegiX PASS · identidad visual
   Paleta de marca: Noche #0F0A1F · Violeta núcleo #7C3AED · Violeta eléctrico #A855F7 · Lavanda #C4B5FD · Cian #22D3EE
   Dos modos con las mismas pantallas:
   - escritorio: computadora con mouse. Claro, denso y serio, con barra superior morada y menú completo.
   - tactil: tablet y celular. Oscuro, botones grandes y menú en hoja. */

:root, [data-modo="tactil"] {
  --fondo: #0F0A1F; --sup: #1C1433; --sup-2: #241a42; --borde: #3B2A6B; --campo: #120C26;
  --texto: #F5F3FF; --texto-2: #C4B5FD; --texto-3: #9a8cc9;
  --acento: #7C3AED; --acento-h: #6D28D9; --acento-txt: #C4B5FD; --cian: #22D3EE;
  --barra: #0F0A1F; --barra-borde: #3B2A6B; --barra-txt: #F5F3FF; --barra-txt-2: #C4B5FD; --barra-act: #1C1433;
  --ok-bg: #052e22; --ok-bd: #10B981; --ok-tx: #6EE7B7;
  --av-bg: #2e2205; --av-bd: #F59E0B; --av-tx: #FCD34D;
  --er-bg: #3a0a14; --er-bd: #F43F5E; --er-tx: #FDA4AF;
  --radio: 14px; --radio-sm: 10px; --fs: 16px;
}
[data-modo="escritorio"] {
  --fondo: #F4F2F9; --sup: #FFFFFF; --sup-2: #F8F6FC; --borde: #E3DDF0; --campo: #FFFFFF;
  --texto: #1E1240; --texto-2: #4C4470; --texto-3: #857DA3;
  --acento: #7C3AED; --acento-h: #6D28D9; --acento-txt: #6D28D9; --cian: #0891B2;
  --barra: #2E1065; --barra-borde: #2E1065; --barra-txt: #FFFFFF; --barra-txt-2: #DDD6FE; --barra-act: #4C1D95;
  --ok-bg: #ECFDF5; --ok-bd: #10B981; --ok-tx: #065F46;
  --av-bg: #FFFBEB; --av-bd: #F59E0B; --av-tx: #92400E;
  --er-bg: #FFF1F2; --er-bd: #F43F5E; --er-tx: #9F1239;
  --radio: 8px; --radio-sm: 6px; --fs: 14px;
}

html, body { background: var(--fondo); color: var(--texto); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: var(--fs); }
a { color: var(--acento-txt); }
.t2 { color: var(--texto-2); } .t3 { color: var(--texto-3); }
.oculto { display: none !important; }

/* Marca */
.logo { font-weight: 600; letter-spacing: .04em; color: var(--barra-txt); line-height: 1; white-space: nowrap; }
.logo .x { color: #A855F7; }
.logo .prod { color: var(--barra-txt-2); letter-spacing: .25em; font-size: .55em; margin-left: .35em; vertical-align: middle; }
.logo-img { display: block; width: auto; max-width: 100%; }
/* En la pantalla de entrada: a color con fondo claro (computadora), blanco con fondo oscuro (tablet/cel) */
.logo-claro { display: none; } [data-modo="escritorio"] .logo-claro { display: block; } [data-modo="escritorio"] .logo-oscuro { display: none; }
#logo .logo-img { margin: 0 auto; }
[data-modo="escritorio"] .logo .x { color: #C084FC; }
.by-abc { display: inline-block; font-size: 10px; letter-spacing: .2em; color: #22D3EE; text-decoration: none; text-transform: uppercase; white-space: nowrap; }
.by-abc:hover { text-decoration: underline; }
.pie .by-abc { color: var(--cian); }

/* Barra superior */
.barra { background: var(--barra); border-bottom: 1px solid var(--barra-borde); color: var(--barra-txt); }
.menu-item { color: var(--barra-txt-2); padding: .5rem .8rem; border-radius: var(--radio-sm); font-size: 13.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: .4rem; }
.menu-item:hover { background: var(--barra-act); color: var(--barra-txt); }
.menu-item.act { background: var(--barra-act); color: var(--barra-txt); box-shadow: inset 0 -2px 0 #22D3EE; }
.menu-item kbd { font-size: 10px; opacity: .6; font-family: inherit; }
.pastilla { font-size: 12px; padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; }
.pastilla-suc { background: rgba(167,139,250,.22); color: #DDD6FE; border: 0; cursor: pointer; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; }
.pastilla-ok { background: rgba(16,185,129,.18); color: #6EE7B7; } .pastilla-off { background: rgba(244,63,94,.18); color: #FDA4AF; }

/* Superficies */
.tarjeta { background: var(--sup); border: 1px solid var(--borde); border-radius: var(--radio); }
[data-modo="escritorio"] .tarjeta { box-shadow: 0 1px 2px rgba(46,16,101,.05); }
.titulo-sec { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-3); font-weight: 600; }
.kpi-num { font-size: 1.6rem; font-weight: 600; line-height: 1.2; }

/* Campos */
.campo { background: var(--campo); border: 1px solid var(--borde); border-radius: var(--radio-sm); color: var(--texto); outline: none; padding: .55rem .75rem; width: 100%; }
[data-modo="tactil"] .campo { padding: .8rem .9rem; font-size: 16px; }
.campo:focus { border-color: #A855F7; box-shadow: 0 0 0 3px rgba(168,85,247,.22); }
.campo:disabled { opacity: .6; }
label.lbl { display: block; font-size: 12.5px; color: var(--texto-2); margin-bottom: .25rem; }
select.campo { appearance: auto; }

/* Botones */
.btn { border-radius: var(--radio-sm); font-weight: 500; padding: .55rem 1rem; transition: background .15s, transform .05s; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; white-space: nowrap; cursor: pointer; }
[data-modo="tactil"] .btn { padding: .8rem 1.1rem; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primario { background: var(--acento); color: #fff; } .btn-primario:hover { background: var(--acento-h); }
.btn-sec { background: transparent; border: 1px solid var(--borde); color: var(--acento-txt); } .btn-sec:hover { background: var(--sup-2); }
.btn-peligro { background: transparent; border: 1px solid var(--er-bd); color: var(--er-tx); } .btn-peligro:hover { background: var(--er-bg); }
.btn-ok { background: #059669; color: #fff; } .btn-ok:hover { background: #047857; }
.btn-chico { padding: .3rem .6rem !important; font-size: 12.5px; }

/* Interruptor (Sí/No) */
.switch { position: relative; display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .riel { width: 38px; height: 22px; border-radius: 999px; background: var(--borde); position: relative; transition: background .15s; flex: none; }
.switch .riel::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .riel { background: var(--acento); }
.switch input:checked + .riel::after { transform: translateX(16px); }

/* Tablas */
.tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabla th { text-align: left; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--texto-3); padding: .55rem .75rem; border-bottom: 1px solid var(--borde); background: var(--sup-2); white-space: nowrap; position: sticky; top: 0; }
.tabla td { padding: .5rem .75rem; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla tr.clic { cursor: pointer; } .tabla tr.clic:hover td { background: var(--sup-2); }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
[data-modo="tactil"] .tabla { font-size: 15px; } [data-modo="tactil"] .tabla td { padding: .75rem; }
.tabla tr.cancelado td { opacity: .5; text-decoration: line-through; }

/* Semáforo */
.sem { border: 2px solid; border-radius: var(--radio); }
.sem-verde { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok-tx); }
.sem-amarillo { background: var(--av-bg); border-color: var(--av-bd); color: var(--av-tx); }
.sem-rojo { background: var(--er-bg); border-color: var(--er-bd); color: var(--er-tx); }
[data-modo="escritorio"] .sem .fuerte { color: var(--texto); }
.punto { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.punto-verde { background: #10B981; } .punto-amarillo { background: #F59E0B; } .punto-rojo { background: #F43F5E; }
.etq { font-size: 11.5px; padding: .15rem .5rem; border-radius: 999px; white-space: nowrap; display: inline-block; }
.etq-verde { background: var(--ok-bg); color: var(--ok-tx); } .etq-amarillo { background: var(--av-bg); color: var(--av-tx); } .etq-rojo { background: var(--er-bg); color: var(--er-tx); }
.etq-gris { background: var(--sup-2); color: var(--texto-3); border: 1px solid var(--borde); }

/* Modal */
.velo { position: fixed; inset: 0; background: rgba(10,5,25,.55); display: flex; align-items: flex-start; justify-content: center; z-index: 50; padding: 5vh 1rem; overflow-y: auto; }
.modal { background: var(--sup); border: 1px solid var(--borde); border-radius: var(--radio); width: 100%; max-width: 560px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal-ancho { max-width: 820px; }
.modal-cab { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.2rem; border-bottom: 1px solid var(--borde); }
.modal-cab h2 { font-size: 1.05rem; font-weight: 600; }
.modal-cuerpo { padding: 1.2rem; }
.modal-pie { display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.2rem; border-top: 1px solid var(--borde); flex-wrap: wrap; }
[data-modo="tactil"] .velo { padding: 0; align-items: flex-end; }
[data-modo="tactil"] .modal { border-radius: 18px 18px 0 0; max-height: 92vh; overflow-y: auto; }

/* Avisos flotantes */
#avisos { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; display: flex; flex-direction: column; gap: .5rem; }
.aviso { padding: .7rem 1rem; border-radius: var(--radio-sm); background: #1E1240; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 14px; max-width: 360px; }
.aviso-error { background: #9F1239; } .aviso-ok { background: #065F46; }

/* POS */
.boton-plan { text-align: left; border: 1px solid var(--borde); border-radius: var(--radio-sm); padding: .6rem .75rem; background: var(--sup); color: var(--texto); }
.boton-plan:hover { border-color: #A855F7; background: var(--sup-2); }
[data-modo="tactil"] .boton-plan { padding: .9rem; }

/* Gráficas simples */
.barras { display: flex; align-items: flex-end; gap: 3px; height: 160px; }
.barras .b { flex: 1; background: var(--acento); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.barras .b:hover { background: #A855F7; }
.barras-lbl { display: flex; gap: 3px; font-size: 10px; color: var(--texto-3); }
.barras-lbl span { flex: 1; text-align: center; overflow: hidden; }

::-webkit-scrollbar { width: 9px; height: 9px; } ::-webkit-scrollbar-thumb { background: var(--borde); border-radius: 5px; }
@media print { .no-imprimir { display: none !important; } }

/* Vencimientos en tarjetas (táctil) */
.ficha-venc > div:nth-child(1) { color: var(--texto-3); font-size: 13px; grid-row: span 2; align-self: start; padding-top: 2px; }
.ficha-venc > div:nth-child(3)::before { content: 'Próximo pago: '; color: var(--texto-3); }
.ficha-venc > div:nth-child(4)::before { content: 'Última visita: '; }
.ficha-venc > div:nth-child(4) { grid-column: 2; font-size: 13px; }
.ficha-venc > div:nth-child(5) { grid-column: 1 / -1; display: flex; gap: .5rem; justify-content: flex-end; margin-top: .4rem; }

/* ---------- Fotos de socios ---------- */
.foto-socio { border-radius: 999px; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: var(--sup-2); border: 1px solid var(--borde); }
.foto-vacia { color: var(--texto-3); font-weight: 600; letter-spacing: .03em; }
.foto-grande { border-radius: 18px; border-width: 2px; }
.foto-marco { position: relative; width: min(320px, 78vw); aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: #0b0716; }
.foto-marco video, .foto-marco canvas, #vista-previa { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.foto-guia { position: absolute; left: 22%; right: 22%; top: 10%; bottom: 14%; border: 2px dashed rgba(255,255,255,.7); border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 999px rgba(0,0,0,.25); }
#vista-previa:not(.oculto) ~ .foto-guia { display: none; }
.foto-sin-cam { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; color: #C4B5FD; }
.foto-sin-cam span { font-size: 3rem; }
.foto-btn { position: relative; cursor: pointer; }
.foto-btn .foto-cta { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; padding: .1rem .5rem; border-radius: 999px; background: var(--acento); color: #fff; }
