/* Panel NOC INTI VPN — una sola hoja de estilos para todas las pantallas */
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url(../fonts/montserrat-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url(../fonts/montserrat-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(../fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url(../fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(../fonts/inter-latin-600-normal.woff2) format("woff2"); }

:root {
  /* Marca INTI VPN */
  --navy: #002A50; --royal: #003DBE; --blue: #0064C4; --sky: #0286D9; --electric: #045DFF;
  --ink: #0E1B2B; --muted: #5A6B80; --line: #DCE5EF; --bg: #F5F8FC; --card: #FFFFFF; --soft: #EEF3F9;
  /* Estados */
  --ok: #138A4B; --ok-bg: #E4F5EC;
  --bad: #C8312B; --bad-bg: #FCE9E8;
  --warn: #B26A00; --warn-bg: #FFF3DC;
  --off: #6B7A8C; --off-bg: #EDF1F5;
  --wa: #25D366;
  --fh: "Montserrat", system-ui, sans-serif;
  --fb: "Inter", system-ui, sans-serif;
  --r: 10px;
  --sombra: 0 1px 2px rgba(14, 27, 43, .06), 0 2px 8px rgba(14, 27, 43, .04);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--fb); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--fh); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
a { color: var(--blue); }
button, input, select { font: inherit; color: inherit; }
.oculto { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.tenue { color: var(--muted); }
.chico { font-size: 12.5px; }
.derecha { text-align: right; }
.fila { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.fila.entre { justify-content: space-between; }
.fila > input { flex: 1; width: auto; min-width: 0; }
.fila > input[type=number] { flex: 0 1 140px; }
.pila > * + * { margin-top: 16px; }

/* ───── Estructura ───── */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--navy) 232px, var(--bg) 232px); }
.lateral { background: var(--navy); color: #C9D6E6; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.lateral .marca { padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.lateral .marca img { width: 140px; display: block; }
.lateral .marca span { display: block; margin-top: 6px; font: 600 11px/1 var(--fh); letter-spacing: .14em; color: #8FB0D6; }
.menu { padding: 12px 10px; flex: 1; overflow-y: auto; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 2px 0; border-radius: 8px; color: #C9D6E6; text-decoration: none; font-weight: 500; }
.menu a:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu a.activo { background: var(--royal); color: #fff; }
.menu svg { width: 18px; height: 18px; flex: none; }
.menu .contador { margin-left: auto; background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 600; padding: 1px 7px; }
.menu .contador.aviso { background: #E69A00; }
.lateral .pie { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.lateral .pie button { background: none; border: 0; color: #8FB0D6; padding: 0; cursor: pointer; text-decoration: underline; }

.principal { min-width: 0; }
.franja-prueba { background: var(--warn-bg); color: #7A4A00; border-bottom: 1px solid #F1D9A6; padding: 9px 28px; font-weight: 500; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.franja-prueba a { color: #7A4A00; font-weight: 600; }
.contenido { padding: 26px 28px 48px; max-width: 1240px; }
.cabecera { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.cabecera p { margin: 4px 0 0; color: var(--muted); }
.barra-movil { display: none; }

/* ───── Tarjetas ───── */
.tarjeta { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sombra); }
.tarjeta > .titulo { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tarjeta > .cuerpo { padding: 16px 18px; }
.tarjeta > .cuerpo.sin-relleno { padding: 0; }
.rejilla { display: grid; gap: 16px; }
.rejilla.dos { grid-template-columns: 1.4fr 1fr; }
.rejilla.dos-iguales { grid-template-columns: 1fr 1fr; }

.cifras { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.cifra { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--sombra); text-decoration: none; color: inherit; display: block; }
.cifra:hover { border-color: var(--mist, #9BB3CB); }
.cifra .n { font: 700 28px/1.1 var(--fh); margin-top: 4px; }
.cifra .e { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cifra.ok .n { color: var(--ok); } .cifra.bad .n { color: var(--bad); } .cifra.warn .n { color: var(--warn); } .cifra.off .n { color: var(--off); }

/* Punto de estado */
.punto { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--off); }
.punto.ok { background: var(--ok); } .punto.bad { background: var(--bad); } .punto.warn { background: #E69A00; }
.punto.vivo { box-shadow: 0 0 0 0 rgba(19,138,75,.5); animation: latido 2s infinite; }
@keyframes latido { 0% { box-shadow: 0 0 0 0 rgba(19,138,75,.45); } 70% { box-shadow: 0 0 0 7px rgba(19,138,75,0); } 100% { box-shadow: 0 0 0 0 rgba(19,138,75,0); } }

/* Etiquetas de fase */
.etq { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.etq.online { background: var(--ok-bg); color: var(--ok); }
.etq.caido { background: var(--bad-bg); color: var(--bad); }
.etq.sospecha, .etq.retornando { background: var(--warn-bg); color: var(--warn); }
.etq.suspendido { background: var(--off-bg); color: var(--off); }
.etq.desconocido { background: var(--soft); color: var(--muted); }
.etq.azul { background: #E6EEFC; color: var(--royal); }
.etq.retirada { background: #F4E9FB; color: #7B3FA6; }

/* ───── Tablas ───── */
.tabla-env { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font: 600 11.5px/1.2 var(--fb); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FAFCFE; white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #FAFCFE; }
tr.clic { cursor: pointer; }
td .sub { display: block; color: var(--muted); font-size: 12px; }
.vacio { padding: 28px; text-align: center; color: var(--muted); }

/* ───── Formularios y botones ───── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #B8C7D8; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primario { background: var(--royal); border-color: var(--royal); color: #fff; }
.btn.primario:hover { background: var(--electric); border-color: var(--electric); }
.btn.peligro { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.chico { padding: 5px 10px; font-size: 13px; }
.btn.enlace { border: 0; background: none; color: var(--blue); padding: 0; font-weight: 500; }

label.campo, div.campo { display: block; }
.campo > span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.campo > small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=tel], input[type=date], select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,100,196,.14); }
input.codigo { font: 600 24px/1 var(--fh); letter-spacing: .4em; text-align: center; padding: 12px; }
.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.filtros input[type=search] { max-width: 320px; }
.filtros select { width: auto; }
.pildoras { display: flex; gap: 6px; flex-wrap: wrap; }
.pildora { border: 1px solid var(--line); background: #fff; padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 500; cursor: pointer; }
.pildora.activa { background: var(--navy); border-color: var(--navy); color: #fff; }
.pildora .n { opacity: .7; margin-left: 4px; }

.interruptor { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.interruptor input { display: none; }
.interruptor .riel { width: 40px; height: 22px; border-radius: 999px; background: #C7D2DE; position: relative; transition: background .15s; flex: none; }
.interruptor .riel::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.interruptor input:checked + .riel { background: var(--ok); }
.interruptor input:checked + .riel::after { transform: translateX(18px); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 13px; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 4px; font-size: 15px; line-height: 1; }

.aviso { border-radius: 8px; padding: 10px 14px; font-size: 13.5px; }
.aviso.info { background: #E6EEFC; color: #12357A; }
.aviso.ok { background: var(--ok-bg); color: #0D5C33; }
.aviso.mal { background: var(--bad-bg); color: #8A1F1A; }
.aviso.atento { background: var(--warn-bg); color: #6E4300; }

/* Lista de eventos */
.eventos { list-style: none; margin: 0; padding: 0; }
.eventos li { display: grid; grid-template-columns: 54px 1fr; gap: 10px; padding: 9px 18px; border-bottom: 1px solid var(--line); }
.eventos li:last-child { border-bottom: 0; }
.eventos .sub { display: block; color: var(--muted); font-size: 12px; }
.eventos .etq { margin-right: 6px; }
.eventos .hora { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; padding-top: 1px; }

/* CHR y WhatsApp */
.estado-linea { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.estado-linea:last-child { border-bottom: 0; }
.estado-linea .nombre { font-weight: 600; }
.estado-linea .detalle { margin-left: auto; color: var(--muted); font-size: 12.5px; text-align: right; }
.qr { display: grid; place-items: center; padding: 18px; background: #fff; border: 1px dashed var(--line); border-radius: var(--r); }
.qr img { width: 260px; height: 260px; image-rendering: pixelated; }

/* ───── Modal y avisos flotantes ───── */
.velo { position: fixed; inset: 0; background: rgba(0, 20, 40, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal .titulo { padding: 18px 20px 0; }
.modal .cuerpo { padding: 16px 20px; }
.modal .acciones { padding: 14px 20px 18px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 380px; font-weight: 500; }
.toast.mal { background: var(--bad); }
.toast.ok { background: var(--ok); }

/* ───── Ingreso ───── */
.ingreso { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, var(--navy) 0%, #002A50 45%, var(--royal) 100%); }
.caja-ingreso { width: 100%; max-width: 380px; background: #fff; border-radius: 14px; padding: 30px 28px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.caja-ingreso .logo { width: 170px; display: block; margin: 0 auto 4px; }
.caja-ingreso .sub { text-align: center; font: 600 11px/1 var(--fh); letter-spacing: .16em; color: var(--muted); margin-bottom: 24px; }
.caja-ingreso form > * + * { margin-top: 14px; }
.caja-ingreso .btn { width: 100%; padding: 11px; }
.pasos { padding-left: 20px; margin: 0; } .pasos li { margin: 6px 0; }
.secreto { word-break: break-all; background: var(--soft); border-radius: 6px; padding: 6px 8px; }

.cargando { padding: 40px; text-align: center; color: var(--muted); }

/* ───── Celular ───── */
@media (max-width: 1020px) {
  .cifras { grid-template-columns: repeat(3, 1fr); }
  .rejilla.dos, .rejilla.dos-iguales { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; background: var(--bg); }
  .lateral { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .app.menu-abierto .lateral { transform: none; }
  .barra-movil { display: flex; align-items: center; justify-content: space-between; background: var(--navy); padding: 10px 16px; position: sticky; top: 0; z-index: 30; }
  .barra-movil img { height: 26px; }
  .barra-movil button { background: none; border: 0; color: #fff; padding: 4px; }
  .contenido { padding: 18px 16px 40px; }
  .franja-prueba { padding: 9px 16px; }
  .cifras { grid-template-columns: repeat(2, 1fr); }
  .ocultar-movil { display: none; }
  td, th { padding: 9px 10px; }
}

/* Importación */
.zona-archivo { display: block; border: 2px dashed #B8C7D8; border-radius: var(--r); padding: 34px 20px; text-align: center; background: #FAFCFE; cursor: pointer; }
.zona-archivo:hover, .zona-archivo.encima { border-color: var(--blue); background: #F0F6FD; }
.zona-archivo input { display: none; }
.zona-archivo b { display: block; font: 600 15px/1.3 var(--fh); margin-bottom: 4px; }
details.plegable { border-top: 1px solid var(--line); }
details.plegable summary { padding: 12px 18px; cursor: pointer; font-weight: 600; }
details.plegable .lista { padding: 0 18px 14px; columns: 2; column-gap: 24px; font-size: 13px; }
details.plegable .lista div { break-inside: avoid; padding: 2px 0; }
.antes { color: var(--muted); text-decoration: line-through; }
@media (max-width: 760px) { details.plegable .lista { columns: 1; } }

/* Ingreso: enlaces y pie */
.pila-chica > * + * { margin-top: 14px; }
.caja-ingreso h2 { font-size: 18px; }
.enlaces-ingreso { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.enlaces-ingreso .btn.enlace { width: auto; padding: 0; font-size: 13.5px; }
.pie-ingreso { color: #C9D6E6; font-size: 13px; text-align: center; margin: 18px 0 0; }
.pie-ingreso a { color: #fff; }
.ingreso { display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* Mi panel (clientes) */
.cabecera-cliente { background: var(--navy); color: #fff; }
.cabecera-cliente .dentro { max-width: 1100px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.cabecera-cliente img { height: 34px; display: block; }
.cabecera-cliente .cuenta { display: flex; gap: 14px; align-items: center; font-size: 13.5px; color: #C9D6E6; flex-wrap: wrap; }
.cabecera-cliente .cuenta button { background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-weight: 600; }
.contenido-cliente { max-width: 1100px; margin: 0 auto; padding: 26px 24px 48px; }
.vpns { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.vpn { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sombra); padding: 18px; display: flex; flex-direction: column; gap: 12px; border-top: 4px solid var(--off); }
.vpn.online { border-top-color: var(--ok); } .vpn.caido { border-top-color: var(--bad); }
.vpn.sospecha, .vpn.retornando { border-top-color: #E69A00; }
.vpn .cab { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.vpn h3 { font-size: 16px; }
.vpn .datos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vpn .dato { background: var(--soft); border-radius: 8px; padding: 8px 10px; }
.vpn .dato .t { font-size: 11.5px; color: var(--muted); }
.vpn .dato .v { font: 700 16px/1.3 var(--fh); }
.vpn ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
@media (max-width: 760px) { .contenido-cliente { padding: 18px 16px 40px; } .cabecera-cliente .dentro { padding: 12px 16px; } .vpns { grid-template-columns: 1fr; } }
