/* Panel Monitoreo Sigylmex — CSS local, sin CDN. */
* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; margin: 0; background: #f4f5f7; color: #1c2430; }
body.centrado { display: flex; min-height: 100vh; align-items: center; justify-content: center; }

.barra { display: flex; align-items: center; gap: 14px; background: #14202e; color: #e8edf3; padding: 10px 18px; flex-wrap: wrap; }
.barra a { color: #c6d2df; text-decoration: none; padding: 4px 8px; border-radius: 6px; }
.barra a:hover { background: #22334a; color: #fff; }
.barra .marca { font-weight: 700; color: #fff; margin-right: 8px; }
.barra .spacer { flex: 1; }
.barra .usuario { color: #8fa3b8; font-size: 14px; }

.contenido { max-width: 1180px; margin: 24px auto; padding: 0 16px; }
h1 small { color: #667; font-weight: 400; }
a { color: #1454a0; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid #e7eaee; font-size: 14px; }
th { background: #eef1f5; }
tr:last-child td { border-bottom: none; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

.tarjeta { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 18px; max-width: 560px; display: flex; flex-direction: column; gap: 12px; }
.tarjeta.login { width: 340px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
label.check { flex-direction: row; align-items: flex-start; gap: 8px; }
input, select { padding: 8px 10px; border: 1px solid #c9d1da; border-radius: 6px; font-size: 14px; }
input:focus, select:focus { outline: 2px solid #7fb0e5; border-color: #7fb0e5; }

button, .boton { background: #1454a0; color: #fff; border: none; border-radius: 6px; padding: 9px 16px; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .boton:hover { background: #0f4486; }
button.link { background: none; color: #1454a0; padding: 0; text-decoration: underline; }
button.peligro { background: #a02828; }
button.peligro:hover { background: #7f1f1f; }
.peligro-texto { color: #a02828 !important; }
.peligro-borde { border: 1px solid #a02828; margin-top: 18px; }

.aviso { padding: 10px 14px; border-radius: 6px; margin: 10px 0; font-size: 14px; }
.aviso.ok { background: #e5f4e8; color: #1d5c2a; }
.aviso.error { background: #fbe9e9; color: #7f1f1f; }
.nota { background: #fdf6e3; border: 1px solid #e8d9a0; padding: 8px 12px; border-radius: 6px; font-size: 13px; }

.filtros { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; align-items: center; }
.paginacion { display: flex; gap: 14px; align-items: center; margin: 14px 0; }

.tarjetas { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.tarjetas .tarjeta { min-width: 170px; text-decoration: none; color: #1c2430; display: flex; flex-direction: column; align-items: center; padding: 22px; }
.tarjetas .tarjeta:hover { outline: 2px solid #1454a0; }
.tarjetas strong { font-size: 30px; }

dl.detalle { display: grid; grid-template-columns: 200px 1fr; gap: 6px 14px; background: #fff; padding: 16px; border-radius: 8px; }
dl.detalle dt { font-weight: 600; font-size: 13px; color: #556; }
dl.detalle dd { margin: 0; overflow-x: auto; }
dl.detalle pre { margin: 0; font-size: 12px; max-width: 720px; white-space: pre-wrap; }

form.inline { display: inline; }
fieldset { border: 1px solid #d5dbe2; border-radius: 8px; display: flex; flex-direction: column; gap: 8px; }
legend { font-size: 13px; font-weight: 600; color: #556; }

/* Dashboard de inicio */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 16px 0; }
.kpi { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 18px 20px; text-decoration: none; color: #1c2430; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.kpi:hover { outline: 2px solid #1454a0; }
.kpi strong { font-size: 28px; }
.kpi span { font-size: 13px; color: #556; text-align: center; }

.dashboard { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; align-items: start; margin-top: 8px; }
.dashboard h2 { font-size: 16px; margin: 0 0 10px; }
.dashboard aside { display: flex; flex-direction: column; gap: 14px; }
.dashboard .tarjeta { max-width: none; }
.barra-fila { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.barra-etiqueta { flex: 0 0 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-pista { flex: 1; background: #eef2f7; border-radius: 4px; height: 10px; overflow: hidden; }
.barra-relleno { display: block; height: 100%; background: #1454a0; border-radius: 4px; }
.barra-valor { flex: 0 0 auto; font-weight: 600; }
@media (max-width: 900px) { .dashboard { grid-template-columns: 1fr; } }

/* Listas: cabecera con título y acción principal */
.lista-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lista-cabecera h1 { margin: 10px 0; }

/* Checkboxes de selección en tablas */
input[type="checkbox"] { width: 16px; height: 16px; accent-color: #1454a0; cursor: pointer; vertical-align: middle; }
.col-check { width: 40px; text-align: center; }
.col-estado { width: 70px; text-align: center; font-size: 16px; cursor: help; }
tr:hover td { background: #f7f9fc; }

/* Acciones masivas: barra en grupos sobre la tabla */
.bloque-masivo { margin: 12px 0; }
.acciones-masivas {
  max-width: none;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 20px;
  padding: 14px 18px;
  margin-bottom: 14px;
}
.acciones-masivas .grupo { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; padding-right: 20px; border-right: 1px solid #e7eaee; }
.acciones-masivas .grupo:last-child { border-right: none; padding-right: 0; }
.grupo-titulo { flex-basis: 100%; font-size: 12px; font-weight: 600; color: #556; text-transform: uppercase; letter-spacing: .04em; }
.acciones-masivas input[type="text"], .acciones-masivas input[type="password"] { min-width: 220px; }

/* Botón secundario (borde, para acciones de fondo sobre formularios anchos) */
button.secundario, .boton.secundario { background: #fff; color: #1454a0; border: 1px solid #1454a0; }
button.secundario:hover, .boton.secundario:hover { background: #eef4fb; }
button.peligro.secundario, .boton.peligro.secundario { color: #a02828; border-color: #a02828; }
button.peligro.secundario:hover, .boton.peligro.secundario:hover { background: #fbe9e9; }

/* Configuración de alertas: secciones, etiquetas y vista previa */
.tarjeta.ancha { max-width: 880px; }
.tarjeta.seccion { max-width: 880px; margin-bottom: 14px; }
.tarjeta.seccion h2 { border-top: none; padding-top: 0; margin: 0 0 12px; }
.seccion-cabecera { margin-bottom: 10px; }
.seccion-cabecera h2 { margin-bottom: 4px; }
.tarjeta .acciones-forma { display: flex; flex-direction: row; gap: 10px; }
textarea { padding: 8px 10px; border: 1px solid #c9d1da; border-radius: 6px; font-size: 13px; font-family: ui-monospace, Consolas, monospace; }
textarea:focus { outline: 2px solid #7fb0e5; border-color: #7fb0e5; }
input.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.nota-inline { margin: -4px 0 10px; font-size: 13px; color: #556; }
.seccion .nota-inline { margin-top: 0; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 14px; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; background: #eef2f7; border-radius: 6px; padding: 4px 8px; }
.chip code { font-family: ui-monospace, Consolas, monospace; color: #1454a0; font-size: 12px; }
.chip small { color: #556; font-size: 11px; }
.preview-email { border: 1px solid #d5dbe2; border-radius: 8px; overflow: hidden; margin-top: 10px; }
.preview-cabeza { background: #eef1f5; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid #e7eaee; }
.preview-cabeza .grupo-titulo { flex-basis: auto; }
.preview-cabeza .fila { display: flex; gap: 10px; font-size: 13px; }
.preview-cabeza .fila span { flex: 0 0 60px; color: #556; }
.preview-email pre { margin: 0; padding: 14px; background: #fff; white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.preview-marco { display: block; width: 100%; height: 480px; border: 0; background: #f4f5f7; }
