/* Centro de control del motor: sólo lo propio de esta pantalla.
   Tokens, marco, paneles y tablas vienen de css/erp.css, que se carga antes. */

h1,h2,h3{font-family:'Plus Jakarta Sans',sans-serif;color:var(--text-title);letter-spacing:-.02em;margin:0}
.brand{display:flex;align-items:center;gap:10px;padding:4px 8px 10px;text-decoration:none}
.navlink[aria-current="page"]{background:var(--navy-800);color:#fff;font-weight:600;box-shadow:inset 2px 0 0 var(--teal-500)}
.navlink .tag{margin-left:auto;flex:none;font-family:'Geist Mono',monospace;font-size:10px;font-weight:600;
  padding:1px 7px;border-radius:var(--radius-full);background:var(--navy-800);color:#64748B;white-space:nowrap}
.navlink.soon{opacity:.4;pointer-events:none}
.navfoot a{color:#94A3B8;text-decoration:none;font-size:12px;font-weight:600}
.navfoot a:hover{color:#E2E8F0;text-decoration:underline}
.topbar .pick{display:flex;align-items:center;gap:8px}
.topbar .pick label{font-size:11px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--text-muted)}
.wrap{max-width:1180px;width:100%;margin:0 auto;padding:28px 22px 64px}

/* ---------- Encabezado ---------- */
.masthead{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-start;justify-content:space-between;margin-bottom:26px}
.masthead h1{font-size:clamp(23px,3vw,31px);font-weight:800}
.masthead p{margin:8px 0 0;color:var(--text-muted);max-width:60ch;font-size:14px}

/* ---------- Estado de carga ---------- */
#status{display:inline-flex;align-items:center;gap:7px;margin:0;font-size:11.5px;font-weight:600;
  color:var(--text-muted);background:var(--surface);border:1px solid var(--border-sand-strong);
  border-radius:var(--radius-full);padding:4px 12px}
#status::before{content:"";width:7px;height:7px;border-radius:var(--radius-full);background:var(--teal-500);flex:none}
#status[data-error="true"]{color:var(--rose-600);border-color:var(--rose-100);background:var(--rose-50)}
#status[data-error="true"]::before{background:var(--rose-600)}

/* ---------- Paneles ---------- */
.panel{background:var(--surface);border:1px solid var(--border-sand);border-radius:var(--radius-lg);
  box-shadow:var(--shadow-card);overflow:hidden;margin-bottom:20px}
.grid-2{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:20px;align-items:start}
@media (max-width:980px){.grid-2{grid-template-columns:1fr}}

/* ---------- Formulario ---------- */
#settings fieldset{border:0;padding:0;margin:0;min-width:0}
#settings fieldset[disabled]{opacity:.62}
.field .help{font-size:12px;color:var(--text-light);margin:6px 0 0}
select{width:100%;font:inherit;font-size:13.5px;color:var(--text-title);background:var(--surface);
  border:1px solid var(--border-sand-strong);border-radius:var(--radius-sm);padding:9px 11px}
select:focus-visible{outline:2px solid var(--sky-600);outline-offset:-1px}
select:disabled{background:var(--surface-subtle);color:var(--text-light);cursor:not-allowed}
.topbar select{width:auto;min-width:210px;font-weight:600;box-shadow:var(--shadow-subtle)}

/* ---------- Botones ---------- */
button{font:inherit;font-size:13px;font-weight:600;padding:9px 15px;border-radius:var(--radius-sm);
  cursor:pointer;border:1px solid transparent;transition:transform .12s,background .15s}
button:active{transform:translateY(1px)}
button[type="submit"]{background:var(--navy-900);color:#fff;box-shadow:0 4px 12px rgba(15,23,42,.22)}
button[type="submit"]:hover{background:var(--navy-800)}
#refresh{background:var(--surface);color:var(--text-body);border-color:var(--border-sand-strong)}
#refresh:hover{background:var(--surface-hover)}
button:disabled{opacity:.45;cursor:not-allowed;transform:none}
button:focus-visible{outline:2px solid var(--sky-600);outline-offset:2px}

/* ---------- Notas ---------- */
.note{padding:11px 13px;border-left:3px solid var(--teal-500);background:var(--teal-50);
  border-radius:0 var(--radius-sm) var(--radius-sm) 0;font-size:12.5px;color:var(--text-body);margin:0}
.note b{color:var(--text-title)}
#gateway,#updated{font-size:12.5px;color:var(--text-muted);margin:0}
#gateway{padding:9px 12px;background:var(--surface-subtle);border:1px solid var(--border-sand);
  border-radius:var(--radius-sm);margin-bottom:15px}
/* El guion los vacía entre consultas; sin esto quedan recuadros huecos. */
#gateway:empty,#updated:empty{display:none}
#updated{margin-top:12px;font-family:'Geist Mono',monospace;font-size:11.5px;color:var(--text-light)}

/* ---------- Reglas del servidor ---------- */
.guard{list-style:none;margin:0;padding:0}
.guard li{display:flex;gap:12px;padding:12px 0;border-bottom:1px dashed var(--border-sand)}
.guard li:last-child{border-bottom:none;padding-bottom:0}
.guard .code{font-family:'Geist Mono',monospace;font-size:10.5px;font-weight:600;color:var(--text-light);
  border:1px solid var(--border-sand-strong);border-radius:var(--radius-sm);padding:2px 7px;
  background:var(--surface-subtle);white-space:nowrap;align-self:flex-start;margin-top:1px}
.guard .what b{display:block;font-size:13.5px;font-weight:600;color:var(--text-title)}
.guard .what > span{font-size:12.5px;color:var(--text-muted)}

/* ---------- Listas que dibuja el guion ----------
   #evidence y #pending reciben <article> con <strong>, <p>, <details>, <pre>. */
.records{padding:0}
.records article{padding:15px 18px;border-bottom:1px solid var(--border-sand)}
.records article:last-child{border-bottom:none}
.records article strong{display:block;font-size:13.5px;font-weight:600;color:var(--text-title);
  font-family:'Geist Mono',monospace;letter-spacing:-.01em}
.records article p{margin:5px 0 0;font-size:12.5px;color:var(--text-muted);overflow-wrap:anywhere}
.records > p{padding:18px;margin:0;font-size:13px;color:var(--text-light)}
.records details{margin-top:9px}
.records summary{cursor:pointer;font-size:12px;font-weight:600;color:var(--sky-600);width:fit-content}
.records summary:focus-visible{outline:2px solid var(--sky-600);outline-offset:2px}
.records pre{margin:9px 0 0;padding:12px;background:var(--navy-950);color:#E2E8F0;
  border-radius:var(--radius-sm);font-family:'Geist Mono',monospace;font-size:11px;line-height:1.6;
  white-space:pre-wrap;overflow-wrap:anywhere;max-height:460px;overflow-y:auto}

.foot{margin-top:6px;padding:16px 18px;border:1px dashed var(--border-sand-strong);
  border-radius:var(--radius-md);font-size:12.5px;color:var(--text-muted);background:var(--surface)}

/* ---------- Angosto ---------- */
@media (max-width:920px){
  .app{grid-template-columns:minmax(0,1fr)}
  .sidenav{position:static;height:auto;min-width:0;flex-direction:row;overflow-x:auto;
    align-items:center;gap:6px;padding:10px 14px}
  .brand{padding:0 12px 0 2px;flex:none} .brand small{display:none}
  .navgroup,.navfoot{display:none}
  .navlink{flex:none}
  .topbar{padding:10px 16px}
  .wrap{padding:22px 16px 48px}
  .topbar select{min-width:0}
}
