/* SIER simulado: réplica visual de las pantallas del PDF (v10.0.0). Todo va bajo .sier para no chocar con la app. */
.sier {
  --s-navy: #1b1f6e;
  --s-azul: #0b5ed7;
  --s-azul2: #1565c0;
  --s-rojo: #e5484d;
  --s-naranja: #f39a1e;
  --s-verde: #9be89b;
  --s-gris: #e9e9e9;
  --s-borde: #c9c9c9;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 560px;
  overflow: auto;
  container: sier / inline-size; /* se adapta al ancho del contenedor (lecciones, celular) */
  font: 13px/1.35 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: #1d1d1d;
  background: #f3f3f3;
  -webkit-text-size-adjust: 100%;
  outline: none;
}
.sier *, .sier *::before, .sier *::after { box-sizing: border-box; }
.sier button { font: inherit; cursor: pointer; }
.sier svg { display: block; }

/* ---------- logo ---------- */
.sier-logo { display: flex; align-items: center; gap: 8px; }
.sier-logo img { width: 62px; height: auto; }
.sier-logo-sep { width: 1.5px; align-self: stretch; background: #707070; margin: 4px 0; }
.sier-logo-txt { font-size: 11px; line-height: 1.02; color: #26346e; letter-spacing: .3px; }
.sier-logo-txt b { font-weight: 700; }
.sier-logo-txt em { font-style: normal; color: #ef8d1d; }
.sier-logo-grande img { width: 104px; }
.sier-logo-grande .sier-logo-txt { font-size: 21px; font-weight: 300; }

/* ---------- login ---------- */
.sier-fondo-login {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 30%, #2f3c6d 0%, #18213f 70%, #10172e 100%);
}
.sier-ventana-login, .sier-splash {
  position: relative; width: min(400px, 100%); background: #fbfcfd; border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); overflow: hidden;
}
.sier-splash { padding: 26px 22px 14px; text-align: center; }
.sier-splash .sier-logo { justify-content: center; }
.sier-splash p { margin: 12px 0 4px; color: #3a4565; }
.sier-splash-barra { height: 4px; background: #dde3ef; border-radius: 2px; overflow: hidden; margin-top: 22px; }
.sier-splash-barra span { display: block; height: 100%; width: 40%; background: var(--s-azul); animation: sier-carga 1s ease-in-out infinite; }
@keyframes sier-carga { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.sier-cerrar-rojo {
  position: absolute; top: 0; right: 0; width: 30px; height: 26px; border: 0; background: #c4302b; color: #fff;
  font-size: 20px; line-height: 1; z-index: 2;
}
.sier-login-cab { padding: 22px 18px 12px; background: #fff; border-bottom: 1px solid #e3e6ee; }
.sier-login-cab .sier-logo { justify-content: center; }
.sier-login-sub { text-align: center; font-weight: 700; font-size: 11.5px; letter-spacing: .4px; color: #444; padding: 6px; border-bottom: 3px solid #1c2448; background: #f4f6fa; }
.sier-login-form { padding: 22px 34px 4px; display: grid; gap: 16px; }
.sier-campo {
  display: flex; align-items: center; gap: 8px; background: #fff; border-bottom: 1.5px solid #c9d0de;
  padding: 10px 8px; box-shadow: 0 1px 3px rgba(20,30,60,.08); border-radius: 3px 3px 0 0;
}
.sier-campo svg { width: 22px; height: 22px; flex: none; }
.sier-campo .ic-azul { color: #1b73d3; }
.sier-campo .ic-naranja { color: #f08c1a; }
.sier-campo input { border: 0; outline: none; flex: 1; min-width: 0; font: inherit; font-size: 13px; background: transparent; color: #222; letter-spacing: .3px; }
.sier-campo input::placeholder { color: #6a7390; font-size: 12px; }
.sier-campo:focus-within { border-bottom-color: var(--s-azul); }
.sier-check { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #555; user-select: none; }
.sier-check input { width: 16px; height: 16px; accent-color: #1a73e8; margin: 0; }
.sier-btn-login {
  border: 0; border-radius: 3px; padding: 12px; background: #1f8fe6; color: #fff; font-weight: 700; font-size: 12.5px;
  letter-spacing: .6px; box-shadow: 0 2px 4px rgba(0,0,0,.18);
}
.sier-btn-login.es-test { background: #f39a1e; }
.sier-btn-login:disabled { opacity: .7; cursor: progress; }
.sier-login-estado { min-height: 16px; margin: -6px 0 0; font-size: 11.5px; color: #3a4565; text-align: center; }
.sier-version { text-align: center; font-weight: 700; font-size: 12px; color: #fff; background: #1b2147; padding: 8px 6px 7px; margin-top: 8px; }
.sier-version small { font-weight: 600; font-size: 10px; opacity: .9; }
.sier-splash .sier-version { margin: 16px -22px -14px; }

/* ---------- diálogos (estilo Windows) ---------- */
.sier-capa { position: fixed; inset: 0; background: rgba(10,15,30,.35); display: grid; place-items: center; padding: 16px; z-index: 50; }
.sier-dialogo {
  width: min(460px, 100%); background: #f0f0f0; border: 1px solid #6f6f6f; box-shadow: 0 8px 30px rgba(0,0,0,.4);
  max-height: 100%; overflow: auto;
}
.sier-dialogo-tit { display: flex; align-items: center; gap: 8px; background: #fff; padding: 6px 4px 6px 10px; font-size: 13px; }
.sier-dialogo-tit svg { width: 18px; height: 18px; }
.sier-dialogo-tit span { flex: 1; }
.sier-x { border: 0; background: transparent; font-size: 22px; line-height: 1; width: 36px; height: 28px; color: #111; }
.sier-x:hover { background: #e81123; color: #fff; }
.sier-dialogo-cuerpo { display: flex; gap: 14px; padding: 20px 18px 14px; background: #fff; }
.sier-dialogo-ico svg { width: 34px; height: 34px; }
.sier-dialogo-msg { margin: 4px 0 0; font-size: 13.5px; }
.sier-dialogo-det { margin: 8px 0 0; font-size: 12px; color: #555; white-space: pre-line; }
.sier-dialogo-bot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px 14px; background: #f0f0f0; border-top: 1px solid #dfdfdf; }
.sier-btn-win { min-width: 86px; padding: 5px 14px; background: #e1e1e1; border: 1px solid #adadad; color: #111; }
.sier-btn-win:hover:not(:disabled) { background: #e5f1fb; border-color: #0078d7; }
.sier-btn-win:focus-visible { outline: 2px solid #0078d7; outline-offset: 1px; }
.sier-btn-win:disabled { color: #8a8a8a; cursor: default; }
.sier-btn-win.grande { min-width: 0; flex: 1; padding: 14px; background: #f3f3f3; box-shadow: 2px 2px 0 #9a9a9a; }
.sier-dialogo-init .sier-dialogo-ver { text-align: center; font-size: 12px; font-weight: 700; padding: 6px; background: #1b2147; color: #fff; }

/* Configuración de la clave (como en el PDF) */
.sier-clave { width: min(470px, 100%); background: #ecebe6; }
.sier-clave-form { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 6px; align-items: center; padding: 26px 14px 16px; }
.sier-clave-form label { font-size: 12.5px; white-space: nowrap; }
.sier-clave-form input { border: 1px solid #7a7a7a; padding: 3px 5px; font: inherit; min-width: 0; background: #fff; }
.sier-rojo { color: #e0201b; font-size: 12px; white-space: nowrap; }
.sier-clave-bot { grid-column: 1 / -1; display: flex; gap: 22px; margin-top: 22px; }

/* ---------- pantalla principal ---------- */
.sier-app {
  position: absolute; inset: 0; display: grid; grid-template-columns: 212px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px; padding: 8px 8px 0; background: #f0f0f0;
}
.sier-lateral { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.sier-lat-logo { background: #fff; border-radius: 4px; padding: 10px 8px 6px; box-shadow: 0 1px 2px rgba(0,0,0,.15); text-align: center; }
.sier-lat-logo .sier-logo { justify-content: center; }
.sier-lat-logo .sier-logo img { width: 58px; }
.sier-lat-logo .sier-logo-txt { font-size: 11px; }
.sier-lat-logo i { display: block; font-family: "Brush Script MT", "Segoe Script", cursive; color: #2a3a8a; font-size: 14px; margin-top: 2px; }
.sier-lat-usuario { background: #c4c4c4; padding: 20px 8px; display: grid; gap: 12px; text-align: center; color: var(--s-navy); font-size: 12px; }
.sier-menu { background: #fff; flex: 1; padding: 8px 18px; display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.sier-menu button {
  display: flex; align-items: center; gap: 10px; text-align: left; border: 0; border-bottom: 1px solid #e3e3e3; background: transparent;
  padding: 14px 8px; font-size: 12px; color: #222; position: relative;
}
.sier-menu button svg { width: 28px; height: 28px; flex: none; }
.sier-menu button:hover { background: #f4f6fb; }
.sier-menu button.activo { background: #eeeeee; }
.sier-menu button.activo::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; background: var(--s-azul); border-radius: 2px; }
.sier-main { display: flex; flex-direction: column; min-height: 0; gap: 8px; }
.sier .sier-titulo { display: block; margin: 0; background: var(--s-navy); color: #fff; text-align: center; font-weight: 700; font-size: 17px; padding: 6px; }
.sier-panel { flex: 1; min-height: 0; background: #fff; border: 1px solid #ddd; padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.sier-bienvenida { margin: auto; text-align: center; color: #333; font-size: 14px; }
.sier-tenue { color: #666; font-size: 12px; }
.sier-cab-modo { background: var(--s-navy); color: #fff; text-align: center; padding: 4px 6px 3px; display: grid; }
.sier-cab-modo b { font-size: 18px; letter-spacing: .3px; }
.sier-cab-modo span { font-size: 11px; font-weight: 600; }
.sier-botones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sier-bt { display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 3px; color: #fff; padding: 10px 6px; font-weight: 700; font-size: 16px; position: relative; }
.sier-bt svg { width: 22px; height: 22px; position: absolute; left: 14px; }
.sier-bt.azul { background: var(--s-azul2); }
.sier-bt.azul:hover { background: #0f56a8; }
.sier-bt.rojo { background: var(--s-rojo); }
.sier-bt.rojo:hover { background: #cf3a3f; }
.sier-bt.trabajando { opacity: .7; cursor: progress; }
.sier-cuerpo { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.05fr 2fr 2.05fr; gap: 6px; }
.sier-col { display: flex; flex-direction: column; min-height: 0; gap: 4px; }
.sier-subt { background: #f2f2f2; border: 1px solid #d5d5d5; text-align: center; padding: 1px 4px; font-size: 12.5px; }
.sier table { border-collapse: collapse; width: 100%; font-size: 11.5px; }
.sier th { font-weight: 400; text-align: left; background: #fff; padding: 6px 5px; border-bottom: 1px solid #ddd; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.sier td { padding: 5px; border-bottom: 1px solid #eee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
.sier-tabla-tx { flex: 1; min-height: 0; overflow: auto; border: 1px solid #d5d5d5; }
.sier-buscar-fila td { background: #fdf8e4; padding: 0; }
.sier-buscar-fila input { width: 100%; border: 0; background: transparent; padding: 6px 5px; font: inherit; font-style: italic; }
.sier-tx-total { align-self: flex-end; border: 1px solid #d5d5d5; padding: 4px 10px; font-size: 12px; margin: 2px 0; }
.sier-imagenes { flex: 3; min-height: 0; overflow: auto; border: 1px solid #c4c4c4; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px 14px; padding: 8px; align-content: start; background: #fff; }
.sier-img { margin: 0; text-align: center; }
.sier-img img { width: 100%; aspect-ratio: 210 / 297; background: #fff; filter: grayscale(1) contrast(1.35) brightness(1.03); box-shadow: 0 0 0 1px #ddd; }
.sier-img figcaption { font-size: 9.5px; letter-spacing: -.1px; margin-top: 2px; word-break: break-all; }
.sier-img.sin { cursor: pointer; }
.sier-img.sin img { box-shadow: 0 0 0 2px #e5484d; }
.sier-mensajes { flex: 2; min-height: 90px; overflow: auto; border: 1px solid #c4c4c4; }
.sier-mensajes td { max-width: none; white-space: normal; }
.sier-mensajes td:nth-child(3) { color: #8a6d00; }
.sier-mensajes tr.m-advertencia td:nth-child(3) { color: #a35a00; }
.sier-mensajes tr.m-error td:nth-child(3) { color: #c4302b; }
.sier-mensajes small { color: #888; }
.sier-tabla-ctl { flex: 1.3; min-height: 0; overflow: auto; border: 1px solid #c4c4c4; }
.sier-tabla-ctl th { background: #fff; font-size: 11px; padding: 6px 4px; }
.sier-tabla-ctl td { font-weight: 700; padding: 3px 4px; border-bottom: 1px solid #fff; }
.sier-tabla-ctl td.c svg { width: 16px; height: 16px; margin: auto; }
.sier-tabla-ctl td.n { text-align: center; }
.sier-tabla-ctl tr.verde td { background: var(--s-verde); }
.sier-tabla-ctl tr.blanca td { background: #fff; border-bottom-color: #eee; cursor: pointer; font-weight: 400; }
.sier-tabla-ctl tr.blanca:hover td { background: #fff9e0; }
.sier-tabla-ctl tr.localizada td { background: #fff4c2; }
.sier-tabla-ctl tr.error-tx td { background: #f7c6c6; }
.sier-sin-reconocer { flex: 1; }
.sier-pie { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; background: #f7f7f7; border-top: 1px solid #ddd; margin: 0 -8px; padding: 12px 16px; font-weight: 700; font-size: 13px; flex-wrap: wrap; }
.sier-pie-sep { width: 1px; height: 22px; background: #bbb; }
.sier-escaneando { position: absolute; inset: 0; background: rgba(255,255,255,.75); display: grid; place-items: center; z-index: 5; }
.sier-escaneando[hidden] { display: none; }
.sier-escaneando > div { text-align: center; color: var(--s-navy); font-weight: 600; }
.sier-hoja { display: block; width: 46px; height: 62px; margin: 0 auto 8px; border: 2px solid var(--s-navy); background: linear-gradient(#fff 0 0) no-repeat, #fff; position: relative; overflow: hidden; }
.sier-hoja::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: #2ea3ff; box-shadow: 0 0 8px #2ea3ff; animation: sier-luz .9s linear infinite; }
@keyframes sier-luz { from { top: 0; } to { top: 100%; } }

/* buscar / reporte */
.sier-buscar { width: min(620px, 100%); }
.sier-buscar-cuerpo { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; padding: 14px; background: #fff; }
.sier-buscar-img img { width: 100%; aspect-ratio: 210/297; filter: grayscale(1) contrast(1.3); box-shadow: 0 0 0 1px #ccc; background: #fff; }
.sier-buscar form { display: grid; gap: 8px; align-content: start; }
.sier-buscar label { display: grid; gap: 2px; font-size: 12px; }
.sier-buscar input, .sier-buscar select { border: 1px solid #7a7a7a; padding: 5px 6px; font: inherit; font-size: 14px; background: #fff; }
.sier-buscar .sier-dialogo-bot { background: transparent; border: 0; padding: 4px 0 0; justify-content: flex-start; }
.sier-buscar-res { min-height: 18px; margin: 0; font-size: 12.5px; }
.sier-buscar-res.bien { color: #1e7e34; font-weight: 600; }
.sier-buscar-res.mal { color: #c4302b; }
.sier-reporte-cuerpo { background: #fff; padding: 12px 16px; }
.sier-reporte td.n { text-align: center; }
.sier-reporte td { max-width: none; }

/* ---------- móvil / contenedor angosto ---------- */
@container sier (max-width: 860px) {
  .sier-app { position: relative; inset: auto; grid-template-columns: minmax(0, 1fr); min-height: 100%; }
  .sier-main, .sier-panel, .sier-col, .sier-lateral { min-width: 0; }
  .sier-lateral { flex-direction: row; flex-wrap: wrap; }
  .sier-lat-logo { display: none; }
  .sier-lat-usuario { width: 100%; padding: 6px; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 11px; }
  .sier-menu { flex-direction: row; overflow-x: auto; padding: 0 4px; width: 100%; }
  .sier-menu button { border-bottom: 0; padding: 8px; flex: none; }
  .sier-menu button.activo::before { left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 3px; }
  .sier-titulo { font-size: 14px; }
  .sier-panel { padding: 8px; }
  .sier-botones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sier-bt { font-size: 14px; }
  .sier-bt svg { position: static; }
  .sier-cuerpo { grid-template-columns: minmax(0, 1fr); }
  .sier-col-ctl { order: -1; }
  .sier-tabla-ctl, .sier-imagenes, .sier-tabla-tx, .sier-mensajes { max-height: 260px; min-height: 120px; }
  .sier-tabla-ctl th:nth-child(n+7):not(:last-child), .sier-tabla-ctl td:nth-child(n+7):not(:last-child) { display: none; }
  .sier-imagenes { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .sier-pie { font-size: 11.5px; padding: 8px 12px; }
  .sier-pie-sep { display: none; }
  .sier-buscar-cuerpo { grid-template-columns: 1fr; }
  .sier-buscar-img { max-width: 140px; }
  .sier-logo-grande .sier-logo-txt { font-size: 17px; }
  .sier-logo-grande img { width: 84px; }
}

/* Vista del acta física en la ventana de búsqueda (en la vida real, el operador la tiene en la mano) */
.sier-papel { margin-top: 8px; background: #fffef8; border: 1px solid #d8d2bf; box-shadow: 2px 2px 0 #e9e4d4; padding: 8px 10px; font: 12px/1.45 Arial, sans-serif; color: #111; }
.sier-papel-tit { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #8a7a50; margin-bottom: 4px; }
.sier-papel b { font-family: "Courier New", monospace; font-size: 14px; letter-spacing: .5px; }
.sier-papel-barras svg { width: 100%; height: 40px; display: block; }

/* Los diálogos cubren la pantalla (en celular el simulador es más alto que la vista) */
.sier-capa .sier-dialogo { max-height: calc(100vh - 32px); overflow: auto; }
