/* ============================================================
 * SEOXtreme · Panel — Sistema de diseño
 * Dark-first, premium, hecho a mano. Vanilla CSS (sin build).
 *  · Tokens en :root (oscuro) + variante clara (prefers-color-scheme
 *    y data-theme para el toggle manual).
 *  · Componentes: glass cards, botones gradiente, toggles píldora,
 *    KPI tiles, tablas sticky, tabs, modales, toasts, skeletons.
 *  · Motion suave con respeto a prefers-reduced-motion.
 * ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html:focus-within { scroll-behavior: smooth; }
body { min-height: 100vh; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, picture, svg, video, canvas { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
[hidden] { display: none !important; }
:where(table) { border-collapse: collapse; }

/* ---------- Tokens: oscuro (base) ---------- */
:root {
  --bg:        #0A0C12;
  --surface:   #12151F;
  --surface-2: #1A1E2B;
  --surface-3: #222739;
  --border:    rgba(255,255,255,.08);
  --border-2:  rgba(255,255,255,.14);
  --text:      #E8EAF0;
  --muted:     #9AA3B6;
  --faint:     #6B7488;

  --accent-1:  #7C5CFF;
  --accent-2:  #22D3EE;
  --accent-3:  #FF5CA8;   /* acento2 (rosa) */
  --success:   #34D399;
  --warn:      #FBBF24;
  --danger:    #F87171;

  --grad:      linear-gradient(135deg, #7C5CFF 0%, #22D3EE 100%);
  --grad-soft: linear-gradient(135deg, rgba(124,92,255,.18), rgba(34,211,238,.14));
  --grad-pink: linear-gradient(135deg, #7C5CFF 0%, #FF5CA8 100%);

  --glass:     rgba(18,21,31,.72);
  --glass-2:   rgba(26,30,43,.62);
  --ring:      rgba(124,92,255,.55);

  --sh-1: 0 1px 2px rgba(0,0,0,.30);
  --sh-2: 0 8px 24px -8px rgba(0,0,0,.55);
  --sh-3: 0 24px 60px -20px rgba(0,0,0,.65);
  --glow: 0 12px 40px -12px rgba(124,92,255,.55);

  --r-xs: 8px;  --r-sm: 12px;  --r-md: 16px;  --r-lg: 22px;  --r-full: 999px;
  --sb: 264px;                 /* ancho del sidebar */
  --ease: cubic-bezier(.22,.61,.36,1);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

/* ---------- Tokens: claro ---------- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:        #F5F6FB;
    --surface:   #FFFFFF;
    --surface-2: #F1F3F9;
    --surface-3: #E7EAF3;
    --border:    rgba(12,16,28,.10);
    --border-2:  rgba(12,16,28,.16);
    --text:      #171A24;
    --muted:     #5A6478;
    --faint:     #8A93A6;
    --glass:     rgba(255,255,255,.78);
    --glass-2:   rgba(255,255,255,.66);
    --ring:      rgba(124,92,255,.45);
    --sh-1: 0 1px 2px rgba(20,26,44,.06);
    --sh-2: 0 10px 30px -12px rgba(24,32,58,.20);
    --sh-3: 0 28px 60px -24px rgba(24,32,58,.26);
    --glow: 0 14px 40px -14px rgba(124,92,255,.40);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg:        #F5F6FB;
  --surface:   #FFFFFF;
  --surface-2: #F1F3F9;
  --surface-3: #E7EAF3;
  --border:    rgba(12,16,28,.10);
  --border-2:  rgba(12,16,28,.16);
  --text:      #171A24;
  --muted:     #5A6478;
  --faint:     #8A93A6;
  --glass:     rgba(255,255,255,.78);
  --glass-2:   rgba(255,255,255,.66);
  --ring:      rgba(124,92,255,.45);
  --sh-1: 0 1px 2px rgba(20,26,44,.06);
  --sh-2: 0 10px 30px -12px rgba(24,32,58,.20);
  --sh-3: 0 28px 60px -24px rgba(24,32,58,.26);
  --glow: 0 14px 40px -14px rgba(124,92,255,.40);
  color-scheme: light;
}
/* El toggle manual siempre gana */
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- Base ---------- */
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(124,92,255,.20), transparent 58%),
    radial-gradient(980px 520px at 112% 4%, rgba(34,211,238,.16), transparent 55%),
    radial-gradient(900px 720px at 50% 128%, rgba(255,92,168,.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  letter-spacing: -.011em;
}
:root[data-theme="light"] body,
:root:not([data-theme="dark"]) body {
  /* mesh más tenue en claro */
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) body {
    background:
      radial-gradient(1100px 620px at 12% -12%, rgba(124,92,255,.10), transparent 58%),
      radial-gradient(980px 520px at 112% 4%, rgba(34,211,238,.10), transparent 55%),
      radial-gradient(900px 720px at 50% 128%, rgba(255,92,168,.06), transparent 60%),
      var(--bg);
  }
}
:root[data-theme="light"] body {
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(124,92,255,.10), transparent 58%),
    radial-gradient(980px 520px at 112% 4%, rgba(34,211,238,.10), transparent 55%),
    radial-gradient(900px 720px at 50% 128%, rgba(255,92,168,.06), transparent 60%),
    var(--bg);
}

::selection { background: rgba(124,92,255,.35); color: #fff; }

/* Scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--border-2); background-clip: content-box; }

/* Ícono base (los componentes ajustan tamaño con mayor especificidad) */
.ic { width: 18px; height: 18px; flex: none; }
i[data-icon] { display: inline-flex; }
/* Checkbox nativo estilizado */
.chk { width: 18px; height: 18px; border-radius: 6px; accent-color: var(--accent-1); cursor: pointer; flex: none; }

/* ---------- Tipografía ---------- */
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}

/* ============================================================
 * Layout de la app (sidebar + main)
 * ============================================================ */
.app { display: grid; grid-template-columns: var(--sb) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; align-self: start;
  height: 100vh; display: flex; flex-direction: column;
  padding: 20px 16px; gap: 6px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-right: 1px solid var(--border);
  z-index: 40;
}
.sidebar__brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 16px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: var(--grad); display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 1.05rem;
  box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.35);
}
.brand-name { font-weight: 800; letter-spacing: -.02em; font-size: 1.06rem; }
.brand-name b { font-weight: 800; }
.brand-sub { font-size: .68rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; margin-left: -20px; padding-left: 20px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: clip; overscroll-behavior: contain; scrollbar-width: thin; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.nav__label {
  font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); padding: 14px 12px 6px;
}
.nav__link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--muted); font-weight: 500; font-size: .92rem;
  position: relative; transition: color .2s var(--ease), background .2s var(--ease);
}
.nav__link .ic { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav__link:hover { color: var(--text); background: var(--surface-2); }
.nav__link.is-active { color: var(--text); background: var(--surface-2); }
.nav__link.is-active::before {
  content: ""; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--grad);
  box-shadow: 0 0 14px 1px rgba(124,92,255,.6);
}
.nav__link .count {
  margin-left: auto; font-size: .72rem; font-weight: 700;
  background: var(--surface-3); color: var(--muted);
  padding: 1px 8px; border-radius: 999px; min-width: 22px; text-align: center;
}
.nav__link.is-active .count { background: rgba(124,92,255,.22); color: var(--text); }

.sidebar__footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.userchip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); }
.userchip__avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--grad-pink); display: grid; place-items: center;
  font-weight: 700; color: #fff; font-size: .85rem;
}
.userchip__meta { min-width: 0; }
.userchip__name { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userchip__role { font-size: .72rem; color: var(--muted); }

/* Main */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 14px clamp(16px, 3vw, 34px);
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.topbar__title { min-width: 0; }
.topbar__title h1 { font-size: 1.28rem; }
.topbar__title p { font-size: .82rem; color: var(--muted); margin-top: 1px; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.store-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--r-full);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: .82rem; font-weight: 600; color: var(--muted);
}
.store-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }

.menu-btn { display: none; }
.content { padding: clamp(18px, 3vw, 34px); flex: 1; }
.view { display: none; }
.view.is-active { display: block; animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.view__head { margin-bottom: 20px; display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.view__head .grow { flex: 1; min-width: 220px; }
.view__head h2 { font-size: 1.4rem; }
.view__head p { color: var(--muted); font-size: .9rem; margin-top: 4px; max-width: 62ch; }

/* Backdrop (drawer móvil) */
.backdrop { position: fixed; inset: 0; background: rgba(4,6,12,.5); backdrop-filter: blur(2px); z-index: 39; opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); }
.backdrop.is-open { opacity: 1; pointer-events: auto; }

/* ============================================================
 * Cards
 * ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-2);
  position: relative;
}
.card--glass { background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.card--pad { padding: 22px; }
.card--hair::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124,92,255,.6), rgba(34,211,238,.5), transparent);
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.card__head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card__head h3 { font-size: 1rem; }
.card__head .sub { font-size: .8rem; color: var(--muted); }
.card__head .spacer { margin-left: auto; }
.card__body { padding: 22px; }
.card__body--flush { padding: 0; }
.card__foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }

.hover-lift { transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease); }
.hover-lift:hover { transform: translateY(-3px); box-shadow: var(--sh-3); border-color: var(--border-2); }

/* Grids */
.grid { display: grid; gap: 18px; }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--sb2 { grid-template-columns: 1.4fr 1fr; }
@media (max-width: 900px){ .grid--sb2 { grid-template-columns: 1fr; } }

/* ---------- KPI tiles ---------- */
.kpi {
  padding: 20px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--sh-2); position: relative; overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px;
  background: var(--grad-soft); filter: blur(10px); border-radius: 50%; opacity: .7; pointer-events: none;
}
.kpi__top { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.kpi__icon {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--accent-2);
}
.kpi__icon .ic { width: 18px; height: 18px; }
.kpi__label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.kpi__value { font-size: 2.05rem; font-weight: 800; letter-spacing: -.03em; margin-top: 10px; line-height: 1; position: relative; z-index: 1; }
.kpi__value small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.kpi__foot { margin-top: 8px; font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; position: relative; z-index: 1; }
.kpi__delta { font-weight: 700; }
.kpi__delta.up { color: var(--success); }
.kpi__delta.down { color: var(--danger); }

/* ============================================================
 * Botones
 * ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-sm);
  font-weight: 600; font-size: .9rem; line-height: 1; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  transition: transform .18s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), opacity .2s var(--ease);
  user-select: none;
}
.btn .ic { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-3); border-color: var(--border-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-loading { opacity: .55; pointer-events: none; }
.btn--cta {
  background: var(--grad); border: none; color: #fff;
  box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.28);
}
.btn--cta:hover { box-shadow: 0 16px 46px -12px rgba(124,92,255,.75), inset 0 1px 0 rgba(255,255,255,.28); transform: translateY(-1px); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--surface-2); }
.btn--soft { background: rgba(124,92,255,.12); border-color: rgba(124,92,255,.28); color: var(--text); }
.btn--soft:hover { background: rgba(124,92,255,.2); }
.btn--success { background: rgba(52,211,153,.14); border-color: rgba(52,211,153,.34); color: #86efc4; }
.btn--success:hover { background: rgba(52,211,153,.24); }
.btn--danger { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.32); color: #fca5a5; }
.btn--danger:hover { background: rgba(248,113,113,.22); }
.btn--sm { padding: 7px 11px; font-size: .82rem; border-radius: 10px; }
.btn--icon { padding: 9px; border-radius: 10px; }
.btn--icon .ic { width: 18px; height: 18px; }
.btn--block { width: 100%; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.btn__spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
 * Formularios
 * ============================================================ */
.field { display: flex; flex-direction: column; gap: 7px; }
.label { font-size: .82rem; font-weight: 600; color: var(--text); }
.label .req { color: var(--accent-3); }
.field__hint { font-size: .76rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  font-size: .92rem; transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent-1);
  box-shadow: 0 0 0 3px var(--ring); background: var(--surface);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239AA3B6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px;
}
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 42px; }

/* Segmented control / tabs */
.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-full); }
.segmented__opt {
  padding: 8px 16px; border-radius: var(--r-full); font-size: .86rem; font-weight: 600;
  color: var(--muted); transition: color .2s var(--ease), background .2s var(--ease); position: relative;
}
.segmented__opt:hover { color: var(--text); }
.segmented__opt.is-active { color: #fff; background: var(--grad); box-shadow: var(--sh-1); }
.segmented--soft .segmented__opt.is-active { color: var(--text); background: var(--surface-3); }

/* Toggle píldora */
.switch { position: relative; display: inline-flex; align-items: center; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 46px; height: 27px; border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--border); transition: background .22s var(--ease), border-color .22s var(--ease);
  position: relative; display: inline-block;
}
.switch__thumb {
  position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform .24s var(--ease);
}
.switch input:checked + .switch__track { background: var(--grad); border-color: transparent; }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(19px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px var(--ring); }
.switch input:disabled + .switch__track { opacity: .5; }

.toggle-row { display: flex; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row__text { flex: 1; min-width: 0; }
.toggle-row__text .t { font-weight: 600; font-size: .92rem; display: flex; align-items: center; gap: 8px; }
.toggle-row__text .d { font-size: .8rem; color: var(--muted); margin-top: 2px; }

/* ============================================================
 * Badges / chips / tags
 * ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700;
  background: var(--surface-3); color: var(--muted); border: 1px solid var(--border);
  letter-spacing: .01em; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--success { background: rgba(52,211,153,.14); color: #6ee7b7; border-color: rgba(52,211,153,.3); }
.badge--warn    { background: rgba(251,191,36,.14); color: #fcd34d; border-color: rgba(251,191,36,.3); }
.badge--danger  { background: rgba(248,113,113,.14); color: #fca5a5; border-color: rgba(248,113,113,.3); }
.badge--accent  { background: rgba(124,92,255,.16); color: #b9a6ff; border-color: rgba(124,92,255,.32); }
.badge--cyan    { background: rgba(34,211,238,.14); color: #7ddfef; border-color: rgba(34,211,238,.3); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: .8rem; font-weight: 600; color: var(--muted);
}
.tag { font-size: .72rem; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--muted); font-weight: 600; }

/* ============================================================
 * Tablas
 * ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88rem; min-width: 560px; }
.table thead th {
  position: sticky; top: 0; z-index: 2; text-align: left; font-weight: 600; font-size: .74rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  padding: 13px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .16s var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .strong { font-weight: 600; color: var(--text); }
.table__empty { padding: 44px 20px; text-align: center; color: var(--muted); }
/* Tabla embebida sin doble borde dentro de una card */
.card__body--flush .table-wrap { border: none; border-radius: 0 0 var(--r-md) var(--r-md); }

/* ============================================================
 * Cola de aprobación (antes / después)
 * ============================================================ */
.queue-item { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); overflow: hidden; box-shadow: var(--sh-1); }
.queue-item + .queue-item { margin-top: 14px; }
.queue-item__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.queue-item__title { font-weight: 600; font-size: .92rem; min-width: 0; }
.queue-item__title a { color: var(--accent-2); }
.queue-item__title a:hover { text-decoration: underline; }
.queue-item__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.queue-item__check { margin-right: 4px; }
.queue-item__body { padding: 18px; }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px){ .diff { grid-template-columns: 1fr; } }
.diff__col { min-width: 0; }
.diff__label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.diff__box {
  padding: 13px 15px; border-radius: var(--r-sm); font-size: .88rem; line-height: 1.55;
  border: 1px solid var(--border); background: var(--surface-2); min-height: 60px;
  overflow-wrap: anywhere; max-height: 320px; overflow-y: auto;
}
.diff--before .diff__box { border-style: dashed; color: var(--muted); }
.diff--after .diff__box { border-color: rgba(52,211,153,.34); background: rgba(52,211,153,.06); }
.diff--after .diff__label { color: #6ee7b7; }
.diff__box img { border-radius: 10px; margin-bottom: 8px; max-height: 140px; width: auto; }
.diff__box.empty { color: var(--faint); font-style: italic; display: flex; align-items: center; }
.queue-item__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.bulkbar {
  position: sticky; bottom: 16px; z-index: 20; margin-top: 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: var(--r-md);
  background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--border-2); box-shadow: var(--sh-3);
}
.bulkbar .sel { font-weight: 600; font-size: .88rem; }
.bulkbar .spacer { margin-left: auto; }

/* ============================================================
 * Modal
 * ============================================================ */
.modal-root { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal-root__bg { position: absolute; inset: 0; background: rgba(4,6,12,.62); backdrop-filter: blur(4px); animation: fade .2s var(--ease); }
.modal {
  position: relative; width: min(560px, 100%); max-height: 88vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg);
  box-shadow: var(--sh-3); animation: modalIn .28s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal__head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 0; }
.modal__head h3 { font-size: 1.12rem; }
.modal__head p { font-size: .85rem; color: var(--muted); margin-top: 3px; }
.modal__close { margin-left: auto; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); }
.modal__close:hover { background: var(--surface-2); color: var(--text); }
.modal__body { padding: 18px 22px; }
.modal__foot { padding: 8px 22px 22px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ============================================================
 * Toasts
 * ============================================================ */
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; width: min(370px, calc(100vw - 36px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 14px; border-radius: var(--r-sm);
  background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--border-2); box-shadow: var(--sh-3);
  animation: toastIn .3s var(--ease); position: relative; overflow: hidden;
}
.toast.leaving { animation: toastOut .25s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(28px); } }
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent-1); }
.toast--success::before { background: var(--success); }
.toast--warn::before { background: var(--warn); }
.toast--danger::before { background: var(--danger); }
.toast--info::before { background: var(--accent-2); }
.toast__icon { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.toast--success .toast__icon { color: var(--success); }
.toast--warn .toast__icon { color: var(--warn); }
.toast--danger .toast__icon { color: var(--danger); }
.toast--info .toast__icon { color: var(--accent-2); }
.toast__body { flex: 1; min-width: 0; }
.toast__title { font-weight: 600; font-size: .88rem; }
.toast__msg { font-size: .82rem; color: var(--muted); margin-top: 1px; overflow-wrap: anywhere; }
.toast__close { color: var(--faint); flex: none; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; }
.toast__close:hover { color: var(--text); background: var(--surface-2); }

/* ============================================================
 * Skeleton loaders
 * ============================================================ */
.skel { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skel--line { height: 12px; margin: 8px 0; }
.skel--title { height: 20px; width: 40%; margin-bottom: 14px; }
.skel--kpi { height: 118px; border-radius: var(--r-md); }
.skel--row { height: 46px; margin: 0; border-radius: 0; border-bottom: 1px solid var(--border); }
.skel--block { height: 220px; border-radius: var(--r-md); }
.skel--chip { height: 30px; width: 90px; border-radius: 999px; display: inline-block; }

/* ============================================================
 * Estados vacíos
 * ============================================================ */
.empty {
  text-align: center; padding: 48px 24px; color: var(--muted);
  border: 1px dashed var(--border-2); border-radius: var(--r-md); background: var(--surface);
}
.empty__icon { width: 46px; height: 46px; margin: 0 auto 14px; color: var(--faint); display: grid; place-items: center; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.empty h4 { font-size: 1rem; margin-bottom: 6px; color: var(--text); }
.empty p { font-size: .88rem; max-width: 42ch; margin: 0 auto; }

/* URLs / feeds */
.url-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.url-row + .url-row { margin-top: 10px; }
.url-row .ic { color: var(--accent-2); flex: none; }
.url-row code { font-size: .8rem; color: var(--text); overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.url-row .btn { margin-left: auto; flex: none; }
.url-row__meta { min-width: 0; }
.url-row__meta .l { font-size: .78rem; color: var(--muted); font-weight: 600; }

/* ============================================================
 * Reveal on scroll
 * ============================================================ */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
/* Salvaguarda de visibilidad: contenido MUY alto (p. ej. cientos de keywords en una sola tabla)
   supera el límite de composición del navegador (~16384px). Ahí las animaciones/transiciones de
   opacidad se atoran y dejan TODO invisible. Con .is-tall (lo pone SX.reveal por altura) se
   desactivan para garantizar que el contenido SIEMPRE se vea, sin importar cuántas filas haya. */
.is-tall, .is-tall .reveal, .reveal.is-tall,
.view.is-tall, .view.is-tall .reveal {
  animation: none !important;
  transition: none !important;
  opacity: 1 !important;
  transform: none !important;
}
.reveal.d1 { transition-delay: .06s; }
.reveal.d2 { transition-delay: .12s; }
.reveal.d3 { transition-delay: .18s; }
.reveal.d4 { transition-delay: .24s; }

/* ============================================================
 * LOGIN
 * ============================================================ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth__aside {
  position: relative; overflow: hidden; padding: 54px; display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  background:
    radial-gradient(700px 500px at 20% 10%, rgba(124,92,255,.28), transparent 60%),
    radial-gradient(600px 460px at 90% 90%, rgba(34,211,238,.22), transparent 60%),
    var(--surface);
}
.auth__aside::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 22px 22px; mask-image: radial-gradient(600px 400px at 30% 30%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(600px 400px at 30% 30%, #000, transparent 75%);
}
.auth__aside .brand-mark { width: 46px; height: 46px; font-size: 1.2rem; border-radius: 13px; }
.auth-brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.auth-brand .n { font-size: 1.35rem; font-weight: 800; }
.auth__hero { margin-top: auto; position: relative; z-index: 1; }
.auth__hero h2 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.5rem); line-height: 1.08; max-width: 16ch; }
.auth__hero p { color: var(--muted); margin-top: 16px; font-size: 1.02rem; max-width: 44ch; }
.auth__feats { margin-top: 30px; display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1; }
.auth__feat { display: flex; align-items: center; gap: 12px; font-size: .95rem; color: var(--text); }
.auth__feat .tick { width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center; background: rgba(52,211,153,.16); color: var(--success); border: 1px solid rgba(52,211,153,.3); }
.auth__feat .tick .ic { width: 15px; height: 15px; }

.auth__panel { display: grid; place-items: center; padding: 32px; }
.auth__card { width: min(430px, 100%); }
.auth__card .head { text-align: center; margin-bottom: 26px; }
.auth__card .head h1 { font-size: 1.55rem; }
.auth__card .head p { color: var(--muted); margin-top: 7px; font-size: .92rem; }
.auth-mobile-brand { display: none; }

.tabs { display: flex; padding: 5px; gap: 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-full); margin-bottom: 22px; }
.tab { flex: 1; padding: 10px; border-radius: var(--r-full); font-weight: 600; font-size: .88rem; color: var(--muted); transition: color .2s var(--ease), background .2s var(--ease); }
.tab:hover { color: var(--text); }
.tab.is-active { color: #fff; background: var(--grad); box-shadow: var(--sh-1); }

.otp-inputs { display: flex; gap: 9px; justify-content: space-between; }
.otp-inputs input {
  width: 100%; aspect-ratio: 1; text-align: center; font-size: 1.4rem; font-weight: 700;
  border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.otp-inputs input:focus { outline: none; border-color: var(--accent-1); box-shadow: 0 0 0 3px var(--ring); }

.auth-foot { text-align: center; margin-top: 20px; font-size: .82rem; color: var(--muted); }
.link { color: var(--accent-2); font-weight: 600; }
.link:hover { text-decoration: underline; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.back-link:hover { color: var(--text); }

.legal { margin-top: 26px; font-size: .74rem; color: var(--faint); text-align: center; line-height: 1.6; }

/* ============================================================
 * Chatbot de soporte (flotante · solo panel del cliente)
 * Reutiliza tokens y estética glass del sistema.
 * ============================================================ */
.sx-chat { position: fixed; right: clamp(14px, 3vw, 26px); bottom: clamp(14px, 3vw, 26px); z-index: 80; display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }

/* Burbuja flotante */
.sx-chat__fab {
  width: 58px; height: 58px; border-radius: 50%; flex: none; position: relative;
  display: grid; place-items: center; color: #fff; background: var(--grad);
  box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.3);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.sx-chat__fab .ic { width: 24px; height: 24px; }
.sx-chat__fab:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 18px 46px -12px rgba(124,92,255,.8), inset 0 1px 0 rgba(255,255,255,.3); }
.sx-chat__fab::after { content: ""; position: absolute; inset: 0; border-radius: 50%; animation: fabPulse 2.8s var(--ease) infinite; }
@keyframes fabPulse { 0% { box-shadow: 0 0 0 0 rgba(124,92,255,.45); } 70% { box-shadow: 0 0 0 15px rgba(124,92,255,0); } 100% { box-shadow: 0 0 0 0 rgba(124,92,255,0); } }
.sx-chat__fab .badge-dot { position: absolute; top: 3px; right: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-3); border: 2px solid var(--bg); }

/* Panel */
.sx-chat__panel {
  width: min(390px, calc(100vw - 28px)); height: min(600px, calc(100vh - 130px));
  display: flex; flex-direction: column; overflow: hidden; transform-origin: bottom right;
  background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border-2); border-radius: var(--r-lg); box-shadow: var(--sh-3);
  animation: chatIn .3s var(--ease);
}
@keyframes chatIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }

.sx-chat__head { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--glass-2), transparent); }
.sx-chat__head .avatar { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: var(--glow); }
.sx-chat__head .avatar .ic { width: 20px; height: 20px; }
.sx-chat__head .meta { min-width: 0; }
.sx-chat__head .t { font-weight: 700; font-size: .95rem; }
.sx-chat__head .s { font-size: .74rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sx-chat__head .s .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); flex: none; }
.sx-chat__head .acts { margin-left: auto; display: flex; gap: 2px; }
.sx-chat__iconbtn { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); }
.sx-chat__iconbtn:hover { background: var(--surface-2); color: var(--text); }
.sx-chat__iconbtn .ic { width: 18px; height: 18px; }

.sx-chat__body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sx-chat__row { display: flex; gap: 8px; max-width: 90%; }
.sx-chat__row--user { align-self: flex-end; flex-direction: row-reverse; }
.sx-chat__msg { padding: 10px 13px; border-radius: 14px; font-size: .88rem; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.sx-chat__msg--bot { background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.sx-chat__msg--user { background: var(--grad); color: #fff; border-bottom-right-radius: 5px; box-shadow: var(--glow); }
.sx-chat__mini-avatar { width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--surface-3); color: var(--accent-2); align-self: flex-end; }
.sx-chat__mini-avatar .ic { width: 15px; height: 15px; }

/* Indicador de escritura */
.sx-chat__typing { display: inline-flex; gap: 4px; align-items: center; }
.sx-chat__typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: chatTyping 1.2s infinite ease-in-out; }
.sx-chat__typing span:nth-child(2) { animation-delay: .18s; }
.sx-chat__typing span:nth-child(3) { animation-delay: .36s; }
@keyframes chatTyping { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Sugerencias */
.sx-chat__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sx-chat__chip { font-size: .8rem; padding: 7px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease); text-align: left; }
.sx-chat__chip:hover { color: var(--text); border-color: var(--accent-1); background: rgba(124,92,255,.12); }

/* Entrada */
.sx-chat__foot { padding: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: flex-end; background: var(--glass-2); }
.sx-chat__input { flex: 1; resize: none; max-height: 120px; min-height: 44px; padding: 12px 13px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: .9rem; line-height: 1.4; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.sx-chat__input::placeholder { color: var(--faint); }
.sx-chat__input:focus { outline: none; border-color: var(--accent-1); box-shadow: 0 0 0 3px var(--ring); background: var(--surface); }
.sx-chat__send { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: var(--glow); transition: transform .18s var(--ease), opacity .2s var(--ease); }
.sx-chat__send:hover { transform: translateY(-1px); }
.sx-chat__send:disabled { opacity: .5; transform: none; box-shadow: none; }
.sx-chat__send .ic { width: 18px; height: 18px; }

@media (max-width: 560px) {
  .sx-chat { right: 12px; bottom: 12px; left: 12px; align-items: stretch; }
  .sx-chat__panel { width: auto; height: min(76vh, 560px); }
  .sx-chat__fab { align-self: flex-end; }
}

/* ============================================================
 * Utilidades
 * ============================================================ */
.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--gap, 16px); }
.stack--sm { --gap: 10px; }
.stack--lg { --gap: 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.row--wrap { flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spacer { margin-left: auto; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
.text-sm { font-size: .84rem; } .text-xs { font-size: .76rem; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Foco visible global accesible */
:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; border-radius: 6px; }
.btn:focus-visible, .nav__link:focus-visible, .tab:focus-visible { outline-offset: 3px; }

/* ============================================================
 * Responsive
 * ============================================================ */
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw);
    transform: translateX(-104%); transition: transform .3s var(--ease); box-shadow: var(--sh-3);
  }
  .sidebar.is-open { transform: none; }
  .menu-btn { display: inline-grid; }
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
  .auth-mobile-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 22px; }
  .grid--sb2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .kpi__value { font-size: 1.8rem; }
  .store-pill .txt { display: none; }
  .view__head h2 { font-size: 1.25rem; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
 * v2.0.8 · Ninguna vista se sale a lo ancho (celular, tableta y laptop).
 * Cada regla solo actúa donde algo NO cabe en su renglón: si cabe, todo se ve igual que antes.
 * ============================================================ */

/* Barras de herramientas (un filtro junto a un renglón de botones, como en Blog): lo que no cabe baja de renglón
   en lugar de ensanchar la página. Antes se desbordaba en cualquier pantalla de menos de ~1,900 px. */
.between:has(> .segmented) { flex-wrap: wrap; }
.row:has(> .btn):not(:has(> :not(.btn))) { flex-wrap: wrap; max-width: 100%; }

/* Panel del dueño → Tiendas: las acciones de cada tienda van en su propio renglón, a lo ancho de la tabla
   (antes se apilaban una sobre otra en una columna angosta y cada tienda ocupaba media pantalla). */
.table tbody tr.sx-fila-principal td { border-bottom: none; padding-bottom: 6px; }
.table tbody tr.sx-fila-acciones td { padding-top: 2px; padding-bottom: 14px; }
/* Los botones se acomodan dentro de lo que se ve de la tabla (pantalla menos menú lateral y márgenes), para no
   tener que deslizarla hacia un lado para encontrarlos. */
.table tbody tr.sx-fila-acciones .btn-group { position: sticky; left: 16px; max-width: min(100%, calc(100vw - var(--sb, 264px) - 2 * clamp(18px, 3vw, 34px) - 54px)); }
.table tbody tr.sx-fila-principal:hover + tr.sx-fila-acciones,
.table tbody tr.sx-fila-principal:has(+ tr.sx-fila-acciones:hover) { background: var(--surface-2); }
@media (max-width: 1440px) {
  /* La lista de tiendas usa todo el ancho; la gráfica pasa abajo (antes quedaba apretada a un lado). */
  #v-panel .grid--sb2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 980px) {
  /* Una sola columna que NO crece con su contenido: una tabla ancha se desliza dentro de su marco. */
  .grid--sb2 { grid-template-columns: minmax(0, 1fr); }
  /* Sin menú lateral fijo: los botones de cada tienda usan el ancho de la pantalla menos los márgenes. */
  .table tbody tr.sx-fila-acciones .btn-group { max-width: min(100%, calc(100vw - 2 * clamp(18px, 3vw, 34px) - 38px)); }
}
@media (max-width: 720px) {
  /* Filtros de varias opciones (Pendientes · Publicadas · …): se deslizan con el dedo dentro de su marco. */
  .segmented { max-width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .segmented::-webkit-scrollbar { display: none; }
  .segmented__opt { flex: 0 0 auto; white-space: nowrap; }
  /* En un renglón que acomoda sus piezas en varios renglones, un botón de texto largo nunca es más ancho que su
     tarjeta: usa dos renglones de texto. (Solo ahí: en esos renglones un botón no queda apretado por lo de al lado.) */
  .row--wrap > .btn, .btn-group > .btn, .modal__foot > .btn,
  .row:has(> .btn):not(:has(> :not(.btn))) > .btn { max-width: 100%; white-space: normal; line-height: 1.25; }
  /* Encabezado desplegable con etiqueta (Landings → Configuración): la etiqueta baja si no cabe. */
  summary { flex-wrap: wrap; }
  /* Botón de texto largo dentro de una tarjeta (Suscripción → cerrar las demás sesiones). */
  #logout-todas { max-width: 100%; white-space: normal; line-height: 1.25; text-align: left; }
}
@media (max-width: 560px) {
  .table tbody tr.sx-fila-acciones .btn-group { max-width: calc(100vw - 68px); }
}
@media (max-width: 400px) {
  /* En pantallas muy angostas las rejillas de tarjetas son de una columna que no fuerza un ancho mínimo. */
  .grid--kpi, .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
}
