/* S2GRUPO Phishing Suite. Mismos tokens de marca que Esfuerzos e Informe de Phishing. */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --azul: #0545b0; --azul-osc: #03307d; --azul-cl: #5a84ce; --lima: #dbf266;
  --bg: #ededeb; --surface: #ffffff; --surface-2: #f6f6f4; --line: #d5d7dc;
  --fg: #1a1d24; --fg-2: #3d414b; --muted: #6b7080;
  --ok-bg: #e3efe0; --ok-fg: #2c5a22;
  --rojo: #b42318; --rojo-bg: #fbd5d2; --rojo-fg: #8a1c12;
  --ambar-bg: #fdf0c8; --ambar-fg: #7a5200;
  --font: 'Manrope', Arial, sans-serif;
  --r: 8px;
}
:root { color-scheme: light; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--azul); }
:focus-visible { outline: 3px solid var(--azul-cl); outline-offset: 2px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { margin: 0 0 4px; }
.muted { color: var(--muted); }

/* Cabecera y navegación */
header.top { background: var(--azul); color: #fff; }
header.top .wrap { display: flex; align-items: center; gap: 16px; padding-block: 12px; flex-wrap: wrap; }
.marca { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.marca img { height: 24px; display: block; }
.marca span { font-weight: 800; font-size: 15px; border-left: 1px solid rgba(255,255,255,.35); padding-left: 12px; }
.quien { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.av { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--azul); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
nav.tabs { background: var(--azul-osc); }
nav.tabs .wrap { display: flex; gap: 2px; overflow-x: auto; }
nav.tabs button { background: none; border: 0; color: #fff; opacity: .8; padding: 11px 16px; cursor: pointer; font-weight: 700; font-size: 13.5px; border-bottom: 3px solid transparent; white-space: nowrap; }
nav.tabs button[aria-current="page"] { opacity: 1; border-bottom-color: var(--lima); }

main { padding-block: 22px 60px; }
.barra { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.barra h1 { font-size: 21px; font-weight: 800; margin-right: auto; }

/* Botones y formularios */
.btn { background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 14px; cursor: pointer; font-weight: 700; font-size: 13.5px; display: inline-block; text-decoration: none; }
.btn:hover { border-color: var(--azul-cl); }
.btn.pri { background: var(--azul); border-color: var(--azul); color: #fff; }
.btn.pri:hover { background: var(--azul-osc); }
.btn.lima { background: var(--lima); border-color: var(--lima); color: var(--fg); }
.btn.rojo { background: var(--rojo); border-color: var(--rojo); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.campo { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.campo label { font-size: 12px; font-weight: 700; color: var(--azul); text-transform: uppercase; letter-spacing: .03em; }
.campo input, .campo select, .campo textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; width: 100%; }
.campo textarea { min-height: 90px; font-family: ui-monospace, monospace; font-size: 12.5px; }
.fila-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); border-radius: 99px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; background: var(--surface); }
.chip.sel { background: var(--azul); border-color: var(--azul); color: #fff; }

/* Tarjetas, tablas y estado vacío */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.vacio { text-align: center; color: var(--muted); padding: 40px 20px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--line); color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; }
table.t td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.t tr:hover td { background: var(--surface-2); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; }
.pill.ok { background: var(--ok-bg); color: var(--ok-fg); }
.pill.rojo { background: var(--rojo-bg); color: var(--rojo-fg); }
.pill.ambar { background: var(--ambar-bg); color: var(--ambar-fg); }
.pill.gris { background: var(--surface-2); color: var(--muted); }

/* Tarjeta de máquina */
.maquina { display: flex; flex-direction: column; gap: 8px; }
.fila { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.maquina .acciones { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* Plantillas: desplegables por categoría en vez de una rejilla larga */
.categoriaPlantillas { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-top: 10px; overflow: hidden; }
.categoriaPlantillas summary { padding: 11px 16px; cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 6px; }
.categoriaPlantillas summary::before { content: '▸'; color: var(--azul); transition: transform .15s; }
.categoriaPlantillas[open] summary::before { transform: rotate(90deg); }
.categoriaPlantillas summary::-webkit-details-marker { display: none; }
.listaPlantillas { border-top: 1px solid var(--line); }
.filaPlantilla { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.filaPlantilla:last-child { border-bottom: 0; }
.filaPlantilla:hover { background: var(--surface-2); }
.nombrePlantilla { min-width: 180px; flex: 1; }
.variablesGophish { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.editorPlantilla { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.editorPlantilla > * { flex: 1 1 420px; min-width: 320px; }
pre.salida { background: #10151f; color: #d7e4f5; padding: 12px; border-radius: 6px; font-size: 12px; max-height: 280px; overflow: auto; white-space: pre-wrap; }

/* Modal */
.fondo-modal { position: fixed; inset: 0; background: rgba(10,15,30,.55); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; z-index: 50; }
.modal { background: var(--surface); border-radius: 10px; padding: 22px; width: 100%; max-width: 560px; }
.modal h2 { font-size: 17px; }
.modal .cerrar { position: absolute; }

/* Avisos */
.aviso { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; }
.aviso.error { background: var(--rojo-bg); color: var(--rojo-fg); }
.aviso.ok { background: var(--ok-bg); color: var(--ok-fg); }

/* Login */
.login-fondo { min-height: 100vh; background: var(--azul); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-caja { background: #fff; border-radius: 12px; padding: 34px 30px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-caja img { height: 36px; margin-bottom: 20px; }
.login-caja h1 { font-size: 19px; }
.login-caja p.sub { color: var(--muted); margin: 2px 0 18px; font-size: 13px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: girar .7s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

@media (max-width: 700px) { header.top { position: static; } .fila-campos { grid-template-columns: 1fr; } }

/* Móvil-mockup del SMS (compositor y página de campaña) */
.movil { width: 230px; margin: 0 auto; border: 10px solid #1a1d24; border-radius: 34px; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.18); overflow: hidden; }
.movil::before { content: ''; display: block; width: 50px; height: 5px; background: #1a1d24; border-radius: 99px; margin: 8px auto; }
.movil-pantalla { background: #e9e9eb; min-height: 260px; padding: 14px 10px 20px; display: flex; flex-direction: column; }
.movil-remitente { text-align: center; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 10px; }
.movil-burbuja { background: #fff; border-radius: 16px; border-bottom-left-radius: 4px; padding: 10px 13px; font-size: 13px; line-height: 1.4; max-width: 90%; box-shadow: 0 1px 2px rgba(0,0,0,.08); word-break: break-word; white-space: pre-wrap; }
.movil-burbuja a, .movil-burbuja .enlace { color: var(--azul); text-decoration: underline; }

/* Ratio de entrega (estilo informe SMS) */
.ratio-fila { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; }
.ratio-fila .punto { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ratio-fila .nombre { flex: none; width: 110px; }
.ratio-fila .barra { flex: 1; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.ratio-fila .barra > span { display: block; height: 100%; border-radius: 99px; }
.ratio-fila .num { flex: none; width: 34px; text-align: right; font-weight: 700; }
