/* Layout Scope — riel claro con borde fino + barra superior (estilo Vercel) */
.app-shell-body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font-sans);
  background: var(--theme-rail-bg, var(--gray-1000));
  color: var(--theme-body-text);
  display: flex;
  flex-direction: row;
  --topbar-height: 64px;
  --sidebar-width: 76px;
  --sidebar-gap: 0;
  --sidebar-top: 0;
  --sidebar-rail: 0;
}

.app-shell__workspace {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--theme-body-bg);
}

.app-shell__main-rail {
  margin-left: 0;
}

.app-shell__header {
  flex-shrink: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--theme-topbar-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--theme-topbar-border);
  position: relative;
  overflow: visible;
}

.app-shell__topbar,
.app-shell__topbar-strip {
  position: relative;
}

.app-shell__topbar {
  z-index: 5;
}

.app-shell__topbar-strip {
  z-index: 1;
}

.app-shell__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: var(--topbar-height);
  padding: 0 var(--space-4) 0 var(--space-5);
}

.app-shell__topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
  flex: 1;
}

.app-shell__brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
  min-width: 72px;
  line-height: 1;
  text-decoration: none;
}

.app-shell__brand:hover .app-shell__brand-name {
  color: var(--sandos-accent);
}

.app-shell__brand-kicker {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sandos-accent);
}

.app-shell__brand-name {
  margin-top: 3px;
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.045em;
  color: var(--theme-heading);
}

.app-shell__context-rule {
  width: 1px;
  align-self: center;
  height: 28px;
  flex-shrink: 0;
  background: var(--theme-topbar-border);
}

.app-shell__context {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 1px;
}

.app-shell__search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  width: 240px;
  flex: 0 1 240px;
  margin-left: 0;
  padding: 0 var(--space-3);
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--theme-input-bg);
  border: 1px solid var(--theme-input-border);
}

.app-shell__search-icon {
  width: 16px;
  height: 16px;
  color: var(--theme-topbar-muted);
  flex-shrink: 0;
}

.app-shell__search-input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--theme-topbar-text);
  font-size: var(--text-sm);
  font-family: inherit;
  outline: none;
}

.app-shell__search-input::placeholder {
  color: var(--theme-topbar-muted);
}

.app-shell__topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.app-shell__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--theme-topbar-text);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.app-shell__icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.app-shell__icon-btn:hover {
  background: var(--theme-topbar-hover);
  border-color: var(--theme-topbar-border);
}

.app-shell__icon-btn .theme-toggle__icon {
  width: 18px;
  height: 18px;
}

.app-shell__user-menu {
  position: relative;
  margin: 0 var(--space-1);
  z-index: 6;
}

.app-shell__topbar-user {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-1);
  margin: 0;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.app-shell__topbar-user:hover,
.app-shell__user-menu.is-open .app-shell__topbar-user {
  background: var(--theme-topbar-hover);
}

.app-shell__user-menu.is-open .app-shell__user-chevron {
  transform: rotate(180deg);
}

.app-shell__user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: var(--space-1) 0;
  background: var(--theme-flyout-bg, var(--background-100));
  border: 1px solid var(--theme-flyout-border);
  border-radius: var(--radius-md);
  box-shadow: var(--theme-flyout-shadow);
  z-index: 70;
  pointer-events: auto;
}

.app-shell__user-dropdown[hidden] {
  display: none !important;
}

.app-shell__user-dropdown-link {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--theme-flyout-link);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.app-shell__user-dropdown-link:hover {
  background: var(--theme-flyout-link-hover-bg);
  color: var(--theme-flyout-link-hover-text);
}

.app-shell__topbar-avatar,
.app-shell__profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--accent-fg);
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--gray-200);
}

.app-shell__avatar-img {
  padding: 0;
  overflow: hidden;
}

.app-shell__topbar-avatar {
  width: 32px;
  height: 32px;
  font-size: var(--text-xs);
}

.app-shell__profile-avatar {
  width: 64px;
  height: 64px;
  font-size: var(--text-lg);
}

.app-shell__user-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--theme-topbar-text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell__user-chevron {
  width: 14px;
  height: 14px;
  color: var(--theme-topbar-muted);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.app-shell__logout-form {
  display: inline;
  margin: 0;
}

.app-shell__sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--theme-topbar-text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.app-shell__sidebar-toggle:hover {
  background: var(--theme-topbar-hover);
}

.app-shell__sidebar-toggle-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.app-shell__strip-label {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--theme-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-shell__breadcrumbs {
  min-width: 0;
}

.app-shell__breadcrumbs-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-shell__breadcrumbs-item {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--theme-topbar-muted);
  white-space: nowrap;
}

.app-shell__breadcrumbs-sep {
  margin: 0 var(--space-2);
  color: var(--theme-topbar-muted);
  opacity: 0.7;
}

.app-shell__breadcrumbs-link {
  color: var(--theme-topbar-muted);
  text-decoration: none;
  transition: color 0.12s ease;
}

.app-shell__breadcrumbs-link:hover {
  color: var(--theme-heading);
}

.app-shell__breadcrumbs-item.is-current .app-shell__breadcrumbs-text {
  color: var(--theme-subtle);
}

/* ── Body row ── */
.app-shell__body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: transparent;
}

.app-shell__sidebar {
  position: relative;
  top: auto;
  left: auto;
  flex-shrink: 0;
  width: var(--sidebar-width);
  height: 100%;
  max-height: none;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--theme-rail-bg, var(--background-100));
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  padding: var(--space-4) 0 var(--space-3);
  overflow: visible;
  pointer-events: auto;
}

.app-shell__sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  background: none;
}

.app-shell__rail-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: var(--space-1) auto var(--space-4);
  border-radius: var(--radius-lg);
  background: transparent;
  text-decoration: none;
}

.app-shell__rail-brand:hover {
  background: var(--gray-alpha-100);
}

.app-shell__rail-logo--dark {
  display: none !important;
}

html[data-theme="dark"] .app-shell__rail-logo--light {
  display: none !important;
}

html[data-theme="dark"] .app-shell__rail-logo--dark {
  display: block !important;
}

.app-shell__rail-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 50%;
  display: block;
}

.app-shell__sidebar--icon {
  overflow: visible;
}

.app-shell__icon-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  width: 100%;
  padding: 0 var(--space-3);
  margin: 0;
  overflow: visible;
}

.app-shell__nav-icon-link,
.app-shell__nav-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--theme-rail-icon, var(--gray-700));
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.app-shell__nav-icon-link:hover,
.app-shell__nav-trigger:hover,
.app-shell__nav-group:hover .app-shell__nav-trigger,
.app-shell__nav-group:focus-within .app-shell__nav-trigger,
.app-shell__nav-group.is-open .app-shell__nav-trigger {
  background: var(--theme-rail-icon-hover-bg, rgba(255, 255, 255, 0.08));
  color: var(--theme-rail-icon-hover, var(--accent-fg));
}

.app-shell__nav-icon-link.is-active,
.app-shell__nav-trigger.is-active,
.app-shell__nav-group.is-active .app-shell__nav-trigger {
  background: var(--theme-rail-icon-active-bg, color-mix(in srgb, var(--red-solid) 22%, transparent));
  color: var(--theme-rail-icon-active, var(--red-border));
  box-shadow: none;
}

.app-shell__nav-group {
  position: relative;
  display: flex;
  justify-content: center;
  overflow: visible;
}

.app-shell__nav-label {
  display: none;
}

.app-shell__drawer-head,
.app-shell__topbar-actions {
  display: contents;
}

.app-shell__menu-btn,
.app-shell__drawer-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-shrink: 0;
}

.app-shell__menu-btn svg,
.app-shell__drawer-close svg {
  width: 20px;
  height: 20px;
  display: block;
}

.app-shell__nav-svg {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
  stroke-width: 1.6;
}

.app-shell__nav-logo--falabella {
  width: 20px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.app-shell__nav-svg--meli {
  width: 20px;
  height: 20px;
  stroke-width: 1.6;
  /* El mark es más ancho que alto; escala óptica al resto de iconos 20px */
  transform: scale(1.35);
  transform-origin: center;
}

.app-shell__flyout {
  position: absolute;
  left: calc(100% + 10px);
  top: 0;
  min-width: 200px;
  width: max-content;
  max-width: 260px;
  height: auto;
  padding: var(--space-3) 0 var(--space-2);
  background: var(--theme-flyout-bg, var(--background-100));
  border: 1px solid var(--theme-flyout-border);
  border-radius: var(--radius-md);
  box-shadow: var(--theme-flyout-shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
  z-index: 80;
}

.app-shell__flyout::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 0;
  width: 14px;
  height: 100%;
}

.app-shell__nav-group.is-open .app-shell__flyout {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.app-shell__flyout-title {
  margin: 0;
  padding: 2px var(--space-4) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--sandos-accent);
}

.app-shell__flyout-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.app-shell__flyout-link {
  display: block;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.35;
  color: var(--theme-flyout-link);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.app-shell__flyout-link:hover {
  background: var(--theme-flyout-link-hover-bg);
  color: var(--theme-flyout-link-hover-text);
}

.app-shell__flyout-link.is-active {
  color: var(--theme-flyout-link-active);
  font-weight: 600;
}

/* ── Main + footer ── */
.app-shell__content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: var(--space-5) var(--space-6) var(--space-3);
}

.app-shell__main {
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.app-shell__footer {
  flex-shrink: 0;
  padding: var(--space-3) var(--space-2) var(--space-1);
  text-align: left;
  border-top: 0;
  background: transparent;
}

.app-shell__footer p {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--theme-muted);
}

.app-shell__footer-mark {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sandos-accent);
  flex-shrink: 0;
}

.app-page__header {
  margin-bottom: var(--space-4);
}

.app-page__title {
  margin: 0 0 var(--space-1);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--theme-heading);
}

.app-page__subtitle {
  margin: 0;
  font-size: var(--text-base);
  color: var(--theme-muted);
}

.app-page--shipit :is(.orders-card, .card) {
  margin-top: var(--space-1);
}

.banners-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
}

.banners-page-header__text {
  flex: 1 1 220px;
  min-width: 0;
}

.banners-page-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.banners-category-heading {
  margin: var(--space-6) 0 var(--space-3);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--theme-heading);
}

.banners-category-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
}

.banners-category-toolbar .banners-category-heading {
  margin: 0;
}

.banners-category-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
