/* Glass Sidebar: menú lateral de vidrio que se colapsa a una cápsula de íconos.
   Tokens --gs-* en :root o en el propio .gs. Sin dependencias. */
.gs {
  --gs-w-col: 68px;            /* ancho colapsado */
  --gs-w-exp: 268px;           /* ancho expandido */
  --gs-pad: 12px;              /* margen interno: el ícono nunca se mueve al expandir */
  --gs-row: 44px;              /* alto de cada fila */
  --gs-radius: 34px;
  --gs-accent: #f05a2a;        /* logo, badges, puntos */
  --gs-accent-2: #ff8a4c;
  --gs-text: rgba(255, 255, 255, .94);
  --gs-muted: rgba(255, 255, 255, .7);
  --gs-glass: linear-gradient(180deg, rgba(255, 255, 255, .20), rgba(255, 255, 255, .07) 45%, rgba(255, 255, 255, .10));
  --gs-tint: rgba(40, 32, 28, .28);
  --gs-rim: rgba(255, 255, 255, .28);
  --gs-blur: 22px;
  --gs-ok: #22c55e;
  --gs-spring: cubic-bezier(.34, 1.36, .5, 1);
  --gs-spring: linear(0, .009, .035 2.1%, .141, .281 6.7%, .723 12.9%, .938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, .991, .977 51%, .974 53.8%, .975 57.1%, .997 69.8%, 1.003 76.9%, 1);
  --gs-ease: cubic-bezier(.22, 1, .36, 1);

  position: relative;
  width: var(--gs-w-exp);
  font: 500 14px/1.2 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--gs-text);
  transition: width .55s var(--gs-ease);
  -webkit-font-smoothing: antialiased;
}
.gs.is-collapsed { width: var(--gs-w-col); }
.gs[data-theme="night"] {
  --gs-tint: rgba(8, 8, 12, .55);
  --gs-rim: rgba(255, 255, 255, .16);
  --gs-glass: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .03) 45%, rgba(255, 255, 255, .05));
}

/* La cápsula de vidrio. El recorte va aquí; el botón de expandir y los tooltips quedan fuera. */
.gs-glass {
  position: relative;
  display: flex; flex-direction: column;
  height: 100%;
  padding: 14px var(--gs-pad) 12px;
  border-radius: var(--gs-radius);
  background: var(--gs-glass), var(--gs-tint);
  -webkit-backdrop-filter: blur(var(--gs-blur)) saturate(150%);
  backdrop-filter: blur(var(--gs-blur)) saturate(150%);
  border: 1px solid var(--gs-rim);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .38),
    inset 0 -1px 0 rgba(255, 255, 255, .08),
    inset 0 0 24px rgba(255, 255, 255, .05),
    0 30px 60px -24px rgba(0, 0, 0, .55),
    0 8px 18px -8px rgba(0, 0, 0, .35);
  overflow: hidden;
  isolation: isolate;
  transition: background .4s, border-color .4s;
}
/* Reflejo de borde: un brillo que recorre el contorno superior izquierdo */
.gs-glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  padding: 1px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .55), transparent 28%, transparent 72%, rgba(255, 255, 255, .18));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

/* ---------- Cabecera ---------- */
.gs-head { display: flex; align-items: center; gap: 12px; height: 44px; margin-bottom: 10px; }
.gs-logo {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 32% 28%, var(--gs-accent-2), var(--gs-accent) 55%, #c63d14);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .45), inset 0 -3px 6px rgba(120, 20, 0, .35), 0 6px 16px -4px rgba(240, 90, 42, .65);
  color: #fff; font: 800 20px/1 system-ui, sans-serif; text-decoration: none;
}
.gs-brand { min-width: 0; white-space: nowrap; }
.gs-brand b { display: block; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.gs-brand small { display: block; margin-top: 2px; font-size: 12px; color: var(--gs-muted); }

/* Botón expandir/colapsar: un círculo blanco que sobresale del borde */
.gs-toggle {
  position: absolute; z-index: 5; top: 22px; right: -13px;
  width: 28px; height: 28px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  background: #fff; color: #1d1d1f;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .18), 0 4px 10px rgba(0, 0, 0, .3);
  transition: transform .5s var(--gs-spring), box-shadow .2s;
}
.gs-toggle:hover { box-shadow: 0 0 0 7px rgba(255, 255, 255, .22), 0 4px 12px rgba(0, 0, 0, .35); }
.gs-toggle svg { width: 14px; height: 14px; transition: transform .5s var(--gs-spring); transform: rotate(180deg); }
.gs.is-collapsed .gs-toggle svg { transform: rotate(0deg); }

/* ---------- Búsqueda ---------- */
.gs-search {
  border: 0; width: 100%; font: inherit; color: inherit; text-align: left;   /* también sirve como <button> */
  position: relative; display: flex; align-items: center; gap: 12px;
  height: var(--gs-row); padding: 0 12px; margin-bottom: 4px;
  border-radius: 999px; cursor: text;
  background: rgba(255, 255, 255, .07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), inset 0 0 0 1px rgba(255, 255, 255, .06);
  transition: background .3s;
}
.gs-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--gs-text); font: inherit;
}
.gs-search > .gs-label { color: var(--gs-muted); }
.gs-search input::placeholder { color: var(--gs-muted); }
.gs-search kbd, .gs-tip kbd {
  flex: none; padding: 2px 6px; border-radius: 6px; font: 600 12px/1.3 inherit; color: var(--gs-muted);
  background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.gs-search:focus-within { background: rgba(255, 255, 255, .12); }

/* ---------- Secciones y filas ---------- */
.gs-nav {
  flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative;
  overflow-y: auto; overflow-x: hidden; scrollbar-width: none; overscroll-behavior: contain;
  margin: 0 calc(-1 * var(--gs-pad)); padding: 0 var(--gs-pad);   /* el scroll no recorta la píldora a los lados */
}
.gs-nav::-webkit-scrollbar { display: none; }
.gs-nav { -webkit-mask: linear-gradient(transparent, #000 10px, #000 calc(100% - 10px), transparent); mask: linear-gradient(transparent, #000 10px, #000 calc(100% - 10px), transparent); }
.gs-sec {
  position: relative; height: 30px; padding: 12px 6px 0;
  font-size: 12px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--gs-muted);
  white-space: nowrap;
}
.gs-sec::before { /* la rayita que reemplaza el título al colapsar */
  content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 2px; margin: 0 0 0 -8px;
  border-radius: 2px; background: rgba(255, 255, 255, .28); opacity: 0; transition: opacity .25s;
}
.gs-list { list-style: none; margin: 0; padding: 0; }
.gs-item {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 12px;
  height: var(--gs-row); padding: 0 12px;
  border-radius: 999px; color: inherit; text-decoration: none; white-space: nowrap;
  background: none; border: 0; width: 100%; font: inherit; cursor: pointer; text-align: left;
  outline: 0;
}
.gs-ico { position: relative; flex: none; width: 20px; height: 20px; display: grid; place-items: center; }
.gs-ico svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.gs-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gs-item[aria-current="page"] { font-weight: 600; }

/* Badges: número en vidrio, número rojo o punto */
.gs-count {
  flex: none; min-width: 22px; padding: 2px 7px; border-radius: 999px; text-align: center;
  font-size: 12px; font-weight: 600; color: var(--gs-muted);
  background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.gs-count.is-hot { color: #fff; background: var(--gs-accent); box-shadow: 0 2px 8px -2px var(--gs-accent); min-width: 20px; padding: 2px 6px; }
.gs-dot { flex: none; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--gs-accent); box-shadow: 0 0 8px var(--gs-accent); }
/* En colapsado, el badge se vuelve un punto en la esquina del ícono */
.gs-ping {
  position: absolute; top: -4px; right: -5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--gs-accent); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85);
  opacity: 0; transform: scale(.4); transition: opacity .25s, transform .4s var(--gs-spring);
}

/* Subárbol (Projects) con líneas de árbol y caret */
.gs-caret { flex: none; width: 14px; height: 14px; opacity: .6; transition: transform .35s var(--gs-ease); }
.gs-item[aria-expanded="false"] .gs-caret { transform: rotate(180deg); }
.gs-sub { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .4s var(--gs-ease), opacity .3s; }
.gs-sub.is-closed { grid-template-rows: 0fr; opacity: 0; }
.gs-sub > ul { overflow: hidden; list-style: none; margin: 0; padding: 0 0 0 33px; position: relative; }
.gs-sub > ul::before { /* tronco */
  content: ""; position: absolute; left: 21px; top: 0; bottom: 18px; width: 1.5px; background: rgba(255, 255, 255, .22);
}
.gs-sub .gs-item { height: 34px; font-size: 13px; color: rgba(255, 255, 255, .78); padding-left: 14px; }
.gs-sub .gs-item::before { /* rama curva */
  content: ""; position: absolute; left: -12px; top: -2px; width: 14px; height: 19px;
  border: solid rgba(255, 255, 255, .22); border-width: 0 0 1.5px 1.5px; border-bottom-left-radius: 9px;
}
.gs-swatch { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c, #2dd4bf); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, #2dd4bf) 25%, transparent); }

/* ---------- Pie: modo noche y usuario ---------- */
.gs-foot { margin-top: 10px; }
.gs-switch {
  flex: none; position: relative; width: 34px; height: 20px; border-radius: 999px;
  background: rgba(255, 255, 255, .18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); transition: background .3s;
}
.gs-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .45s var(--gs-spring);
}
.gs-item[aria-pressed="true"] .gs-switch { background: var(--gs-accent); }
.gs-item[aria-pressed="true"] .gs-switch::after { transform: translateX(14px); }
.gs-rule { height: 1px; margin: 8px 6px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent); }
.gs-user { height: 52px; padding-left: 0; }
.gs-avatar {
  position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff;
  background: linear-gradient(140deg, #7c8aa5, #3f4a5f); box-shadow: 0 0 0 2px rgba(255, 255, 255, .7);
  background-size: cover; background-position: center;
}
.gs-avatar::after {
  content: ""; position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--gs-ok); box-shadow: 0 0 0 2.5px rgba(255, 255, 255, .9);
}
.gs-who { flex: 1; min-width: 0; }
.gs-who b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.gs-who small { display: block; margin-top: 2px; font-size: 12px; color: var(--gs-muted); overflow: hidden; text-overflow: ellipsis; }

/* ---------- Píldoras: la activa (vidrio convexo) y la de hover (plana) ---------- */
.gs-pill {
  position: absolute; z-index: 1; left: 0; top: 0; pointer-events: none;
  width: var(--w, 0); height: var(--h, 0);
  transform: translate(var(--x, 0), var(--y, 0));
  border-radius: 999px; opacity: 0;
}
.gs-pill.is-on { opacity: 1; }
.gs-pill.is-ready { transition: transform .55s var(--gs-spring), width .55s var(--gs-spring), height .45s var(--gs-ease), opacity .25s; }
.gs-pill--hover { background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
.gs-pill--hover.is-ready { transition-duration: .35s, .35s, .3s, .2s; }
.gs-pill--active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .30), rgba(255, 255, 255, .08) 48%, rgba(255, 255, 255, .02) 52%, rgba(255, 255, 255, .12)),
    rgba(120, 100, 90, .25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .6),
    inset 0 -1px 1px rgba(255, 255, 255, .2),
    inset 0 0 0 1px rgba(255, 255, 255, .28),
    0 6px 14px -6px rgba(0, 0, 0, .45);
}

/* Tooltip (uno compartido, posicionado por JS, fuera de la cápsula) */
.gs-tip {
  position: fixed; z-index: 60; left: 0; top: 0; pointer-events: none;
  display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px;
  border-radius: 999px; white-space: nowrap;
  font: 600 12.5px/1.2 "Inter", system-ui, sans-serif; color: #1d1d1f;
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(255, 255, 255, .5), 0 8px 20px -6px rgba(0, 0, 0, .35);
  opacity: 0; transform: translate(var(--tx), var(--ty)) translateX(-6px) scale(.96);
  transition: opacity .18s, transform .35s var(--gs-spring);
}
.gs-tip.is-on { opacity: 1; transform: translate(var(--tx), var(--ty)); }
.gs-tip kbd { color: #6b6b70; background: rgba(0, 0, 0, .06); box-shadow: none; }
.gs-tip .gs-count { background: rgba(0, 0, 0, .07); color: #555; box-shadow: none; }
.gs-tip .gs-count.is-hot { background: var(--gs-accent, #f05a2a); color: #fff; }

/* ---------- Estado colapsado ---------- */
.gs .gs-brand, .gs .gs-label, .gs .gs-count, .gs .gs-dot, .gs .gs-caret, .gs .gs-switch, .gs .gs-who,
.gs .gs-search input, .gs .gs-search kbd, .gs .gs-sec span {
  transition: opacity .3s .12s;
}
.gs.is-collapsed .gs-brand, .gs.is-collapsed .gs-label, .gs.is-collapsed .gs-count, .gs.is-collapsed .gs-dot,
.gs.is-collapsed .gs-caret, .gs.is-collapsed .gs-switch, .gs.is-collapsed .gs-who,
.gs.is-collapsed .gs-search input, .gs.is-collapsed .gs-search kbd, .gs.is-collapsed .gs-sec span {
  opacity: 0; pointer-events: none; transition-delay: 0s; transition-duration: .12s;
}
.gs.is-collapsed .gs-sec { height: 22px; padding-top: 0; }
.gs.is-collapsed .gs-sec::before { opacity: 1; }
.gs.is-collapsed .gs-ping { opacity: 1; transform: none; }
.gs.is-collapsed .gs-search { background: transparent; box-shadow: none; cursor: pointer; }
.gs.is-collapsed .gs-sub { grid-template-rows: 0fr; opacity: 0; }
.gs.is-collapsed .gs-head { margin-bottom: 6px; }
.gs.is-collapsed .gs-user { padding-left: 0; }
.gs.is-collapsed .gs-rule { margin-inline: 10px; }

/* ---------- Teclado, búsqueda, movimiento reducido ---------- */
.gs-item:focus-visible, .gs-toggle:focus-visible, .gs-logo:focus-visible { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.gs-hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  .gs, .gs *, .gs-tip { transition-duration: .01ms !important; transition-delay: 0s !important; }
}
@media (max-width: 560px) { .gs { --gs-w-exp: min(268px, calc(100vw - 32px)); } }
@media (pointer: coarse) { .gs { --gs-row: 44px; } .gs-sub .gs-item { height: 40px; } .gs-search input { font-size: 16px; } }
/* Sin transparencia (ajuste del sistema): el vidrio se vuelve opaco y sin desenfoque */
@media (prefers-reduced-transparency: reduce) {
  .gs-glass { background: var(--gs-opaco, #1b2740); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .gs-tip { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (max-height: 820px) and (pointer: fine) { .gs { --gs-row: 38px; } .gs-sub .gs-item { height: 30px; } .gs-sec { height: 26px; padding-top: 9px; } }
