:root {
  --teal: #1f6f6b;
  --teal-d: #155350;
  --bg: #f4f7f7;
  --card: #ffffff;
  --ink: #1c2b2a;
  --muted: #6b7d7c;
  --line: #e2eae9;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: Segoe UI, Roboto, system-ui, sans-serif;
  background: var(--bg); color: var(--ink);
}
.topbar {
  display: flex; align-items: center; gap: .75rem;
  background: var(--teal); color: #fff; padding: .7rem 1.2rem;
}
.brand { font-weight: 700; letter-spacing: .3px; color: #fff; text-decoration: none; font-size: 1.05rem; }
.topnav { display: flex; gap: .25rem; align-items: center; margin-left: 1rem; flex-wrap: wrap; }
.topnav a { color: #fff; text-decoration: none; padding: .35rem .75rem; border-radius: 7px; font-size: .9rem; opacity: .9; }
.topnav a:hover { background: rgba(255,255,255,.18); opacity: 1; }
.topnav-current { color: #fff; background: rgba(255,255,255,.22); padding: .3rem .75rem; border-radius: 999px; font-size: .85rem; margin-left: .3rem; }
.spacer { flex: 1; }
.user { opacity: .9; font-size: .9rem; }
.btn-ghost { color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.5);
  padding: .25rem .6rem; border-radius: 6px; font-size: .85rem; }
.container { max-width: 1000px; margin: 1.5rem auto; padding: 0 1.2rem; }
h1 { margin: .2rem 0; } h2 { margin-top: 0; }
.muted { color: var(--muted); }
small.muted { font-weight: 400; font-size: .9rem; }

/* Login */
.login-card {
  max-width: 360px; margin: 8vh auto; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 2rem;
  text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.06);
}
.login-card .logo { font-size: 2.4rem; }
.login-card label { display: block; text-align: left; font-size: .85rem; color: var(--muted); margin-top: 1rem; }
.login-card input {                     /* usuario y contraseña, iguales */
  width: 100%; padding: .6rem; margin-top: .3rem;
  border: 1px solid var(--line); border-radius: 8px; font-size: 1rem;
}
button {
  margin-top: 1.2rem; width: 100%; background: var(--teal); color: #fff;
  border: 0; padding: .7rem; border-radius: 8px; font-size: 1rem; cursor: pointer;
}
button:hover { background: var(--teal-d); }
.hint { color: var(--muted); font-size: .8rem; margin-top: 1rem; }
.error { color: #b3261e; background: #fdecea; padding: .5rem; border-radius: 8px; }

/* Dashboard */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-top: 1rem; }
.card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 1.1rem; text-decoration: none; color: inherit;
  transition: transform .08s, box-shadow .08s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.08); }
.card h3 { margin: 0 0 .3rem; color: var(--teal-d); }
.badge { display: inline-block; margin-top: .6rem; font-size: .72rem; padding: .15rem .5rem; border-radius: 999px; }
.badge.on { background: #e3f3ef; color: var(--teal-d); }
.badge.off { background: #eee; color: #888; }

/* Laboratorio */
/* La columna del contenido nunca pasa del contenedor (minmax(0, …)): con «1fr» una tabla ancha la estiraba
   y la página quedaba corrida a la derecha, cortada (lista de muestras, 23/09/2026).
   Las pantallas de la sucursal miden lo que necesita su contenido —entre los 1000 px de siempre y 1400— y
   quedan centradas: ni corridas ni estiradas con un hueco al costado (detalle de muestra, 23/09/2026).
   Las listas de muchas columnas (Muestras, Órdenes) aprovechan el ancho, hasta 1400. */
.lab-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.4rem; }
main.container:has(> .lab-layout) { width: fit-content; min-width: min(1000px, 100%); max-width: min(1400px, 100%); }
main.container:has(> .lab-layout .mu-tabla-wrap) { width: auto; }
/* Lo que decide ese ancho es el contenido (tablas, formularios): los avisos y las migas no, su texto se
   parte (un aviso largo en un renglón llevaba la pantalla a 1400). */
.lab-layout .aviso, .lab-layout .aviso-deuda, .lab-layout .md-migas { contain: inline-size; }
/* Usuarios (29/09/2026): su tabla de muchas columnas no entraba en los 1000 px de la administración y quedaba
   cortada, con la barra para deslizarla abajo de todo. Como las pantallas de la sucursal, la página mide lo que su
   tabla —desde los 1000 px de siempre hasta el ancho de la ventana— y recién si no entra, la tabla se desliza.
   Los avisos no deciden ese ancho: su texto se parte. */
main.container:has(.tabla-scroll) { width: fit-content; min-width: min(1000px, 100%); max-width: 100%; }
main.container:has(.tabla-scroll) > .aviso, main.container:has(.tabla-scroll) .panel-body > p,
main.container:has(.tabla-scroll) .panel:has(.admin-form) { contain: inline-size; }
/* la tabla, a su ancho: con un ancho en % (width o min-width) ocupaba toda la ventana y la página también */
table.data.tabla-usuarios { width: auto; }     /* más específica que «table.data { width: 100% }», que va después */
/* Detalle de muestra: mide lo que su lista de análisis, y lo demás (cabecera, pestañas, «Más detalles»,
   la barra de abajo) se acomoda a ella; así tampoco cambia de ancho al pasar a «Pagos». */
.md-pagina { width: 860px; max-width: 100%; }
.sidebar { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; height: fit-content; }
.sidebar h4 { margin: .2rem 0 .8rem; color: var(--teal-d); }
.sidebar nav { display: flex; flex-direction: column; gap: .15rem; }
.sidebar nav a { text-decoration: none; color: var(--ink); padding: .45rem .6rem; border-radius: 8px; font-size: .92rem; }
.sidebar nav a:hover { background: var(--bg); }
.sidebar nav a.active { background: var(--teal); color: #fff; }
.sidebar .back { display: inline-block; margin-top: 1rem; color: var(--muted); text-decoration: none; font-size: .85rem; }
/* «Firma del informe» (23/09/2026): debajo del menú y separado, cómo sale la firma al imprimir */
.firma-sel { margin-top: 1rem; padding-top: .75rem; border-top: 1px dashed #c9d6d5; }
.firma-sel-tit { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 0 0 .35rem .15rem; }
.sidebar .firma-op { display: grid; grid-template-columns: auto 1fr; column-gap: .45rem; align-items: start; margin: 0 0 .15rem;
  padding: .35rem .5rem; border: 1px solid transparent; border-radius: 8px; font-size: .84rem; color: var(--ink); cursor: pointer; }
.sidebar .firma-op input { margin: .18rem 0 0; accent-color: var(--teal); }
.sidebar .firma-op:hover { background: var(--bg); }
.sidebar .firma-op.activa { border-color: var(--teal); background: var(--bg); font-weight: 600; }
.sidebar .firma-op.apagada { opacity: .6; cursor: not-allowed; }
.sidebar .firma-op.apagada:hover { background: none; }
.firma-op-ico { display: inline-block; width: 1.1rem; text-align: center; }
.firma-op-ico svg { vertical-align: -1px; }
.firma-op-nota { grid-column: 2; font-size: .7rem; font-weight: 400; color: var(--muted); line-height: 1.25; margin-top: .1rem; }
.firma-aviso { margin: .4rem 0 0; padding: .3rem .45rem; border-radius: 6px; font-size: .74rem; color: #8a5300; background: #fff4dc; }
.firma-sel.guardando { opacity: .6; pointer-events: none; }
.content { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.3rem; }
.mt { margin-top: 1rem; } .mt2 { margin-top: 2rem; }
table.data { width: 100%; border-collapse: collapse; margin-top: .8rem; }
table.data th, table.data td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
table.data th { color: var(--muted); font-weight: 600; }
.cat-group { margin-top: 1.2rem; }
.cat-title { margin: 0 0 .2rem; color: var(--teal-d); border-bottom: 2px solid var(--line); padding-bottom: .25rem; }

/* Formularios (Registrar Paciente) */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; }
.content label { display: block; font-size: .8rem; color: var(--muted); margin-top: .7rem; }
.content input, .content select { width: 100%; padding: .5rem; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; background: #fff; }
.content input[readonly] { background: var(--bg); color: var(--muted); }
select.multi { height: auto; }
.content form button { width: auto; min-width: 170px; margin-top: 1.2rem; }
.btnlink { display: inline-block; background: var(--teal); color: #fff; text-decoration: none; padding: .5rem .9rem; border-radius: 8px; font-size: .9rem; }
.btnlink:hover { background: var(--teal-d); }

/* Editor de catálogo (estilo Biovida) */
.cat-tabs { display: flex; gap: .2rem; border-bottom: 2px solid var(--line); margin: .6rem 0 1rem; flex-wrap: wrap; }
.cat-tab { padding: .5rem .9rem; cursor: pointer; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -2px; font-size: .9rem; }
.cat-tab:hover { color: var(--ink); }
.cat-tab.active { color: var(--teal-d); border-bottom-color: var(--teal); font-weight: 600; }
/* Alta y edición de valores de referencia, dentro del catálogo. */
.cat-form { margin-top: .8rem; padding: .8rem 1rem; background: #f4faf9; border: 1px solid #d8ebe7; border-radius: 10px; }
.cat-form-titulo { font-weight: 700; color: var(--teal-d); margin-bottom: .6rem; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem .8rem; }
.cat-grid label { display: flex; flex-direction: column; font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; gap: .2rem; }
.cat-grid label.ancho { grid-column: 1 / -1; }
.cat-grid input, .cat-grid select { margin: 0; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; text-transform: none; letter-spacing: 0; color: var(--ink); background: #fff; }
.cat-sel { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.cat-sel label { display: block; font-size: .76rem; color: var(--muted); margin-bottom: .15rem; }
.cat-sel select { padding: .45rem; border: 1px solid var(--line); border-radius: 8px; min-width: 230px; background: #fff; }
.catbtns { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .9rem; }
.catbtns button { width: auto; min-width: 0; margin-top: 0; padding: .5rem .9rem; font-size: .9rem; }
.catbtns .ghost { background: #fff; color: var(--teal-d); border: 1px solid var(--line); }
.catbtns button:disabled { opacity: .55; cursor: not-allowed; }
td.rowdel { color: #c0392b; text-align: center; cursor: pointer; font-weight: 700; }

/* Asistente de registro (wizard) */
.wizard-steps { display: flex; gap: .5rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.wstep { padding: .5rem .9rem; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: .88rem; border: 1px solid var(--line); }
.wstep.active { background: var(--teal); color: #fff; border-color: var(--teal); font-weight: 600; }
.wstep.done { background: #e3f3ef; color: var(--teal-d); border-color: #cfe8e3; }
.rowbtns { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .3rem 0 .6rem; }
.rowbtns button { width: auto; min-width: 0; margin-top: 0; }
.total-line { text-align: right; font-size: 1.05rem; margin-top: .8rem; }
/* Pie del panel de análisis: la proforma a la izquierda, el total a la derecha. */
.si-pie { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.si-pie .total-line { margin: .8rem 0 0; }
.btn-quitar { width: auto; min-width: 0; margin: 0; padding: .3rem .6rem; background: #fdecea; color: #b3261e; font-size: .82rem; }
.wnav { display: flex; justify-content: space-between; margin-top: 1.4rem; }
.wnav button { width: auto; min-width: 150px; margin-top: 0; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: flex-start; justify-content: center; padding-top: 6vh; z-index: 50; }
.modal-box { background: #fff; border-radius: 14px; width: min(540px, 92vw); max-height: 84vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); padding: 1.2rem 1.3rem; }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; color: var(--teal-d); }
.modal-x { cursor: pointer; color: var(--muted); font-size: 1.1rem; }
.modal-search { width: 100%; padding: .55rem; margin: .8rem 0; border: 1px solid var(--line); border-radius: 8px; }
.modal-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.modal-list tr.pick-doctor, .modal-list tr.pick-paciente { cursor: pointer; }
.modal-list tr.pick-doctor:hover, .modal-list tr.pick-paciente:hover { background: #e3f3ef; }
.modal-nav { display: flex; align-items: center; justify-content: space-between; margin-top: .7rem; }
.modal-nav button { width: auto; min-width: 0; margin-top: 0; padding: .4rem .7rem; }
.modal-form label { display: block; font-size: .8rem; color: var(--muted); margin-top: .6rem; }
.modal-form input, .modal-form select { width: 100%; padding: .5rem; border: 1px solid var(--line); border-radius: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.2rem; }
.modal-actions button { width: auto; min-width: 110px; margin-top: 0; }

/* Resultados de muestra */
.small { font-size: .82rem; }
.teal { color: var(--teal-d); }
.badge-estado { display: inline-block; padding: .14rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.badge-estado.pendiente { background: #fff3d6; color: #9a6b00; }
.badge-estado.en-proceso { background: #e7f0fb; color: #1c5fb0; }
.badge-estado.llenado { background: #e3f3ef; color: var(--teal-d); }
.btnmini { font-size: .8rem; padding: .25rem .6rem; border-radius: 6px; background: var(--teal); color: #fff; text-decoration: none; }
.btnlink.ghost { background: #fff; color: var(--teal-d); border: 1.5px solid var(--teal); font-weight: 600; }
.muestra-head { display: flex; align-items: center; justify-content: space-between; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1rem; }
.ll { color: var(--teal-d); font-weight: 600; font-size: .82rem; }
.nl { color: #9a6b00; font-weight: 600; font-size: .82rem; }
.ana-title { color: var(--teal-d); border-bottom: 2px solid var(--line); padding-bottom: .2rem; margin-top: 1.4rem; }
.res-table input.res-input { width: 100%; padding: .35rem; border: 1px solid var(--line); border-radius: 6px; }
.res-input.fuera { border-color: #c0392b; color: #c0392b; font-weight: 600; background: #fdecea; }
.fuera-txt { color: #c0392b; font-weight: 600; }
.informe-head { border-bottom: 2px solid var(--teal); padding-bottom: .5rem; margin-bottom: 1rem; }

/* Sucursales / branding */
.lab-logo { max-width: 100%; max-height: 48px; object-fit: contain; display: block; margin-bottom: .5rem; }
.lab-logo-lg { max-height: 64px; max-width: 100%; object-fit: contain; margin-bottom: .4rem; }
.color-dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); vertical-align: middle; }
.admin-form input, .admin-form select { width: 100%; padding: .5rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.admin-form input[type=color] { padding: .2rem; height: 40px; }
.admin-form label { display: block; font-size: .8rem; color: var(--muted); margin-top: .6rem; }
.admin-form button { width: auto; min-width: 160px; margin-top: 0; }
.asignados { margin: .6rem 0; padding-top: .5rem; border-top: 1px dashed var(--line); }
.asig-title { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; margin-bottom: .4rem; }
.chip-user { display: inline-block; background: #eef5f4; color: var(--teal-d); border: 1px solid var(--line); border-radius: 999px; padding: .14rem .6rem; font-size: .78rem; margin: 0 .25rem .3rem 0; }
.act-badge { display: inline-block; font-size: .74rem; padding: .14rem .55rem; border-radius: 999px; background: #f0f0f0; color: #777; }
.act-badge.online { background: #e3f3ef; color: var(--teal-d); font-weight: 600; }
.stats { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.stat { font-size: .78rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .25rem .55rem; }
.stat strong { color: var(--teal-d); }
.btnmini.danger { background: #c0392b; }
.btnmini.danger:hover { background: #a5301f; }
.card.inactiva { opacity: .62; }
.act-badge.inactiva { background: #fdecea; color: #c0392b; font-weight: 600; }
.aviso { padding: .6rem .9rem; border-radius: 8px; margin: .2rem 0 1rem; font-size: .9rem; }
.aviso.ok { background: #e3f3ef; color: var(--teal-d); border-left: 4px solid var(--teal); }
.aviso.warn { background: #fff3d6; color: #9a6b00; border-left: 4px solid #d8a400; }
tr.sin-suc { background: #fff7e6; }
tr.sin-suc td { border-top: 1px solid #f0d8a0; }
.data input, .data select { padding: .3rem .4rem; border: 1px solid var(--line); border-radius: 6px; max-width: 100%; }

/* Buscador de análisis (paso 2 del registro) */
.ana-buscador { position: relative; margin-bottom: 1rem; }
.ana-buscador input { width: 100%; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; }
.ana-lista { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 420px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 22px rgba(0,0,0,.14); display: none; }
.ana-lista mark { background: #ffd400; color: #1a1a1a; font-weight: 800; padding: 0 .1em; border-radius: 3px; box-shadow: 0 0 0 1.5px #ffb300; }
/* Nivel 1: categoría */
.ana-grupo-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .5rem; padding: .12rem .8rem; background: var(--teal); border-bottom: 1px solid var(--line); line-height: 1.3; }
.ana-grupo-head.match { background: var(--teal); }   /* mismo color: la coincidencia se ve en la palabra resaltada */
.ana-grupo-nom { flex: 1; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #fff; }
.ana-grupo-nom mark { background: #ffd400; color: #1a1a1a; }
.ana-grupo-n { font-size: .66rem; color: rgba(255,255,255,.85); white-space: nowrap; }
/* Nivel 2: análisis · nivel 3: detalle */
.ana-ana, .ana-det { display: flex; align-items: center; gap: .6rem; padding: .42rem .8rem; border-bottom: 1px solid #f0f4f3; }
.ana-ana { padding-left: .5rem; }
.ana-det { padding-left: 2.6rem; background: #fafcfc; }
.ana-ana:hover, .ana-det:hover { background: #eef5f4; }
.ana-ana.match, .ana-det.match { background: #fffbe6; box-shadow: inset 3px 0 0 #d8a400; }
.ana-ana.sel, .ana-det.sel { background: #e3f3ef; }
.ana-det.nov { color: var(--muted); }
.ana-det.nov .ana-nom { font-style: italic; }
.ana-det.mas { font-size: .78rem; padding-top: .3rem; padding-bottom: .3rem; }
.ana-nom { flex: 1; font-size: .92rem; }
.ana-n { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; font-style: normal; white-space: nowrap; }
.ana-precio { color: var(--teal-d); font-weight: 700; font-size: .84rem; white-space: nowrap; min-width: 70px; text-align: right; }
.ana-lista .ana-toggle { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; width: auto; min-width: 3.1rem; height: 1.7rem; margin: 0; padding: 0 .5rem; border: 1.5px solid var(--teal); border-radius: 999px; background: #fff; color: var(--teal-d); font-size: .8rem; font-weight: 700; cursor: pointer; flex: none; }
.ana-lista .ana-toggle .ana-chev { font-size: .72rem; }
.ana-lista .ana-toggle.abierto { background: var(--teal); color: #fff; }
.ana-lista .ana-toggle.vacio { border-color: transparent; background: transparent; cursor: default; }
.ana-lista .ana-toggle:not(.vacio):hover { background: var(--teal-d); border-color: var(--teal-d); color: #fff; }
/* los parámetros cuelgan de su análisis: sangría, guía vertical y flecha; el análisis conserva su color */
.ana-dets { margin: 0 0 .25rem 2.1rem; border-left: 3px solid var(--teal); background: #fafcfc; }
.ana-dets .ana-det { padding-left: 1.9rem; position: relative; background: #fafcfc; }
.ana-dets .ana-det::before { content: "↳"; position: absolute; left: .6rem; color: var(--teal-d); font-weight: 700; }
.ana-dets .ana-det.sel { background: #f1f8f6; }
.ana-dets .ana-det.match { background: #fffbe6; }
.ana-dets .ana-det.mas { cursor: pointer; }
.ana-dets .ana-det.mas::before { content: ""; }
.ana-lista .ana-add { font-size: .72rem; padding: .2rem .6rem; border: 0; border-radius: 999px; background: var(--teal); color: #fff; cursor: pointer; white-space: nowrap; width: auto; min-width: 0; margin: 0; }
.ana-lista .ana-add:hover { background: var(--teal-d); }
.ana-lista .ana-add.ya { background: transparent; color: var(--teal-d); font-weight: 600; cursor: default; }
.ana-vacio { padding: .8rem; text-align: center; color: var(--muted); font-size: .85rem; }
/* Tabla de seleccionados */
.item-det { color: var(--muted); font-size: .82rem; }

/* ===== Sucursales (panel unificado) =====
   Es la pantalla principal: tarjetas grandes, legibles a distancia. La tarjeta
   entera abre la sucursal; editar y eliminar viven en el menú «⋮» para que no se
   pulsen sin querer. */
.grid-labs { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 1.5rem; }
.lab-card { position: relative; padding: 1.6rem 1.5rem; border-radius: 16px; }
.lab-card h3 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .5rem; }
.lab-card .muted { font-size: 1.05rem; }
.lab-card .small { font-size: .95rem; line-height: 1.5; }
.lab-card .act-badge { font-size: .92rem; padding: .25rem .8rem; }
.lab-card .asig-title { font-size: .85rem; }
.lab-card .chip-user { font-size: .95rem; padding: .25rem .8rem; }
.lab-card .stat { font-size: .98rem; padding: .4rem .8rem; }
.lab-card .lab-logo-lg { max-height: 96px; margin-bottom: .6rem; }
.lab-card .color-dot { width: 20px; height: 20px; }
.lab-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.11); }

/* Enlace que cubre la tarjeta: clic en cualquier área. Va por debajo del menú. */
.card-link { position: absolute; inset: 0; z-index: 1; border-radius: 16px; }
.card-link:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Menú «⋮» */
.menu { position: absolute; top: .7rem; right: .7rem; z-index: 3; }
.menu > summary {
  list-style: none; cursor: pointer; user-select: none;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; line-height: 1; color: var(--muted);
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { background: #eef5f4; color: var(--teal-d); }
.menu > summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.menu-pop {
  position: absolute; top: 2.5rem; right: 0; min-width: 232px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,.16); padding: .35rem; overflow: hidden;
}
.menu-pop a, .menu-pop button {
  display: block; width: 100%; text-align: left; box-sizing: border-box;
  padding: .6rem .8rem; border: 0; border-radius: 8px; margin: 0;
  background: none; color: var(--ink); text-decoration: none;
  font: inherit; font-size: 1rem; cursor: pointer; white-space: nowrap;
}
.menu-pop a:hover, .menu-pop button:hover { background: #eef5f4; color: var(--teal-d); }
.menu-pop button.danger { color: #c0392b; }
.menu-pop button.danger:hover { background: #fdecea; color: #a5301f; }
.menu-pop form { margin: 0; }

/* Inactivas: se ven, pero no se abren con el clic de la tarjeta. */
.lab-card.inactiva { opacity: .72; }
.lab-card.inactiva:hover { transform: none; box-shadow: none; }

@media (max-width: 560px) {
  .grid-labs { grid-template-columns: 1fr; }
}

/* ===== Registro: cabecera compacta y selector de paciente / doctor =====
   El paciente es el dato clave y el doctor es opcional: un solo campo cada uno,
   con búsqueda y alta en el mismo sitio, sin modales. */
.reg-cab { display: grid; grid-template-columns: 150px 170px 1fr; gap: 1rem; align-items: start; }
.reg-cab label, .sel > label { display: block; font-size: .8rem; color: var(--muted); margin-top: .4rem; }
.sel > label.req::after { content: " *"; color: #c0392b; }
.sel { position: relative; margin-top: .3rem; }
.sel-buscar { position: relative; }
.sel-buscar input { width: 100%; }
.sel.principal .sel-buscar input { padding: .7rem .9rem; font-size: 1.05rem; }
.sel-lista { position: absolute; z-index: 31; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 22px rgba(0,0,0,.14); display: none; max-height: 320px; overflow-y: auto; }
.sel-item { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; padding: .5rem .8rem; cursor: pointer; border-bottom: 1px solid #f0f4f3; }
.sel-item:hover, .sel-item.activo { background: #e3f3ef; }
.sel-nom { font-weight: 600; }
.sel-sub { color: var(--muted); font-size: .8rem; }
.sel-hint, .sel-vacio { padding: .5rem .8rem; color: var(--muted); font-size: .82rem; }
.sel-lista .sel-crear { display: block; width: 100%; text-align: left; margin: 0; padding: .6rem .8rem; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; background: #eef5f4; color: var(--teal-d); font-weight: 600; font-size: .9rem; cursor: pointer; }
.sel-lista .sel-crear:hover { background: #e3f3ef; }
/* Ficha del elegido: una sola línea */
.sel-ficha { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .5rem .8rem; border: 1px solid #cfe8e3; border-radius: 8px; background: #eef5f4; font-size: .95rem; }
.sel.principal .sel-ficha { font-size: 1.05rem; padding: .65rem .9rem; }
.sel-ficha .sel-x { width: auto; min-width: 0; margin: 0 0 0 auto; padding: .22rem .6rem; font-size: .78rem; background: #fff; color: var(--teal-d); border: 1px solid var(--line); border-radius: 999px; }
/* editar · cambiar/quitar · eliminar, juntos a la derecha (22/09) */
.sel-ficha .sel-btns { display: flex; gap: .3rem; margin-left: auto; flex-wrap: wrap; }
.sel-ficha .sel-btns .sel-x { margin: 0; }
.sel-ficha .sel-x.peligro { color: #b3261e; border-color: #f5c6c2; }
.sel-hint.ok { color: var(--teal-d); background: #e3f3ef; border-radius: 8px; margin-top: .4rem; }
.sel-aviso.warn { margin-top: .4rem; padding: .5rem .8rem; border-radius: 8px; background: #fff3d6; color: #9a6b00; border-left: 4px solid #d8a400; font-size: .88rem; }
.sel-ficha .sel-x:hover { background: #fdecea; color: #b3261e; border-color: #f5c6c2; }
/* Alta en línea */
.sel-form { margin-top: .5rem; padding: .7rem 1rem .9rem; border: 1px solid var(--teal); border-radius: 10px; background: #fff; }
.sel-form-titulo { font-weight: 700; color: var(--teal-d); }
.sel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem 1rem; }
.sel-grid .c2 { grid-column: span 2; }
.sel-grid label { margin-top: .3rem; }
.sel-acciones { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .8rem; }
.content .sel-acciones button { width: auto; min-width: 120px; margin-top: 0; padding: .5rem .9rem; font-size: .92rem; }
.content .sel-acciones .ghost { background: #fff; color: var(--teal-d); border: 1px solid var(--line); }
@media (max-width: 760px) {
  .reg-cab { grid-template-columns: 1fr 1fr; }
  .reg-cab .sel { grid-column: span 2; }
  .sel-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== Registro: areas independientes (tarjetas separadas sobre el fondo) ===== */
.content.content-plain { background: transparent; border: 0; padding: 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
/* Separacion pareja entre paneles, esten o no dentro del mismo contenedor
   (en el registro cada bloque vive en su propio div: .panel + .panel no alcanzaba). */
.panel { margin-bottom: 1.5rem; }
.panel:last-child { margin-bottom: 0; }
.wstep-body > .panel:only-child { margin-bottom: 1.5rem; }
.panel-head { display: flex; align-items: baseline; gap: .6rem; padding: .7rem 1.2rem; background: #eef5f4; border-bottom: 1px solid var(--line); border-left: 5px solid var(--teal); border-radius: 12px 12px 0 0; color: var(--teal-d); font-weight: 700; font-size: 1rem; text-transform: uppercase; letter-spacing: .4px; }
.panel-sub { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); font-size: .84rem; }
.panel-body { padding: .4rem 1.3rem 1.2rem; }
.panel-body > p.muted.small { margin: .6rem 0 .5rem; }

/* ===== Llenar resultados: como la tabla del sistema original ===== */
.res-table { margin-bottom: 1.4rem; }
.res-table th { white-space: nowrap; }
.res-table tr.res-ana th { background: #eef5f4; color: var(--teal-d); font-size: 1rem; text-transform: uppercase; letter-spacing: .3px; padding: .6rem .7rem; border-left: 5px solid var(--teal); }
.res-table tr.res-sec td { background: #fff6e0; color: var(--teal-d); font-weight: 700; padding: .35rem .7rem .35rem 1.2rem; }
.res-table tr.res-sub td { font-weight: 700; color: var(--ink); padding: .35rem .7rem .3rem 1.2rem; background: #fbfcfc; }
.res-table tr.res-obs td { background: #fafcfc; }
.res-table tr.res-obs input { font-style: italic; }
.res-table td { vertical-align: middle; }
.res-table td.res-val { min-width: 220px; }
.res-table td.res-ref { white-space: nowrap; }
.res-table td.small { font-size: .8rem; }
.res-wrap { display: flex; align-items: flex-start; gap: .3rem; }
.res-wrap textarea.res-input { flex: 1; width: 100%; min-height: 2.1rem; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: .92rem; font-weight: 600; resize: none; overflow: hidden; background: #fffdf3; line-height: 1.3; }
.res-wrap textarea.res-input.fuera { color: #c0392b; border-color: #e6a19a; }
.content .res-pick { width: auto; min-width: 0; margin: 0; padding: .3rem .45rem; font-size: .9rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--teal-d); line-height: 1; }
.content .res-pick:hover { background: #eef5f4; }
.res-rojo label { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; color: #c0392b; font-weight: 600; cursor: pointer; white-space: nowrap; }
.res-rojo input { width: auto; margin: 0; accent-color: #c0392b; }
.res-otras { white-space: pre-line; max-width: 220px; }
.pick-pop { position: absolute; z-index: 40; min-width: 260px; max-width: 420px; max-height: 320px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.16); padding: .3rem; }
.pick-op { padding: .45rem .7rem; border-radius: 6px; cursor: pointer; font-size: .9rem; white-space: pre-line; }
.pick-op:hover { background: #eef5f4; }
.pick-op.rojo { color: #c0392b; }
.pick-tag { font-size: .68rem; border: 1px solid #e6a19a; border-radius: 999px; padding: 0 .4rem; margin-left: .3rem; vertical-align: middle; }
.badge-estado.llenado { background: #e3f3ef; color: var(--teal-d); }

/* ===== Paneles en todas las pantallas con agrupaciones ===== */
.panel-head .badge-estado, .panel-head .btnlink { font-size: .8rem; letter-spacing: 0; text-transform: none; }
.panel-head .btnlink { padding: .35rem .8rem; }
.panel-body table.data { margin-top: .6rem; }
.panel-body .res-table { margin-bottom: .2rem; }
.panel-body .cat-tabs { margin-top: .4rem; }
.panel-body .admin-form { margin: 0; }
/* Ficha de datos dentro de un panel: etiqueta chica arriba, valor abajo */
.datos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem 1.2rem; padding: .7rem 0 .3rem; }
.datos-grid > div > span.muted { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .3px; margin-bottom: .1rem; }
.datos-grid > div > strong { font-size: 1rem; color: var(--ink); }
/* Filas de sección también en la vista de resultados */
table.data tr.res-sec td { background: #fff6e0; color: var(--teal-d); font-weight: 700; padding: .35rem .7rem .35rem 1.2rem; }
table.data tr.res-sub td { font-weight: 700; padding: .35rem .7rem .3rem 1.2rem; background: #fbfcfc; }
table.data tr.res-obs td { background: #fafcfc; }
.fuera-txt { color: #c0392b; }
/* Campo con opciones del catálogo: chevron a la derecha; opción resaltada con teclado */
.res-wrap textarea.res-input.con-lista { padding-right: 1.5rem; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23155350' stroke-width='1.8'/></svg>"); background-repeat: no-repeat; background-position: right .45rem top .7rem; }
.pick-op.activo { background: #e3f3ef; }
.btnmini.ghost { background: #fff; color: var(--teal-d); border: 1px solid var(--line); }
table.data td.acciones { white-space: nowrap; }
table.data td.acciones .btnmini + .btnmini { margin-left: .3rem; }
.reg-titulo { margin: 0 0 1rem; color: var(--teal-d); font-size: 1.25rem; }
.reg-titulo small { font-weight: 400; font-size: .85rem; }

/* ===== Forma de pago: total grande, tres respuestas, aviso claro ===== */
.pago-total { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: .8rem 0 .4rem; padding: .8rem 1rem; background: #eef5f4; border-radius: 10px; font-size: 1.05rem; color: var(--teal-d); }
.pago-total strong { font-size: 1.9rem; }
.pago-desc { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.pago-desc label { margin: 0; }
.pago-inline { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.pago-inline input { width: 150px; font-size: 1.1rem; font-weight: 600; text-align: right; }
.pago-bs { color: var(--muted); }
.pago-pregunta { margin: 1.1rem 0 .5rem; font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.pago-opciones { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.content .pago-opciones .pago-op { width: 100%; min-width: 0; margin: 0; padding: .9rem .6rem; font-size: 1rem; font-weight: 700; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--ink); }
.content .pago-opciones .pago-op:hover { border-color: var(--teal); background: #f4faf9; }
.content .pago-opciones .pago-op.activo { background: var(--teal); border-color: var(--teal); color: #fff; }
.pago-monto { margin-top: .9rem; }
.pago-monto label { margin-top: 0; }
.pago-monto input { width: 170px; font-size: 1.4rem; }
.pago-rapidos { display: inline-flex; gap: .3rem; flex-wrap: wrap; margin-left: .4rem; }
.content .pago-rapidos button { width: auto; min-width: 0; margin: 0; padding: .45rem .7rem; font-size: .85rem; border-radius: 999px; background: #fff; color: var(--teal-d); border: 1px solid var(--line); }
.content .pago-rapidos button:hover { background: #eef5f4; }
.pago-resultado { margin-top: 1rem; padding: .9rem 1rem; border-radius: 10px; background: var(--bg); color: var(--muted); font-size: 1.05rem; }
.pago-resultado.ok { background: #e3f3ef; color: var(--teal-d); }
.pago-resultado.deuda { background: #fff3d6; color: #7a5400; }
.pago-resultado strong { font-size: 1.15rem; }
@media (max-width: 640px) { .pago-opciones { grid-template-columns: 1fr; } }

/* El panel de analisis es lo primero que se usa: borde y cabecera en ambar para que resalte */
.panel.analisis { border: 2px solid #e8a317; box-shadow: 0 4px 18px rgba(232,163,23,.20); }
.panel.analisis > .panel-head { background: #fff6e0; border-left-color: #e8a317; border-bottom-color: #f3d78f; color: #6b4a00; }
.panel.analisis > .panel-head .panel-sub { color: #9a6b00; }
.panel.analisis .ana-buscador input { border: 2px solid #f1c96b; }
.panel.analisis .ana-buscador input:focus { outline: none; border-color: #e8a317; box-shadow: 0 0 0 3px rgba(232,163,23,.18); }

/* Sexo: dos botones grandes en vez de un desplegable (radio real debajo, funciona con teclado) */
.sexo-radio { display: flex; gap: .4rem; }
.sexo-radio label { flex: 1; margin: 0; font-size: 1rem; color: var(--ink); }
.sexo-radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.sexo-radio span { display: block; text-align: center; padding: .5rem .4rem; border: 2px solid var(--line); border-radius: 10px; font-weight: 600; cursor: pointer; background: #fff; }
.sexo-radio span:hover { border-color: var(--teal); }
.sexo-radio input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; }
.sexo-radio input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }

/* Órdenes: pago al día o con saldo pendiente */
.badge-pago { display: inline-block; font-size: .78rem; font-weight: 700; padding: .18rem .6rem; border-radius: 999px; white-space: nowrap; }
.badge-pago.pagado { background: #e3f3ef; color: var(--teal-d); }
.badge-pago.debe { background: #fff3d6; color: #7a5400; border: 1px solid #e8c46b; }
table.data tr.con-saldo { background: #fffaf0; box-shadow: inset 4px 0 0 #e8a317; }
table.data tr.con-saldo:hover { background: #fff5e0; }

/* Recordatorio rojo de saldo pendiente (Llenar, Ver, Detalle) */
.aviso-deuda { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; padding: .9rem 1.1rem; background: #fdecea; border: 2px solid #c0392b; border-left-width: 8px; border-radius: 12px; color: #7a1d12; }
.aviso-deuda-titulo { font-size: 1.15rem; font-weight: 800; letter-spacing: .3px; }
.aviso-deuda-det { font-size: .9rem; margin-top: .15rem; }
.aviso-deuda .btnlink { background: #c0392b; white-space: nowrap; }
.aviso-deuda .btnlink:hover { background: #a5301f; }
.aviso-nueva { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 1rem; }

/* Precios por sucursal y derivaciones */
.panel.precios .panel-head { border-left-color: #2e7d32; }
.adic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem 1.2rem; }
.adic-inline { display: flex; gap: .3rem; align-items: center; }
.adic-inline input { flex: 1; min-width: 0; }
.adic-inline select { width: auto; min-width: 64px; }
.admin-form .btn-sm { padding: .3rem .7rem; font-size: .85rem; margin-left: .4rem; }
.der-tabla input.num, .tar-tabla input.num { width: 100%; max-width: 120px; text-align: right; padding: .35rem .5rem; }
.der-tabla tr.usar { background: #f2faf5; }
.der-tabla .chk input { width: 1.2rem; height: 1.2rem; }
.tar-filtro { margin: .6rem 0 .2rem; }
.tar-filtro input { width: 100%; padding: .6rem .9rem; font-size: 1rem; }
.tar-tabla tr.grupo td { background: #eef5f4; color: var(--teal-d); font-weight: 700; text-transform: uppercase; font-size: .76rem; letter-spacing: .4px; padding: .35rem .6rem; }
.tar-tabla tr.det td { background: #fafcfc; }
.tar-det { color: #445; padding-left: .6rem; }
.tar-tabla tr.sinprecio td:first-child { color: var(--muted); }
.tar-tabla .fijo { color: #2e7d32; }
/* Precio fijo a mano desde la tabla. Los selectores llevan `.cmp-tabla` delante para ganarle a
   `.content input { width:100% }`, `.content form button { min-width:170px }` y
   `button { color:#fff }` (que dejaría la ✕ blanca sobre blanco). */
/* Valen para las DOS celdas editables (costo de referencia y precio de cada sucursal): la primera
   versión los ató solo a `.precio-celda` y el costo quedó con los estilos generales — campo al 100 %
   y botones de 170 px encimados sobre las celdas vecinas. `.cmp-tabla td` da la especificidad
   (0,2,1) que les gana a `.content input` (0,1,1) y a `.content form button` (0,1,2). */
.cmp-tabla .precio-celda, .cmp-tabla .costo-celda { cursor: pointer; }
.cmp-tabla .precio-celda:hover, .cmp-tabla .costo-celda:hover { background: #eef7f5; }
.cmp-tabla td .precio-input { width: 74px; min-width: 0; margin: 0; padding: .1rem .3rem; border: 1px solid var(--teal); border-radius: 5px; font-size: .86rem; text-align: right; color: var(--ink); background: #fff; }
.cmp-tabla td .precio-b { width: auto; min-width: 0; margin: 0 0 0 .15rem; padding: .05rem .3rem; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #444; font-size: .82rem; font-weight: 700; line-height: 1.25; cursor: pointer; }
.cmp-tabla td .precio-b:hover { background: #eef7f5; }
.cmp-tabla td .precio-b.si { background: var(--teal); border-color: var(--teal); color: #fff; }
.cmp-tabla td.editando, .cmp-tabla td .editando { white-space: nowrap; }
/* ↺ al lado de un precio fijo: vuelve al calculado. Es un <button> DENTRO del form de la página,
   así que también tiene que ganarle a `button` y a `.content form button` (ancho, margen, color). */
.cmp-leyenda-fijo { color: #2e7d32; font-weight: 700; }
.cmp-tabla td .cmp-volver { width: auto; min-width: 0; margin: 0 0 0 .2rem; padding: 0 .28rem; border: 1px solid #cfe3d0; border-radius: 5px; background: #fff; color: #2e7d32; font-size: .78rem; font-weight: 700; line-height: 1.35; cursor: pointer; vertical-align: 1px; }
.cmp-tabla td .cmp-volver:hover { background: #eef7f5; border-color: #2e7d32; }
/* mín: hasta cuánto se rebaja al cobrar; con mínimo, un renglón chico bajo el precio. Sin mínimo
   NO ocupa lugar (si no, cada fila crece y el precio queda desalineado con el nombre): «+ mín»
   cuelga como pestañita del borde de la celda, solo mientras el mouse está encima. */
.cmp-tabla td.precio-celda { position: relative; }
.cmp-tabla td .cmp-min { font-size: .74rem; color: #5f7471; line-height: 1.35; cursor: pointer; }
.cmp-tabla td .cmp-min:hover { color: var(--teal-d); text-decoration: underline; }
.cmp-tabla td .cmp-min.vacio { display: none; position: absolute; right: .45rem; bottom: -.75rem; z-index: 3; padding: 0 .35rem; background: #fff; border: 1px solid #cfe3de; border-radius: 4px; font-size: .68rem; color: var(--teal-d); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.cmp-tabla td.precio-celda:hover .cmp-min.vacio { display: block; }
.cmp-tabla td .cmp-min.editando, .cmp-tabla td .cmp-min.vacio.editando { display: block; position: static; margin: .1rem 0; padding: 0; border: 0; background: none; box-shadow: none; text-decoration: none; }
.cmp-tabla td .cmp-min.alto { color: #c62828; font-weight: 700; }
/* Registro: el tope del descuento (la suma de los precios mínimos) */
.pago-tope { flex-basis: 100%; margin-top: -.2rem; font-size: .86rem; color: #2e6b62; }
.pago-tope.excede { color: #c62828; font-weight: 600; }
.pago-inline input.excede, .md-pago-form input.excede { border-color: #c62828; background: #fff5f5; }
.md-tope { font-size: .82rem; color: var(--muted); align-self: center; }
.der-op { display: inline-block; margin: .1rem .4rem .1rem 0; padding: .1rem .5rem; border-radius: 999px; background: #eef2fb; color: #1c3f8a; font-size: .8rem; white-space: nowrap; }
table.data tr.inactivo td { color: var(--muted); }
.btnmini.ghost { background: #fff; color: var(--teal-d); border: 1px solid var(--line); }
.badge-der { display: inline-block; padding: .16rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.badge-der.pendiente { background: #fff3d6; color: #9a6b00; }
.badge-der.enviado { background: #e7f0fb; color: #1c5fb0; }
.badge-der.recibido { background: #e3f3ef; color: var(--teal-d); }
/* Origen del ítem en el registro y en el detalle */
.origen { display: inline-block; margin-left: .4rem; padding: .08rem .5rem; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.origen.casa { background: #e3f3ef; color: var(--teal-d); }
.origen.derivado { background: #eef2fb; color: #1c3f8a; }
/* Buscador: cuando hay más de una forma de hacer el análisis, se elige con el precio a la vista */
.ana-lista .ana-ops { display: flex; flex-wrap: wrap; gap: .25rem; justify-content: flex-end; }
.ana-lista .ana-add.der { background: #1c3f8a; }
.ana-lista .ana-add.der:hover { background: #142e66; }
.ana-lista .ana-add small { font-weight: 400; opacity: .9; }
.ana-lista .ana-add.sinprecio { background: #eee; color: #888; cursor: default; }
@media (max-width: 900px) { .adic-grid { grid-template-columns: 1fr 1fr; } }
/* Ventana emergente para derivar: comparar laboratorios y elegir */
.der-modal { position: fixed; inset: 0; z-index: 90; background: rgba(20,40,40,.45); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.der-caja { background: #fff; border-radius: 14px; width: min(860px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 16px 40px rgba(0,0,0,.3); padding: 0 1.2rem 1.2rem; }
.der-head { display: flex; align-items: center; gap: .8rem; padding: .9rem 0 .4rem; border-bottom: 2px solid #1c3f8a; margin-bottom: .4rem; }
.der-titulo { flex: 1; font-weight: 800; color: #1c3f8a; font-size: 1.05rem; }
.der-caja .der-x { width: auto; min-width: 0; margin: 0; padding: .2rem .6rem; background: #eee; color: #444; border-radius: 999px; }
.der-casa { margin: .2rem 0 .6rem; font-size: .9rem; }
.der-opciones td.num, .der-opciones th.num { text-align: right; white-space: nowrap; }
.der-opciones td small { color: var(--muted); }
.der-opciones a { color: #1c3f8a; font-weight: 600; text-decoration: none; white-space: nowrap; }
.der-caja .ana-add { font-size: .8rem; padding: .3rem .7rem; border: 0; border-radius: 999px; background: #1c3f8a; color: #fff; cursor: pointer; white-space: nowrap; width: auto; min-width: 0; margin: 0; }
.der-caja .ana-add:hover { background: #142e66; }
.der-opciones th, .der-opciones td { padding: .45rem .4rem; }
.der-opciones td:last-child { white-space: nowrap; }
/* contacto: un renglón por número, un poco más chico; el desglose del precio puede partirse (22/09) */
.der-opciones td.der-contacto { font-size: .84rem; line-height: 1.55; }
.der-opciones td.num small { display: inline-block; max-width: 15rem; white-space: normal; line-height: 1.3; }
.der-opciones .der-term { white-space: nowrap; }
/* Buscador: fila marcada con el teclado y línea de ayuda */
.ana-ana.kb, .ana-det.kb { background: #e3f3ef; box-shadow: inset 3px 0 0 var(--teal); }
.ana-ayuda { padding: .22rem .8rem; font-size: .7rem; color: var(--muted); background: #fafcfc; border-bottom: 1px solid #f0f4f3; }
/* Comparador de precios entre sucursales */
.cmp-extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.cmp-suc { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem .8rem; background: #fff; }
.cmp-suc-nom { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-weight: 800; color: var(--teal-d); margin-bottom: .3rem; }
.cmp-adic { display: grid; grid-template-columns: auto 1fr; gap: .25rem .6rem; align-items: center; }
.cmp-adic label { margin: 0; font-size: .78rem; }
.cmp-adic input, .cmp-adic select { padding: .3rem .45rem; font-size: .88rem; }
.cmp-der { margin-top: .6rem; border-top: 1px dashed var(--line); padding-top: .4rem; }
.cmp-der-titulo { font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: .2rem; }
.cmp-der-fila { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .15rem 0; font-size: .85rem; }
.cmp-der-fila.usar { color: var(--teal-d); font-weight: 600; }
.cmp-der-fila .chk { display: flex; align-items: center; gap: .35rem; margin: 0; font-size: .85rem; color: inherit; }
.cmp-der-fila .chk input { width: 1rem; height: 1rem; }
.cmp-der-campos { display: flex; align-items: center; gap: .2rem; white-space: nowrap; }
.cmp-der-campos input { width: 52px; padding: .2rem .3rem; text-align: right; font-size: .82rem; }
.cmp-der-campos select { width: auto; padding: .2rem; font-size: .8rem; }
.cmp-der-campos small { color: var(--muted); margin-right: .3rem; }
.cmp-scroll { overflow-x: auto; }
.cmp-tabla th.num, .cmp-tabla td.num { text-align: right; white-space: nowrap; }
.cmp-tabla thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
.cmp-deriv { font-size: .76rem; color: #1c3f8a; white-space: nowrap; }
.cmp-deriv small { color: var(--muted); }
.ana-lista .ana-add.todos { background: #b7d8d4; color: #1f4f4b; opacity: .85; }
.ana-lista .ana-add.todos:hover { background: var(--teal); color: #fff; opacity: 1; }
/* Registro: detalles sueltos agrupados bajo su análisis */
table.data tr.item-grupo td { background: #eef5f4; font-weight: 700; color: var(--teal-d); border-top: 2px solid #cfe8e3; padding-top: .45rem; padding-bottom: .45rem; }
table.data tr.item-grupo .item-sub { font-weight: 400; color: var(--muted); }
table.data tr.item-grupo .btn-quitar { background: #fff; color: #b3261e; border: 1px solid #f5c6c2; }
table.data tr.item-hijo td { padding-top: .3rem; padding-bottom: .3rem; }
table.data tr.item-hijo td:first-child { padding-left: 2rem; position: relative; }
table.data tr.item-hijo td:first-child::before { content: "↳"; position: absolute; left: .8rem; color: var(--muted); }
/* Registro: la orden en tres niveles, compacta */
.si-lista { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: .4rem; font-size: .9rem; }
.si-cat { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .1rem .7rem; background: var(--teal); color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; line-height: 1.5; }
.si-cat-n { font-weight: 400; letter-spacing: 0; text-transform: none; opacity: .9; }
.si-ana, .si-det { display: flex; align-items: center; gap: .5rem; padding: .06rem .5rem .06rem .7rem; border-bottom: 1px solid #f0f4f3; line-height: 1.3; }
.si-ana { font-weight: 600; background: #fff; }
.si-ana.grupo { background: #eef5f4; color: var(--teal-d); }
.si-ana.grupo small { font-weight: 400; color: var(--muted); }
.si-dets { background: #fafcfc; border-bottom: 1px solid #e3ecea; border-left: 3px solid #cfe8e3; margin-left: 1.4rem; }   /* una columna, con sangría: se nota que son sub */
.si-det { font-size: .84rem; padding-left: 2rem; position: relative; border-bottom: 1px dotted #e3ecea; }
.si-det::before { content: "↳"; position: absolute; left: .8rem; color: var(--muted); font-size: .8rem; }
.si-nom { flex: 1; min-width: 0; }
.si-precio { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 58px; text-align: right; }
.si-precio.sub { font-weight: 400; color: var(--muted); }
.si-lista .si-x { width: 1.15rem; height: 1.15rem; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #b3261e; font-size: .8rem; line-height: 1; cursor: pointer; flex: none; }
.si-lista .si-x:hover { background: #fdecea; }
.si-lista .origen { font-size: .68rem; margin-left: .2rem; padding: 0 .4rem; }
.si-vacio { padding: .5rem .7rem; color: var(--muted); font-size: .85rem; }
/* la misma lista compacta en Detalle de muestra: con estado de llenado y quitar por formulario */
.si-estado { font-size: .66rem; font-weight: 700; letter-spacing: .3px; white-space: nowrap; padding: 0 .4rem; border-radius: 999px; }
.si-estado.ll { color: var(--teal-d); background: #e3f3ef; }
.si-estado.nl { color: #9a6b00; background: #fff3d6; }
.si-lista .si-form { margin: 0; display: inline-flex; flex: none; }
.si-x-hueco { width: 1.15rem; flex: none; }
/* Llenar resultados como Biovida: una sola grilla compacta */
.ll-cab { display: grid; grid-template-columns: repeat(4, 1fr); gap: .25rem 1.2rem; font-size: .88rem; }
.ll-cab .muted { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .4px; }
.ll-panel { padding: 0; overflow-x: auto; }
.ll-grid { width: 100%; border-collapse: collapse; font-size: .86rem; }
.ll-grid th { position: sticky; top: 0; z-index: 3; background: #fff; text-align: left; padding: .35rem .45rem; font-size: .76rem; color: var(--muted); border-bottom: 2px solid var(--line); white-space: nowrap; }
.ll-grid td { padding: .08rem .45rem; border-bottom: 1px solid #eef2f1; vertical-align: middle; line-height: 1.25; }
.ll-grid .ll-chk { width: 2.4rem; text-align: center; white-space: nowrap; }
.ll-grid .ll-chk input { width: auto; margin: 0; accent-color: var(--teal); }
.ll-grid tr.ll-ana td { background: #fdeecb; border-top: 2px solid #f0d48a; padding-top: .22rem; padding-bottom: .22rem; }
.ll-ana-nom { font-weight: 800; color: #1a7f4b; letter-spacing: .2px; }
.ll-grid .ll-sigma { width: auto; min-width: 0; margin: 0 0 0 .6rem; padding: 0 .55rem; height: 1.35rem; border: 0; border-radius: 5px; background: var(--teal); color: #fff; font-weight: 800; font-size: .85rem; cursor: pointer; vertical-align: middle; }
.ll-grid .ll-sigma:disabled { background: #d9dfde; cursor: default; }
.ll-grid tr.ll-tit td { background: #fdf3d6; color: #1c5fb0; font-weight: 800; padding-top: .16rem; padding-bottom: .16rem; }
/* Secciones que tienen que sumar 100 % (FÓRMULA LEUCOCITARIA): el total, al lado del título. */
.ll-suma { margin-left: .6rem; padding: .02rem .4rem; border-radius: 999px; font-size: .72rem; font-weight: 700; vertical-align: middle; }
.ll-suma.ok { background: #e3f3ef; color: #12705f; }
.ll-suma.mal { background: #fdecea; color: #b3261e; }
.ll-grid tr.ll-tit.suma-mal td { background: #fdecea; color: #b3261e; box-shadow: inset 3px 0 0 #b3261e; }
.ll-grid tr.ll-tit.sub td:nth-child(2) { padding-left: 1.3rem; }
.ll-grid tr.ll-det:hover td { background: #f6fbfa; }
.ll-grid .ll-desc { white-space: pre-line; }   /* la sangría va por padding (f.sangria), no por los espacios */
.ll-grid td.ll-res { width: 210px; min-width: 170px; }
.ll-grid textarea.res-input { display: block; width: 100%; min-height: 1.55rem; margin: 0; padding: .12rem .4rem; border: 1px solid #ecdca6; border-radius: 4px; background: #fdf3d6; font: inherit; font-size: .88rem; font-weight: 600; line-height: 1.25; resize: none; overflow: hidden; }
.ll-grid textarea.res-input:focus { outline: 2px solid var(--teal); background: #fffaf0; }
.ll-grid textarea.res-input.fuera { color: #d0121a; font-weight: 800; }
.ll-grid textarea.res-input.calc { font-style: italic; }
.ll-grid .ll-btns { white-space: nowrap; width: 5.2rem; }
/* FÓRMULA LEUCOCITARIA (23/09/2026): el % y, al lado, su absoluto (se calcula solo, no se escribe) */
.ll-grid .ll-res-abs { display: flex; align-items: center; gap: .35rem; }
.ll-grid .ll-res-abs textarea.res-input { flex: 0 0 46%; width: 46%; }
.ll-grid output.ll-abs { flex: 1; min-width: 0; padding: .12rem .4rem; border: 1px dashed #b9d7d2; border-radius: 4px; background: #eef7f5;
  color: #12705f; font-weight: 700; font-size: .88rem; line-height: 1.25; font-variant-numeric: tabular-nums; cursor: default; }
.ll-grid output.ll-abs.vacio { color: #9aa9a8; font-weight: 400; }
.ll-grid .ll-abs-no { flex: 1; padding-left: .45rem; font-size: .72rem; color: #9aa9a8; }
.ll-grid tr.ll-abs-cab td { padding-top: 0; padding-bottom: .05rem; background: #fffbf0; }
.ll-grid tr.ll-abs-cab .ll-res-abs span { font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.ll-grid tr.ll-abs-cab .ll-res-abs span:first-child { flex: 0 0 46%; padding-left: .4rem; }
.ll-grid tr.ll-abs-cab .ll-res-abs span:last-child { flex: 1; padding-left: .45rem; }
.ll-grid tr.ll-abs-cab small { font-size: .66rem; text-transform: none; font-weight: 600; }
.ll-grid .ll-abs-falta { color: #b3261e; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.res-abs-ver { margin-left: .5rem; color: #12705f; font-weight: 600; white-space: nowrap; }
.ll-grid .ll-b { width: 1.5rem; height: 1.35rem; min-width: 0; margin: 0 1px; padding: 0; border: 0; border-radius: 4px; font-size: .72rem; line-height: 1; color: #fff; cursor: pointer; }
.ll-grid .ll-b.rojo { background: #dc3545; } .ll-grid .ll-b.verde { background: #28a745; } .ll-grid .ll-b.lupa { background: #3b82f6; }
.ll-grid .ll-b:disabled { background: #d9dfde; cursor: default; }
.ll-grid .ll-ref { white-space: nowrap; }
/* Mínimo y máximo se corrigen con un clic, sin ir al catálogo. */
.ll-grid .edit-ref { cursor: pointer; }
.ll-grid .edit-ref:hover { background: #eef7f5; box-shadow: inset 0 -1px 0 var(--teal); }
.ll-grid .edit-ref.editando { background: #fff; }
/* Los selectores van con `.ll-grid .edit-ref` delante a propósito: hay reglas generales que si no
   les ganan por especificidad — `.content input { width:100% }` estiraba el campo hasta empujar la
   columna Máximo fuera de la pantalla, `.content form button { min-width:170px }` inflaba los
   botones y `button { color:#fff }` dejaba la ✕ blanca sobre fondo blanco, invisible. */
.ll-grid .edit-ref .ref-input { width: 72px; min-width: 0; margin: 0; padding: .1rem .3rem; border: 1px solid var(--teal); border-radius: 5px; font-size: .86rem; }
.ll-grid .edit-ref .ref-b { width: auto; min-width: 0; margin: 0 0 0 .15rem; padding: .05rem .3rem; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #444; font-size: .82rem; font-weight: 700; line-height: 1.25; cursor: pointer; }   /* gris, no el color de la sucursal: tiene que leerse en todas */
.ll-grid .edit-ref .ref-b:hover { background: #eef7f5; }
.ll-grid .edit-ref .ref-b.si { background: var(--teal); border-color: var(--teal); color: #fff; }
.ll-grid .edit-ref.editando { white-space: nowrap; }
.ll-grid .ll-chico { font-size: .76rem; color: #445; white-space: pre-line; }   /* método y muestra: varios renglones */
.ll-grid .ll-otras { white-space: pre-line; max-width: 240px; }
.ll-grid .ll-otras .edit-campo { min-height: 1.25em; }         /* vacía también se puede tocar (24/09/2026) */
.ll-grid .ll-otras textarea.campo-input { width: 210px; }
.ll-grid .ll-otras-abs { color: #445; }
.ll-grid tr.ll-obs td { background: #fafcfc; }
.ll-grid tr.ll-obs input { width: 100%; margin: 0; padding: .12rem .4rem; border: 1px solid var(--line); border-radius: 4px; font-style: italic; font-size: .86rem; background: #fdf3d6; }
.f-pop { padding: .5rem .7rem; max-width: 520px; }
.f-tit { font-weight: 700; color: var(--teal-d); margin-bottom: .3rem; } .f-tit small { font-weight: 400; color: var(--muted); }
.f-linea { padding: .2rem 0; border-top: 1px dotted var(--line); font-size: .86rem; } .f-linea small { display: block; color: var(--muted); font-family: monospace; }
@media (max-width: 900px) { .ll-cab { grid-template-columns: 1fr 1fr; } }
/* ===== Resultados de Muestra como Biovida: lista con búsqueda y páginas ===== */
.mu-busca { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .2rem 0 .6rem; }
.mu-busca input[type=search] { flex: 1 1 260px; max-width: 420px; margin: 0; padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 8px; font-size: .92rem; }
.mu-btn, .mu-busca button.mu-btn { display: inline-block; width: auto; min-width: 0; margin: 0; padding: .38rem .75rem; border: 1.5px solid var(--teal); border-radius: 8px; background: var(--teal); color: #fff; font-size: .84rem; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; }
.mu-btn.ghost, .mu-busca button.mu-btn.ghost { background: #fff; color: var(--teal-d); }
.mu-btn.ghost:hover { background: #eef7f5; }
.mu-seg { display: inline-flex; }
.mu-seg .mu-btn { border-radius: 0; border-right-width: 0; }
.mu-seg .mu-btn:first-child { border-radius: 8px 0 0 8px; }
.mu-seg .mu-btn:last-child { border-radius: 0 8px 8px 0; border-right-width: 1.5px; }
.mu-seg .mu-btn.on { background: var(--teal); color: #fff; }
.mu-avanzada { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: end; padding: .5rem .7rem; background: #f4faf9; border: 1px solid #d8ebe7; border-radius: 8px; }
.mu-avanzada label { display: flex; flex-direction: column; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; gap: .15rem; }
.mu-avanzada input, .mu-avanzada select { margin: 0; padding: .3rem .45rem; border: 1px solid var(--line); border-radius: 6px; font-size: .88rem; width: auto; }
.mu-tabla-wrap { overflow-x: auto; }
table.mu-tabla { font-size: .86rem; }
table.mu-tabla th { white-space: nowrap; font-size: .76rem; }
table.mu-tabla td { padding: .28rem .5rem; vertical-align: middle; line-height: 1.25; }
tr.mu-fila { cursor: pointer; }
tr.mu-fila:hover td, tr.mu-fila:focus td { background: #eef7f5; }
tr.mu-fila:focus { outline: 2px solid var(--teal); outline-offset: -2px; }
.mu-cod { white-space: nowrap; font-weight: 700; }
.mu-cod a { text-decoration: none; color: var(--teal-d); }
.mu-fecha { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mu-fecha small, .mu-pac small { color: var(--muted); }
.mu-pac { font-weight: 600; min-width: 150px; }
/* «Análisis» toma el lugar que dejan las otras columnas y corta con «…» (el resto, en el tooltip y en el
   detalle). El max-width de una celda no limita una tabla: `max-width: 0` + un ancho en % sí. */
.mu-ana { width: 32%; max-width: 0; color: var(--muted); font-size: .78rem; }
.mu-ana span { display: block; min-width: 9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* (en una pantalla angosta la tabla no entra: se desplaza de costado dentro de su panel, .mu-tabla-wrap) */
.mu-deuda { display: inline-block; margin-left: .3rem; padding: 0 .3rem; border-radius: 4px; background: #fdecea; color: #b3261e; font-size: .64rem; font-weight: 800; vertical-align: middle; }
.mu-ico { display: inline-block; padding: .1rem .3rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; text-decoration: none; font-size: .95rem; line-height: 1.2; }
.mu-ico:hover { background: #e3f3ef; border-color: var(--teal); }
.mu-ico + .mu-ico { margin-left: .2rem; }
.or-num { white-space: nowrap; font-variant-numeric: tabular-nums; }   /* Ítems y Total, con los dígitos alineados */
.mu-pie { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .6rem; }
.mu-pag { display: inline-flex; align-items: center; gap: .3rem; }
.mu-pag-n { padding: 0 .5rem; font-size: .88rem; }
/* ===== Detalles de Muestra: cabecera, pestañas, ✓ por fila y barra de acciones abajo ===== */
.md-pagina { padding-bottom: 1rem; }
.md-migas { font-size: .8rem; color: var(--muted); margin: 0 0 .5rem; }
.md-migas a { color: var(--teal-d); text-decoration: none; }
.md-cab { padding: .55rem .9rem; }
.md-cab-fila { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.6rem; }
.md-dato { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .4rem; }
.md-dato > .muted { flex-basis: 100%; font-size: .66rem; text-transform: uppercase; letter-spacing: .4px; }
.md-dato strong { font-size: .98rem; }
.md-dato small { color: var(--muted); }
.md-crece { flex: 1 1 200px; }
.md-nlab { color: var(--teal-d); font-size: 1.1rem !important; letter-spacing: .3px; }
.md-cab-pie { display: flex; align-items: flex-start; gap: .6rem; }
.md-cab-pie .md-mas { flex: 1; min-width: 0; }
.md-cab-editar { flex: none; width: auto; min-width: 0; margin: .15rem 0 0; padding: .3rem .7rem; font-size: .82rem; line-height: 1.25; }
.md-lapiz { text-decoration: none; color: var(--teal-d); border: 1px solid var(--line); border-radius: 5px; padding: 0 .3rem; font-size: .8rem; }
.md-lapiz:hover { background: #e3f3ef; border-color: var(--teal); }
.md-mas { margin-top: .3rem; }
.md-mas summary { cursor: pointer; font-size: .78rem; color: var(--teal-d); font-weight: 600; width: max-content; }
.md-mas .datos-grid { padding: .4rem 0 .1rem; gap: .35rem 1.2rem; }
.md-mas .datos-grid > div > strong { font-size: .9rem; }
/* Resultados en línea (el QR): el enlace a lo ancho de «Más detalles» */
.md-enlace { grid-column: 1 / -1; }
/* Imprimir: el botón de siempre (carta) y pegado un ▾ con la media hoja y los sobres (24/09/2026) */
.imp-grupo { display: inline-flex; align-items: stretch; }
.imp-grupo > .btnlink { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.imp-mas { position: relative; display: flex; }
.imp-mas > summary { list-style: none; display: flex; align-items: center; padding: 0 .6rem; cursor: pointer;
  border: 1.5px solid var(--teal); border-left-width: 0; border-radius: 0 8px 8px 0; background: #fff;
  color: var(--teal-d); font-weight: 700; user-select: none; }
.imp-mas > summary::-webkit-details-marker { display: none; }
.imp-mas > summary:hover, .imp-mas[open] > summary { background: var(--bg); }
.imp-opciones { position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; min-width: 230px; padding: .3rem 0;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.14); }
.imp-mas.arriba .imp-opciones { top: auto; bottom: calc(100% + 4px); }
.imp-opciones a { display: block; padding: .5rem 1rem; color: var(--ink); text-decoration: none; font-size: .92rem; white-space: nowrap; }
.imp-opciones a:hover { background: var(--bg); }
/* Nueva orden: la hoja de prueba de la proforma, chiquita al lado del botón */
.si-proforma { display: inline-flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.si-prueba { font-size: .75rem; color: var(--muted); }
.md-enlace-fila { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: .15rem 0 .2rem; }
.md-enlace-fila input { flex: 1 1 320px; min-width: 0; font-family: Consolas, monospace; font-size: .82rem; }
.md-enlace-fila form { margin: 0; }
/* los botones de la app son anchos y con margen (button, .content form button): acá, chicos y en fila */
.content .md-enlace-fila button, .md-enlace-fila .btnlink { width: auto; min-width: 0; margin: 0; padding: .3rem .6rem; font-size: .8rem; }
.content .md-enlace-fila button.ghost { background: #fff; color: var(--teal-d); border: 1.5px solid var(--teal); font-weight: 600; }
.content .md-enlace-fila button.ghost:hover { background: var(--bg); }
.md-cuerpo { padding: 0; overflow: visible; }
.md-tabs { display: flex; gap: .2rem; padding: .4rem .7rem 0; border-bottom: 2px solid var(--teal); }
.md-tabs button.md-tab { width: auto; min-width: 0; margin: 0; padding: .4rem .9rem; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: #f2f6f5; color: var(--muted); font-size: .88rem; font-weight: 600; cursor: pointer; }
.md-tabs button.md-tab.activa { background: var(--teal); border-color: var(--teal); color: #fff; }
.md-tab-n { display: inline-block; margin-left: .3rem; padding: 0 .4rem; border-radius: 999px; background: rgba(0,0,0,.09); font-size: .72rem; font-weight: 700; }
.md-tab-n.debe { background: #fdecea; color: #b3261e; }
.md-tab-n.ok { background: #e3f3ef; color: var(--teal-d); }
.md-lista { margin-top: 0; }
.md-lista .si-ana, .md-lista .si-det { padding-top: .12rem; padding-bottom: .12rem; }
.md-lista a.si-estado { text-decoration: none; min-width: 84px; text-align: center; }
.md-lista a.si-estado:hover { outline: 1px solid currentColor; }
.md-lista .si-ok { display: inline-flex; align-items: center; justify-content: center; width: 1.35rem; height: 1.35rem; min-width: 0; margin: 0; padding: 0; border: 1px solid #bfe3d0; border-radius: 5px; background: #fff; color: #1a7f4b; font-size: .85rem; font-weight: 800; line-height: 1; cursor: pointer; flex: none; }
.md-lista button.si-ok:hover { background: #1a7f4b; color: #fff; border-color: #1a7f4b; }
.md-lista .si-ok.deshacer { color: #9a6b00; border-color: #ecdca6; }
.md-lista button.si-ok.deshacer:hover { background: #9a6b00; border-color: #9a6b00; color: #fff; }
.md-lista .si-ok.hecho { background: #e3f3ef; border-color: #e3f3ef; cursor: default; opacity: .75; }
.md-lista .si-ana.grupo { padding-right: calc(.5rem + 84px + 1.35rem + 1rem); }   /* su subtotal queda en la columna de precios */
.md-total { display: flex; justify-content: flex-end; gap: .8rem; padding: .25rem .7rem; background: #f4faf9; font-size: .9rem; }
.solo-editando { display: none !important; }
.editando .solo-editando { display: inline-flex !important; }
.editando div.solo-editando { display: block !important; }
.editando .md-lista .si-ana.grupo { padding-right: calc(.5rem + 84px + 2.5rem + 1.5rem); }
.md-editar-fila { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .6rem; }
.md-editar-fila .btnlink { width: auto; min-width: 0; margin: 0; padding: .35rem .75rem; font-size: .85rem; line-height: 1.25; }
.md-editar-fila .md-llenar { margin-left: auto; }        /* a la derecha del renglón */
.md-editar { margin-top: .7rem; padding: .5rem .7rem; border: 1.5px dashed var(--teal); border-radius: 8px; background: #f8fcfb; }
table.md-pagos { max-width: 720px; font-size: .88rem; }
table.md-pagos td, table.md-pagos th { padding: .25rem .5rem; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.md-totales { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; max-width: 720px; margin: .5rem 0; padding: .4rem .7rem; background: #f4faf9; border-radius: 8px; }
.md-totales > div { display: flex; flex-direction: column; }
.md-totales .muted { font-size: .66rem; text-transform: uppercase; letter-spacing: .4px; }
.md-totales .debe strong { color: #b3261e; }
.md-totales .ok strong { color: var(--teal-d); }
.md-pago-form input { margin: 0; }
.md-inl { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; color: var(--muted); }
.md-barra { position: sticky; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .4rem; margin-top: .8rem; padding: .45rem .7rem; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 -4px 14px rgba(0,0,0,.07); }
.md-barra .rowbtns { margin: 0; gap: .35rem; }
.md-barra .btnlink, .md-barra button.btnlink { width: auto; min-width: 0; margin: 0; padding: .4rem .75rem; font-size: .85rem; line-height: 1.25; cursor: pointer; font-family: inherit; }
.md-barra button.btnlink.ghost:hover, .md-barra a.btnlink.ghost:hover { background: #eef7f5; }
.md-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 .2rem; }
.md-sub { margin: .6rem 0 .3rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: var(--teal-d); }
.md-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .5rem .9rem; max-width: 820px; }
.md-form label { display: flex; flex-direction: column; gap: .15rem; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.md-form label.ancho { grid-column: span 2; }
.md-form input, .md-form select { margin: 0; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: 7px; font-size: .92rem; width: 100%; }
.mu-avanzada[hidden], .md-panel[hidden] { display: none !important; }
.md-dato .md-lapiz { order: 0; }
.md-pago-form button { padding: .4rem .8rem; font-size: .88rem; }
/* ventana «Medicamentos» del antibiograma */
/* Ventana «Generar Resultado»: el texto se arma sumando opciones de varias pestañas. */
.gen-caja { max-width: 620px; }
.gen-cuerpo { padding: .8rem 1rem; }
.gen-campo { display: block; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.gen-campo textarea { width: 100%; margin-top: .25rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; font-family: inherit; resize: vertical; text-transform: none; letter-spacing: 0; color: var(--ink); }
.gen-tabs { display: flex; gap: .2rem; margin: .8rem 0 0; border-bottom: 1px solid var(--line); }
.gen-tab { width: auto; min-width: 0; margin: 0; padding: .35rem .9rem; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: .9rem; font-weight: 600; cursor: pointer; }
.gen-tab:hover { color: var(--teal-d); }
.gen-tab.on { color: var(--teal-d); border-bottom-color: var(--teal); }
.gen-lista-caja { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; overflow-y: auto; max-height: 300px; }
.gen-lista li { border-bottom: 1px solid #f0f4f3; }
.gen-lista li.muted { padding: .4rem .5rem; font-size: .85rem; }
.gen-lista .gen-sumar { width: 100%; margin: 0; padding: .3rem .6rem; border: 0; background: transparent; color: var(--teal-d); font-size: .92rem; text-align: left; cursor: pointer; }
.gen-lista .gen-sumar:hover { background: #eef7f5; }
.med-caja { max-width: 860px; }
.med-cuerpo { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: .8rem 1rem; }
.med-col { display: flex; flex-direction: column; min-width: 0; }
.med-tit { margin: 0 0 .4rem; font-size: .9rem; }
.med-elegidos, .med-lista { list-style: none; margin: 0; padding: 0; }
.med-elegidos { flex: 1; min-height: 240px; border: 1px solid var(--line); border-radius: 8px; padding: .3rem; overflow-y: auto; max-height: 340px; }
.med-elegidos li { display: flex; align-items: center; gap: .4rem; padding: .18rem .35rem; border-bottom: 1px dotted var(--line); font-size: .9rem; }
.med-elegidos li.muted { border: 0; font-size: .85rem; }
.med-elegidos .med-quitar { width: auto; min-width: 0; margin: 0 0 0 auto; padding: 0 .35rem; border: 0; border-radius: 6px; background: transparent; color: #b3261e; font-size: .8rem; cursor: pointer; }
.med-elegidos .med-quitar:hover { background: #fdecea; }
.med-nuevo { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.med-nuevo .rowbtns { margin: .2rem 0 .5rem; gap: .35rem; }
.med-nuevo input { flex: 1; margin: 0; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 7px; font-size: .9rem; }
.med-nuevo button { width: auto; min-width: 0; margin: 0; padding: .35rem .7rem; font-size: .85rem; }
.med-buscar { margin: 0 0 .4rem; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 7px; font-size: .9rem; }
.med-lista-caja { flex: 1; border: 1px solid var(--line); border-radius: 8px; overflow-y: auto; max-height: 340px; }
.med-lista li { display: flex; align-items: center; border-bottom: 1px solid #f0f4f3; }
.med-lista li.muted { padding: .4rem .5rem; font-size: .85rem; }
.med-lista li.puesto { background: #e8f7f4; }
.med-lista .med-sumar { flex: 1; width: auto; min-width: 0; margin: 0; padding: .22rem .5rem; border: 0; background: transparent; color: var(--teal-d); font-size: .9rem; text-align: left; cursor: pointer; }
.med-lista .med-sumar:hover { background: #eef7f5; }
.med-lista .med-baja { width: auto; min-width: 0; margin: 0; padding: 0 .45rem; border: 0; background: transparent; color: #b3261e; font-size: .85rem; cursor: pointer; }
.med-lista .med-baja:hover { background: #fdecea; }
@media (max-width: 700px) { .med-cuerpo { grid-template-columns: 1fr; } }
.der-modal[hidden] { display: none !important; }
.der-pie { display: flex; gap: .5rem; justify-content: flex-end; padding: .6rem 1rem 0; border-top: 1px solid var(--line); }
.der-pie .btnlink { width: auto; min-width: 0; margin: 0; padding: .4rem .9rem; font-size: .88rem; cursor: pointer; font-family: inherit; }
.check-inline { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--ink); margin: .2rem 0 .35rem; text-transform: none; letter-spacing: 0; }
.check-inline input { width: auto; margin: 0; }
/* ---- Laboratorios derivables: «Su lista» (lo que ellos ofrecen) y «Nuestro catálogo con sus precios».
   Todo lleva `.lst-…` delante: los botones y casillas tienen que ganarle a `button` (ancho 100 %,
   margen, color blanco, hover oscuro) y a `.content input` (ancho 100 %). */
.vista-tabs { display: flex; gap: .3rem; margin: 0 0 .7rem; flex-wrap: wrap; }
.vista-tab { padding: .45rem .9rem; border: 1px solid var(--line); border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0; background: #fff; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92rem; }
.vista-tab small { color: var(--muted); font-weight: 400; margin-left: .3rem; }
.vista-tab:hover { background: #f4faf9; }
.vista-tab.activa { border-bottom-color: var(--teal); color: var(--teal-d); background: #eef7f5; }
.tar-vista { margin: .1rem 0 .5rem; font-size: .9rem; }
.tar-vista .btnmini { margin-left: .4rem; }
.lst-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .6rem 0 .2rem; }
.lst-chips .lst-chip { width: auto; min-width: 0; margin: 0; padding: .25rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #444; font-size: .84rem; font-weight: 600; cursor: pointer; }
.lst-chips .lst-chip:hover { background: #eef7f5; }
.lst-chips .lst-chip b { margin-left: .25rem; color: var(--muted); }
.lst-chips .lst-chip.nochip { border-color: #f4b08a; color: #b3400b; }
.lst-chips .lst-chip.activo { background: var(--teal); border-color: var(--teal); color: #fff; }
.lst-chips .lst-chip.activo b { color: #e6f4f1; }
.lst-tabla td { vertical-align: top; }
.lst-tabla tr.est-no_esta td { background: #fff4ec; }
.lst-tabla tr.est-no_esta td:first-child { box-shadow: inset 4px 0 0 #e8590c; }
.lst-tabla tr.est-en_uso td:first-child { box-shadow: inset 4px 0 0 #2e7d32; }
.lst-tabla tr.est-por_confirmar td:first-child { box-shadow: inset 4px 0 0 #f0a500; }
.lst-tabla tr.est-convalidable td:first-child, .lst-tabla tr.est-sin_precio td:first-child { box-shadow: inset 4px 0 0 #cfd8d6; }
.lst-marca { display: inline-block; padding: .08rem .5rem; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.lst-marca.no_esta { background: #fde2d3; color: #b3400b; border: 1px solid #f4b08a; }
.lst-marca.probable { background: #fff3d6; color: #8a6100; }
.lst-marca.dudosa { background: #ffe8c2; color: #9a5b00; border: 1px solid #f0c27a; }
.lst-marca.manual { background: #e7f0fb; color: #1c5fb0; }
.lst-noconv { color: #b3400b; font-size: .78rem; }
.lst-nuestro { font-weight: 600; color: var(--teal-d); }
.lst-cubierto { font-size: .78rem; color: #7a6a00; }
.lst-cortado { font-size: .72rem; color: #c00000; white-space: nowrap; }
.lst-tabla td .lst-b { width: auto; min-width: 0; margin: .15rem 0 0 .2rem; padding: .12rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #444; font-size: .8rem; font-weight: 600; line-height: 1.3; cursor: pointer; }
.lst-tabla td .lst-b:hover { background: #eef7f5; }
.lst-tabla td .lst-b.si { background: var(--teal); border-color: var(--teal); color: #fff; }
.lst-tabla td .lst-vinc { display: flex; gap: .3rem; align-items: center; margin-top: .3rem; flex-wrap: wrap; }
.lst-tabla td .lst-vinc[hidden], .lst-tabla td [hidden] { display: none; }
.lst-tabla td .lst-vinc-input { width: 320px; max-width: 100%; margin: 0; padding: .25rem .45rem; font-size: .85rem; }
.lst-tabla .lst-usar { white-space: nowrap; }
.lst-tabla td .lst-check { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; font-weight: 600; }
.lst-tabla td .lst-check input { width: auto; margin: 0; padding: 0; transform: scale(1.2); accent-color: #2e7d32; }
.lst-tabla tr.est-en_uso .lst-check { color: #2e7d32; }
.lst-tabla tr.lst-aviso td { background: #fdecea; color: #b3261e; font-weight: 600; }
/* Laboratorios derivables: con «📋 Su lista» son tres botones y la fila se salía del panel (24 px).
   En esta tabla la celda de acciones puede partir en dos renglones. */
table.data.deriv-tabla td.acciones { white-space: normal; min-width: 150px; }
table.data.deriv-tabla td.acciones .btnmini { display: inline-block; margin: .1rem .3rem .1rem 0; }
table.data.deriv-tabla td.acciones .btnmini + .btnmini { margin-left: 0; }
/* ---- Llenar: descripción y rango PROPIOS de esta orden (no tocan el catálogo).
   La descripción tiene seguro: solo se edita con la casilla ✎ del encabezado tildada. Los botones van
   con `.ll-grid .desc-edit` delante para ganarle a `button` y a `.content form button`. */
.ll-grid th .ll-desc-lock { display: inline-flex; align-items: center; gap: .2rem; margin-left: .35rem; font-weight: 400; font-size: .8rem; color: var(--muted); cursor: pointer; text-transform: none; letter-spacing: 0; }
.ll-grid th .ll-desc-lock input { width: auto; margin: 0; padding: 0; }
.ll-grid.desc-habilitada .desc-edit { cursor: pointer; box-shadow: inset 0 -1px 0 #9fc9c2; }
.ll-grid.desc-habilitada .desc-edit:hover { background: #eef7f5; }
.ll-grid .desc-edit.editando { background: #fff; white-space: nowrap; }
.ll-grid .desc-edit .desc-input { width: 220px; min-width: 0; margin: 0; padding: .1rem .3rem; border: 1px solid var(--teal); border-radius: 5px; font-size: .86rem; color: var(--ink); background: #fff; }
/* desde el 22/09 es un área de varios renglones (Enter = renglón nuevo) */
.ll-grid .desc-edit textarea.desc-input { display: inline-block; vertical-align: top; font-family: inherit; line-height: 1.25; resize: vertical; }
.ll-grid .desc-edit.editando .ref-b { vertical-align: top; }
.ll-grid span.desc-edit { white-space: pre-line; }       /* los títulos también muestran sus renglones */
.ll-grid .desc-edit .ref-b { width: auto; min-width: 0; margin: 0 0 0 .15rem; padding: .05rem .3rem; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #444; font-size: .82rem; font-weight: 700; line-height: 1.25; cursor: pointer; }
.ll-grid .desc-edit .ref-b:hover { background: #eef7f5; }
.ll-grid .desc-edit .ref-b.si { background: var(--teal); border-color: var(--teal); color: #fff; }
.ll-grid .propia { color: #1c5fb0; font-weight: 600; }
.ll-grid .propia::after { content: " ✎"; font-size: .72em; color: #1c5fb0; }
.ll-grid .editando.propia::after { content: none; }

/* Firma de cada usuario (Usuarios) y sello de la sucursal: pedido del 22/09 */
table.data td.u-firma { white-space: nowrap; }
table.data td.u-firma form { display: inline; margin: 0; }
table.data td.u-firma .u-firma-cambiar { display: inline-block; cursor: pointer; margin: 0; vertical-align: middle; }
table.data td.u-firma .u-firma-img { display: block; height: 28px; width: 72px; object-fit: contain;
  background: repeating-conic-gradient(#f2f2f2 0% 25%, #fff 0% 50%) 50% / 10px 10px; border: 1px solid var(--line); border-radius: 4px; }
table.data td.u-firma .u-firma-cambiar:hover .u-firma-img { border-color: var(--teal); }
table.data td.u-firma label.btnmini { display: inline-block; cursor: pointer; font-weight: 600; margin: 0; }
table.tabla-usuarios td input[name="nombre"] { width: 130px; }
table.tabla-usuarios td input[name="carnet"] { display: block; width: 130px; margin-top: .25rem; }
table.tabla-usuarios td input[name="password"] { width: 110px; }
table.tabla-usuarios th, table.tabla-usuarios td { padding-left: .4rem; padding-right: .4rem; }
.tabla-scroll { overflow-x: auto; }
/* nombre completo y matrícula, uno debajo del otro (firma por código de barras, 23/09/2026) */
table.tabla-usuarios td.u-informe { min-width: 180px; }
table.tabla-usuarios td.u-informe input { display: block; margin: 0; max-width: none; }
table.tabla-usuarios td.u-informe input[name="nombre_completo"] { width: 180px; }
table.tabla-usuarios td.u-informe input[name="matricula"] { width: 110px; margin-top: .25rem; }
/* «Guardar» arriba y «Eliminar» abajo (23/09/2026: con «Para el informe» la fila ya tiene dos renglones
   y los dos botones en uno sacaban la tabla del panel) */
table.tabla-usuarios td.rowbtns { display: table-cell; white-space: nowrap; }
table.tabla-usuarios td.rowbtns form { display: block; margin: .25rem 0 0; }
table.tabla-usuarios td.rowbtns button { margin: 0; width: 100%; }
table.data td.u-firma button.btnmini { width: auto; min-width: 0; margin: 0 0 0 .2rem; padding: .25rem .5rem; }
.admin-form img.sello-muestra { background: repeating-conic-gradient(#f2f2f2 0% 25%, #fff 0% 50%) 50% / 12px 12px; }

/* Editor del catálogo (22/09): estados, chips, acciones por fila, reordenar y fórmulas */
.cat-tabla tr.inactivo td { color: #9a9a9a; }
.cat-tabla tr.inactivo td:not(.acciones) { text-decoration: line-through; text-decoration-color: #c9c9c9; }
.cat-tabla tr.titulo td:nth-child(2), .cat-tabla tr.titulo td:nth-child(3) { font-weight: 700; color: #253098; }
.chip-ok, .chip-off, .chip-tipo, .chip-formula, .chip-rojo, .chip-modo { display: inline-block; border-radius: 999px; padding: .05rem .5rem; font-size: .72rem; font-weight: 600; margin-left: .3rem; vertical-align: middle; text-decoration: none !important; }
.chip-ok { background: #e3f3ef; color: var(--teal-d); }
.chip-off { background: #f3e2e2; color: #a33; }
.chip-tipo { background: #eef2fb; color: #1c3f8a; font-weight: 500; }
.chip-formula { background: #fff3d6; color: #9a6b00; font-family: Georgia, serif; font-style: italic; }
.chip-rojo { background: #fdecea; color: #c0392b; }
.chip-modo { background: #eef2fb; color: #1c3f8a; font-weight: 500; font-size: .78rem; }
table.data td.cat-acciones { white-space: nowrap; text-align: right; }
table.data td.cat-acciones .btnmini { width: auto; min-width: 0; margin: 0 .15rem 0 0; padding: .2rem .45rem; }
table.data td.cat-acciones .rowdel { display: inline-block; padding: .1rem .4rem; cursor: pointer; color: #c0392b; font-weight: 700; }
table.data td.cat-orden { white-space: nowrap; }
table.data td.cat-orden .btnmini { width: auto; min-width: 0; margin: 0 .1rem 0 0; padding: .15rem .45rem; }
table.data td.cat-orden .btnmini:disabled { opacity: .3; cursor: default; }
.catbtns .btnlink.cat-exportar { width: auto; min-width: 0; margin: 0 auto 0 0; padding: .45rem .8rem; font-size: .85rem; line-height: 1.25; }
.cat-otras { white-space: pre-line; }          /* Otras referencias, renglón por renglón */
.cat-grid textarea { margin: 0; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .95rem; text-transform: none; letter-spacing: 0; color: var(--ink); background: #fff; resize: vertical; }
.cat-grid .check-inline { flex-direction: row; align-items: center; align-self: end; }
.cat-grid label.doble { grid-column: span 2; }
/* Método y Muestra: un renglón entero, mitad cada uno (23/09/2026: en su celda eran muy chicos) */
.cat-grid .cat-fila-par { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .8rem; }
.cat-grid .cat-fila-par .small { grid-column: 1 / -1; }
.cat-grid .cat-fila-par textarea { min-height: 3.2rem; }
.cat-grid .small { text-transform: none; letter-spacing: 0; font-size: .74rem; }
.cat-formula-txt, .mono { font-family: Consolas, "Courier New", monospace; font-size: .9rem; }
.cat-tabla td.pre { white-space: pre-line; }
.cat-formulas .cat-tabla { margin-bottom: .6rem; }
.cat-formula-form { margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed #c9dedb; }
.cat-ayuda { margin-top: .5rem; font-size: .85rem; }
.cat-ayuda summary { cursor: pointer; color: var(--teal-d); font-weight: 600; }
.cat-ayuda .cat-ids td { padding: .15rem .5rem; }

.ll-imp-aviso { align-self: center; color: var(--teal-d); font-weight: 600; font-size: .85rem; }

/* el catálogo muestra las descripciones tal cual (renglones y espacios de sangría) */
.cat-tabla td.cat-desc-celda { white-space: pre-wrap; }
.cat-grid textarea.cat-desc { font-family: inherit; white-space: pre; }

/* Equipos (22/09): PCs habilitadas para la app de escritorio */
.nav-pend { display: inline-block; min-width: 1.2rem; padding: 0 .35rem; margin-left: .15rem; border-radius: 999px; background: #d8a400; color: #fff; font-size: .72rem; font-weight: 700; text-align: center; }
.eq-ayuda { max-width: 60rem; margin: 0 0 1rem; }
.tabla-equipos td { vertical-align: middle; }
.tabla-equipos td.rowbtns { display: table-cell; white-space: nowrap; }
.eq-codigo { font-family: ui-monospace, Consolas, monospace; font-weight: 700; letter-spacing: .5px; white-space: nowrap; }
.eq-habilitar { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.eq-habilitar select, .eq-habilitar input[name=nombre] { width: auto; min-width: 11rem; margin: 0; }
.eq-reemplazar { display: inline-flex; align-items: center; gap: .25rem; margin: 0; white-space: nowrap; }
.eq-reemplazar input { width: auto; margin: 0; }
.eq-nombre input { width: 100%; min-width: 9rem; margin: 0; }
.eq-rehabilitar { display: inline-block; position: relative; }
.eq-rehabilitar > summary { list-style: none; cursor: pointer; display: inline-block; }
.eq-rehabilitar > summary::-webkit-details-marker { display: none; }
.eq-rehabilitar > form { position: absolute; right: 0; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .6rem; box-shadow: 0 6px 18px rgba(0,0,0,.12); min-width: 22rem; }

/* ---- Llenar: MÉTODO y MUESTRA propios de esta orden (22/09). Clic en la celda para corregirla;
   «⊘ Método» / «⊘ Muestra» en la fila del análisis vacían la columna entera (no sale en el informe). */
.ll-grid .edit-campo { cursor: pointer; white-space: pre-line; }
.ll-grid .edit-campo:hover { background: #eef7f5; box-shadow: inset 0 -1px 0 var(--teal); }
.ll-grid .edit-campo.editando { background: #fff; white-space: nowrap; }
.ll-grid .edit-campo.propia:empty::before { content: "—"; color: #1c5fb0; font-weight: 400; }
.ll-grid .edit-campo textarea.campo-input { width: 150px; min-width: 0; margin: 0; padding: .1rem .3rem; border: 1px solid var(--teal); border-radius: 5px; font-size: .84rem; font-family: inherit; line-height: 1.25; color: var(--ink); background: #fff; display: inline-block; vertical-align: top; resize: vertical; }
.ll-grid .edit-campo .ref-b { width: auto; min-width: 0; margin: 0 0 0 .15rem; padding: .05rem .3rem; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #444; font-size: .82rem; font-weight: 700; line-height: 1.25; cursor: pointer; vertical-align: top; }
.ll-grid .edit-campo .ref-b:hover { background: #eef7f5; }
.ll-grid .edit-campo .ref-b.si { background: var(--teal); border-color: var(--teal); color: #fff; }
.ll-grid td.ll-ana-cols { white-space: nowrap; }      /* «⊘ Método» / «⊘ Muestra», cada uno en su columna */
.ll-grid .ll-ana-cols .ll-col-b { width: auto; min-width: 0; margin: 0; padding: .05rem .5rem; height: 1.35rem; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #555; font-size: .76rem; font-weight: 600; cursor: pointer; }
.ll-grid .ll-ana-cols .ll-col-b:hover { background: #eef7f5; }
.ll-grid .ll-ana-cols .ll-col-b.on { background: #e7f0fb; border-color: #b9d1f0; color: #1c5fb0; }

/* ---- Sin precio fijado (costo de referencia 0, 23/09): se puede agregar a 0 Bs., en ámbar ---- */
.sinp-txt { color: #9a6b00; background: #fff3d6; border: 1px solid #f0d58a; border-radius: 999px; padding: .02rem .5rem; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.ana-lista .ana-ana.sinp { box-shadow: inset 4px 0 0 #d8a400; }
.ana-lista .ana-add.sinp { background: #d8a400; color: #fff; }
.ana-lista .ana-add.sinp:hover { background: #b98c00; }
.si-ana.sinp, .si-det.sinp { box-shadow: inset 4px 0 0 #d8a400; background: #fffbef; }
.tar-tabla tr.sinp td:first-child { box-shadow: inset 4px 0 0 #d8a400; }

/* ---- Reportes (24/09/2026): la ventana como la del programa de ejemplo ---- */
.sidebar nav hr.sb-sep { border: 0; border-top: 1px solid #aab7bc; margin: .45rem .3rem; width: auto; }
.rep-tabs { display: flex; flex-wrap: wrap; gap: .2rem; border-bottom: 1px solid var(--line); margin: 0 0 .9rem; }
.rep-tabs a { padding: .5rem 1rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.rep-tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }
.rep-tabs a:hover { color: var(--ink); }
.rep-filtro { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; margin: 0 0 .9rem; }
.rep-filtro label { display: flex; flex-direction: column; gap: .2rem; font-weight: 600; font-size: .85rem; }
.rep-filtro input[type=date] { width: auto; min-width: 11rem; margin: 0; }
.rep-filtro button, .rep-filtro .rep-pdf { margin: 0; }
.rep-tabla { width: 100%; border-collapse: collapse; font-size: .84rem; }
.rep-tabla th { text-align: left; font-size: .78rem; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); padding: .3rem .45rem; vertical-align: bottom; }
.rep-tabla td { border-bottom: 1px dotted #8f9aa3; padding: .25rem .45rem; vertical-align: top; }
.rep-tabla .num { text-align: right; white-space: nowrap; }
.rep-tabla td.rep-varios { white-space: pre-line; }
.rep-tabla tr.rep-cat td { background: #e6f3f6; color: #3695a2; font-weight: 700; font-size: .95rem; border-bottom: 0; }
.rep-tabla tr.rep-total td { font-weight: 700; font-style: italic; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.rep-tabla td.rep-debe { color: #b3261e; font-weight: 600; }
.rep-tabla.rep-angosta { max-width: 760px; }
.rep-vacio { color: var(--muted); padding: 1rem .45rem !important; }
.rep-pendiente p { margin: 0 0 .8rem; }

/* ---- Llenar: la unidad se cambia solo en esta orden (24/09/2026) ---- */
.ll-grid td.ll-uni { min-width: 2.2rem; }
.ll-grid .edit-campo input.campo-input { width: 90px; min-width: 0; margin: 0; padding: .1rem .3rem; border: 1px solid var(--teal); border-radius: 5px; font-size: .84rem; font-family: inherit; line-height: 1.25; color: var(--ink); background: #fff; display: inline-block; vertical-align: top; }

/* ---- Reportes › Doctores: «Órdenes de un doctor» (24/09/2026) ---- */
.rep-sub { font-size: 1.02rem; margin: 1.6rem 0 .7rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.rep-sub2 { font-size: .92rem; margin: 1.2rem 0 .45rem; }
.rep-doc { display: flex; gap: .4rem; align-items: center; font-weight: 400; }
.rep-filtro .rep-doc input[type=search] { width: 9.5rem; margin: 0; }
.rep-filtro .rep-doc select { width: 14rem; margin: 0; }   /* la lista abierta muestra el nombre entero */
.rep-resumen { margin: .1rem 0 .6rem; }
.rep-tabla td a { color: inherit; text-decoration: underline dotted #8f9aa3; text-underline-offset: 2px; }
.rep-tabla td a:hover { color: var(--teal); }

/* ---- Usuarios: el «Administrador» principal no se elimina (28/09/2026) ---- */
.tabla-usuarios .u-principal { font-weight: 600; }
.tabla-usuarios .u-candado { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.tabla-usuarios input[readonly] { background: #f3f5f5; color: var(--muted); }

/* Usuarios › Acciones (29/09/2026): «Guardar» y «Eliminar» apilados, a su ancho, dentro de una celda de tabla común */
table.tabla-usuarios td.u-acciones { white-space: nowrap; }      /* sin % de ancho: estiraba la tabla a toda la ventana */
table.tabla-usuarios .u-acc { display: flex; flex-direction: column; gap: .3rem; }
table.tabla-usuarios .u-acc form { margin: 0; }
table.tabla-usuarios .u-acc button { width: 100%; min-width: 0; margin: 0; }

/* ---- La edad en dos partes (02/10/2026): «2 años y 3 meses» ---- */
.edad-partes { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.edad-partes input[type=number] { width: 5.2rem; margin: 0; }
.edad-partes select { width: auto; margin: 0; }
.edad-partes .edad-y { color: var(--muted); font-size: .9rem; }
.md-form .edad-partes { text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--ink); }
/* Sexo (02/10/2026): los dos botones iguales, con el símbolo grande, arriba y en color */
.sexo-radio { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.sexo-radio span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 3.6rem; padding: .35rem .4rem; }
.sexo-radio .sx-simbolo { font-size: 1.55rem; line-height: 1; font-weight: 700; }
.sexo-radio .sx-m { color: #1f6fd1; }
.sexo-radio .sx-f { color: #d23f87; }
.sexo-radio input:checked + span .sx-simbolo { color: #fff; }
/* Nuevo paciente (02/10/2026, maqueta aprobada): la edad en DOS renglones al lado del sexo, que vuelve arriba a la
   derecha; los botones de sexo toman el alto de los dos renglones */
.edad-renglones { display: grid; grid-template-columns: .7rem minmax(2.5rem, 1fr) minmax(5.6rem, 1.6fr); gap: .3rem .25rem; align-items: center; }
.edad-renglones input, .edad-renglones select { min-width: 0; margin: 0; padding-left: .4rem; padding-right: .3rem; }
.edad-renglones input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.edad-renglones input[type=number]::-webkit-inner-spin-button,
.edad-renglones input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.edad-renglones .edad-y { color: var(--muted); font-size: .9rem; text-align: center; }
.sexo-celda { display: flex; flex-direction: column; }
.sexo-celda .sexo-radio { flex: 1; }
.sexo-celda .sexo-radio label { display: flex; }
.sexo-celda .sexo-radio span { flex: 1; }
.pac-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(11.5rem, 1fr) minmax(11.5rem, 1fr); }
@media (max-width: 760px) { .pac-grid { grid-template-columns: 1fr 1fr; } }

/* ---- Kardex, Asignar Insumos e inventario de reactivos (06/10/2026) ---- */
/* el botón del módulo: gana a «button { width:100%; margin-top }» y a «.content form button { min-width:170px }» */
.kx-btn, .content .kx-btn, .content form .kx-btn { display: inline-block; width: auto; min-width: 0; margin: 0; padding: .42rem .8rem; border: 1.5px solid var(--teal); border-radius: 8px; background: var(--teal); color: #fff; font-size: .86rem; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; font-family: inherit; }
.kx-btn:hover { background: var(--teal-d); }
.kx-btn.ghost, .content form .kx-btn.ghost { background: #fff; color: var(--teal-d); }
.kx-btn.ghost:hover { background: #eef7f5; }
.kx-btn.rojo, .content form .kx-btn.rojo { background: #fff; color: #b3261e; border-color: #e3b3ae; }
.kx-btn.rojo:hover { background: #fdecea; }
.kx-btn.mini, .content form .kx-btn.mini { padding: .2rem .5rem; font-size: .78rem; }
.kx-der { margin-left: auto; display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.kx-rojo { color: #b3261e; font-weight: 700; }
.kx-chip { display: inline-block; padding: .05rem .45rem; border-radius: 999px; background: #e3f3ef; color: #1b6e4b; font-size: .72rem; font-weight: 700; vertical-align: middle; white-space: nowrap; }
.kx-chip.rojo { background: #fdecea; color: #b3261e; }
table.data th.num, table.data td.num { text-align: right; white-space: nowrap; }
/* la lista */
.mu-busca select.kx-sel { width: auto; margin: 0; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 8px; font-size: .9rem; background: #fff; }
tr.kx-fila { cursor: pointer; }
tr.kx-fila:hover td { background: #eef7f5; }
tr.kx-fila.kx-sin td { background: #fdecea; }
tr.kx-fila.kx-sin:hover td { background: #fbdcd8; }
.kx-nom a { color: var(--teal-d); font-weight: 600; text-decoration: none; }
.kx-ana { color: var(--muted); font-size: .86rem; }
.kx-pie { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.kx-pie form { margin: 0; }
.kx-vacio { padding: .9rem 1.2rem; background: #f4faf9; border: 1px dashed #b9d8d2; border-radius: 10px; margin-top: .6rem; max-width: 760px; }
.kx-vacio ol { margin: .3rem 0 .2rem; padding-left: 1.3rem; }
.kx-vacio li { margin: .25rem 0; }
/* un insumo: sus lotes y su Kardex */
.kx-controles { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem 1.2rem; margin: .5rem 0 .7rem; }
.kx-controles label { display: flex; flex-direction: column; gap: .15rem; font-size: .78rem; color: var(--muted); margin: 0; }
.content .kx-controles select { width: auto; min-width: 9rem; margin: 0; }
/* (verde y rojo fijos: con los colores de la sucursal un saldo sano podía verse en rojo) */
.kx-saldo { margin-left: auto; padding: .35rem .85rem; border-radius: 999px; background: #e3f3ef; color: #1b6e4b; font-size: .92rem; white-space: nowrap; }
.kx-saldo.rojo { background: #fdecea; color: #b3261e; }
.kx-datos { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); gap: .2rem 2rem; margin: 0 0 .8rem; padding: .6rem .9rem; background: #f7fafa; border: 1px solid var(--line); border-radius: 10px; }
.kx-datos div { display: flex; gap: .45rem; font-size: .88rem; }
.kx-datos dt { color: var(--muted); white-space: nowrap; }
.kx-datos dt::after { content: ":"; }
.kx-datos dd { margin: 0; font-weight: 600; }
.kx-datos dd small { font-weight: 400; color: var(--muted); }
.kx-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .5rem 0 .2rem; }
.kx-acciones form { margin: 0; }
table.kx-kardex, table.kx-mano { font-size: .88rem; }
table.kx-kardex td, table.kx-mano td { padding: .3rem .6rem; }
.kx-fecha { white-space: nowrap; font-variant-numeric: tabular-nums; }
.kx-pendientes { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; }
.kx-pend-acc { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.kx-pend-acc form { margin: 0; }
.kx-mas { margin-top: 1.1rem; }
.kx-mas summary { cursor: pointer; color: var(--muted); font-size: .86rem; }
.kx-mas.kx-mano-caja summary { color: var(--ink); font-weight: 600; font-size: .92rem; }
.kx-linea { display: flex; align-items: end; gap: .6rem; flex-wrap: wrap; margin: .5rem 0 .7rem; }
.kx-linea label { margin: 0; flex: 0 1 340px; }
/* las ventanas */
dialog.kx-dlg { border: 0; border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); box-shadow: 0 20px 60px rgba(0,0,0,.28); color: var(--ink); }
dialog.kx-dlg.kx-dlg-ancho { width: min(780px, calc(100vw - 2rem)); }
dialog.kx-dlg::backdrop { background: rgba(20, 35, 34, .45); }
.kx-dlg-cab { padding: .75rem 1.2rem; background: #eef5f4; border-bottom: 1px solid var(--line); color: var(--teal-d); font-weight: 700; font-size: 1.05rem; }
.kx-dlg-cab small { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; }
.kx-dlg-cuerpo { padding: .8rem 1.2rem; overflow-y: auto; max-height: calc(100vh - 11rem); }
.kx-dlg-pie { display: flex; justify-content: flex-end; gap: .5rem; padding: .7rem 1.2rem; border-top: 1px solid var(--line); background: #fafcfc; }
.kx-dlg label, .kx-config label { display: block; font-size: .78rem; color: var(--muted); margin: .38rem 0 0; }
.kx-dlg input, .kx-dlg select, .kx-dlg textarea, .kx-config input, .kx-linea input { display: block; width: 100%; margin: .1rem 0 0; padding: .32rem .5rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .9rem; background: #fff; color: var(--ink); }
.kx-dlg textarea { resize: vertical; }
.kx-form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1.2rem; }
.kx-form-cols fieldset, .kx-config fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .3rem .9rem .9rem; margin: 0; min-width: 0; }
.kx-form-cols legend, .kx-config legend { font-weight: 700; color: var(--teal-d); padding: 0 .4rem; font-size: .9rem; }
.kx-form-una { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.kx-form-una .ancho { grid-column: 1 / -1; }
label.kx-check { display: flex; gap: .5rem; align-items: flex-start; font-size: .86rem; color: var(--ink); margin-top: .8rem; }
label.kx-check input { display: inline-block; width: auto; margin: .2rem 0 0; }
@media (max-width: 640px) { .kx-form-cols, .kx-form-una, .kx-dos { grid-template-columns: 1fr; } }
/* configuración */
.kx-config { max-width: 720px; }
.kx-config fieldset { margin-bottom: .9rem; }
.kx-con-unidad { display: flex; align-items: center; gap: .5rem; color: var(--ink); font-size: .9rem; }
.kx-config .kx-con-unidad input { width: 6rem; margin: 0; }
.kx-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
/* asignar insumos */
table.ins-tabla { max-width: 900px; }
table.ins-tabla td { padding: .28rem .6rem; font-size: .88rem; vertical-align: middle; }
tr.ins-cat td { background: #e6f3f6; color: #3695a2; font-weight: 700; font-size: .95rem; }
tr.ins-analisis .ins-desc { color: #1c5fb0; font-weight: 700; }
tr.ins-detalle .ins-desc { padding-left: 1.7rem; }
table.ins-tabla td.acciones { text-align: right; width: 1%; }
.mu-busca label.ins-solo { display: inline-flex; align-items: center; gap: .35rem; font-size: .86rem; color: var(--ink); margin: 0; }
.mu-busca label.ins-solo input { width: auto; margin: 0; }
.mu-btn[hidden] { display: none !important; }      /* «Limpiar búsqueda» mientras no se busca nada */
.ins-renglon .ins-titulo { margin: 0 0 .15rem; color: var(--teal-d); font-size: 1.1rem; }
.ins-padre { margin: 0 0 .3rem; font-size: .92rem; }
.ins-renglon table.ins-asignados td { padding: .3rem .5rem; }
.ins-renglon table.ins-asignados td.acciones { text-align: right; }
.ins-renglon form { margin: 0; }
.ins-nuevo { display: flex; gap: .5rem; margin-top: .7rem; align-items: center; }
.ins-nuevo input { flex: 1; margin: 0; }
/* la ventana «Editar» como la del programa de ejemplo: ✕ arriba, «Cancelar» y «Guardar cambios» abajo */
form.ins-renglon { margin: 0; }
.ins-cab { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
button.ins-x { width: auto; margin: 0; padding: .1rem .45rem; background: transparent; border: 0; border-radius: 6px; color: var(--ink); font-size: 1.1rem; line-height: 1; cursor: pointer; }
button.ins-x:hover { background: rgba(0, 0, 0, .08); }
.kx-dlg input[readonly] { background: var(--bg); }
.ins-nota { margin: .4rem 0 0; }
.ins-rotulo { margin: .7rem 0 .1rem; font-weight: 700; }
#ins-lista { counter-reset: ins; }
#ins-lista tr:not(.ins-vacio) { counter-increment: ins; }
#ins-lista .ins-n::before { content: counter(ins); }
.ins-aviso { margin: .4rem 0 0; color: #9a6b00; font-size: .84rem; }
/* la campana y los avisos */
button.kx-campana { position: relative; width: auto; margin: 0; padding: .28rem .5rem; background: transparent; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; color: #fff; font-size: 1.05rem; line-height: 1; cursor: pointer; }
button.kx-campana:hover { background: rgba(255,255,255,.18); }
.kx-campana .kx-n { position: absolute; top: -.5rem; right: -.5rem; min-width: 1.15rem; padding: 0 .28rem; border-radius: 999px; background: #e23b2e; color: #fff; font-size: .68rem; font-weight: 800; line-height: 1.15rem; text-align: center; }
ul.kx-avisos { list-style: none; margin: 0; padding: 0; }
.kx-av { padding: .35rem .6rem .35rem .8rem; border-left: 4px solid #d8a400; background: #fffaf0; margin-bottom: .3rem; border-radius: 0 6px 6px 0; font-size: .9rem; }
.kx-av a { color: inherit; text-decoration: none; }
.kx-av a:hover { text-decoration: underline; }
.kx-av.sin, .kx-av.vencido, .kx-av.pendiente { border-left-color: #c0392b; background: #fdecea; }
.kx-av-titulo { margin: 0 0 .4rem; font-weight: 700; font-size: .88rem; }
.kx-av-nada { margin: .3rem 0; color: var(--muted); }
/* Reportes › Inventario */
.rep-inv-barra { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .6rem; margin: 0 0 .9rem; }
.rep-inv-barra form { margin: 0; }
.content .rep-filtro select { width: auto; min-width: 12rem; margin: 0; }
.rep-tabla tr.rep-inv-fin td { color: #9a5b55; }
.rep-estado { font-weight: 700; font-size: .78rem; white-space: nowrap; }
/* el lote, las fechas y el registro sanitario no se parten: la pantalla usa el ancho y, si no entra, la tabla se desliza */
.rep-inventario td:nth-child(4), .rep-inventario td:nth-child(5), .rep-inventario td:nth-child(6), .rep-inventario td:nth-child(10) { white-space: nowrap; }
.rep-tabla.rep-inventario td a { color: var(--teal-d); font-weight: 600; text-decoration: none; }

/* ---- «Exportar PDF», al lado de «Imprimir» (06/10/2026): el mismo grupo de botón + ▾ (.imp-grupo) ---- */

/* ---- Formatos especiales del informe (08/10/2026): la pestaña de Codificadores y lo suyo en Llenar ---- */
.fmt-renglon { display: flex; align-items: flex-end; gap: .6rem; flex-wrap: wrap; margin-top: .7rem; }
.fmt-renglon label { display: flex; flex-direction: column; gap: .2rem; flex: 1 1 280px; font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.fmt-renglon select, .fmt-renglon input { margin: 0; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; text-transform: none; letter-spacing: 0; }
.fmt-renglon button { width: auto; min-width: 0; margin: 0; padding: .5rem .9rem; font-size: .9rem; }
.cat-tabla tr.fmt-sel td { background: #eef7f5; }
.cat-grid.fmt-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cat-grid label.fmt-doble { grid-column: span 2; }
.cat-grid label.fmt-triple { grid-column: span 3; }
.cat-grid.fmt-grid input::placeholder, .cat-grid.fmt-grid textarea::placeholder { color: #a9b4b2; font-style: italic; }
@media (max-width: 760px) { .cat-grid.fmt-grid { grid-template-columns: 1fr 1fr; } .cat-grid label.fmt-triple { grid-column: span 2; } }
.cat-grid label[hidden] { display: none; }
.fmt-otras .fmt-renglon { margin-top: 0; }
.fmt-otras p { margin: .5rem 0 .7rem; }
.fmt-otras .fmt-quitar { width: auto; min-width: 0; margin: 0; padding: .4rem .8rem; font-size: .85rem; background: #fff; color: #b3261e; border: 1px solid #f0c9c5; }
.ll-grid .ll-defecto { width: auto; min-width: 0; margin: 0 0 0 .6rem; padding: 0 .6rem; height: 1.35rem; border: 1px solid var(--teal); border-radius: 5px; background: #fff; color: var(--teal-d); font-size: .78rem; font-weight: 700; cursor: pointer; }
.ll-grid .ll-defecto:hover { background: var(--teal); color: #fff; }
.ll-nota-caja summary { cursor: pointer; font-size: .85rem; color: var(--teal-d); padding: .15rem 0; }
.ll-nota-caja .ll-nota-txt { width: 100%; margin: .3rem 0; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .88rem; line-height: 1.35; resize: vertical; }
.ll-nota-caja .ll-nota-volver { width: auto; min-width: 0; margin: 0 0 .3rem; padding: .2rem .6rem; font-size: .78rem; background: #fff; color: var(--teal-d); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.fmt-quitar-aviso { margin-top: .6rem; padding: .7rem .9rem; background: #fdecea; border: 1px solid #f0c9c5; border-radius: 10px; color: #5c1410; font-size: .9rem; }
.fmt-quitar-aviso[hidden], .fmt-otras .fmt-quitar[hidden] { display: none; }
.fmt-quitar-aviso p { margin: 0 0 .4rem; }
.fmt-quitar-aviso ul { margin: 0 0 .7rem 1.1rem; padding: 0; }
.fmt-quitar-aviso li { margin: .2rem 0; }
.fmt-quitar-botones { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
.fmt-quitar-botones button { width: auto; min-width: 0; margin: 0; padding: .5rem .9rem; font-size: .9rem; }
.fmt-quitar-botones .fmt-quitar-si { background: #b3261e; border-color: #b3261e; color: #fff; }
.cat-grid .fmt-ojo { display: block; margin-top: .25rem; padding: .35rem .5rem; background: #fff6e0; border: 1px solid #f1d58a; border-radius: 8px; color: #7a5200; font-size: .8rem; text-transform: none; letter-spacing: 0; line-height: 1.3; }

/* ---- Responsable de cada análisis (15/10/2026): el selector de Llenar, la ventana del código y «Mi código» ---- */
.ll-grid .ll-resp { display: inline-flex; align-items: center; gap: .3rem; margin-left: .8rem; font-size: .8rem; color: var(--muted); font-weight: 400; }
.ll-grid .ll-resp-sel { width: auto; min-width: 11rem; max-width: 16rem; margin: 0; padding: .1rem .35rem; height: 1.6rem; border: 1px solid var(--line); border-radius: 6px; font-size: .82rem; background: #fff; color: var(--ink); }
.ll-resp-aviso { font-size: .78rem; }
.ll-resp-aviso.bien { color: #1b6e4b; }
.ll-resp-aviso.mal { color: #b3261e; font-weight: 600; }
.ll-resp-aviso.pista { color: var(--muted); font-style: italic; }
.ll-grid .ll-resp-sel.falta { border-color: #b3261e; box-shadow: 0 0 0 2px rgba(179, 38, 30, .25); }
.resp-dlg { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; max-width: 26rem; width: calc(100% - 2rem); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.resp-dlg::backdrop { background: rgba(0,0,0,.35); }
.resp-dlg-tit { font-weight: 700; color: var(--teal-d); margin-bottom: .5rem; }
.resp-dlg p { margin: .3rem 0 .6rem; font-size: .9rem; }
.resp-dlg label { display: flex; flex-direction: column; gap: .2rem; margin: .45rem 0; font-size: .8rem; color: var(--muted); }
.resp-dlg input { width: 100%; margin: 0; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; letter-spacing: .15em; }
.resp-dlg input[hidden], .resp-dlg button[hidden], .resp-dlg p[hidden] { display: none; }
.resp-error { color: #b3261e; background: #fdecea; border: 1px solid #f0c9c5; border-radius: 8px; padding: .4rem .55rem; font-size: .85rem; }
.resp-botones { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .8rem; }
.resp-botones button { width: auto; min-width: 0; margin: 0; padding: .45rem .9rem; font-size: .9rem; }
.resp-botones .ghost { background: #fff; color: var(--teal-d); border: 1px solid var(--line); }
#realizado button { width: auto; min-width: 0; padding: .5rem 1rem; }
#realizado button.ghost { background: #fff; color: var(--teal-d); border: 1px solid var(--line); }
.firma-codigo { margin-top: .5rem; padding-top: .45rem; border-top: 1px dashed var(--line); font-size: .78rem; color: var(--muted); }
.firma-codigo .ok { color: #1b6e4b; }
.firma-codigo .falta { color: #b3261e; }
.firma-codigo-btn { width: auto; min-width: 0; margin: .2rem 0 0 .3rem; padding: .1rem .5rem; font-size: .75rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--teal-d); cursor: pointer; }
