/* ==========================================================================
   Offimedicas Recepción — personal (tablero y administración)
   Sistema de diseño de offim.co (ECO/brand/sistema-de-diseno.md): mismos tokens.
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap");

:root {
  --brand: #084283;
  --brand-2: #1C5BA8;
  --brand-deep: #062F5E;
  --brand-darkest: #041F3D;
  --accent: #92BC3E;
  --accent-2: #B5D16E;
  --brand-soft: #E6EEF8;

  --ink: #0E1B2C;
  --ink-2: #45536A;
  --muted: #66748A;
  --line: #DCE3EE;
  --line-2: #EBF0F7;
  --surface: #FFFFFF;
  --bg: #F3F6FB;
  --ok: #4E7D16;
  --ok-soft: #EEF5DF;
  --danger: #C8372D;
  --danger-soft: #FDECEA;
  --warn: #8A6100;
  --warn-soft: #FFF6D6;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(14, 27, 44, .05), 0 8px 24px -12px rgba(6, 47, 94, .18);
  --shadow-lg: 0 30px 60px -20px rgba(6, 47, 94, .35), 0 10px 24px -12px rgba(6, 47, 94, .2);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; font-size: 14.5px; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15.5px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: .92em; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }
.sep { height: 1px; background: var(--line-2); margin: 6px 0; border: 0; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; background: none;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s, opacity .2s;
}
.btn.primary { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%); color: #fff; box-shadow: 0 8px 18px -8px rgba(6, 47, 94, .6); }
.btn.primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(6, 47, 94, .7); }
.btn.accent { background: var(--accent); color: var(--brand-deep); box-shadow: 0 8px 18px -10px rgba(78, 125, 22, .7); }
.btn.accent:hover:not(:disabled) { transform: translateY(-1px); background: #9BC548; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--brand-deep); }
.btn.ghost:hover:not(:disabled) { border-color: var(--brand); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.ok:hover:not(:disabled) { background: #436C12; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-ghost { color: var(--danger); border-color: #F2C6C2; background: var(--surface); }
.btn.danger-ghost:hover:not(:disabled) { background: var(--danger-soft); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { height: 52px; padding: 0 24px; font-size: 15.5px; border-radius: 14px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.cargando { pointer-events: none; opacity: .85; }
.btn.cargando::after { content: ""; width: 15px; height: 15px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: giro .7s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
.link { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.link:hover { text-decoration: underline; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 6px; border: 1px solid rgba(255,255,255,.35); opacity: .8; }

/* ---------- Formularios ---------- */
.campo { display: grid; gap: 6px; min-width: 0; }
.campo > label, .etiqueta { font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.campo > label .req { color: var(--danger); }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  outline: none; transition: border-color .15s, box-shadow .15s; font-size: 14.5px;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 14px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(28, 91, 168, .12); }
.input.error { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(200, 55, 45, .08); }
.input:disabled { background: var(--line-2); color: var(--muted); }
.ayuda { font-size: 12px; color: var(--muted); }
.error-texto { font-size: 12.5px; color: var(--danger); font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13.5px; line-height: 1.45; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.segmento { display: inline-flex; background: var(--line-2); border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.segmento button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.segmento button.activo { background: var(--surface); color: var(--brand-deep); box-shadow: var(--shadow); }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 64px; padding: 0 22px; display: flex; align-items: center; gap: 18px;
  background: linear-gradient(120deg, var(--brand-deep) 0%, var(--brand) 60%, var(--brand-2) 100%); color: #fff;
  box-shadow: 0 6px 24px -12px rgba(4, 31, 61, .7);
}
.topbar .logo { height: 30px; width: auto; }
.topbar .titulo { font-weight: 700; font-size: 15px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.topbar .titulo::before { content: ""; width: 1px; height: 22px; background: rgba(255,255,255,.3); }
.topbar select { height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1); color: #fff; padding: 0 12px; font-weight: 600; }
.topbar select option { color: var(--ink); }
.topbar .reloj { font-variant-numeric: tabular-nums; font-weight: 600; opacity: .9; font-size: 14px; }
.topbar .nav { display: flex; gap: 4px; }
.topbar .nav a { color: rgba(255,255,255,.8); text-decoration: none; font-weight: 600; font-size: 13.5px; padding: 8px 12px; border-radius: 10px; display: inline-flex; gap: 6px; align-items: center; }
.topbar .nav a:hover, .topbar .nav a.activo { background: rgba(255,255,255,.12); color: #fff; }
.topbar .usuario { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.topbar .usuario .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--brand-deep); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.topbar .icon-btn { color: rgba(255,255,255,.85); }
.topbar .icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.vivo { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; opacity: .9; }
.vivo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(146, 188, 62, .7); animation: pulso 2s infinite; }
.vivo.caido::before { background: #F2B8B3; animation: none; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(146,188,62,.6); } 70% { box-shadow: 0 0 0 8px rgba(146,188,62,0); } 100% { box-shadow: 0 0 0 0 rgba(146,188,62,0); } }

/* ---------- Contenido ---------- */
.contenido { padding: 22px; max-width: 1680px; margin: 0 auto; }
.tarjeta { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line-2); }
.tarjeta.pad { padding: 20px; }
.cabecera { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge .ico { width: 13px; height: 13px; }

.aviso { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; background: var(--brand-soft); color: var(--brand-deep); }
.aviso.warn { background: var(--warn-soft); color: var(--warn); }
.aviso.danger { background: var(--danger-soft); color: var(--danger); }
.aviso.ok { background: var(--ok-soft); color: var(--ok); }
.aviso .ico { margin-top: 1px; }
.aviso b { font-weight: 700; }

/* ---------- Tablero ---------- */
.resumen { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 14px; margin-bottom: 18px; align-items: stretch; }
.kpi { background: var(--surface); border-radius: 16px; padding: 14px 18px; border: 1px solid var(--line-2); box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; }
.kpi .num { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi .ico-kpi { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi.warn .ico-kpi { background: var(--warn-soft); color: var(--warn); }
.kpi.ok .ico-kpi { background: var(--ok-soft); color: var(--ok); }
.kpi.gris .ico-kpi { background: var(--line-2); color: var(--ink-2); }
.registrar { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.registrar .btn { height: 100%; min-height: 64px; padding: 0 26px; font-size: 16px; border-radius: 16px; }
.registrar .btn .ico { width: 22px; height: 22px; }

.tablero { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.columna { background: rgba(230, 238, 248, .55); border-radius: 18px; padding: 12px; min-height: 240px; border: 1px solid var(--line-2); }
.columna > header { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; }
.columna > header h3 { font-size: 14px; }
.columna > header .cuenta { margin-left: auto; font-weight: 800; font-size: 13px; color: var(--brand); background: var(--surface); border-radius: 999px; min-width: 28px; text-align: center; padding: 1px 8px; }
.columna .vacia { text-align: center; color: var(--muted); font-size: 13px; padding: 28px 10px; }
.columna .lista { display: grid; gap: 10px; }

.visita {
  --c: var(--brand);
  position: relative; background: var(--surface); border-radius: 14px; padding: 12px 12px 12px 16px; box-shadow: var(--shadow); cursor: pointer;
  border: 1px solid var(--line-2); transition: transform .15s var(--ease), box-shadow .2s; overflow: hidden;
}
.visita::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.visita:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.visita.nueva { animation: llega .9s var(--ease); }
@keyframes llega { 0% { transform: scale(.96); box-shadow: 0 0 0 4px rgba(146,188,62,.6); } 100% { transform: none; } }
.visita .top { display: flex; gap: 10px; align-items: flex-start; }
.visita .avatar { width: 38px; height: 38px; border-radius: 12px; background: color-mix(in srgb, var(--c) 14%, white); color: var(--c); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.visita .nombre { font-weight: 700; font-size: 14px; line-height: 1.25; }
.visita .empresa { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visita .tiempo { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.visita .tiempo.alerta { color: var(--danger); }
.visita .destino { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
.visita .destino .ico { width: 14px; height: 14px; color: var(--muted); }
.visita .chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.visita .acciones { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.visita .acciones .btn { flex: 1; }
.visita.compacta { padding: 9px 10px 9px 14px; opacity: .8; }
.visita.compacta .avatar { width: 30px; height: 30px; border-radius: 9px; font-size: 11px; }

/* ---------- Ventanas (modal y panel lateral) ---------- */
.fondo { position: fixed; inset: 0; background: rgba(4, 31, 61, .45); backdrop-filter: blur(3px); z-index: 50; display: flex; animation: aparece .2s ease; }
@keyframes aparece { from { opacity: 0; } }
.modal { margin: auto; width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 32px); background: var(--bg); border-radius: 22px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: sube .3s var(--ease); }
.modal.angosto { width: min(520px, calc(100vw - 32px)); }
@keyframes sube { from { transform: translateY(18px); opacity: 0; } }
.modal > header, .panel > header { display: flex; align-items: center; gap: 12px; padding: 18px 22px; background: var(--surface); border-bottom: 1px solid var(--line-2); }
.modal > .cuerpo, .panel > .cuerpo { padding: 20px 22px; overflow: auto; flex: 1; }
.modal > footer, .panel > footer { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 14px 22px; background: var(--surface); border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.panel { margin-left: auto; width: min(560px, 100vw); height: 100%; background: var(--bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: entra .3s var(--ease); }
@keyframes entra { from { transform: translateX(40px); opacity: 0; } }

.seccion { background: var(--surface); border-radius: 16px; border: 1px solid var(--line-2); padding: 16px; display: grid; gap: 14px; }
.seccion + .seccion { margin-top: 14px; }
.seccion > h3 { display: flex; align-items: center; gap: 8px; }
.seccion > h3 .num { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; }

/* Lector */
.lector { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 2px dashed var(--brand-2); background: var(--brand-soft); color: var(--brand-deep); }
.lector .ico { width: 28px; height: 28px; }
.lector.leido { border-style: solid; border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.lector textarea { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.lector .estado { font-weight: 700; }

/* Tipos de visita */
.tipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tipo { --c: var(--brand); display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; font-weight: 600; font-size: 13px; line-height: 1.25; transition: border-color .15s, box-shadow .15s; }
.tipo .chip { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, white); color: var(--c); flex: none; }
.tipo:hover { border-color: var(--c); }
.tipo.activo { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.politica { display: flex; flex-wrap: wrap; gap: 6px; }

/* Búsqueda de anfitrión */
.buscador { position: relative; }
.resultados { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); max-height: 320px; overflow: auto; padding: 6px; }
.resultado { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.resultado:hover, .resultado.activo { background: var(--brand-soft); }
.resultado .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--ink-2); flex: none; }
.elegido { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--ok); background: var(--ok-soft); }
.elegido .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-weight: 800; }

/* Cámara */
.capturas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.captura { border-radius: 14px; border: 1.5px dashed var(--line); background: var(--line-2); aspect-ratio: 4 / 3; display: grid; place-items: center; text-align: center; padding: 10px; cursor: pointer; position: relative; overflow: hidden; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.captura .ico { width: 26px; height: 26px; margin: 0 auto 6px; }
.captura.requerida { border-color: var(--brand-2); color: var(--brand); }
.captura img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.captura .quitar { position: absolute; top: 6px; right: 6px; z-index: 2; background: rgba(255,255,255,.92); }
.camara { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.camara video { width: 100%; height: 100%; object-fit: cover; }
.camara .marco { position: absolute; inset: 10% 22%; border: 3px solid rgba(255,255,255,.75); border-radius: 50% / 42%; pointer-events: none; }
.camara .marco.doc { inset: 18% 8%; border-radius: 14px; }

/* Detalle */
.ficha { display: flex; gap: 16px; align-items: center; }
.ficha .foto { width: 92px; height: 92px; border-radius: 18px; background: var(--line-2); object-fit: cover; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 26px; color: var(--muted); }
.datos { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 13.5px; }
.datos dt { color: var(--muted); font-weight: 500; }
.datos dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.linea-tiempo { position: relative; display: grid; gap: 14px; padding-left: 22px; }
.linea-tiempo::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.hito { position: relative; font-size: 13px; }
.hito::before { content: ""; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); }
.hito.ok::before { border-color: var(--ok); }
.hito.danger::before { border-color: var(--danger); }
.hito.warn::before { border-color: #D9A400; }
.hito .cuando { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.imagenes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.imagenes img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; background: var(--line-2); cursor: zoom-in; }

/* Tablas (administración) */
.tabla { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tabla th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.tabla td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tabla tr.clic { cursor: pointer; }
.tabla tr.clic:hover td { background: #F8FAFD; }
.tabla tr.inactivo td { color: var(--muted); }
.tabla-scroll { overflow: auto; max-height: calc(100vh - 260px); border-radius: var(--radius); }
.punto { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: middle; background: var(--c, var(--brand)); }

.pestanas { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.pestanas button { border: 0; background: none; padding: 12px 16px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.pestanas button.activo { color: var(--brand-deep); border-bottom-color: var(--accent); }

.barras { display: grid; gap: 8px; }
.barra { display: grid; grid-template-columns: 160px 1fr 44px; gap: 10px; align-items: center; font-size: 12.5px; }
.barra .riel { height: 10px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.barra .riel i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.barra span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.barra b { text-align: right; font-variant-numeric: tabular-nums; }

.espacio { height: 12px; }
.espacio-arriba { margin-top: 30px; }
.filtros { margin-bottom: 4px; }
.subtitulo-form { margin-top: 8px; color: var(--brand-deep); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.centrado { text-align: center; }
.nombre-recepcion { line-height: 1.2; font-size: 13.5px; }
.nombre-recepcion .small { opacity: .75; }
.nombre-usuario { font-weight: 600; line-height: 1.2; }
.rol-usuario { opacity: .75; }
.visita .nota { margin-top: 6px; font-style: italic; }
.resultados .pad { padding: 10px; }

/* ---------- Ingreso ---------- */
.login { min-height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .marca { background: radial-gradient(1200px 600px at 10% 10%, var(--brand-2) 0%, transparent 60%), linear-gradient(150deg, var(--brand-deep) 0%, var(--brand-darkest) 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login .marca::after { content: ""; position: absolute; right: -160px; bottom: -160px; width: 480px; height: 480px; border-radius: 50%; border: 48px solid rgba(146, 188, 62, .18); }
.login .marca h1 { font-size: 40px; line-height: 1.1; margin-top: 18px; max-width: 460px; }
.login .marca p { opacity: .8; max-width: 440px; margin-top: 14px; }
.login .marca .logo { height: 46px; width: auto; align-self: flex-start; }
.login .marca .muted-claro { opacity: .6; position: relative; z-index: 1; }
.login .forma { display: grid; place-items: center; padding: 32px; }
.login form { width: min(380px, 100%); display: grid; gap: 16px; }

/* ---------- Avisos flotantes ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: grid; gap: 10px; }
.toast { min-width: 280px; max-width: 420px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; animation: sube .3s var(--ease); }
.toast.ok { background: var(--ok); }
.toast.error { background: var(--danger); }
.toast.alerta { background: var(--brand-deep); }

/* ---------- Escarapela (impresión térmica) ---------- */
#escarapela { display: none; }
@media print {
  body > *:not(#escarapela) { display: none !important; }
  #escarapela { display: block; }
}
/* Páginas con nombre: cada impresión toma el tamaño de su clase */
@page escarapela-brother { size: 62mm 100mm; margin: 0; }
@page escarapela-zebra { size: 57mm 102mm; margin: 0; }
@page lista { size: A4; margin: 14mm; }
.lista-impresion { page: lista; font-size: 11pt; }
.lista-impresion .tabla th { position: static; }
.esc { page: escarapela-brother; width: 62mm; height: 100mm; padding: 4mm; font-family: var(--font); color: #000; display: flex; flex-direction: column; gap: 2mm; overflow: hidden; page-break-after: always; }
.esc.zebra { page: escarapela-zebra; width: 57mm; height: 102mm; }
.esc .franja { height: 9mm; background: #000; color: #fff; display: flex; align-items: center; justify-content: center; gap: 2mm; font-weight: 800; font-size: 10pt; text-transform: uppercase; letter-spacing: .04em; border-radius: 1.5mm; }
.esc .franja svg { width: 5mm; height: 5mm; stroke: #fff; }
.esc .foto { width: 26mm; height: 30mm; object-fit: cover; filter: grayscale(1) contrast(1.15); border-radius: 1.5mm; align-self: center; }
.esc .sinfoto { width: 26mm; height: 30mm; border: .4mm solid #000; border-radius: 1.5mm; align-self: center; display: grid; place-items: center; font-size: 16pt; font-weight: 800; }
.esc .nom { font-size: 13pt; font-weight: 800; line-height: 1.1; text-align: center; }
.esc .emp { font-size: 8.5pt; text-align: center; }
.esc .dest { font-size: 8.5pt; border-top: .3mm solid #000; padding-top: 1.5mm; line-height: 1.25; }
.esc .pie { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; font-size: 7.5pt; }
.esc .pie svg { width: 20mm; height: 20mm; }
.esc .acomp { font-size: 8pt; font-weight: 800; text-align: center; border: .4mm solid #000; border-radius: 1mm; padding: .8mm; }

@media (max-width: 1280px) {
  .tablero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resumen { grid-template-columns: repeat(2, 1fr); }
  .registrar { grid-column: span 2; }
}
@media (max-width: 760px) {
  .tablero, .grid2, .grid3, .grid4, .capturas { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
  .login { grid-template-columns: 1fr; }
  .login .marca { display: none; }
  .topbar .titulo, .topbar .reloj { display: none; }
}
