/* SICAS Core — estructura de la interfaz con estilo «Liquid Glass» (20261116).
   Barra superior, menú lateral, buscador, migas de pan, pestañas, panel de cuenta, avisos y diálogos.
   Vidrio: fondo translúcido + desenfoque + brillo especular en el borde. Las tablas y formularios quedan sólidos
   (se leen mejor). Con «reducir transparencia», contraste alto o sin backdrop-filter, todo pasa a colores sólidos. */

:root {
  --tb-h: 60px; --sn-w: 282px; --sn-wc: 78px;
  --gl-ink: #19283b; --gl-muted: #5d7088; --gl-navy: #172b46; --gl-brand: #294b70; --gl-teal: #287a80;
  --gl-ease: cubic-bezier(.2, 0, 0, 1); --gl-spring: cubic-bezier(.3, 1.3, .4, 1);
  --gl-blur: blur(24px) saturate(180%);
  --gl-light: linear-gradient(115deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 42%), linear-gradient(135deg, rgba(255, 255, 255, .74), rgba(255, 255, 255, .46));
  --gl-light-strong: linear-gradient(115deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 42%), linear-gradient(135deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .74));
  --gl-rim: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .4), inset 0 0 0 1px rgba(255, 255, 255, .5);
  --gl-drop: 0 14px 36px rgba(23, 43, 70, .14), 0 2px 8px rgba(23, 43, 70, .06);
}

/* ------------------------------------------------------------------ Fondo: manchas de color para que el vidrio «refracte» algo */
body { background: #eaf0f8; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55vmax 45vmax at 6% -8%, rgba(68, 132, 205, .38), transparent 62%),
    radial-gradient(48vmax 42vmax at 100% 2%, rgba(72, 190, 190, .30), transparent 60%),
    radial-gradient(58vmax 48vmax at 75% 112%, rgba(146, 126, 220, .24), transparent 62%),
    radial-gradient(40vmax 36vmax at 0% 95%, rgba(240, 180, 110, .16), transparent 60%), #eef3f9; }

/* ------------------------------------------------------------------ Barra superior */
#topbar { position: sticky; top: 10px; z-index: 40; display: flex; align-items: center; gap: 14px; min-height: var(--tb-h);
  margin: 10px clamp(10px, 2vw, 28px) 0; padding: 8px 12px 8px 16px; border-radius: 22px; color: var(--gl-ink);
  background: var(--gl-light); -webkit-backdrop-filter: var(--gl-blur); backdrop-filter: var(--gl-blur);
  border: 1px solid rgba(255, 255, 255, .62); box-shadow: var(--gl-rim), var(--gl-drop); }
.tb-brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; border-radius: 12px; }
.tb-brand:focus-visible { outline: 3px solid rgba(47, 109, 181, .45); outline-offset: 3px; }
.tb-brand img { display: block; height: 36px; width: auto; max-width: 130px; object-fit: contain; border-radius: 8px; }
.tb-name { display: grid; line-height: 1.15; min-width: 0; }
.tb-name b { font-size: 1.28rem; font-weight: 780; letter-spacing: -.035em; color: var(--gl-navy); white-space: nowrap; }
body.in-app .tb-name small { display: none; }
.tb-name small { margin-top: 2px; font-size: .7rem; color: var(--gl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-right { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
.tb-control { display: block; height: 30px; width: auto; max-width: 150px; object-fit: contain; border-radius: 8px; background: rgba(255, 255, 255, .85); padding: 2px 6px; box-shadow: var(--gl-rim); }

/* Controles de la barra: solo en la aplicación */
#topbar .tb-menu, #topbar .tb-search, #topbar .tb-search-mini, #topbar .tb-bell, #topbar .tb-account, #topbar .tb-hours { display: none; }
body.in-app #topbar .tb-bell { display: grid; }
body.in-app #topbar .tb-search { display: flex; }
body.in-app #topbar .tb-account { display: block; }
body.in-app #topbar .tb-hours:not(.hidden) { display: inline-flex; }

#topbar .gl-icon { position: relative; place-items: center; flex: none; width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 14px;
  color: var(--gl-brand); background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .7); box-shadow: var(--gl-rim);
  transition: background-color .16s ease, scale .12s var(--gl-ease), box-shadow .16s ease; cursor: pointer; }
#topbar .gl-icon:hover { background: rgba(255, 255, 255, .9); }
#topbar .gl-icon:active { scale: .94; }
.gl-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#topbar button:focus-visible, #topbar a:focus-visible { outline: 3px solid rgba(47, 109, 181, .5); outline-offset: 2px; }
.tb-badge { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; display: grid; place-items: center;
  font-size: .68rem; font-weight: 750; line-height: 1; color: #fff; background: #e5484d; box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }
.tb-badge.hidden { display: none; }

/* Buscador */
#topbar .tb-search { flex: 0 1 380px; align-items: center; gap: 10px; min-width: 0; height: 42px; min-height: 0; margin: 0 auto 0 12px; padding: 0 8px 0 14px;
  color: var(--gl-muted); font: inherit; font-size: .88rem; font-weight: 500; text-align: left; border-radius: 999px; cursor: text;
  background: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .7); box-shadow: inset 0 1px 3px rgba(23, 43, 70, .08), var(--gl-rim);
  transition: background-color .16s ease, box-shadow .16s ease; }
#topbar .tb-search:hover { background: rgba(255, 255, 255, .85); }
.tb-search-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { display: inline-block; padding: 2px 7px; border-radius: 7px; font: 650 .7rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #3b4f68;
  background: rgba(255, 255, 255, .75); border: 1px solid rgba(25, 40, 59, .14); box-shadow: 0 1px 0 rgba(25, 40, 59, .16); }

/* Estado del horario */
.tb-hours { flex: none; align-items: center; gap: 7px; height: 34px; padding: 0 12px 0 10px; border-radius: 999px; font-size: .78rem; font-weight: 650; white-space: nowrap; text-decoration: none;
  color: #0f6e56; background: rgba(22, 130, 103, .13); box-shadow: inset 0 0 0 1px rgba(22, 130, 103, .22); transition: background-color .16s ease; }
.tb-hours i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: gl-live 2.4s ease-out infinite; }
.tb-hours.warn { color: #8a5a0f; background: rgba(224, 160, 40, .2); box-shadow: inset 0 0 0 1px rgba(224, 160, 40, .35); }
.tb-hours.err { color: #a23a3a; background: rgba(181, 68, 68, .14); box-shadow: inset 0 0 0 1px rgba(181, 68, 68, .28); }
.tb-hours.info { color: #294b70; background: rgba(41, 75, 112, .12); box-shadow: inset 0 0 0 1px rgba(41, 75, 112, .22); }
.tb-hours:hover { filter: brightness(.97); }
@keyframes gl-live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

/* Cuenta */
.tb-account { position: relative; flex: none; }
#topbar .tb-avatar { display: flex; align-items: center; gap: 10px; height: 44px; min-height: 0; padding: 0 12px 0 5px; border-radius: 999px; font: inherit; color: var(--gl-ink); cursor: pointer;
  background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .7); box-shadow: var(--gl-rim); transition: background-color .16s ease, scale .12s var(--gl-ease); }
#topbar .tb-avatar:hover { background: rgba(255, 255, 255, .9); }
#topbar .tb-avatar:active { scale: .97; }
.tb-initials { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; font-size: .78rem; font-weight: 750; letter-spacing: .02em; color: #fff;
  background: linear-gradient(145deg, #3b6ea5, #1f8a8f); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 2px 6px rgba(23, 43, 70, .25); }
.tb-initials.lg { width: 46px; height: 46px; font-size: 1rem; }
.tb-who { display: grid; text-align: left; line-height: 1.2; min-width: 0; }
.tb-who b { font-size: .84rem; font-weight: 700; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-who small { font-size: .7rem; color: var(--gl-muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-chev { width: 7px; height: 7px; margin: -3px 2px 0 0; border-right: 1.8px solid var(--gl-muted); border-bottom: 1.8px solid var(--gl-muted); transform: rotate(45deg); transition: transform .2s var(--gl-ease); }
.tb-avatar[aria-expanded="true"] .tb-chev { transform: rotate(-135deg); margin-top: 3px; }
.tb-panel { position: absolute; z-index: 70; top: calc(100% + 12px); right: 0; width: 310px; padding: 8px; border-radius: 20px;
  /* casi opaco: dentro de la barra (que ya es vidrio) el desenfoque no alcanza a la pantalla de atrás */
  background: linear-gradient(115deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 40%), linear-gradient(135deg, #fcfdff, #f4f8fc); border: 1px solid rgba(255, 255, 255, .75); box-shadow: var(--gl-rim), 0 22px 50px rgba(23, 43, 70, .24);
  transform-origin: top right; animation: gl-pop .2s var(--gl-ease) backwards; }
.tb-panel.hidden { display: none; }
.tb-card { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid rgba(25, 40, 59, .09); }
.tb-card div { display: grid; min-width: 0; line-height: 1.3; }
.tb-card b { font-size: .95rem; overflow-wrap: anywhere; }
.tb-card small { font-size: .74rem; color: var(--gl-muted); overflow-wrap: anywhere; }
#topbar .tb-panel button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; margin: 0; padding: 0 12px; border-radius: 12px; border: 0; text-align: left; font: inherit; font-size: .88rem; font-weight: 600;
  color: var(--gl-ink); background: transparent; box-shadow: none; cursor: pointer; transition: background-color .14s ease, scale .12s var(--gl-ease); }
#topbar .tb-panel button .gl-ico { color: var(--gl-brand); }
#topbar .tb-panel button:hover, #topbar .tb-panel button:focus-visible { background: rgba(41, 75, 112, .1); outline: none; }
#topbar .tb-panel button:active { scale: .985; }
#topbar .tb-panel button.danger-item { color: #a23a3a; margin-top: 4px; }
#topbar .tb-panel button.danger-item .gl-ico { color: #b54444; }
#topbar .tb-panel button.danger-item:hover, #topbar .tb-panel button.danger-item:focus-visible { background: rgba(181, 68, 68, .12); }
@keyframes gl-pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ Estructura: menú | migas + pantalla */
#main #view-app:not(.hidden) { display: grid; grid-template-columns: var(--sn-w) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); align-items: start;
  column-gap: clamp(16px, 2vw, 28px); row-gap: 6px; transition: grid-template-columns .32s var(--gl-ease); }
#main #view-app.sn-collapsed:not(.hidden) { grid-template-columns: var(--sn-wc) minmax(0, 1fr); }
#sidenav { grid-column: 1; grid-row: 1 / span 2; }
#crumbs { grid-column: 2; grid-row: 1; }
#page { grid-column: 2; grid-row: 2; }

/* ------------------------------------------------------------------ Menú lateral (vidrio tintado) */
#sidenav { position: sticky; top: calc(var(--tb-h) + 30px); z-index: 30; display: flex; flex-direction: column; max-height: calc(100vh - var(--tb-h) - 52px); min-width: 0; padding: 8px 0 6px;
  overflow: hidden; border-radius: 24px; color: rgba(255, 255, 255, .86);
  background: linear-gradient(150deg, rgba(255, 255, 255, .20), rgba(255, 255, 255, 0) 36%), linear-gradient(180deg, rgba(28, 54, 90, .80), rgba(18, 35, 60, .88));
  -webkit-backdrop-filter: var(--gl-blur); backdrop-filter: var(--gl-blur);
  border: 1px solid rgba(255, 255, 255, .16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .34), inset 0 0 0 1px rgba(255, 255, 255, .06), 0 18px 44px rgba(12, 28, 52, .30); }
#sidenav::before { content: none; }
.sn-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 6px 20px; }
.sn-title { font-size: .66rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .5); }
#sidenav .sn-collapse { display: grid; place-items: center; width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 11px; border: 0; cursor: pointer;
  color: rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); transition: background-color .16s ease, scale .12s var(--gl-ease); }
#sidenav .sn-collapse:hover { background: rgba(255, 255, 255, .18); color: #fff; }
#sidenav .sn-collapse:active { scale: .92; }
#sidenav .sn-collapse svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--gl-ease); }
#view-app.sn-collapsed .sn-collapse svg { transform: rotate(180deg); }
.sn-scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 2px 10px 10px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }

/* Pastilla de vidrio que se desliza hasta la opción activa */
.sn-lens { position: absolute; z-index: 0; left: 10px; right: 10px; top: 0; height: var(--lh, 40px); border-radius: 14px; pointer-events: none; opacity: 0;
  transform: translateY(var(--ly, 0px)); transition: transform .42s var(--gl-spring), height .3s var(--gl-ease), opacity .2s ease;
  background: linear-gradient(180deg, rgba(255, 255, 255, .30), rgba(255, 255, 255, .13));
  -webkit-backdrop-filter: blur(8px) saturate(160%); backdrop-filter: blur(8px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 0 0 1px rgba(255, 255, 255, .22), 0 8px 18px rgba(6, 16, 32, .32); }
.sn-lens.on { opacity: 1; }

#sidenav .sicas-nav-group { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; border: 0; }
#sidenav .sicas-nav-group + .sicas-nav-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .08); }
#sidenav .sicas-nav-items { display: flex; flex-direction: column; gap: 2px; }
#sidenav .sicas-nav-group.folded .sicas-nav-items { display: none; }
#sidenav button { position: relative; z-index: 1; display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; min-width: 0; min-height: 0; margin: 0;
  font: inherit; text-align: left; border: 0; box-shadow: none; cursor: pointer; background: transparent; color: rgba(255, 255, 255, .82);
  transition: background-color .16s ease, color .16s ease, scale .12s var(--gl-ease); }
#sidenav button:focus-visible { outline: 2px solid rgba(154, 216, 220, .95); outline-offset: -2px; }
#sidenav [data-sicas-nav-item], #sidenav .sn-quick-item { height: 42px; padding: 0 12px; border-radius: 14px; font-size: .9rem; font-weight: 560; }
#sidenav [data-sicas-nav-item]:hover:not(.active), #sidenav .sn-quick-item:hover { background: rgba(255, 255, 255, .09); color: #fff; }
#sidenav [data-sicas-nav-item]:active, #sidenav .sn-quick-item:active { scale: .98; }
#sidenav [data-sicas-nav-item].active { color: #fff; font-weight: 680; background: transparent; }
#sidenav .sicas-nav-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
#sidenav .sicas-nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sidenav button.sicas-nav-group-head { justify-content: space-between; height: 30px; padding: 0 12px; margin-top: 2px; border-radius: 10px; font-size: .66rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; color: rgba(255, 255, 255, .46); }
#sidenav button.sicas-nav-group-head:hover { color: rgba(255, 255, 255, .85); background: transparent; }
#sidenav .sicas-nav-chevron { width: 7px; height: 7px; flex: none; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); margin-top: -3px; transition: transform .2s var(--gl-ease); }
#sidenav .sicas-nav-group.folded .sicas-nav-chevron { transform: rotate(-45deg); margin-top: 0; }
.sicas-nav-badge { flex: none; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; font-size: .7rem; font-weight: 750; line-height: 1; color: #fff;
  background: linear-gradient(180deg, #ff6b6f, #e5484d); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 2px 6px rgba(229, 72, 77, .45); animation: gl-pop .25s var(--gl-ease) backwards; }
.sicas-nav-badge[hidden] { display: none; }

/* Accesos: fijados y recientes */
.sn-quick { padding: 0 0 4px; margin-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sn-quick[hidden] { display: none; }
.sn-quick-title { display: block; padding: 6px 12px 3px; font-size: .64rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; color: rgba(255, 255, 255, .42); }
#sidenav .sn-quick-item { height: 36px; font-size: .86rem; font-weight: 520; }
#sidenav .sn-quick-item.fav .sicas-nav-icon { color: #f5c04a; fill: rgba(245, 192, 74, .25); }
#sidenav .sn-quick-item.rec .sicas-nav-icon { opacity: .6; }

/* Plegado a íconos */
@media (min-width: 901px) {
  #view-app.sn-collapsed #sidenav .sn-title, #view-app.sn-collapsed #sidenav .sicas-nav-label, #view-app.sn-collapsed #sidenav .sicas-nav-group-head,
  #view-app.sn-collapsed #sidenav .sn-quick-title { display: none; }
  #view-app.sn-collapsed #sidenav .sicas-nav-group.folded .sicas-nav-items { display: flex; }
  #view-app.sn-collapsed .sn-head { justify-content: center; padding: 8px 0 6px; }
  #view-app.sn-collapsed .sn-scroll { padding: 2px 8px 10px; }
  #view-app.sn-collapsed .sn-lens { left: 8px; right: 8px; }
  #view-app.sn-collapsed #sidenav [data-sicas-nav-item], #view-app.sn-collapsed #sidenav .sn-quick-item { justify-content: center; padding: 0; }
  #view-app.sn-collapsed .sicas-nav-badge { position: absolute; top: 4px; right: 6px; min-width: 9px; width: 9px; height: 9px; padding: 0; font-size: 0; }
}

/* ------------------------------------------------------------------ Migas de pan */
.gl-crumbs { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; padding: 0 2px; }
.gl-crumbs:empty, .gl-crumbs.is-home { display: none; }
.cr-trail { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; min-width: 0; }
.cr-trail li { display: inline-flex; align-items: center; min-width: 0; }
.cr-seg { font-size: .84rem; color: var(--gl-muted); max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-seg.cur { color: var(--gl-ink); font-weight: 680; }
a.cr-link { text-decoration: none; border-radius: 6px; transition: color .14s ease; }
a.cr-link:hover { color: var(--gl-brand); text-decoration: underline; text-underline-offset: 3px; }
.cr-sep { width: 14px; height: 14px; margin: 0 4px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: #9aa9bd; flex: none; }
#crumbs button.cr-star { display: grid; place-items: center; flex: none; width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 12px; border: 1px solid transparent;
  color: #8a99ad; background: transparent; box-shadow: none; cursor: pointer; transition: background-color .15s ease, color .15s ease, scale .12s var(--gl-ease); }
#crumbs button.cr-star:hover { background: rgba(255, 255, 255, .7); color: #b8861b; }
#crumbs button.cr-star:active { scale: .9; }
#crumbs button.cr-star.on { color: #d49a14; }
#crumbs button.cr-star.on .cr-star-ico { fill: rgba(245, 192, 74, .55); animation: gl-star .4s var(--gl-spring); }
#crumbs button.cr-star:focus-visible { outline: 3px solid rgba(47, 109, 181, .45); outline-offset: 2px; }
.cr-star-ico { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
@keyframes gl-star { 0% { transform: scale(.6) rotate(-20deg); } 100% { transform: none; } }

/* ------------------------------------------------------------------ Pestañas de una pantalla (segmentado de vidrio) */
.gl-tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 16px; border-radius: 999px; max-width: 100%; overflow-x: auto;
  background: var(--gl-light); -webkit-backdrop-filter: var(--gl-blur); backdrop-filter: var(--gl-blur); border: 1px solid rgba(255, 255, 255, .65); box-shadow: var(--gl-rim), 0 6px 18px rgba(23, 43, 70, .08); }
.gl-tab { padding: 8px 18px; border-radius: 999px; font-size: .86rem; font-weight: 620; color: var(--gl-muted); text-decoration: none; white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, scale .12s var(--gl-ease); }
.gl-tab:hover { color: var(--gl-ink); background: rgba(255, 255, 255, .55); }
.gl-tab:active { scale: .96; }
.gl-tab.active { color: var(--gl-brand); font-weight: 720; background: #fff; box-shadow: 0 2px 8px rgba(23, 43, 70, .14), inset 0 0 0 1px rgba(41, 75, 112, .08); }
.gl-tab:focus-visible { outline: 3px solid rgba(47, 109, 181, .45); outline-offset: 2px; }

/* ------------------------------------------------------------------ Buscador global */
.pal-overlay { position: fixed; inset: 0; z-index: 10003; display: grid; justify-items: center; align-content: start; padding: 11vh 16px 16px;
  background: rgba(14, 26, 46, .34); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: mo-fade .18s ease backwards; }
.pal-box { display: flex; flex-direction: column; width: min(660px, 100%); max-height: min(70vh, 640px); overflow: hidden; border-radius: 24px;
  background: var(--gl-light-strong); -webkit-backdrop-filter: var(--gl-blur); backdrop-filter: var(--gl-blur); border: 1px solid rgba(255, 255, 255, .78);
  box-shadow: var(--gl-rim), 0 30px 70px rgba(10, 22, 42, .38); animation: pal-in .22s var(--gl-ease) backwards; }
@keyframes pal-in { from { opacity: 0; transform: translateY(-12px) scale(.975); } to { opacity: 1; transform: none; } }
.pal-input { display: flex; align-items: center; gap: 12px; padding: 0 20px; height: 62px; border-bottom: 1px solid rgba(25, 40, 59, .09); color: var(--gl-brand); }
#palette .pal-input input { flex: 1; width: auto; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: none;
  font: inherit; font-size: 1.08rem; color: var(--gl-ink); -webkit-appearance: none; appearance: none; }
#palette .pal-input input::placeholder { color: #8a99ad; }
#palette .pal-input input::-webkit-search-cancel-button { display: none; }
.pal-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 0 8px; }
.pal-group { padding: 10px 22px 4px; font-size: .66rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; color: #8190a5; }
.pal-item { display: flex; align-items: center; gap: 12px; margin: 0 8px; padding: 0 14px; height: 46px; border-radius: 14px; cursor: pointer; color: var(--gl-ink); transition: background-color .1s ease; }
.pal-item.active { background: rgba(41, 75, 112, .12); box-shadow: inset 0 0 0 1px rgba(41, 75, 112, .1); }
.pal-ico { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 10px; color: var(--gl-brand); background: rgba(41, 75, 112, .09); }
.pal-ico .gl-ico { width: 17px; height: 17px; }
.pal-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .93rem; font-weight: 600; }
.pal-hint { flex: none; font-size: .76rem; color: var(--gl-muted); }
.pal-empty { padding: 28px 22px; text-align: center; color: var(--gl-muted); font-size: .9rem; }
.pal-foot { display: flex; gap: 18px; padding: 10px 20px; border-top: 1px solid rgba(25, 40, 59, .09); font-size: .74rem; color: var(--gl-muted); background: rgba(255, 255, 255, .35); }
.pal-foot kbd { margin-right: 3px; }
body.pal-open { overflow: hidden; }

/* Atajos (diálogo) */
.sc-list { display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; align-items: center; margin: 4px 0 0; }
.sc-list dt { margin: 0; } .sc-list dd { margin: 0; color: var(--gl-muted); font-size: .92rem; }

/* ------------------------------------------------------------------ Capas flotantes con vidrio: avisos, diálogos, ingreso */
#toasts .toast { background: var(--gl-light-strong); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .75); box-shadow: var(--gl-rim), 0 16px 36px rgba(23, 43, 70, .22); }
.overlay { background: rgba(14, 26, 46, .38); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.overlay > .modal { border-radius: 22px; background: var(--gl-light-strong); -webkit-backdrop-filter: var(--gl-blur); backdrop-filter: var(--gl-blur);
  border: 1px solid rgba(255, 255, 255, .78); box-shadow: var(--gl-rim), 0 30px 70px rgba(10, 22, 42, .36); }
#view-login, #view-change, #view-enroll, #view-mfa { background: var(--gl-light-strong); -webkit-backdrop-filter: var(--gl-blur); backdrop-filter: var(--gl-blur);
  border: 1px solid rgba(255, 255, 255, .8); border-radius: 26px; box-shadow: var(--gl-rim), 0 26px 60px rgba(23, 43, 70, .16); }
.nav-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(12, 22, 38, .42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: mo-fade .22s ease backwards; }
.nav-scrim[hidden] { display: none; }

/* ------------------------------------------------------------------ Tablet y escritorio estrecho */
@media (max-width: 1180px) {
  .tb-name small, .tb-control { display: none; }
  #topbar .tb-search { flex-basis: 300px; }
}
@media (max-width: 1020px) {
  .tb-who { display: none; }
  #topbar .tb-avatar { padding-right: 8px; }
  .tb-search-text, #topbar .tb-search kbd { display: none; }
  #topbar .tb-search { flex: none; width: 42px; padding: 0; justify-content: center; margin: 0 0 0 auto; }
  body.in-app #topbar .tb-search-mini { display: none; }
}

/* ------------------------------------------------------------------ Móvil: barra de 52 px y menú deslizable */
@media (max-width: 900px) {
  :root { --tb-h: 52px; }
  #topbar { top: 8px; margin: 8px 8px 0; padding: 6px 8px 6px 10px; gap: 8px; border-radius: 20px; }
  body.in-app #topbar .tb-menu { display: grid; }
  .tb-brand img { height: 30px; max-width: 96px; }
  .tb-name b { font-size: 1.05rem; }
  .tb-hours span { display: none; }
  .tb-hours { width: 34px; padding: 0; justify-content: center; }
  #main #view-app:not(.hidden), #main #view-app.sn-collapsed:not(.hidden) { grid-template-columns: minmax(0, 1fr); }
  #crumbs, #page { grid-column: 1; }
  #sidenav { position: fixed; z-index: 60; top: 8px; bottom: 8px; left: 8px; width: min(88vw, 320px); max-height: none; grid-column: auto; grid-row: auto;
    transform: translateX(calc(-100% - 16px)); visibility: hidden; transition: transform .36s var(--gl-ease), visibility 0s linear .36s; }
  body.nav-open #sidenav { transform: none; visibility: visible; transition-delay: 0s; }
  body.nav-open { overflow: hidden; }
  #sidenav .sn-collapse { display: none; }
  .tb-panel { position: fixed; top: 68px; right: 8px; left: 8px; width: auto; }
  .gl-crumbs { min-height: 30px; }
  .cr-seg { max-width: 22ch; }
  .pal-overlay { padding-top: 8vh; }
  #toasts { bottom: 12px; }
}
@media (max-width: 420px) { .tb-name b { display: none; } }

/* ------------------------------------------------------------------ Accesibilidad: sin transparencia, contraste alto, sin movimiento */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  #topbar, .tb-panel, .pal-box, .gl-tabs, #toasts .toast, .overlay > .modal, #view-login, #view-change, #view-enroll, #view-mfa { background: #fff; }
  #sidenav { background: #172b46; }
  .sn-lens { background: rgba(255, 255, 255, .18); }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  :root { --gl-light: #fff; --gl-light-strong: #fff; }
  #topbar, .tb-panel, .pal-box, .gl-tabs, #toasts .toast, .overlay > .modal, #view-login, #view-change, #view-enroll, #view-mfa, .sn-lens, .pal-overlay, .overlay, .nav-scrim { -webkit-backdrop-filter: none; backdrop-filter: none; }
  #sidenav { background: #172b46; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .sn-lens { background: rgba(255, 255, 255, .2); }
  body::before { display: none; }
}
@media (prefers-contrast: more) {
  #topbar, #sidenav, .tb-panel, .pal-box { border-color: #19283b; }
  .cr-seg, .tb-who small, .pal-hint { color: #2c3d52; }
}
@media (prefers-reduced-motion: reduce) {
  .tb-hours i, .tb-panel, .pal-box, .pal-overlay, .sicas-nav-badge, .nav-scrim, .cr-star.on .cr-star-ico { animation: none; }
  .sn-lens, #sidenav, #main #view-app:not(.hidden), .sn-collapse svg { transition: none; }
}

/* ------------------------------------------------------------------ Aviso de fin de sesión */
.sg-overlay { z-index: 10004; }
.sg-overlay > .modal { width: min(520px, 100%); }
.sg { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; margin: 6px 0 2px; }
.sg-ring { --p: 100; position: relative; display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%;
  background: conic-gradient(var(--gl-brand) calc(var(--p) * 1%), rgba(41, 75, 112, .14) 0); transition: background .4s linear; }
.sg-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #fff; box-shadow: inset 0 1px 3px rgba(23, 43, 70, .12); }
.sg-count { position: relative; font-size: 1.45rem; font-weight: 760; font-variant-numeric: tabular-nums; color: var(--gl-navy); letter-spacing: -.02em; }
.sg-text p { margin: 0 0 8px; line-height: 1.5; color: var(--gl-ink); }
.sg-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.sg-code label { display: grid; gap: 6px; font-size: .84rem; font-weight: 600; color: var(--gl-muted); }
.sg-code input { width: 100%; font-size: 1.25rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.sg-err { min-height: 1.3em; margin: 6px 0 0; font-size: .84rem; font-weight: 600; color: #b54444; }
@media (max-width: 480px) { .sg { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
@media (prefers-reduced-motion: reduce) { .sg-ring { transition: none; } }
