/* ==========================================================================
   SHELL — barra superior + menú lateral (fijos en todas las vistas)
   ========================================================================== */

.rs-top {
  position: sticky;
  top: 0;
  z-index: 1035;
  height: var(--top-h);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.rs-top__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 0 1rem;
}
.rs-top__spacer { flex: 1 1 auto; }

.rs-burger {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  display: grid; place-items: center;
}
.rs-burger:hover { background: var(--canvas); }

/* Marca */
.rs-brand { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.rs-brand__mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--brand-600), var(--brand-800));
  color: #fff;
  display: grid; place-items: center;
  box-shadow: var(--sh-brand);
  flex: 0 0 auto;
}
.rs-brand__name {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1;
  white-space: nowrap;
}
.rs-brand__name span { color: var(--brand-600); font-style: italic; }
.rs-brand__by {
  font-size: .68rem;
  color: var(--faint);
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 600;
  padding-left: .7rem;
  margin-left: .1rem;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}

/* Selector de empresa activa — la pieza que une a los cuatro productos */
.rs-orgbtn {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .3rem .7rem .3rem .35rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  max-width: 260px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.rs-orgbtn:hover { border-color: var(--brand-300); box-shadow: var(--sh-sm); }
.rs-orgbtn__txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; }
.rs-orgbtn__txt small { font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.rs-orgbtn__txt strong { font-size: .82rem; font-weight: 700; color: var(--ink); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-orgbtn__go { color: var(--faint); }

.rs-menu {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
  padding: .4rem;
  min-width: 280px;
}
.rs-menu .dropdown-item {
  border-radius: var(--r-sm);
  font-size: .86rem;
  font-weight: 500;
  color: var(--ink-2);
  padding: .55rem .6rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.rs-menu .dropdown-item:hover { background: var(--canvas); color: var(--ink); }
.rs-menu .dropdown-item.is-active { background: var(--brand-50); color: var(--brand-700); }
.rs-menu__label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  padding: .5rem .6rem .3rem;
}

/* Lanzador de aplicaciones (cuadrícula) */
.rs-launch {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  display: grid; place-items: center;
}
.rs-launch:hover { background: var(--canvas); border-color: var(--line); }
.rs-launchmenu { min-width: 320px; padding: .75rem; }
.rs-launchgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.rs-launchgrid__item {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: .8rem .7rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: all .16s ease;
}
.rs-launchgrid__item:hover { border-color: var(--brand-200); background: var(--brand-50); transform: translateY(-2px); }
.rs-launchgrid__ico {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: #fff;
}
.rs-launchgrid__name { font-size: .8rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.rs-launchgrid__desc { font-size: .7rem; color: var(--muted); line-height: 1.35; }

/* Selector de idioma (visual) */
.rs-lang {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--line-soft);
  border: 1px solid var(--line);
}
.rs-lang__opt {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border: 0;
  background: transparent;
  border-radius: var(--r-pill);
  padding: .2rem .55rem;
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .02em;
}
.rs-lang__opt.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-sm); }
.rs-lang__flag { font-size: .78rem; line-height: 1; }

.rs-avatarbtn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--canvas);
  padding: 0;
  overflow: hidden;
  flex: 0 0 auto;
}
.rs-avatarbtn:hover { border-color: var(--brand-300); }
.rs-avatarbtn img { width: 100%; height: 100%; object-fit: cover; }

/* Layout del shell */
.rs-shell { display: flex; align-items: flex-start; }

.rs-side {
  width: var(--side-w);
  flex: 0 0 var(--side-w);
  position: sticky;
  top: var(--top-h);
  height: calc(100vh - var(--top-h));
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 1.1rem .85rem 1.5rem;
}

.rs-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1.75rem 1.5rem 4rem;
}
.rs-view { max-width: 1120px; }

@media (max-width: 991.98px) {
  .rs-main { padding: 1.25rem 1rem 3rem; }
}

/* Menú lateral */
.rs-nav__group + .rs-nav__group { margin-top: 1.4rem; }
.rs-nav__label {
  display: block;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 .7rem .5rem;
}
.rs-nav__link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem .7rem;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 600;
  color: var(--ink-2);
  transition: background .15s ease, color .15s ease;
}
.rs-nav__link + .rs-nav__link { margin-top: 2px; }
.rs-nav__link:hover { background: var(--canvas); color: var(--ink); }
.rs-nav__link.is-active { background: var(--brand-50); color: var(--brand-700); }
.rs-nav__link.is-active svg { color: var(--brand-600); }
.rs-nav__n {
  margin-left: auto;
  font-family: var(--font-data);
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--line-soft);
  border-radius: var(--r-pill);
  padding: .05rem .45rem;
}
.rs-nav__link.is-active .rs-nav__n { background: var(--brand-100); color: var(--brand-700); }
.rs-nav__state {
  margin-left: auto;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--faint);
}
.rs-nav__state.is-on { color: #0B8F5C; }

.rs-nav__dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; margin-left: .2rem; }
.rs-dot--ri { background: var(--app-ri); }
.rs-dot--jb { background: var(--app-jb); }
.rs-dot--ex { background: var(--app-ex); }
.rs-dot--cm { background: var(--app-cm); }

.rs-nav__card {
  margin-top: 1.6rem;
  padding: .9rem;
  border-radius: var(--r-md);
  background: linear-gradient(140deg, var(--brand-50), #F6F5FF 120%);
  border: 1px solid var(--brand-100);
}
.rs-nav__card p { font-size: .74rem; color: var(--ink-2); line-height: 1.5; margin: .35rem 0 .7rem; }

.rs-offcanvas { width: 292px; }
.rs-offcanvas .offcanvas-body { padding-top: .5rem; }

/* Encabezado de vista */
.rs-head { margin-bottom: 1.5rem; }
.rs-head h1 { margin: .35rem 0 .4rem; }

.rs-launch .rs-ico,
.rs-launchgrid .rs-ico,
.rs-lang .rs-ico {
    width: 1.05rem;
    height: 1.05rem;
}