/* ============================================================
   SIGRE · demo interactiva
   Réplica navegable del programa de escritorio. Los valores de
   este archivo no son una interpretación: son los de
   src/Sigre.Escritorio/Recursos/Modernist.xaml y de las vistas,
   medidos sobre el XAML — Fondo #F4F3F2, Tinta #201E1D, reglas de
   2 px al 40 % de la tinta, radio 6 en tarjetas y 4 en botones,
   filas de tabla de 38 a 40 px, rótulos de 10 px ExtraBold.
   La ventana se queda clara aunque el sitio esté en modo oscuro:
   el programa no tiene tema oscuro, tiene variante azul.
   ============================================================ */

.sg-app {
  --a-chrome: #201e1d;      /* Tinta: barra de título, lateral y de estado */
  --a-chrome-2: #201e1d;
  --a-chrome-ink: #f4f3f2;  /* Fondo sobre la tinta */
  --a-chrome-dim: rgba(244, 243, 242, .55);
  --a-bg: #f4f3f2;          /* Fondo */
  --a-panel: #eae9e9;       /* Superficie */
  --a-card: #fcfcfb;        /* Papel */
  --a-card-hi: #fff;        /* PapelHover */
  --a-ink: #201e1d;         /* Tinta */
  --a-ink-2: rgba(32, 30, 29, .6);   /* TextoTenue */
  --a-ink-3: rgba(32, 30, 29, .45);  /* TextoMuyTenue */
  --a-line: rgba(32, 30, 29, .18);   /* DivisorSuave */
  --a-line-2: rgba(32, 30, 29, .4);  /* Divisor — nunca un pelo */
  --a-accent: #ec3013;
  --a-accent-600: #dd2b0f;
  --a-fill: #ec3013;        /* BotonPrimario usa el acento puro */
  --a-fill-hi: #dd2b0f;
  --a-fill-lo: #ae1800;
  /* Acento 700: el único tono del acento legible a cuerpo de párrafo. */
  --a-accent-text: #ae1800;
  --a-accent-ink: #f4f3f2;
  --a-accent-soft: #fff2ef; /* Acento100 */
  --a-accent-400: #ff9783;
  --a-accent-800: #7c1405;
  --a-ok: #166534;          /* AlertaNormal */
  --a-warn: #b45309;        /* AlertaBajo */
  --a-bad: #c81e1e;         /* AlertaAlto */
  --a-crit: #9b1c1c;        /* AlertaCritico */
  --a-bad-soft: #fbeaea;    /* FondoCritico */
  --a-faviso: #fdf4e7;      /* FondoAviso */
  --a-fmarcado: #fdeae7;    /* FondoMarcado: fila fuera de rango */
  --a-n100: #f8f4f4;        /* Neutral100: fondo de las etiquetas */
  --a-n800: #444141;        /* Neutral800: texto de las etiquetas */
  --a-r: 6px;               /* Radio */
  --a-r4: 4px;              /* RadioSuave */
  --a-r12: 12px;            /* las cajas de Caja y ARS suben a 8-12 */
  --a-sh: 0 1px 10px rgba(32, 30, 29, .10);
  --a-sh2: 0 4px 22px rgba(32, 30, 29, .16);
  --a-rail: 64px;
  --a-rail-open: 236px;
  --a-bar: 34px;
  --a-status: 28px;
  font-family: var(--sans);
  color: var(--a-ink);
}

/* ---------- marco exterior de la demo ---------- */
.sg-dock {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.sg-dock__who { display: flex; flex-direction: column; gap: 2px; }
.sg-dock__who b { font-size: .95rem; font-weight: 700; letter-spacing: -.01em; }
.sg-dock__who span { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); }
#sg-dock-btns { display: flex; gap: 8px; }
.sg-dock__btn {
  font: 600 .78rem/1 var(--sans); letter-spacing: -.01em; padding: 9px 13px; cursor: pointer;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r4);
}
.sg-dock__btn:hover { border-color: var(--ink-3); }
.sg-wrapx { position: relative; }

.sg {
  display: grid; grid-template-rows: var(--a-bar) 1fr var(--a-status);
  height: min(760px, 82vh); min-height: 560px; background: var(--a-bg);
  border: 1px solid var(--a-ink); border-radius: var(--a-r); overflow: hidden;
  box-shadow: var(--a-sh2); font-size: 13px; line-height: 1.35;
  contain: paint;
}

/* ---------- barra de título (34 px, Tinta) ---------- */
.sg__bar {
  display: flex; align-items: center; gap: 12px; padding: 0 0 0 12px;
  background: var(--a-chrome); color: var(--a-chrome-ink);
}
.sg__brand { font-weight: 700; font-size: 12px; letter-spacing: .02em; }
.sg__bar .sep { width: 2px; height: 14px; background: var(--a-chrome-ink); opacity: .25; }
.sg__title { font-size: 11px; opacity: .55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg__win { margin-left: auto; display: flex; align-self: stretch; }
.sg__win span {
  width: 46px; display: grid; place-items: center; font-size: 12px; cursor: pointer;
  border-left: 1px solid rgba(244, 243, 242, .12);
}
.sg__win span:hover { background: rgba(243, 242, 242, .2); }
.sg__win span[data-x]:hover { background: var(--a-accent); }
.sg__win svg { width: 13px; height: 13px; display: block; }

/* ---------- cuerpo: lateral + contenido ---------- */
.sg__body { display: grid; grid-template-columns: auto minmax(0, 1fr); min-height: 0; }

/* El raíl mide 64 px y se despliega a 236 con el cursor encima, empujando el
   contenido en vez de taparlo: es el comportamiento del programa. */
.sg__rail {
  width: var(--a-rail); flex: none; background: var(--a-chrome); color: var(--a-chrome-ink);
  overflow: hidden; transition: width .16s ease; overflow-y: auto; scrollbar-width: none;
}
.sg__rail::-webkit-scrollbar { display: none; }
.sg__rail:hover, .sg__rail:focus-within { width: var(--a-rail-open); }
.sg__rail > div { padding: 14px 0 16px; display: flex; flex-direction: column; min-height: 100%; }
.sg-nav { display: flex; flex-direction: column; gap: 8px; }
.sg-nav__top { padding: 0 0 14px; }
.sg-nav__rule { height: 2px; background: var(--a-chrome-ink); opacity: .22; flex: none; }
.sg-nav__label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  opacity: .5; padding: 14px 16px 10px; white-space: nowrap;
}
.sg-nav__i {
  display: flex; align-items: center; gap: 0; height: 42px; flex: none; width: 100%;
  background: transparent; border: 0; border-radius: var(--a-r4); cursor: pointer;
  color: var(--a-chrome-ink); font: 400 13.5px/1 var(--sans); text-align: left; opacity: .85;
  position: relative;
}
.sg-nav__i:hover { opacity: 1; }
.sg-nav__i svg { width: 20px; height: 20px; flex: none; margin: 0 22px 0 22px; }
.sg-nav__i b { font-weight: inherit; white-space: nowrap; opacity: 0; transition: opacity .12s; }
.sg__rail:hover .sg-nav__i b, .sg__rail:focus-within .sg-nav__i b { opacity: 1; }
.sg-nav__i .n {
  margin-left: auto; font-family: var(--mono); font-size: 11.5px; padding-right: 16px;
  opacity: 0; transition: opacity .12s;
}
.sg__rail:hover .sg-nav__i .n, .sg__rail:focus-within .sg-nav__i .n { opacity: 1; }
.sg-nav__i[aria-current="true"] { background: var(--a-accent); font-weight: 600; opacity: 1; }
.sg-nav__i.is-hot .n { color: var(--a-accent-400); font-weight: 600; }
.sg-nav__new { height: 44px; background: var(--a-accent); color: var(--a-accent-ink); font-weight: 600; }
.sg-nav__new:hover { background: var(--a-accent-600); }
.sg-nav__pt {
  height: 40px; border: 1px solid var(--a-chrome-ink); opacity: .75; font-size: 13px;
}
.sg-nav__pt:hover { opacity: 1; background: rgba(243, 242, 242, .13); }
.sg-nav__out { margin-top: auto; }
.sg-nav__i[disabled] { opacity: .45; cursor: no-drop; }
.sg-nav__who { padding: 14px 16px 0; font-size: 11.5px; line-height: 1.45; opacity: .6; white-space: nowrap; }

.sg__main { min-width: 0; overflow: hidden; display: flex; }
.sg__view { flex: 1; min-width: 0; overflow: auto; background: var(--a-bg); }
.sg__view:focus { outline: none; }

/* ---------- barra de estado (28 px, Tinta) ---------- */
.sg__status {
  display: flex; align-items: center; gap: 20px; padding: 0 12px;
  background: var(--a-chrome); color: var(--a-chrome-ink);
  font-size: 11px; white-space: nowrap; overflow: hidden;
}
.sg__status span { opacity: .55; }
.sg__status span.on { opacity: 1; }
.sg__status b { font-weight: 400; }
.sg__right { margin-left: auto; display: flex; gap: 20px; }

/* ---------- piezas tipográficas ---------- */
.sg-kicker {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--a-accent); margin: 0 0 10px;
}
.sg-kicker i { color: var(--a-ink-3); font-style: normal; }
.sg-kicker--dim { color: var(--a-ink-2); }
.sg-kicker--dim i { color: var(--a-ink-3); }
.sg-kicker--ink { color: rgba(244, 243, 242, .8); }
.sg-kicker--ink i { color: rgba(244, 243, 242, .5); }
.sg-h { font-size: 25px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin: 0; }
.sg-h--2 { font-size: 20px; }
.sg-h--3 { font-size: 16px; }
.sg-h small { font-size: .5em; font-weight: 400; color: var(--a-ink-2); letter-spacing: 0; margin-left: 8px; }
.sg-lab { font-size: 11px; color: var(--a-ink-2); display: block; margin: 0 0 4px; }
.sg-tenue { font-size: 12px; color: var(--a-ink-2); }
.sg-dato { font-size: 12px; font-weight: 600; }
.sg-cifra { font-size: 54px; font-weight: 700; letter-spacing: -.03em; line-height: 1; margin: 10px 0 0; }
.sg-num { text-align: right; font-variant-numeric: tabular-nums; }
.sg-mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sg-regla { height: 2px; background: var(--a-line-2); margin: 14px 0; }

/* ---------- botones ---------- */
.sg-btn {
  font: 700 13px/1 var(--sans); padding: 10px 18px; border-radius: var(--a-r4); cursor: pointer;
  background: var(--a-fill); color: var(--a-accent-ink); border: 1px solid transparent;
  box-shadow: var(--a-sh); display: inline-flex; align-items: center; gap: 8px;
  transition: background .12s ease;
}
.sg-btn:hover { background: var(--a-fill-hi); box-shadow: var(--a-sh2); }
.sg-btn:active { background: var(--a-fill-lo); box-shadow: var(--a-sh); }
.sg-btn--sec {
  background: var(--a-card); color: var(--a-ink); border-color: var(--a-line);
  padding: 9px 16px; box-shadow: none; font-weight: 700;
}
.sg-btn--sec:hover { background: var(--a-card-hi); border-color: var(--a-line-2); box-shadow: var(--a-sh); }
.sg-btn--fan {
  background: transparent; color: var(--a-accent); border-color: transparent;
  padding: 4px 6px; box-shadow: none; font-weight: 700;
}
.sg-btn--fan:hover { background: var(--a-accent-soft); box-shadow: none; }
.sg-btn--sm { font-size: 12px; padding: 7px 12px; }
.sg-btn--wide { width: 100%; justify-content: center; }
.sg-btn kbd { font: 600 11px/1 var(--mono); opacity: .7; margin-left: 4px; }
/* El programa apaga sus botones con opacidad, no con gris: se copia tal cual. */
.sg-btn[disabled] { opacity: .45; cursor: no; box-shadow: none; }
.sg-btn[disabled]:hover { background: var(--a-fill); box-shadow: none; }
.sg-btn--sec[disabled]:hover { background: var(--a-card); }
.sg-btn:focus-visible, .sg-in:focus-visible, .sg-nav__i:focus-visible, .sg-tab:focus-visible {
  outline: 2px solid var(--a-accent); outline-offset: 2px;
}

/* ---------- campos ---------- */
.sg-in {
  font: 400 13px/1.4 var(--sans); min-height: 38px; padding: 7px 11px; width: 100%;
  background: var(--a-card); color: var(--a-ink); border: 1px solid var(--a-line);
  border-radius: 0; box-sizing: border-box;
}
.sg-in:hover { border-color: var(--a-line-2); }
.sg-in:focus { outline: none; border: 2px solid var(--a-accent); background: var(--a-card-hi); padding: 6px 10px; }
textarea.sg-in { min-height: 58px; resize: vertical; }
select.sg-in { appearance: none; border-radius: 0;
  background-image: linear-gradient(45deg, transparent 50%, var(--a-ink-2) 50%), linear-gradient(135deg, var(--a-ink-2) 50%, transparent 50%);
  background-position: right 13px center, right 8px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.sg-in::placeholder { color: var(--a-ink-3); }
.sg-field { margin: 0 0 12px; }
.sg-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.sg-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 8px; }

/* ---------- superficies ---------- */
.sg-card {
  background: var(--a-card); border: 1px solid var(--a-line); border-radius: var(--a-r);
  padding: 18px; box-shadow: var(--a-sh);
}
.sg-aviso {
  background: var(--a-panel); border-left: 3px solid var(--a-accent); border-radius: 0 var(--a-r4) var(--a-r4) 0;
  padding: 11px 14px; font-size: 12.5px; color: var(--a-ink);
}
.sg-aviso--warn { border-left-color: var(--a-warn); background: var(--a-faviso); }
.sg-aviso--bad { border-left-color: var(--a-crit); background: var(--a-bad-soft); }
.sg-aviso--line { border-left-color: var(--a-line-2); }
.sg-tag {
  display: inline-block; background: var(--a-n100); color: var(--a-n800);
  font-size: 10.5px; padding: 3px 8px; border-radius: var(--a-r4); vertical-align: middle;
}
.sg-tag--acc { background: var(--a-accent-soft); color: var(--a-accent-800); }
.sg-tag--ok { background: #e8f4ec; color: var(--a-ok); }
.sg-tag--warn { background: var(--a-faviso); color: var(--a-warn); }
.sg-tag--bad { background: var(--a-bad-soft); color: var(--a-crit); }
.sg-err { color: var(--a-crit); font-size: 12.5px; font-weight: 600; }
.sg-err--acc { color: var(--a-accent-text); }

/* ---------- tabla ---------- */
.sg-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sg-tbl th {
  font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--a-ink-2); text-align: left; padding: 9px 10px;
  border-bottom: 2px solid var(--a-line-2); white-space: nowrap;
}
.sg-tbl td { padding: 0 10px; height: 38px; border-bottom: 1px solid var(--a-line); vertical-align: middle; }
.sg-tbl td.num, .sg-tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.sg-tbl .sg-in { height: 30px; min-height: 30px; padding: 3px 8px; font-size: 12.5px; }
.sg-tbl .sg-in:focus { padding: 2px 7px; }
.sg-tbl tr.out td { background: var(--a-fmarcado); }
.sg-tbl tr.crit td { background: var(--a-bad-soft); }
.sg-tbl tr.mark td { background: var(--a-fmarcado); }
.sg-tbl td.flagcell { position: relative; }
.sg-tbl .fl { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.sg-tbl tr.out .fl { background: var(--a-warn); }
.sg-tbl tr.crit .fl { background: var(--a-crit); }
.sg-tbl tr.sel td { background: var(--a-bg); box-shadow: inset 3px 0 0 var(--a-accent); }
.sg-tbl td b { font-weight: 600; }
.sg-tbl .arw { font-weight: 700; }
.sg-tbl-wrap { max-height: 340px; overflow: auto; }

/* ---------- layouts de pantalla ---------- */
/* Cabecera de página: 2 px por debajo, como el Border Divisor 0,0,0,2 del XAML */
.sg-phead {
  border-bottom: 2px solid var(--a-line-2); padding: 16px 26px 14px;
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; background: var(--a-bg);
}
.sg-phead__grow { min-width: 0; flex: 1; }
.sg-phead .sg-btn { margin-left: auto; }
.sg-pad { padding: 22px 26px; }
.sg-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 2px solid var(--a-line-2); }
.sg-cell { border-right: 2px solid var(--a-line-2); padding: 22px 24px; min-width: 0; }
.sg-cell:last-child { border-right: 0; }
.sg-cell .sg-cifra { font-size: 40px; }
.sg-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
.sg-split--wide { grid-template-columns: minmax(0, 1fr) 476px; }
.sg-split--ficha { grid-template-columns: minmax(0, 1fr) 372px; }
.sg-split--dashboard { grid-template-columns: minmax(0, 1fr) 300px; }
.sg-split--dashboard .sg-cell { padding: 18px 12px; }
.sg-split--dashboard .sg-cell .sg-cifra { font-size: 32px; }
.sg-tray { background: var(--a-panel); border-right: 2px solid var(--a-line-2); align-self: stretch; min-height: 100%; }
.sg-tray__h { padding: 12px 14px; border-bottom: 2px solid var(--a-line-2); }
.sg-li {
  display: block; width: 100%; text-align: left; background: transparent; cursor: pointer;
  border: 0; border-bottom: 1px solid var(--a-line); padding: 11px 14px; font: inherit; color: inherit;
}
.sg-li:hover { background: var(--a-card); }
.sg-li b { display: block; font-size: 13px; font-weight: 600; }
.sg-li span { display: block; font-size: 11.5px; color: var(--a-ink-2); margin-top: 2px; }
.sg-li[aria-current="true"] { background: var(--a-bg); border-left: 3px solid var(--a-accent); padding-left: 11px; }
.sg-side { background: var(--a-panel); padding: 22px 20px; align-self: stretch; }
.sg-side--r { border-left: 2px solid var(--a-line-2); }
.sg-hdr {
  background: var(--a-panel); border-bottom: 2px solid var(--a-line-2); padding: 12px 18px;
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
}
.sg-hdr__meta { min-width: 0; }
.sg-hdr__meta i { display: block; font-size: 11px; color: var(--a-ink-2); font-style: normal; }
.sg-hdr__meta b { display: block; font-size: 12px; font-weight: 600; margin-top: 2px; }
.sg-hdr__grow { margin-left: auto; }
.sg-foot {
  background: var(--a-panel); border-top: 2px solid var(--a-line-2); padding: 14px 18px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.sg-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sg-row--mt { margin-top: 18px; }
.sg-between { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }

/* Bloque rojo del panel: «listos para entrega» */
.sg-red {
  background: var(--a-fill); color: var(--a-accent-ink); padding: 28px 30px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0;
}
.sg-red .sg-cifra { font-size: 92px; margin: 14px 0 10px; color: var(--a-accent-ink); }
.sg-red p { font-size: 14px; line-height: 1.45; max-width: 330px; margin: 0 0 18px; }
.sg-red .sg-btn { background: var(--a-accent-ink); color: var(--a-fill); box-shadow: none; }
.sg-red .sg-btn:hover { background: #fff; }
.sg-alerts { background: var(--a-panel); border-top: 2px solid var(--a-line-2); padding: 22px 30px; }
.sg-alerts .sg-aviso { background: var(--a-bg); margin-bottom: 8px; }

/* Catálogo de estudios: tarjetas pulsables de 248×106 */
.sg-cat { display: flex; flex-wrap: wrap; gap: 10px; max-height: 360px; overflow: auto; padding: 2px; }
.sg-tar {
  width: 248px; min-height: 106px; text-align: left; cursor: pointer;
  background: var(--a-card); border: 1px solid var(--a-line); border-radius: var(--a-r);
  padding: 13px 15px; box-shadow: var(--a-sh); font: inherit; color: inherit;
  display: flex; flex-direction: column; gap: 4px;
}
.sg-tar:hover { background: var(--a-card-hi); border-color: var(--a-accent); box-shadow: var(--a-sh2); }
.sg-tar em { font: 700 11px/1 var(--sans); color: var(--a-accent-text); font-style: normal; letter-spacing: .02em; }
.sg-tar b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-tar .f { display: flex; justify-content: space-between; align-items: baseline; margin-top: auto; }
.sg-tar .f span { font-size: 11px; color: var(--a-ink-2); }
.sg-tar .f i { font-style: normal; font-size: 10px; color: var(--a-ink-2); }
.sg-tar .f i + b { font-size: 14px; font-weight: 700; }

/* Pasos de admisión */
.sg-pasos { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--a-line-2); background: var(--a-bg); }
.sg-paso {
  text-align: left; background: transparent; border: 0; border-right: 1px solid var(--a-line-2);
  padding: 12px 20px; cursor: pointer; font: inherit; color: inherit;
}
.sg-paso:last-child { border-right: 0; }
.sg-paso em { display: block; font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--a-ink-2); font-style: normal; margin-bottom: 4px; }
.sg-paso b { font-size: 13.5px; font-weight: 400; }
.sg-paso[aria-current="true"], .sg-paso[aria-selected="true"] { box-shadow: inset 0 -3px 0 var(--a-accent); }
.sg-paso[aria-current="true"] b, .sg-paso[aria-selected="true"] b { font-weight: 700; }
.sg-paso[aria-current="true"] em, .sg-paso[aria-selected="true"] em { color: var(--a-accent); }
/* Paso ya recorrido: queda resuelto, no subrayado. */
.sg-paso--done em { color: var(--a-ok); }
.sg-paso--done b { color: var(--a-ink-2); }

/* Caja y ARS usan cajas de radio mayor, como el XAML */
.sg-box { background: var(--a-panel); border: 1px solid var(--a-line); border-radius: var(--a-r12); padding: 22px; }
.sg-box--acc { background: var(--a-accent-soft); border: 0; border-left: 3px solid var(--a-accent); border-radius: 8px; padding: 18px; }
.sg-cols { display: grid; grid-template-columns: 300px minmax(0, 1fr); align-items: stretch; }
.sg-cols--eq { grid-template-columns: 1fr 1fr; gap: 16px; }
.sg-cards { display: flex; flex-wrap: wrap; gap: 14px; }
.sg-cards .sg-box { width: 290px; }
.sg-cards .sg-box b { display: block; font-size: 16px; }
.sg-cards .sg-box .tot { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0; }
.sg-cards .sg-box p { font-size: 12px; color: var(--a-ink-2); margin: 2px 0; }

/* Pestañas de ARS */
.sg-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--a-line-2); margin: 14px 0 0; }
.sg-tab {
  background: transparent; border: 0; padding: 10px 16px; cursor: pointer; font: 700 13px/1 var(--sans);
  color: var(--a-ink-2); border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.sg-tab[aria-current="true"] { color: var(--a-accent); border-bottom-color: var(--a-accent); }

/* Código de barras de la etiqueta */
.sg-bars { display: flex; align-items: flex-end; gap: 2px; height: 42px; }
.sg-bars i { display: block; background: var(--a-ink); height: 100%; }
.sg-lbl { border: 2px solid var(--a-ink); border-radius: var(--a-r); padding: 14px 16px; background: var(--a-card); max-width: 340px; }

/* ---------- acceso ---------- */
.sg-login { display: grid; grid-template-columns: 360px minmax(0, 1fr); height: 100%; }
.sg-login__l { background: var(--a-chrome); color: var(--a-chrome-ink); padding: 32px 34px; display: flex; flex-direction: column; }
.sg-login__l h3 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.sg-login__l .k { font-size: 12.5px; opacity: .6; margin: 4px 0 0; line-height: 1.4; }
.sg-login__l .m { font-size: 12.5px; line-height: 1.6; opacity: .55; margin: auto 0; }
.sg-login__l .sg-regla { background: var(--a-chrome-ink); opacity: .25; margin: 16px 0 0; }
.sg-login__l .c { font-size: 12px; opacity: .7; }
.sg-login__l .v { font-size: 11px; opacity: .4; margin-top: 6px; }
.sg-spec { margin: 18px 0 0; padding: 0; border-top: 1px solid rgba(244, 243, 242, .14); }
.sg-spec > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 8px 0; border-bottom: 1px solid rgba(244, 243, 242, .09); }
.sg-spec dt { font: 400 10.5px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: rgba(244, 243, 242, .5); }
.sg-spec dd { margin: 0; font: 500 11.5px/1.4 var(--mono); color: rgba(244, 243, 242, .85); text-align: right; }
.sg-spec--off { color: #f0b429 !important; }
.sg-login__r { padding: 40px 44px; overflow: auto; background: var(--a-bg); position: relative; }
.sg-login__r .sg-x {
  position: absolute; top: 0; right: 0; width: 46px; height: 34px; border: 0; background: transparent;
  cursor: pointer; color: var(--a-ink); font-size: 14px;
}
.sg-login__r h2 { margin: 0 0 20px; }
.sg-demo { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }

/* ---------- portal del paciente ---------- */
#sg-portal .sg-p { max-width: 720px; margin: 0 auto; }
.sg-doc { background: #fff; color: #201e1d; border: 1px solid var(--a-line); border-radius: var(--a-r); padding: 26px 30px; box-shadow: var(--a-sh); }
.sg-doc h3 { font-size: 20px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.02em; }
.sg-doc .sg-tbl th { border-bottom-color: var(--a-line-2); }
.sg-firma { border-top: 2px solid var(--a-line-2); margin-top: 18px; padding-top: 14px; font-size: 12px; color: var(--a-ink-2); }

/* ---------- piezas sueltas ---------- */
.sg-toast {
  position: absolute; left: 50%; bottom: 46px; transform: translate(-50%, 14px);
  background: var(--a-ink); color: var(--a-card); font-size: 12.5px; padding: 11px 16px;
  border-radius: var(--a-r4); border-left: 3px solid var(--a-accent); max-width: min(560px, 90%);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 5;
  box-shadow: var(--a-sh2);
}
.sg-toast.on { opacity: 1; transform: translate(-50%, 0); }
.sg--bare .sg__rail, .sg--bare .sg__status .sg__fkeys { display: none; }
.sg--bare .sg__body { grid-template-columns: minmax(0, 1fr); }
.sg--bare .sg__status { opacity: .92; }
.dim { opacity: .6; }
.sg-hr { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--a-ink-2); margin: 18px 0 8px; }

/* ---------- piezas de las pantallas de trabajo ---------- */
/* Encabezado: Kicker + H3 y, a la derecha, la pastilla de estado con la acción. */
.sg-phead__end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sg-phead .sg-tag { flex: none; }
.sg-tag small { display: block; font-size: 10px; font-weight: 400; letter-spacing: 0; opacity: .8; }

/* Rótulo de sección: el KickerTenue del XAML, 10 px ExtraBold en mayúsculas. */
.sg-sub {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--a-ink-2); margin: 18px 0 8px;
}
.sg-lab--dim { color: var(--a-ink-3); }
.sg-hint { font-size: 12px; color: var(--a-ink-2); margin: 6px 0 0; }
.sg-fine { font-size: 11px; line-height: 1.5; opacity: .4; margin-top: auto; }
.sg-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* La variante verde de la misma etiqueta de Alerta: todo dentro de referencia. */
.sg-aviso--ok { border-left-color: var(--a-ok); background: #e8f4ec; }
.sg-aviso p { margin: 0 0 6px; }
.sg-aviso p:last-child { margin: 0; }
.sg-aviso .sg-btn { margin-top: 8px; }

/* Filas de campos: la barra de búsqueda, la cédula, el retiro de caja. */
.sg-g-search, .sg-g-id, .sg-g-verif, .sg-g-ret { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.sg-g-search .sg-in, .sg-g-id .sg-in, .sg-g-verif .sg-in, .sg-g-ret .sg-in { flex: 1; min-width: 150px; }
.sg-g-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.sg-g-pat { display: grid; grid-template-columns: 2fr .8fr .8fr 2fr; gap: 0 8px; }

/* Columnas: bandeja a la izquierda, trabajo a la derecha. */
.sg-split__a { min-width: 0; padding: 22px 26px; }
.sg-split__b {
  min-width: 0; padding: 22px 20px; background: var(--a-panel);
  border-left: 2px solid var(--a-line-2);
}
.sg-cols__l { min-width: 0; background: var(--a-panel); border-right: 2px solid var(--a-line-2); }
.sg-cols__r { min-width: 0; padding: 18px 22px; }
.sg-pad2 { padding: 22px 26px; }
.sg-list { display: block; }
.sg-mw { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; align-items: start; }

/* Pie de la captura: la nota del bioanalista y el semáforo del rango. */
.sg-cap { display: flex; gap: 18px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-top: 18px; }
.sg-cap__r { display: flex; gap: 10px; align-items: flex-end; justify-content: flex-end; flex: 1; }
.sg-cap__r .sg-aviso { flex: 1; min-width: 220px; max-width: 360px; }

/* Importes: una etiqueta y su cifra alineada a la derecha, en tabular. */
.sg-money {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: 7px 0; border-bottom: 1px solid var(--a-line); font-size: 12.5px;
}
.sg-money b { font-weight: 700; font-variant-numeric: tabular-nums; }
.sg-money--big { border-bottom: 0; border-top: 2px solid var(--a-line-2); margin-top: 8px; padding-top: 10px; }
.sg-money--big b { font-size: 20px; letter-spacing: -.02em; }
.sg-big { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1; margin: 4px 0 0; }

/* Trazabilidad de la ficha y rastro de la sesión. */
.sg-tr {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 10px; align-items: baseline;
  font-size: 12px; padding: 5px 0; border-bottom: 1px solid var(--a-line);
}
.sg-tr .mono { font-size: 11.5px; color: var(--a-ink-2); }
.sg-trail {
  display: grid; gap: 4px; font-family: var(--mono); font-size: 11.5px; color: var(--a-ink-2);
  border-left: 2px solid var(--a-line-2); padding-left: 12px;
}
.sg-trail span { color: var(--a-ink-3); }

/* Botones de texto rápido: cuentas de la demo, plantillas, filtros. */
.sg-qa { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-qa button {
  font: 600 11.5px/1 var(--mono); padding: 7px 10px; cursor: pointer; text-align: left;
  background: var(--a-card); color: var(--a-ink-2); border: 1px dashed var(--a-line-2);
  border-radius: var(--a-r4);
}
.sg-qa button:hover { color: var(--a-accent-text); border-color: var(--a-accent); background: var(--a-accent-soft); }

/* Opciones de liberación. */
.sg-rad { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; padding: 5px 0; cursor: pointer; }
.sg-rad input { margin-top: 2px; accent-color: var(--a-accent); }

/* Miniaturas de la serie de imagen: 8 huecos, rellenos sólo si están adquiridas. */
.sg-plates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sg-plate {
  width: 62px; height: 46px; display: grid; place-items: center;
  font: 600 10.5px/1 var(--mono); color: var(--a-chrome-ink);
  background: repeating-linear-gradient(135deg, #2b2927 0 6px, #201e1d 6px 12px);
  border: 1px solid var(--a-line-2); border-radius: var(--a-r4);
}
.sg-plate--off { background: var(--a-panel); border-style: dashed; color: transparent; }

/* Bloque de interpretación y firma. */
.sg-sign {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start;
  margin-top: 18px; padding-top: 18px; border-top: 2px solid var(--a-line-2);
}
.sg-sign__r { display: flex; flex-direction: column; }

/* Etiqueta de tubo previsualizada en la pantalla de toma de muestras. */
.sg-lbl b { display: block; font-size: 13px; }
.sg-lbl span { display: block; font: 400 10.5px/1.5 var(--mono); color: var(--a-ink-2); }
.sg-lbl .sg-hr { margin: 2px 0 0; text-align: center; letter-spacing: .18em; color: var(--a-ink); }
.sg-lbl--off {
  display: grid; place-items: center; min-height: 96px; border-style: dashed;
  font-size: 11.5px; color: var(--a-ink-3);
}
hr.sg-regla { border: 0; }
.sg-red strong.sg-cifra { display: block; }

/* ---------- recorrido guiado bajo la ventana ---------- */
.sg-stages { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 18px; }
.sg-stage {
  text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 13px; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 4px;
}
.sg-stage em { font-family: var(--mono); font-size: 10px; font-style: normal; color: var(--ink-3); letter-spacing: .1em; }
.sg-stage b { font-size: .84rem; font-weight: 600; letter-spacing: -.01em; }
.sg-stage span { font-size: .74rem; line-height: 1.4; color: var(--ink-3); }
.sg-stage[aria-current="true"] { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.sg-stage[aria-current="true"] em { color: var(--accent-text); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .sg-strip { grid-template-columns: 1fr 1fr; }
  .sg-cell:nth-child(2) { border-right: 0; }
  .sg-cell { border-bottom: 2px solid var(--a-line-2); }
  .sg-split, .sg-split--wide, .sg-split--ficha, .sg-split--dashboard { grid-template-columns: minmax(0, 1fr); }
  .sg-split__b, .sg-side--r { border-left: 0; border-top: 2px solid var(--a-line-2); }
  .sg-tray { border-right: 0; border-bottom: 2px solid var(--a-line-2); min-height: 0; }
  .sg-cols { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .sg-cols__l { border-right: 0; border-bottom: 2px solid var(--a-line-2); }
  .sg-mw, .sg-sign { grid-template-columns: minmax(0, 1fr); }
  .sg-g-pat { grid-template-columns: 1fr 1fr; }
  .sg-stages { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .sg { height: auto; min-height: 0; grid-template-rows: var(--a-bar) auto; }
  .sg__status { display: none; }
  .sg__body { display: block; }
  .sg__main { min-width: 0; width: 100%; }
  .sg__view { max-height: 74vh; width: 100%; }
  .sg__rail, .sg__win { display: none; }
  .sg-phead { padding: 16px; }
  .sg-split__a, .sg-pad, .sg-pad2, .sg-cols__r { padding: 16px; }
  .sg-login { grid-template-columns: minmax(0, 1fr); }
  .sg-login__l { display: none; }
  .sg-strip { grid-template-columns: 1fr; }
  .sg-split--dashboard .sg-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-split--dashboard .sg-cell .sg-cifra { font-size: 28px; }
  .sg-cell { border-right: 0; }
  .sg-pasos { grid-template-columns: 1fr 1fr; }
  .sg-stages { grid-template-columns: 1fr 1fr; }
  .sg-red .sg-cifra { font-size: 64px; }
}
