/* ============================================================
   linkcompare · ui.css
   Implementación viva de DESIGN.md — tokens y componentes.
   Las fuentes (Inter 400–700, Instrument Serif 400) se cargan
   con <link> en cada página.
   ============================================================ */

/* ---------- 1 · Tokens (DESIGN.md §1) ---------- */
:root {
  /* superficies */
  --bg-canvas:  #F7F7F8;
  --bg-surface: #FFFFFF;
  --bg-hover:   #F3F4F6;
  --bg-chip:    #F3F4F6;

  /* bordes */
  --border:      #E9EAEC;
  --border-soft: #F0F0F1;

  /* texto */
  --text-primary:   #111827;
  --text-secondary: #6B7280;
  --text-muted:     #9CA3AF;
  --text-inverse:   #FFFFFF;

  /* acento */
  --primary:       #2563EB;
  --primary-hover: #1D4ED8;
  --primary-soft:  #EFF4FF;
  --focus-ring:    rgba(37, 99, 235, .25);

  /* estado */
  --green-bg:  #DCFCE7;  --green-text:  #15803D;
  --pink-bg:   #FCE7F3;  --pink-text:   #BE185D;
  --blue-bg:   #DBEAFE;  --blue-text:   #1D4ED8;
  --amber-bg:  #FEF3C7;  --amber-text:  #B45309;
  --violet-bg: #EDE9FE;  --violet-text: #6D28D9;
  --red-bg:    #FEE2E2;  --red-text:    #B91C1C;
  --gray-bg:   #F3F4F6;  --gray-text:   #4B5563;

  /* acentos puntuales */
  --accent-green:  #22C55E;
  --accent-blue:   #3B82F6;
  --accent-violet: #8B5CF6;
  --accent-pink:   #F9A8D4;
  --notify-dot:    #A855F7;

  /* geometría */
  --radius-card: 16px;
  --radius-ctrl: 12px;
  --radius-chip: 10px;
  --radius-full: 999px;

  /* tipografía */
  --font-ui:    'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-brand: 'Instrument Serif', Georgia, serif;

  --transition: 150ms ease;
}

/* ---------- 2 · Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; }
svg { display: block; flex: none; }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---------- 3 · Wordmark ---------- */
.wordmark {
  font-family: var(--font-brand);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -.01em;
  color: var(--text-primary);
  text-decoration: none;
  line-height: 1;
}

/* ---------- 4 · Shell de aplicación (DESIGN.md §3) ---------- */
.app {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-soft);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .wordmark { padding: 12px 12px 4px; display: block; }
.sidebar__nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar__footer { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-ctrl);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.nav-item svg { width: 20px; height: 20px; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item--active,
.nav-item--active:hover {
  background: var(--primary);
  color: var(--text-inverse);
  font-weight: 600;
}

.main-col { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
  padding: 0 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-soft);
}
.topbar__actions { display: flex; align-items: center; gap: 12px; }

.content {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 36px 40px 64px;
}

/* ---------- 5 · Buscador y kbd (DESIGN.md §4.2, §4.12) ---------- */
.search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(600px, 100%);
}
.search svg {
  position: absolute; left: 14px;
  width: 20px; height: 20px;
  color: var(--text-muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 44px;
  padding: 0 64px 0 44px;
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
}
.search input::placeholder { color: var(--text-muted); }
.search input:focus {
  border-color: var(--primary);
  outline: 2px solid var(--focus-ring);
  outline-offset: 0;
}
.kbd {
  position: absolute; right: 10px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

/* ---------- 6 · Botones (DESIGN.md §4.3) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-ctrl);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), transform var(--transition);
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 20px; height: 20px; }

.btn--primary { background: var(--primary); color: var(--text-inverse); }
.btn--primary:hover { background: var(--primary-hover); }

.btn--secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 500;
  border: 1px solid var(--border);
}
.btn--secondary:hover { background: var(--bg-hover); }

.btn--ghost {
  width: 40px; height: 40px;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-chip);
}
.btn--ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn--chip {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-chip);
  color: var(--text-primary);
  border-radius: var(--radius-chip);
}
.btn--chip:hover { background: #E8EAED; }

.btn--block { width: 100%; }

/* ---------- 7 · Formularios (DESIGN.md §4.13) ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 16px; }

.label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.input, .select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  transition: border-color var(--transition);
}
.input::placeholder { color: var(--text-muted); }

/* El atributo `hidden` lo pisa cualquier `display` declarado después, y eso ya ha
   roto tres componentes (.empty, .nav-sub, .field). Se zanja de raíz: ocultar con
   `hidden` funciona siempre, sin que cada componente tenga que acordarse. */
[hidden] { display: none !important; }

.input:focus, .select:focus {
  border-color: var(--primary);
  outline: 2px solid var(--focus-ring);
  outline-offset: 0;
}

.select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' 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 14px center;
  background-size: 16px;
  cursor: pointer;
}

.input--readonly, .input:read-only {
  background: var(--bg-canvas);
  color: var(--text-secondary);
  cursor: default;
}

.field__hint { font-size: 12px; color: var(--text-muted); }
.field--error .input { border-color: var(--red-text); }
.field__error { font-size: 13px; color: var(--red-text); }

.form-alert {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--red-text);
  background: var(--red-bg);
  border-radius: var(--radius-chip);
  margin-bottom: 16px;
}

/* ---------- 8 · Cards (DESIGN.md §4.6) ---------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
}
.card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.card__header svg { width: 20px; height: 20px; }
.card__title { font-size: 20px; font-weight: 600; }
.card__header > :last-child:not(.card__title) { margin-left: auto; }

/* ---------- 9 · Cabecera de página (DESIGN.md §4.4) ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-head__meta {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.page-head h1 {
  font-size: clamp(32px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.page-head__actions { display: flex; gap: 12px; }

/* ---------- 10 · Tabs (DESIGN.md §4.15) ---------- */
.tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 24px;
}
.tab {
  padding: 12px 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition);
}
.tab:hover { color: var(--text-primary); }
.tab--active { color: var(--text-primary); border-bottom-color: var(--primary); }

/* ---------- 11 · Toggle (DESIGN.md §4.16) ---------- */
.toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 40px; height: 22px; }
.toggle__track {
  width: 40px; height: 22px; flex: none;
  background: #D1D5DB;
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--transition);
}
.toggle__track::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
}
.toggle input:checked + .toggle__track { background: var(--primary); }
.toggle input:checked + .toggle__track::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle__track {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.toggle__label { font-weight: 500; }
.toggle__desc { font-size: 13px; color: var(--text-secondary); }

/* ---------- 12 · Zona de subida (DESIGN.md §4.17) ---------- */
.upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-ctrl);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition), background var(--transition),
              color var(--transition);
}
.upload svg { width: 20px; height: 20px; }
.upload:hover, .upload--over {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.upload__hint { font-size: 12px; font-weight: 400; color: var(--text-muted); }

/* ---------- 13 · Avatares y puntos (DESIGN.md §4.11–4.12) ---------- */
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.avatar--lg { width: 64px; height: 64px; }

.dot-notify { position: relative; }
.dot-notify::after {
  content: '';
  position: absolute; top: 7px; right: 8px;
  width: 8px; height: 8px;
  background: var(--notify-dot);
  border: 2px solid var(--bg-surface);
  border-radius: 50%;
}

.badge-num {
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--accent-green);
  border-radius: 8px;
  margin-left: auto;
}

/* ---------- 14 · Pills de estado (DESIGN.md §4.8) ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.pill--green  { background: var(--green-bg);  color: var(--green-text); }
.pill--pink   { background: var(--pink-bg);   color: var(--pink-text); }
.pill--blue   { background: var(--blue-bg);   color: var(--blue-text); }
.pill--amber  { background: var(--amber-bg);  color: var(--amber-text); }
.pill--violet { background: var(--violet-bg); color: var(--violet-text); }
.pill--red    { background: var(--red-bg);    color: var(--red-text); }
.pill--gray   { background: var(--gray-bg);   color: var(--gray-text); }

/* ---------- 15 · Auth (login) — PANTALLAS.md §1 ---------- */
.auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.auth__brand { padding: 32px 36px; }
.auth__main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 400px;
  max-width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 32px;
  animation: rise 400ms ease both;
}
.auth-card h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
  text-align: center;
  margin-bottom: 24px;
}
.auth-card form { margin-top: 0; }
.auth__links {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
}
.auth__links a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth__links a:hover { color: var(--text-primary); }

.divider-o {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.divider-o::before, .divider-o::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 16 · Utilidades ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: start;
}
.stack-16 > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; }

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  /* el shell móvil vive en §148: aquí solo lo que no es del shell */
  .content { padding: 24px 20px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================================================
   Catálogo (PANTALLAS.md §3)
   ============================================================ */

/* ---------- 17 · Barra de stats (DESIGN.md §4.5) ---------- */
.stats {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.stat { display: flex; align-items: center; gap: 7px; }
.stat + .stat { border-left: 1px solid var(--border-soft); padding-left: 20px; }
.stat svg { width: 15px; height: 15px; color: var(--text-secondary); }
.stat__num { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 13px; color: var(--text-secondary); }

/* ---------- 18 · Filtros guardados como pestañas (DESIGN.md §4.15) ---------- */
.ftabs {
  display: flex;
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 20px;
}
.ftab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 2px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  text-decoration: none;
  transition: color var(--transition);
}
.ftab svg { width: 15px; height: 15px; }
.ftab:hover { color: var(--text-primary); }
.ftab--active { color: var(--text-primary); border-bottom-color: var(--primary); }
.ftab--new { font-weight: 500; }
.ftab--new:hover { color: var(--primary); }
.ftab__menu {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-muted);
  border-radius: 6px; cursor: pointer; font: inherit; line-height: 1;
}
.ftab__menu:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ---------- 19 · Panel de creación de filtro ---------- */
.filter-panel { margin-bottom: 24px; }
.filter-panel[hidden] { display: none; }
.fp-section { margin-top: 24px; }
.fp-section:first-of-type { margin-top: 20px; }
.fp-section h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}
.fp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px 20px;
  align-items: end;
}
.range { display: flex; align-items: center; gap: 8px; }
.range .input { text-align: right; }
.range span { color: var(--text-muted); }
.fp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}
.link-cancel {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.link-cancel:hover { color: var(--red-text); }

/* ---------- 20 · Tabla del catálogo (DESIGN.md §4.7) ---------- */
.datatable { padding: 0; overflow: hidden; }
.dt-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.dt-toolbar .select { width: auto; height: 40px; }
.dt-found { margin-right: auto; }
.dt-found strong { font-variant-numeric: tabular-nums; }
.dt-label { font-size: 13px; color: var(--text-secondary); }

.dt-scroll { overflow: visible; }
.dt {
  width: 100%;
  border-collapse: collapse;
}
.dt th, .dt td { text-align: left; vertical-align: middle; }
.dt thead th {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.dt thead .th-search { display: inline-flex; margin-left: 10px; }
.th-search input {
  height: 28px;
  width: 150px;
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
}
.dt tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.dt tbody tr { transition: background var(--transition); }
.dt tbody tr:hover { background: #FAFAFB; }
.dt tbody tr:last-child td { border-bottom: none; }
.dt .col-sep { border-left: 1px solid var(--border-soft); }

.dt input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* celda dominio */
.dom { display: flex; flex-direction: column; gap: 6px; min-width: 260px; }
.dom__main { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.dom__main a { text-decoration: none; }
.dom__main a:hover { text-decoration: underline; text-underline-offset: 3px; }
.dom__main .ext { color: var(--text-muted); font-size: 11px; }
.dom__sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag {
  display: inline-flex;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-chip);
  border-radius: 8px;
  white-space: nowrap;
}
.quick-add {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  color: var(--primary);
  background: none; border: none; cursor: pointer; font-family: inherit;
  padding: 2px 4px; border-radius: 6px;
}
.quick-add:hover { background: var(--primary-soft); }

/* celda precio */
.pricecell { min-width: 190px; }
.pricecell__main {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.pricecell__price { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pricecell__shop { font-size: 12px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 5px; }
.pricecell__sub {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px; flex-wrap: wrap;
}
.pricecell__n { font-size: 12px; color: var(--text-muted); }
.spread {
  display: inline-flex;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green-text);
  background: var(--green-bg);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* celda metricas */
.metric { font-size: 12px; white-space: nowrap; }
.metric + .metric { margin-top: 2px; }
.metric .k { color: var(--text-secondary); }
.metric .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.metric .v--link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.delta-up { color: var(--green-text); font-weight: 600; }
.delta-down { color: var(--red-text); font-weight: 600; }

/* barra de seleccion multiple */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-soft);
  font-weight: 600;
}
.bulk-bar[hidden] { display: none; }
.bulk-bar .btn { height: 36px; font-size: 13px; }

/* paginacion */
.dt-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.pages { display: flex; gap: 4px; margin-right: auto; }
.page-btn {
  min-width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 8px;
  font: inherit; font-size: 13px; font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: none; border-radius: var(--radius-chip);
  cursor: pointer; text-decoration: none;
}
.page-btn:hover { background: var(--bg-hover); }
.page-btn--active { background: var(--primary); color: var(--text-inverse); font-weight: 600; }
.page-btn--gap { pointer-events: none; color: var(--text-muted); }
.dt-footer .select { width: auto; height: 36px; }

/* ---------- 21 · Modal (DESIGN.md §4.18) ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(17, 24, 39, .5);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 50;
}
.modal[hidden] { display: none; }
.modal__card {
  width: 640px; max-width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .08);
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 16px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
}
.modal__title { font-size: 16px; font-weight: 600; }
.modal__foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}
.domain-box {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-ctrl);
  font-weight: 600;
  margin-bottom: 20px;
}
.domain-box .price { font-size: 20px; font-weight: 700; }
.mcards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.mcard {
  background: var(--bg-canvas);
  border-radius: var(--radius-chip);
  padding: 12px 14px;
}
.mcard .k { font-size: 12px; color: var(--text-secondary); }
.mcard .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.offers { width: 100%; border-collapse: collapse; font-size: 13px; }
.offers th {
  text-align: left; font-weight: 500; color: var(--text-secondary);
  padding: 8px 10px; border-bottom: 1px solid var(--border-soft);
}
.offers td { padding: 9px 10px; border-bottom: 1px solid var(--border-soft); }
.offers td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.offers th.num { text-align: right; }
.offers tr:last-child td { border-bottom: none; }

/* ---------- 22 · Popover (DESIGN.md §4.19) ---------- */
.pop-anchor { position: relative; display: inline-block; }
.popover {
  position: fixed;
  width: 280px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  padding: 16px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .08);
  z-index: 40;
  font-weight: 400;
}
.popover[hidden] { display: none; }
.popover__head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600;
  margin-bottom: 12px;
}
.popover__head .pill { margin-left: auto; }
.snapshot { display: flex; gap: 16px; align-items: flex-end; }
.snap { flex: 1; text-align: center; }
.snap__bar {
  background: var(--blue-bg);
  border-radius: 6px 6px 0 0;
  margin-bottom: 6px;
}
.snap--now .snap__bar { background: var(--primary); }
.snap__v { font-weight: 700; font-variant-numeric: tabular-nums; }
.snap__d { font-size: 11px; color: var(--text-muted); }
.popover__hint { font-size: 12px; color: var(--text-muted); margin-top: 12px; }

/* ---------- 23 · Botón compacto ---------- */
.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 6px; }
.btn--sm svg { width: 13px; height: 13px; }
.label .tip { margin-left: 4px; }

/* ---------- 24 · Skin de Tom Select (DESIGN.md §4.13: selects siempre con librería) ---------- */
.ts-wrapper.select {
  height: auto; padding: 0; border: none;
  background: transparent; background-image: none;
}
.ts-control {
  min-height: 44px;
  padding: 5px 40px 5px 14px;
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  box-shadow: none;
  gap: 4px;
}
.ts-wrapper.single .ts-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' 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 14px center;
  background-size: 16px;
}
.ts-wrapper.single .ts-control::after { display: none; }
.ts-wrapper.focus .ts-control {
  border-color: var(--primary);
  outline: 2px solid var(--focus-ring);
  outline-offset: 0;
  box-shadow: none;
}
.ts-control input { font: inherit; color: var(--text-primary); }
.ts-control input::placeholder, .ts-wrapper .ts-control .ts-placeholder { color: var(--text-muted); }
.ts-wrapper.multi .ts-control > .item {
  display: inline-flex; align-items: center;
  background: var(--bg-chip);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 2px 4px 2px 8px;
  font-size: 13px; font-weight: 500;
}
.ts-wrapper.multi .ts-control > .item .remove {
  border-left: none; padding: 0 5px; margin-left: 2px;
  border-radius: 6px; font-size: 13px;
}
.ts-wrapper.multi .ts-control > .item .remove:hover { background: #E2E4E8; }
.ts-dropdown {
  margin-top: 6px;
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  box-shadow: 0 8px 24px rgba(17, 24, 39, .08);
  overflow: hidden;
}
.ts-dropdown .option { padding: 9px 14px; }
.ts-dropdown .active { background: var(--bg-hover); color: var(--text-primary); }
.ts-dropdown .selected { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.ts-dropdown .no-results { padding: 9px 14px; color: var(--text-muted); }
.ts-dropdown-content { max-height: 260px; }

/* tamaños contextuales */
.dt-toolbar .ts-wrapper.select { width: auto; min-width: 130px; }
.dt-toolbar .ts-control { min-height: 36px; padding-top: 1px; padding-bottom: 1px; font-size: 13px; }
.dt-footer .ts-wrapper.select { width: auto; min-width: 84px; }
.dt-footer .ts-control { min-height: 32px; padding-top: 0; padding-bottom: 0; font-size: 13px; }

/* ---------- 25 · Panel de filtro animado ---------- */
.fp-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 250ms ease;
}
.fp-wrap.open { grid-template-rows: 1fr; }
.fp-inner { overflow: hidden; min-height: 0; }
.fp-wrap .filter-panel {
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 200ms ease, transform 250ms ease;
}
.fp-wrap.open .filter-panel { opacity: 1; transform: none; }

/* ---------- 26 · Tooltips de ayuda (DESIGN.md §4.22) ---------- */
.tip {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  color: var(--text-muted);
  cursor: help;
  border: none; background: none; padding: 0; font: inherit;
}
.tip svg { width: 13px; height: 13px; }
.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 8px;
  width: max-content;
  max-width: 240px;
  white-space: normal;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
  z-index: 60;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .15);
}
.tip:hover::after, .tip:focus-visible::after { opacity: 1; }
.tip--down::after { bottom: auto; top: calc(100% + 8px); }
.tip--left::after { left: auto; right: -8px; transform: none; }

/* ---------- 27 · Isotipos de marketplaces (DESIGN.md §4.21) ---------- */
.shoplogo {
  width: 18px; height: 18px;
  border-radius: 5px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border-soft);
  display: inline-block;
}
.shoplogos { display: inline-flex; align-items: center; gap: 4px; }
.shoplogos .more {
  height: 18px;
  padding: 0 5px;
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-chip);
  border-radius: 5px;
}
.offers .shop { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.offers .shoplogo { width: 20px; height: 20px; }

/* ---------- 28 · Banderas (flag-icons; emojis prohibidos) ---------- */
.fi {
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, .08);
  font-size: 12px;
  flex: none;
}

/* ---------- 29 · Menú desplegable (DESIGN.md §4.20) ---------- */
.menuwrap { position: relative; display: inline-block; }
.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  box-shadow: 0 8px 24px rgba(17, 24, 39, .08);
  padding: 6px;
  z-index: 45;
}
.menu[hidden] { display: none; }
.menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
}
.menu__item svg { width: 16px; height: 16px; color: var(--text-secondary); }
.menu__item:hover { background: var(--bg-hover); }
.menu__item--danger, .menu__item--danger svg { color: var(--red-text); }
.menu__sep { height: 1px; background: var(--border-soft); margin: 6px 4px; }
.menu__head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 6px;
}
.menu__head .name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.menu__head .mail { font-size: 12px; color: var(--text-secondary); }
.btn--ghost-sm { width: 30px; height: 30px; padding: 0; }
.btn--ghost-sm svg { width: 16px; height: 16px; }

/* ---------- 30 · Notificaciones (topbar) ---------- */
.notif { width: 320px; padding: 0; }
.notif__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px; font-weight: 600;
}
.notif__head a { font-size: 12px; font-weight: 500; color: var(--primary); text-decoration: none; }
.notif__item {
  display: flex; gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.notif__item:last-child { border-bottom: none; }
.notif__ico {
  width: 28px; height: 28px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--primary-soft); color: var(--primary);
}
.notif__ico svg { width: 15px; height: 15px; }
.notif__ico--green { background: var(--green-bg); color: var(--green-text); }
.notif__txt { font-size: 12.5px; line-height: 1.45; }
.notif__time { font-size: 11px; color: var(--text-muted); }

/* ---------- 31 · Sugerencias del buscador ---------- */
.suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  box-shadow: 0 8px 24px rgba(17, 24, 39, .08);
  padding: 6px;
  z-index: 55;
}
.suggest[hidden] { display: none; }
.suggest__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 10px;
  font: inherit; font-size: 13px; font-weight: 500;
  background: none; border: none; border-radius: 8px;
  cursor: pointer; text-align: left;
}
.suggest__item:hover { background: var(--bg-hover); }
.suggest__item .meta { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.suggest__hint {
  padding: 6px 10px 8px;
  font-size: 11px; color: var(--text-muted);
}

/* ---------- 32 · Densidad compacta (catalogo) ---------- */
.content--compact .page-head h1 { font-size: 30px; }
.content--compact .page-head { margin-bottom: 20px; }
.content--compact .stats { margin-bottom: 20px; }
.content--compact .card { padding: 20px; }
.content--compact .card.datatable { padding: 0; }
.content--compact .label { font-size: 12px; }
.content--compact .field + .field { margin-top: 12px; }
.content--compact .input { height: 36px; padding: 0 12px; font-size: 13px; }
.content--compact .ts-control { min-height: 36px; padding-top: 2px; padding-bottom: 2px; font-size: 13px; }
.content--compact .fp-grid { gap: 14px 16px; }
.content--compact .fp-section { margin-top: 18px; }
.content--compact .fp-section h3 { font-size: 13px; margin-bottom: 10px; }
.content--compact .btn:not(.btn--sm):not(.btn--ghost):not(.btn--ghost-sm) { height: 38px; font-size: 13px; }
.content--compact .toggle__label { font-size: 13px; }
.content--compact .toggle__desc { font-size: 12px; }
.content--compact .tag { font-size: 11px; }

/* ---------- 33 · Modal de exportación ---------- */
.radio-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.radio-card + .radio-card { margin-top: 10px; }
.radio-card input { accent-color: var(--primary); margin-top: 2px; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio-card .t { font-size: 13px; font-weight: 600; }
.radio-card .d { font-size: 12px; color: var(--text-secondary); }

/* isotipo de texto para marketplaces sin logo descargado */
.shoplogo--txt {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff;
  border: none; line-height: 1;
}

/* ---------- 34 · Contador en pestañas (DESIGN.md §4.15) ---------- */
.ftab__count {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-chip);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.ftab--active .ftab__count { background: var(--primary-soft); color: var(--primary); }

/* ---------- 35 · Rail de filtros (DESIGN.md §4.24, patron Apollo) ---------- */
.filter-layout {
  display: grid;
  grid-template-columns: 264px 1fr;
  gap: 20px;
  align-items: start;
  transition: grid-template-columns 250ms ease;
}
.filter-layout--hidden { grid-template-columns: 0px 1fr; gap: 0; }
.frail {
  padding: 0;
  overflow: hidden;
  min-width: 0;
  opacity: 1;
  transition: opacity 200ms ease;
}
.filter-layout--hidden .frail { opacity: 0; pointer-events: none; }
.frail__sec { border-bottom: 1px solid var(--border-soft); }
.frail__head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}
.frail__head:hover { background: #FAFAFB; }
.frail__head .ftab__count { margin-left: auto; }
.frail__head .chev { transition: transform var(--transition); color: var(--text-muted); }
.frail__head .chev svg { width: 14px; height: 14px; }
.frail__sec--open .frail__head .chev { transform: rotate(180deg); }
.frail__body { display: none; padding: 2px 16px 16px; }
.frail__sec--open .frail__body { display: block; }
.frail__body .field + .field { margin-top: 12px; }
.frail__body .range .input { text-align: right; padding: 0 8px; }
.frail__foot {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-soft);
}
.frail__foot .btn { width: 100%; }
.frail__foot .link-cancel { align-self: center; }

/* boton mostrar/ocultar filtros con contador de activos */
.btn-filters { position: relative; }
.btn-filters .ftab__count { background: var(--primary-soft); color: var(--primary); }

@media (max-width: 1100px) {
  .filter-layout { grid-template-columns: 1fr; }
  .frail { order: -1; }
}

/* el nº de ofertas y los isotipos abren el modal de precios (sin botón) */
.pricecell .pricecell__n {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  transition: color var(--transition);
}
.pricecell .pricecell__n:hover { color: var(--primary); }
.pricecell .shoplogos { cursor: pointer; }

/* ---------- 36 · Densidad Apollo: aprovechar el espacio ---------- */
.content--compact { padding-top: 20px; padding-bottom: 40px; }
.content--compact .page-head { margin-bottom: 12px; }
.content--compact .page-head h1 { font-size: 26px; }
.content--compact .page-head__meta { margin-bottom: 2px; font-size: 12px; }
.content--compact .ftabs { margin-bottom: 14px; gap: 18px; }
.content--compact .ftab { padding: 8px 2px; font-size: 13px; }
.content--compact .filter-layout { gap: 14px; grid-template-columns: 240px 1fr; }
.content--compact .filter-layout--hidden { grid-template-columns: 0px 1fr; gap: 0; }
.content--compact .frail__head { padding: 10px 14px; font-size: 12.5px; }
.content--compact .frail__body { padding: 0 14px 12px; }
.content--compact .frail__body .field + .field { margin-top: 10px; }
.content--compact .frail__foot { padding: 12px 14px; gap: 8px; }
.content--compact .btn:not(.btn--sm):not(.btn--ghost):not(.btn--ghost-sm) { height: 34px; font-size: 13px; }
.content--compact .dt thead th { padding: 8px 12px; }
.content--compact .dt tbody td { padding: 8px 12px; }
.content--compact .dom { gap: 4px; min-width: 220px; }
.content--compact .pricecell__sub { margin-top: 4px; }
.content--compact .tag { padding: 1px 7px; }
.content--compact .dt-toolbar { padding: 10px 14px; gap: 10px; }
.content--compact .dt-toolbar .ts-control { min-height: 32px; font-size: 12.5px; }
.content--compact .dt-footer { padding: 10px 14px; }
.content--compact .page-btn { min-width: 30px; height: 30px; font-size: 12.5px; }
.content--compact .dt-footer .ts-control { min-height: 30px; }
.content--compact .metric + .metric { margin-top: 0; }
.content--compact .th-search input { height: 26px; }
.content--compact .bulk-bar { padding: 8px 14px; }
.content--compact .bulk-bar .btn { height: 30px; font-size: 12.5px; }

/* ---------- 37 · Afinado: selects compactos y espacios del rail ---------- */
.dt-toolbar .ts-control, .dt-footer .ts-control {
  border-radius: 8px;
  padding: 0 28px 0 10px;
  background-position: right 9px center;
  background-size: 14px;
  align-items: center;
}
.dt-toolbar .ts-wrapper.select { min-width: 110px; }
.dt-toolbar .ts-control input, .dt-footer .ts-control input { font-size: 12.5px; }

.frail .field { gap: 4px; }
.content--compact .frail__body .field + .field { margin-top: 8px; }
.content--compact .frail__head { padding: 9px 14px; }
.frail .input { height: 32px; padding: 0 10px; font-size: 12.5px; }
.frail .ts-control {
  min-height: 32px;
  border-radius: 8px;
  padding: 2px 26px 2px 8px;
  background-position: right 8px center;
  background-size: 14px;
  font-size: 12.5px;
}
.frail .range .input { padding: 0 8px; }
.frail__sec:last-of-type { border-bottom: none; }
.content--compact .frail__foot { padding: 8px 14px 12px; }

/* ---------- 38 · Ficha del sitio en el modal ---------- */
.msec { font-size: 13px; font-weight: 600; margin: 0 0 10px; }
.cbars { display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px; }
.cbar {
  display: grid;
  grid-template-columns: 18px 88px 1fr 42px;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
}
.cbar__track {
  height: 8px;
  background: var(--bg-hover);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.cbar__fill { height: 100%; background: var(--primary); border-radius: var(--radius-full); }
.cbar__pct { text-align: right; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 16px;
  margin-bottom: 20px;
}
.fact .k { font-size: 11px; color: var(--text-secondary); }
.fact .v { font-size: 13px; font-weight: 600; }
.mcard .d { font-size: 11px; font-weight: 600; }

/* ---------- 39 · Filtros como segundo sidebar (DESIGN.md §4.24) ---------- */
.app--filters {
  grid-template-columns: 264px 240px 1fr;
  transition: grid-template-columns 250ms ease;
}
.app--filters.rail-off { grid-template-columns: 264px 0px 1fr; }
.frail-side {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  opacity: 1;
  transition: opacity 200ms ease;
}
.rail-off .frail-side { opacity: 0; pointer-events: none; }
.frail-side__inner {
  width: 240px;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.frail-side__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 14px 10px;
  font-size: 13px;
  font-weight: 600;
}
.frail-side__head .link-cancel { margin-left: auto; font-size: 12px; }
.frail-side__scroll { flex: 1; overflow-y: auto; }
.frail-side .frail__foot {
  border-top: 1px solid var(--border-soft);
  padding: 10px 14px 14px;
}
.content--full { max-width: none; }

/* la adaptación del rail a pantallas cortas vive en §148 */

/* los dropdowns (Tom Select, menús) no deben recortarse dentro de la card */
.datatable { overflow: visible; }

/* ---------- 40 · Filtros bajo topbar y pestañas (estructura Apollo) ---------- */
.catalog-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 14px;
  align-items: start;
  transition: grid-template-columns 250ms ease;
}
.catalog-body.rail-off { grid-template-columns: 0px 1fr; gap: 0; }
.catalog-body .frail-side {
  position: sticky;
  top: 12px;
  height: auto;
  max-height: calc(100vh - 24px);
  border: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.catalog-body.rail-off .frail-side { opacity: 0; pointer-events: none; }
.catalog-body .frail-side__inner { height: auto; max-height: calc(100vh - 24px); }
.content--full { padding-left: 20px; padding-right: 20px; }

/* Entre 901 y 1100 el rail cabe como columna (sidebar ya va en mini): la
   media que lo apilaba encima de la tabla dejaba una vista absurda. El paso a
   panel flotante vive en §148 (≤900). */

/* ---------- 41 · Rail: controles proporcionales a los de la tabla ---------- */
.frail-side .field { gap: 4px; }
.frail-side .field + .field { margin-top: 8px; }
.frail-side .label { font-size: 12px; }
.frail-side .input {
  height: 30px;
  padding: 0 9px;
  font-size: 12.5px;
  border-radius: 8px;
}
.frail-side .ts-control {
  min-height: 30px;
  border-radius: 8px;
  padding: 2px 24px 2px 9px;
  background-position: right 8px center;
  background-size: 13px;
  font-size: 12.5px;
}
.frail-side .ts-control input { font-size: 12.5px; }
.frail-side .ts-wrapper.multi .ts-control > .item { font-size: 11.5px; padding: 1px 3px 1px 6px; border-radius: 6px; }
.frail-side .range .input { padding: 0 9px; }
.frail-side .toggle__track { transform: scale(.85); transform-origin: left center; }
.frail-side .frail__head { padding: 9px 14px; }
.frail-side .frail__body { padding: 0 14px 12px; }
.frail-side .frail__foot .btn { height: 32px; font-size: 12.5px; }
.frail-side__head { padding: 13px 14px 8px; }

/* ---------- 42 · Sidebar de navegación compacto (espaciado Apollo) ---------- */
.sidebar { padding: 14px 12px; gap: 14px; }
.sidebar .wordmark { font-size: 25px; padding: 8px 10px 2px; }
.nav-item {
  height: 34px;
  gap: 10px;
  padding: 0 10px;
  font-size: 13.5px;
  border-radius: 8px;
}
.nav-item svg { width: 17px; height: 17px; }
.sidebar__nav { gap: 2px; }
.sidebar__footer { gap: 2px; }

/* chevrons de las secciones siempre alineados a la derecha */
.frail__head .chev { margin-left: auto; }
.frail__head .ftab__count { margin-left: auto; }
.frail__head .ftab__count ~ .chev { margin-left: 6px; }

/* ---------- 43 · Barra de vistas (Default view · filtros · buscador) ---------- */
.viewbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.viewbar .btn { height: 32px; font-size: 12.5px; padding: 0 12px; border-radius: 8px; }
.viewbar .btn svg { width: 15px; height: 15px; }
.viewbar .search { width: 300px; }
.viewbar .search input {
  height: 32px;
  padding: 0 40px 0 32px;
  font-size: 12.5px;
  border-radius: 8px;
}
.viewbar .search > svg { width: 15px; height: 15px; left: 10px; }
.viewbar .kbd { right: 8px; padding: 1px 6px; font-size: 11px; }
.menu__item .ftab__count { margin-left: auto; }
.menu__item--active { background: var(--primary-soft); color: var(--primary); }
.menu__item--active svg { color: var(--primary); }
.topbar__actions { margin-left: auto; }

/* ---------- 44 · Sidebar de navegación más estrecho ---------- */
.app { grid-template-columns: 200px 1fr; }

/* ---------- 45 · Estrella de favoritos (DESIGN.md §4.26) ---------- */
.star {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; padding: 0;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition), color var(--transition), transform var(--transition);
}
.star svg { width: 15px; height: 15px; }
tr:hover .star, .star:focus-visible, .star--on { opacity: 1; }
.star:hover { color: #F59E0B; transform: scale(1.15); }
.star:active { transform: scale(.92); }
.star--on { color: #F59E0B; }
.star--on svg { fill: #F59E0B; stroke: #F59E0B; }

/* ---------- 46 · Toast (DESIGN.md §4.27) ---------- */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 360px;
  padding: 12px 14px;
  font-size: 13px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  box-shadow: 0 8px 24px rgba(17, 24, 39, .12);
  animation: toast-in 250ms ease;
}
.toast[hidden] { display: none; }
.toast--out { animation: toast-out 200ms ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }
.toast__ico {
  width: 30px; height: 30px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--amber-bg);
  color: var(--amber-text);
}
.toast__ico svg { width: 15px; height: 15px; fill: currentColor; stroke: currentColor; }
.toast__undo {
  font: inherit; font-weight: 600; font-size: 13px;
  color: var(--primary);
  background: none; border: none; cursor: pointer;
  white-space: nowrap;
}
.toast__undo:hover { color: var(--primary-hover); }

/* ---------- 47 · Layout a pantalla completa (catálogo tipo app) ---------- */
.main-col--app { height: 100vh; overflow: hidden; }
.main-col--app .content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 14px;
}
.main-col--app .page-head, .main-col--app .viewbar { flex: none; }
.main-col--app .catalog-body { flex: 1; min-height: 0; align-items: stretch; }
.main-col--app .frail-side {
  position: static;
  height: auto;
  max-height: none;
}
.main-col--app .frail-side__inner { height: 100%; max-height: none; }
.main-col--app .datatable {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.main-col--app .dt-toolbar, .main-col--app .bulk-bar, .main-col--app .dt-footer { flex: none; }
.tbody-scroll { flex: 1; min-height: 0; overflow: auto; }

/* scrollbar personalizada (fina, redondeada) */
.tbody-scroll, .frail-side__scroll {
  scrollbar-width: thin;
  scrollbar-color: #D3D6DB transparent;
}
.tbody-scroll::-webkit-scrollbar, .frail-side__scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.tbody-scroll::-webkit-scrollbar-thumb, .frail-side__scroll::-webkit-scrollbar-thumb {
  background: #D3D6DB;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: content-box;
}
.tbody-scroll::-webkit-scrollbar-thumb:hover, .frail-side__scroll::-webkit-scrollbar-thumb:hover { background-color: #B9BEC6; background-clip: content-box; }
.tbody-scroll::-webkit-scrollbar-track, .frail-side__scroll::-webkit-scrollbar-track { background: transparent; }

/* los menús de fila viven dentro del scroll: se posicionan en fixed */
.tbody-scroll .menu { position: fixed; top: auto; right: auto; }

/* ---------- 48 · Viewbar: banda derecha + popover de ordenación ---------- */
.viewbar__spacer { flex: 1; }
.menu--sort { min-width: 250px; padding: 12px; }
.menu--sort .label { display: block; margin-bottom: 6px; }
.menu--sort .field + .field { margin-top: 10px; }
.menu--sort .ts-control { min-height: 32px; border-radius: 8px; font-size: 12.5px; }
.menu--sort__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}

/* ---------- 49 · Guardar vista compacto ---------- */
.frail__foot .btn {
  width: auto;
  align-self: center;
  height: 30px;
  padding: 0 14px;
  font-size: 12.5px;
}

/* ---------- 50 · Acordeón animado (el JS anima la altura) ---------- */
.frail__body { overflow: hidden; }

/* ---------- 51 · NProgress con la línea del sistema ---------- */
#nprogress .bar { background: var(--primary); height: 2.5px; }
#nprogress .peg { box-shadow: 0 0 10px var(--primary), 0 0 5px var(--primary); }

/* al estrechar la ventana, la tabla scrollea en horizontal con barra custom */
.tbody-scroll .dt { min-width: 900px; }

/* ---------- 52 · Estrella siempre visible, delante del dominio ---------- */
.star { opacity: 1; color: #C9CDD3; }
tr:hover .star { color: #B4BAC3; }
.star:hover { color: #F59E0B; }
.star--on { color: #F59E0B; }

/* nombre de vista truncado */
.vname {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* selector de moneda en la topbar */
.topbar .ts-wrapper.select { width: auto; min-width: 84px; }
.topbar .ts-control {
  min-height: 32px;
  border-radius: 8px;
  padding: 0 26px 0 10px;
  background-position: right 8px center;
  background-size: 13px;
  font-size: 12.5px;
}

/* ---------- 53 · Pie del rail rediseñado ---------- */
.frail__foot { padding: 10px 12px 12px; }
.frail__foot .btn {
  width: 100%;
  height: 32px;
  border-radius: 8px;
  font-size: 12.5px;
  gap: 8px;
}
.frail__foot .btn .ftab__count {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}

/* el select del pie de tabla abre hacia arriba (no se sale de la ventana) */
.dt-footer .ts-dropdown {
  top: auto;
  bottom: calc(100% + 6px);
  margin-top: 0;
}

/* ---------- 54 · Tooltips en fixed (nunca se recortan) ---------- */
.tip::after { content: none; }
.tipbox {
  position: fixed;
  z-index: 80;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 8px;
  max-width: 240px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .15);
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
}
.tipbox--show { opacity: 1; }

/* dropdowns proporcionados a los controles compactos */
.dt-footer .ts-dropdown, .dt-toolbar .ts-dropdown, .topbar .ts-dropdown,
.frail-side .ts-dropdown, .menu--sort .ts-dropdown, .viewbar .ts-dropdown {
  font-size: 12.5px;
}
.dt-footer .ts-dropdown .option, .dt-toolbar .ts-dropdown .option,
.topbar .ts-dropdown .option, .frail-side .ts-dropdown .option,
.menu--sort .ts-dropdown .option, .viewbar .ts-dropdown .option {
  padding: 7px 12px;
}

/* checkbox de fila más discreto y columna estrecha */
.dt input[type="checkbox"] { width: 14px; height: 14px; }
.dt th:first-child, .dt td:first-child {
  width: 30px;
  padding-left: 12px;
  padding-right: 2px;
}

/* ---------- 55 · Barra de selección minimalista ---------- */
.bulk-bar { padding: 10px 16px; gap: 10px; font-size: 12.5px; font-weight: 500; }
.bulk-bar .btn { height: 26px; font-size: 12px; padding: 0 10px; border-radius: 7px; gap: 6px; }
.bulk-bar .btn svg { width: 13px; height: 13px; }
.bulk-bar .link-cancel { font-size: 12px; }

/* ---------- 56 · Popover Ordenar a escala ---------- */
.viewbar .menu--sort .label { font-size: 11px; margin-bottom: 4px; }
.viewbar .menu--sort .ts-control {
  min-height: 30px;
  padding: 1px 26px 1px 9px;
  font-size: 12.5px;
  border-radius: 8px;
}
.viewbar .menu--sort .ts-control .item { font-size: 12.5px; }
.viewbar .menu--sort .link-cancel { font-size: 12px; }
.viewbar .menu--sort .btn--sm { height: 26px; font-size: 12px; border-radius: 7px; }

/* ---------- 57 · Selector de moneda como menú ---------- */
.menu--currency { min-width: 130px; }
.btn--topctl { height: 32px; font-size: 12.5px; padding: 0 10px; border-radius: 8px; gap: 6px; }
.menu__item .mi-spacer { width: 16px; flex: none; }

/* ---------- 58 · Buscador de topbar a escala ---------- */
.topbar .search { width: min(340px, 100%); }
.topbar .search input {
  height: 34px;
  padding: 0 42px 0 32px;
  font-size: 12.5px;
  border-radius: 8px;
}
.topbar .search > svg { width: 15px; height: 15px; left: 10px; }
.topbar .kbd { right: 8px; padding: 1px 6px; font-size: 11px; }

/* ---------- 59 · Control segmentado (pares de opciones) ---------- */
.seg {
  display: inline-flex;
  background: var(--bg-chip);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.seg__opt {
  height: 26px;
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.seg__opt:hover { color: var(--text-primary); }
.seg__opt--on {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

/* ---------- 60 · Densidad compacta en pantallas de formulario ---------- */
.content--compact .tabs { margin-bottom: 18px; }
.content--compact .tab { padding: 8px 2px; font-size: 13px; }
.content--compact .grid-2 { gap: 16px; }
.content--compact .card__title { font-size: 16px; }
.content--compact .card__header { margin-bottom: 14px; }
.content--compact .upload { padding: 20px; }
.content--compact .avatar--lg { width: 56px; height: 56px; }

/* ---------- 61 · Fila de idioma en el menú de perfil ---------- */
.menu__lang {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 4px;
  font-size: 12px;
  color: var(--text-secondary);
}
.menu__lang .seg__opt { height: 22px; padding: 0 8px; font-size: 11.5px; }

/* sugerencias: precio en una línea, sin ruido */
.suggest__item .meta {
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------- 62 · Afinado final: alineaciones y columna de acciones ---------- */
.pricecell__main { align-items: center; }
.dt th:last-child, .dt td:last-child {
  width: 42px;
  padding-left: 4px;
  padding-right: 10px;
}

/* ---------- 63 · Rail: aire lateral y dropdowns sin recortes ---------- */
.frail-side .frail__head { padding: 9px 16px; }
.content--compact .frail__body { padding: 0 16px 14px; }
.frail-side__head { padding: 13px 16px 8px; }
.ts-dropdown--rail { font-size: 12.5px; }
.ts-dropdown--rail .option { padding: 7px 12px; }

/* ---------- 64 · Modal por pestañas ---------- */
.modal-tabs { margin-bottom: 16px; }
.tabs button.tab { background: none; border: none; cursor: pointer; font-family: inherit; }
.modal-tabs .ftab__count { margin-left: 6px; }

/* ---------- 65 · Barras de tráfico por países, rediseñadas ---------- */
.cbars { gap: 10px; margin-bottom: 8px; }
.cbar {
  grid-template-columns: 20px 92px 1fr 48px;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 500;
}
.cbar .fi { font-size: 13px; }
.cbar__track {
  height: 10px;
  background: #EEF0F3;
  border-radius: var(--radius-full);
  overflow: hidden;
}
.cbar__fill {
  height: 100%;
  min-width: 5px;
  background: linear-gradient(90deg, var(--primary), #4F7DF0);
  border-radius: var(--radius-full);
}
.cbar__pct { font-size: 12px; font-weight: 700; color: var(--primary); }

/* ---------- 66 · Dropdowns del rail por encima de todo ---------- */
body > .ts-dropdown { z-index: 95; }

/* ---------- 67 · Cabecera del rail marcada ---------- */
.frail-side__head {
  background: #FAFAFB;
  border-bottom: 1px solid var(--border-soft);
  padding: 12px 16px;
}

/* ---------- 68 · Chip de filtros de sección con aspa ---------- */
.fchip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  padding: 1px 7px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.fchip svg { width: 9px; height: 9px; }
.fchip:hover { background: var(--red-bg); color: var(--red-text); }
.frail__head .fchip ~ .chev { margin-left: 6px; }

/* ---------- 69 · Offcanvas de información del sitio (DESIGN.md §4.18) ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(17, 24, 39, .4);
  opacity: 0;
  transition: opacity 250ms ease;
}
.drawer[hidden] { display: none; }
.drawer.open { opacity: 1; }
.drawer__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(540px, 92vw);
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  box-shadow: -16px 0 40px rgba(17, 24, 39, .12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(.32, .72, .33, 1);
}
.drawer.open .drawer__panel { transform: none; }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
  flex: none;
}
.drawer__head .modal__title { font-size: 15px; }
.drawer__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px;
  scrollbar-width: thin;
  scrollbar-color: #D3D6DB transparent;
}
.drawer__body::-webkit-scrollbar { width: 8px; }
.drawer__body::-webkit-scrollbar-thumb {
  background: #D3D6DB;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: content-box;
}
.drawer__body::-webkit-scrollbar-track { background: transparent; }
.drawer__foot {
  flex: none;
  padding: 12px 20px;
  border-top: 1px solid var(--border-soft);
}
.drawer .mcards { grid-template-columns: repeat(2, 1fr); }

/* ---------- 70 · Sidebar colapsable a iconos ---------- */
.app { transition: grid-template-columns 250ms ease; }
.app.nav-mini { grid-template-columns: 56px 1fr; }
.sidebar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 4px 0 10px;
}
.nav-collapse svg { transition: transform 250ms ease; }
.nav-mini .nav-collapse svg { transform: rotate(180deg); }
.nav-mini .sidebar { padding: 14px 8px; }
.nav-mini .sidebar__top { justify-content: center; padding: 4px 0 0; }
.nav-mini .wordmark { display: none; }
.nav-mini .nav-item {
  font-size: 0;
  gap: 0;
  justify-content: center;
  padding: 0;
}

/* ---------- 71 · Rail: reset con icono y chips de limpieza ---------- */
.reset-link { display: inline-flex; align-items: center; gap: 5px; }
.reset-link svg { width: 12px; height: 12px; }

/* la tabla cabe entera en más tamaños */
.tbody-scroll .dt { min-width: 780px; }

/* ---------- 72 · Ajustes finos: drawer adaptable, guardar discreto, chip pegado ---------- */
.drawer__panel { width: clamp(420px, 40vw, 600px); }
.frail-side__head .fchip { margin-left: 6px; }
.frail__foot .btn {
  height: 28px;
  font-size: 12px;
  padding: 0 12px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 500;
  border: 1px solid var(--border);
  width: auto;
  align-self: center;
}
.frail__foot .btn:hover { background: var(--bg-hover); }
.frail__foot .btn .ftab__count { background: var(--primary-soft); color: var(--primary); }
.dom__main a { cursor: pointer; }

/* ---------- 73 · El card de la tabla puede encoger: el scroll interno actúa ---------- */
.catalog-body > .datatable { min-width: 0; }
.tbody-scroll .dt { min-width: 910px; }

/* ---------- 74 · Menús compactos y footer con resultados ---------- */
.menu__item { padding: 7px 10px; font-size: 12.5px; }
.dt-footer .dt-found { margin: 0 0 0 4px; font-size: 12.5px; }
.dt-footer .pages { margin-right: 0; }
.dt-footer { gap: 12px; }
.dt-footer .dt-spacer { flex: 1; }

/* ---------- 75 · Buscador que crece al focus ---------- */
.topbar .search { width: 220px; transition: width 250ms ease; }
.topbar .search:focus-within { width: 360px; }

/* ---------- 76 · Cabecera de tabla y topbar fijas ---------- */
.topbar { position: sticky; top: 0; z-index: 30; }
.dt thead th {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 5;
  box-shadow: inset 0 -1px 0 var(--border-soft);
  border-bottom: none;
}

/* ---------- 77 · Paginación compacta con elipsis ---------- */
.dt-footer { padding: 8px 12px; gap: 10px; }
.dt-footer .pages { gap: 2px; }
.page-btn { min-width: 26px; height: 26px; font-size: 12px; }

/* ---------- 78 · Resultados discretos ---------- */
.dt-footer .dt-found { font-size: 12px; color: var(--text-muted); }
.dt-footer .dt-found strong { color: var(--text-secondary); font-weight: 600; }

/* ---------- 79 · Barra de selección bajo la cabecera de la tabla ---------- */
.datatable { position: relative; }
.bulk-bar {
  position: absolute;
  top: 35px;
  left: 0;
  right: 0;
  z-index: 6;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

/* ---------- 80 · Barra de selección mini ---------- */
.bulk-bar { padding: 10px 16px; gap: 10px; font-size: 12px; }
.bulk-bar .btn { height: 22px; font-size: 11.5px; padding: 0 8px; border-radius: 6px; gap: 4px; }
.bulk-bar .btn svg { width: 11px; height: 11px; }
.bulk-bar .link-cancel { font-size: 11.5px; }

/* la barra de selección gana a las reglas genéricas del modo compacto */
.content--compact .bulk-bar { padding: 10px 16px; }
.content--compact .bulk-bar .btn:not(.btn--sm):not(.btn--ghost):not(.btn--ghost-sm) {
  height: 22px;
  font-size: 11.5px;
  padding: 0 8px;
  border-radius: 6px;
}

/* ---------- 81 · Guardar vista bajo la cabecera de filtros ---------- */
.frail-save { padding: 8px 12px; border-bottom: 1px solid var(--border-soft); }
.frail-save .btn {
  width: 100%;
  height: 28px;
  font-size: 12px;
  font-weight: 500;
  gap: 6px;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.frail-save .btn:hover { background: var(--bg-hover); }
.frail-save .btn svg { width: 13px; height: 13px; }
.frail-save .btn .ftab__count { background: var(--primary-soft); color: var(--primary); }

/* ---------- 82 · Selección: fila propia en la tabla; sin destacado de texto ---------- */
.pricecell, .dom__main { user-select: none; }
.bulk-cell { padding: 0 !important; }
.bulk-bar { position: static; border-top: none; }
.frail-save { display: flex; justify-content: center; padding: 6px 12px; }
.frail-save .btn { width: auto; padding: 0 12px; }

/* ---------- 83 · Checkboxes redondeados estilo Apollo ---------- */
.dt input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid #C9CDD3;
  border-radius: 4px;
  background: var(--bg-surface);
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  transition: background var(--transition), border-color var(--transition);
}
.dt input[type="checkbox"]:hover { border-color: var(--primary); }
.dt input[type="checkbox"]:checked { background: var(--primary); border-color: var(--primary); }
.dt input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- 84 · Dominio truncado con elipsis ---------- */
.dom__main a {
  max-width: 185px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

/* ---------- 85 · Checkbox y dominio fijos en el scroll lateral ---------- */
.dt th:first-child, .dt td:first-child {
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--bg-surface);
}
.dt th:nth-child(2), .dt td:nth-child(2) {
  position: sticky;
  left: 30px;
  z-index: 4;
  background: var(--bg-surface);
  box-shadow: 6px 0 8px -6px rgba(17, 24, 39, .10);
}
.dt thead th:first-child, .dt thead th:nth-child(2) { z-index: 8; }
.dt tbody tr:hover { background: none; }
.dt tbody tr:hover td { background: #FAFAFB; }

/* Guardar vista como chip gris sin borde */
.frail-save { padding: 6px 12px 8px; }
.frail-save .btn {
  border: none;
  background: var(--bg-chip);
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 7px;
}
.frail-save .btn:hover { background: #E8EAED; }

/* ---------- 86 · Columnas fijas bien alineadas y con sus líneas ---------- */
.dt { border-collapse: separate; border-spacing: 0; }
.dt th:nth-child(2), .dt td:nth-child(2) {
  left: 44px;
  padding-left: 4px;
}

/* sombra de columna fija solo al scrollear lateralmente */
.dt th:nth-child(2), .dt td:nth-child(2) { box-shadow: none; }
.tbody-scroll.scrolled-x .dt th:nth-child(2),
.tbody-scroll.scrolled-x .dt td:nth-child(2) {
  box-shadow: 6px 0 8px -6px rgba(17, 24, 39, .14);
}

/* ---------- 87 · Columnas fijas: líneas y sombra homogéneas (inset) ---------- */
.dt thead th:first-child, .dt thead th:nth-child(2) {
  box-shadow: inset 0 -1px 0 var(--border-soft);
}
.dt tbody td:first-child, .dt tbody td:nth-child(2) {
  border-bottom: none;
  box-shadow: inset 0 -1px 0 var(--border-soft);
}
.dt tbody tr:last-child td:first-child,
.dt tbody tr:last-child td:nth-child(2) { box-shadow: none; }

.tbody-scroll.scrolled-x .dt thead th:nth-child(2),
.tbody-scroll.scrolled-x .dt tbody td:nth-child(2) {
  box-shadow: inset 0 -1px 0 var(--border-soft),
              inset -9px 0 8px -8px rgba(17, 24, 39, .16);
}
.tbody-scroll.scrolled-x .dt tbody tr:last-child td:nth-child(2) {
  box-shadow: inset -9px 0 8px -8px rgba(17, 24, 39, .16);
}

/* ---------- 88 · Sombra proyectada hacia fuera (gradiente continuo) ---------- */
.tbody-scroll.scrolled-x .dt thead th:nth-child(2),
.tbody-scroll.scrolled-x .dt tbody td:nth-child(2) {
  box-shadow: inset 0 -1px 0 var(--border-soft);
}
.tbody-scroll.scrolled-x .dt tbody tr:last-child td:nth-child(2) { box-shadow: none; }
.tbody-scroll.scrolled-x .dt th:nth-child(2)::after,
.tbody-scroll.scrolled-x .dt td:nth-child(2)::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  right: -12px;
  width: 12px;
  background: linear-gradient(90deg, rgba(17, 24, 39, .10), transparent);
  pointer-events: none;
}
.dom__main a { max-width: 150px; }

/* Guardar vista como barra integrada del rail */
.frail-save { padding: 0; border-bottom: 1px solid var(--border-soft); }
.frail-save .btn {
  width: 100%;
  height: 30px;
  border-radius: 0;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}
.frail-save .btn:hover { background: #E3ECFE; }
.frail-save .btn .ftab__count { background: rgba(255, 255, 255, .75); }

/* ---------- 89 · Acciones de la viewbar como texto plano (estilo Apollo) ---------- */
.btn--plain {
  border: none;
  background: transparent;
  padding: 0 6px;
  height: 30px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  border-radius: 6px;
}
.btn--plain:hover { background: var(--bg-hover); }

/* Guardar vista sin total y más fina */
.frail-save .btn { height: 26px; }
.frail-save .btn .ftab__count { display: none; }

/* la última sección del rail recupera su línea */
.frail-side .frail__sec:last-of-type { border-bottom: 1px solid var(--border-soft); }

/* ---------- 90 · Columna de acciones con iconos (estilo Apollo) ---------- */
.row-actions { display: flex; align-items: center; gap: 2px; }
.row-actions .star { opacity: 1; width: 26px; height: 26px; }
.row-actions .btn--ghost-sm { width: 26px; height: 26px; color: var(--text-muted); }
.row-actions .btn--ghost-sm:hover { color: var(--text-primary); }
.dt th:last-child, .dt td:last-child { width: 96px; padding-right: 8px; }

/* ---------- 91 · Submenús laterales del perfil ---------- */
.submenuwrap { position: relative; }
.submenuwrap > .menu__item .sub-chev { margin-left: auto; width: 13px; height: 13px; color: var(--text-muted); }
.submenu {
  position: absolute;
  top: -6px;
  right: calc(100% + 6px);
  display: none;
  min-width: 140px;
}
.submenuwrap:hover > .submenu, .submenu:hover { display: block; }

/* ---------- 92 · Paginación comprimida ---------- */
.dt-footer .pages { gap: 0; }
.page-btn { min-width: 24px; height: 24px; font-size: 12px; padding: 0 6px; }

/* ---------- 93 · Acciones tras el dominio, ancladas; menú de vistas compacto ---------- */
.dt th:nth-child(2), .dt td:nth-child(2) { width: 230px; max-width: 230px; }
.dt th:nth-child(3), .dt td:nth-child(3) {
  position: sticky;
  left: 274px;
  z-index: 4;
  background: var(--bg-surface);
  width: 100px;
}
.dt thead th:nth-child(3) { z-index: 8; box-shadow: inset 0 -1px 0 var(--border-soft); }
.dt tbody td:nth-child(3) { border-bottom: none; box-shadow: inset 0 -1px 0 var(--border-soft); }
.dt tbody tr:last-child td:nth-child(3) { box-shadow: none; }
.tbody-scroll.scrolled-x .dt th:nth-child(2)::after,
.tbody-scroll.scrolled-x .dt td:nth-child(2)::after { content: none; }
.tbody-scroll.scrolled-x .dt th:nth-child(3)::after,
.tbody-scroll.scrolled-x .dt td:nth-child(3)::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  right: -12px;
  width: 12px;
  background: linear-gradient(90deg, rgba(17, 24, 39, .10), transparent);
  pointer-events: none;
}
.dt th:last-child, .dt td:last-child { width: auto; padding-left: 12px; padding-right: 14px; }
#menu-views { min-width: 220px; }
#menu-views .menu__item { padding: 6px 10px; }

/* ---------- 94 · Pie del rail: limpiar + crear vista; acciones con left medido ---------- */
.dt th:nth-child(3), .dt td:nth-child(3) { left: var(--col3-left, 274px); }
.frail-side__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid var(--border-soft);
  flex: none;
}
.link-clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.link-clear:hover { background: var(--bg-hover); color: var(--text-primary); }
.link-clear .ftab__count { background: var(--bg-chip); color: var(--text-secondary); }
.btn-newview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.btn-newview:hover { background: var(--bg-hover); }
.btn-newview svg { width: 13px; height: 13px; }

/* popover de listas */
#pop-list { width: 240px; }
#pop-list .pl-txt { font-size: 12.5px; padding: 2px 2px 8px; display: block; }
#pop-list .menu__sep { margin: 0 0 6px; }

/* la celda cuyo menú está abierto se eleva sobre el resto de celdas fijas */
.dt td:has(.menu[data-menu-open]) { z-index: 30; }

/* el pie del rail no parte los textos */
.link-clear, .btn-newview { white-space: nowrap; }
.frail-side__foot { gap: 6px; padding: 9px 10px; }

/* ---------- 95 · Compactación general extra ---------- */
.content--compact.content--full { padding: 12px 14px 10px; }
.content--compact .viewbar { margin-bottom: 10px; gap: 8px; }
.viewbar .btn { height: 28px; font-size: 12px; padding: 0 10px; }
.btn--plain { height: 28px; font-size: 12px; }
.catalog-body { gap: 10px; }
.topbar { height: 56px; padding: 0 16px; }
.frail-side__head { padding: 10px 12px 7px; }
.content--compact .frail__head { padding: 8px 12px; }
.content--compact .frail__body { padding: 0 12px 12px; }
.frail-side__foot { padding: 7px 10px; }
.link-clear, .btn-newview { font-size: 12px; }
.btn-newview { height: 26px; padding: 0 9px; }

/* ---------- 96 · Sección abierta destacada (estilo Apollo) ---------- */
.content--compact .frail__body { padding: 6px 12px 12px; }
.frail__sec--open .frail__head { color: var(--primary); }
.frail__sec--open .frail__head .chev { color: var(--primary); }
.frail__sec--open .frail__body {
  margin: 0 8px 10px;
  padding: 8px 10px 10px;
  border: 1px solid #D6E3FC;
  border-radius: 10px;
  background: #FDFEFF;
}

/* ---------- 97 · Columnas ancladas con anchos deterministas (sin JS) ---------- */
.dt th:first-child, .dt td:first-child {
  width: 30px; min-width: 30px; max-width: 30px;
}
.dt th:nth-child(2), .dt td:nth-child(2) {
  width: 205px; min-width: 205px; max-width: 205px;
}
.dom { min-width: 0; }
.dom__sub .tag { max-width: 108px; overflow: hidden; text-overflow: ellipsis; }
.dt th:nth-child(3), .dt td:nth-child(3) {
  left: 249px;
  width: 100px; min-width: 100px; max-width: 100px;
}

/* ---------- 98 · Menú de vistas: acciones ⋯ por vista ---------- */
.vitem { display: flex; align-items: center; gap: 2px; position: relative; }
.vitem .menu__item { flex: 1; }
.vitem .ftab__menu { color: var(--text-muted); flex: none; }
.vitem .ftab__menu:hover { color: var(--text-primary); background: var(--bg-hover); }
.vitem .menu--vactions {
  position: absolute;
  left: calc(100% + 6px);
  top: -4px;
  min-width: 150px;
}

/* ---------- 99 · SOLO checkbox y dominio fijos; Acciones scrollea ---------- */
.dt td:nth-child(3) {
  position: static;
  left: auto;
  width: auto; min-width: 0; max-width: none;
  background: transparent;
  z-index: auto;
  box-shadow: none;
  border-bottom: 1px solid var(--border-soft);
}
.dt tbody tr:last-child td:nth-child(3) { border-bottom: none; }
.dt thead th:nth-child(3) {
  position: sticky;
  top: 0;
  left: auto;
  width: auto; min-width: 0; max-width: none;
  background: var(--bg-surface);
  z-index: 5;
  box-shadow: inset 0 -1px 0 var(--border-soft);
}
.tbody-scroll.scrolled-x .dt th:nth-child(3)::after,
.tbody-scroll.scrolled-x .dt td:nth-child(3)::after { content: none; }
.tbody-scroll.scrolled-x .dt th:nth-child(2)::after,
.tbody-scroll.scrolled-x .dt td:nth-child(2)::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  right: -12px;
  width: 12px;
  background: linear-gradient(90deg, rgba(17, 24, 39, .10), transparent);
  pointer-events: none;
}

/* ---------- 100 · Header del sidebar alineado con la topbar (pixel perfect) ---------- */
.sidebar { padding-top: 0; gap: 12px; }
.sidebar__top {
  height: 56px;
  margin: 0 -12px;
  padding: 0 10px 0 16px;
  border-bottom: 1px solid var(--border-soft);
  align-items: center;
  flex: none;
}
.sidebar .wordmark { font-size: 20px; padding: 0; }
.nav-mini .sidebar__top { margin: 0 -8px; padding: 0; justify-content: center; }

/* ---------- 101 · Sin hueco entre columnas fijas (border-box: left = ancho total) ---------- */
.dt th:nth-child(2), .dt td:nth-child(2) { left: 30px; }

/* el botón de colapso no retiene el halo tras el click */
.nav-collapse:focus:not(:focus-visible) { outline: none; }

/* checkbox con aire: columna 40px y dominio anclado a juego */
.dt th:first-child, .dt td:first-child { width: 40px; min-width: 40px; max-width: 40px; }
.dt th:nth-child(2), .dt td:nth-child(2) { left: 40px; }
.dt input[type="checkbox"] { min-width: 15px; }

/* ---------- 102 · Sliders de rango (noUiSlider con el skin del sistema) ---------- */
.uislider { margin: 10px 7px 4px; height: 4px; }
.uislider .noUi-base { height: 4px; }
.uislider.noUi-target {
  background: #E8EAEC;
  border: none;
  box-shadow: none;
  border-radius: var(--radius-full);
}
.uislider .noUi-connect { background: var(--primary); }
.uislider .noUi-handle {
  width: 14px; height: 14px;
  right: -7px; top: -5px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--primary);
  box-shadow: 0 1px 3px rgba(17, 24, 39, .15);
  cursor: grab;
}
.uislider .noUi-handle::before, .uislider .noUi-handle::after { display: none; }
.uislider .noUi-handle:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* ---------- 103 · Esquinas del card de tabla intactas; tags en filas ---------- */
.tbody-scroll {
  border-top-left-radius: var(--radius-card);
  border-top-right-radius: var(--radius-card);
}
#bulk-row + .tbody-scroll { border-radius: 0; }
#bulk-row[hidden] + .tbody-scroll { border-top-left-radius: var(--radius-card); border-top-right-radius: var(--radius-card); }
.dom__sub { flex-direction: column; align-items: flex-start; gap: 3px; }

/* iconos de acciones más grandes y compactos */
.row-actions { gap: 0; }
.row-actions .star { width: 28px; height: 28px; }
.row-actions .star svg { width: 17px; height: 17px; }
.row-actions .btn--ghost-sm { width: 28px; height: 28px; }
.row-actions .btn--ghost-sm svg { width: 17px; height: 17px; }

/* ---------- 104 · Categoría y % país como columnas ---------- */
.td-plain { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; }
.dom__sub { display: none; }

/* ---------- 105 · Celda de precios en una línea: precio + logos + n ---------- */
.pricecell { min-width: 150px; }
.pricecell__main { align-items: center; flex-wrap: nowrap; }

/* ---------- 106 · Métricas en una línea, sin Dominios, tooltip por sigla ---------- */
.dt tbody .metric { display: inline-flex; align-items: baseline; gap: 4px; margin: 0; }
.dt tbody .metric + .metric { margin: 0 0 0 12px; }
.dt tbody .metric .k[data-tip] { cursor: help; text-decoration: underline dotted var(--text-muted); text-underline-offset: 3px; }

/* ---------- 107 · Una sola columna de métricas, todo en una línea ---------- */
.td-metrics { white-space: nowrap; }
.td-metrics .metric + .metric { margin-left: 14px; }

/* ---------- 108 · La última fila también dibuja su línea (cierra la tabla) ---------- */
.tbody-scroll .dt tbody tr:last-child td,
.tbody-scroll.scrolled-x .dt tbody tr:last-child td:first-child,
.tbody-scroll.scrolled-x .dt tbody tr:last-child td:nth-child(2),
.tbody-scroll.scrolled-x .dt tbody tr:last-child td:nth-child(3) {
  border-bottom: none;
  box-shadow: inset 0 -1px 0 var(--border-soft);
}

/* ---------- 109 · Subrayado punteado en el dominio ---------- */
.dom__main a:hover {
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ---------- 110 · Grupo de filtros avanzados en el rail ---------- */
.fgroup {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px 7px;
  border-top: 1px solid var(--border);
  background: var(--bg-canvas);
}
.fgroup__ico { width: 13px; height: 13px; color: var(--text-muted); flex: none; }
.fgroup__label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.fgroup .tip { margin-left: -1px; }
.frail__sec--adv .frail__head { color: var(--text-secondary); }
.frail__sec--adv.frail__sec--open .frail__head { color: var(--text-primary); }

/* ---------- 111 · Idioma y moneda: caja desplegable con el select dentro ---------- */
.menu__acc { border-radius: 8px; }
.menu__acchead {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0; border-radius: 8px;
  background: none; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--text-primary);
  text-align: left;
}
.menu__acchead:hover { background: var(--bg-hover); }
.menu__acc.is-open .menu__acchead { background: var(--primary-soft); color: var(--primary); }
.menu__acchead > svg:first-child { width: 15px; height: 15px; flex: none; color: var(--text-muted); }
.menu__acc.is-open .menu__acchead > svg:first-child { color: var(--primary); }
.menu__acclabel { flex: 1; }
.menu__accval { color: var(--text-secondary); font-size: 12px; }
.menu__acc.is-open .menu__accval { color: var(--primary); }
.menu__accchev {
  width: 13px; height: 13px; flex: none; color: var(--text-muted);
  transition: transform var(--transition);
}
.menu__acc.is-open .menu__accchev { transform: rotate(180deg); color: var(--primary); }

.menu__accbody {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 180ms ease;
}
.menu__acc.is-open .menu__accbody { grid-template-rows: 1fr; }
.menu__accbody > * { overflow: hidden; min-height: 0; }
.menu__acc.is-open .menu__accbody { padding: 2px 10px 8px; }

/* ---------- 112 · Logos de marketplace solapados (máx. 3 + contador) ---------- */
.shoplogos { display: inline-flex; align-items: center; }
.shoplogos .shoplogo {
  position: relative;
  margin-left: -6px;
  box-shadow: 0 0 0 2px var(--bg-surface);
  transition: transform var(--transition);
}
.shoplogos .shoplogo:first-child { margin-left: 0; }
.shoplogos .shoplogo:nth-child(1) { z-index: 3; }
.shoplogos .shoplogo:nth-child(2) { z-index: 2; }
.shoplogos .shoplogo:nth-child(3) { z-index: 1; }
.shoplogos .shoplogo:hover { z-index: 5; transform: translateY(-1px); }
.shoplogos .more { margin-left: 5px; cursor: default; }
.dt tbody tr:hover .shoplogos .shoplogo { box-shadow: 0 0 0 2px #FAFAFB; }

/* ---------- 113 · Alineación uniforme de todos los controles (inputs y selects) ---------- */
/* El texto arranca siempre a 9px del borde, como en .input, y al mismo tamaño. */
.ts-wrapper .ts-control {
  padding-left: 9px;
  padding-right: 26px;
  font-size: 12.5px;
  /* sin esto el valor se estira y el texto queda pegado al borde superior */
  align-items: center;
}
.ts-wrapper.single .ts-control > .item { display: flex; align-items: center; }
.ts-wrapper .ts-control > input,
.ts-wrapper .ts-control > input::placeholder {
  font-size: 12.5px;
  margin-left: 0;
  padding-left: 0;
}
.ts-wrapper.single .ts-control > .item {
  margin: 0;
  padding: 0;
  font-size: 12.5px;
}
/* multi con chips: el primer chip arranca en la misma vertical que el resto */
.ts-wrapper.multi.has-items .ts-control { padding-left: 9px; }

/* ---------- 114 · Configurador de columnas ---------- */
.menu--cols { min-width: 236px; padding: 6px; }
.colcfg__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px 8px;
  font-size: 11px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-muted);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 4px;
}
.colcfg__head .link-cancel { font-size: 11.5px; text-transform: none; letter-spacing: 0; }
.colcfg { list-style: none; margin: 0; padding: 0; }
.colcfg__item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 7px;
  font-size: 12.5px; background: var(--bg-surface);
}
.colcfg__item[draggable="true"] { cursor: grab; }
.colcfg__item[draggable="true"]:hover { background: var(--bg-hover); }
.colcfg__item.is-drag { opacity: .45; cursor: grabbing; }
.colcfg__item--fija { color: var(--text-muted); }
.colcfg__grip { display: inline-flex; width: 14px; color: var(--text-muted); flex: none; }
.colcfg__grip svg { width: 14px; height: 14px; }
.colcfg__name { flex: 1; }
.colcfg__lock svg { width: 13px; height: 13px; color: var(--text-muted); }

/* interruptor compacto */
.switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch__track {
  width: 28px; height: 16px; border-radius: 999px;
  background: #D4D7DD; transition: background var(--transition);
}
.switch__track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; transition: transform var(--transition);
}
.switch input:checked + .switch__track { background: var(--primary); }
.switch input:checked + .switch__track::after { transform: translateX(12px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 2px rgba(37, 99, 235, .25); }

/* ---------- 115 · Dominio un punto más pequeño ---------- */
.dt tbody .dom__main { font-size: 12.5px; }
/* separación bandera-texto dentro del desplegable */
.ts-dropdown .option .fi { margin-right: 7px; vertical-align: -1px; }
/* desplegable del menú: buscador arriba, dentro del propio panel */
.ts-dropdown--menu .dropdown-input-wrap { padding: 6px; border-bottom: 1px solid var(--border-soft); }
.ts-dropdown--menu .dropdown-input {
  width: 100%;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12.5px;
  background: var(--bg-surface);
}
.ts-dropdown--menu .dropdown-input:focus { outline: none; border-color: var(--primary); }

/* ---------- 116 · Radio discreto en los controles de formulario ---------- */
.input,
.ts-wrapper .ts-control,
.frail-side .ts-control,
.frail-side .input,
.viewbar .menu--sort .ts-control,
.range .input {
  border-radius: 6px;
}
.ts-dropdown { border-radius: 8px; }

/* caja desplegable del menú: más aire y sin recortar el borde del select */
.menu__acc.is-open .menu__accbody { padding: 4px 10px 10px; }
/* recortado solo mientras está plegado; abierto no debe cortar el borde del select */
.menu__accbody > * { overflow: hidden; }
.menu__acc.is-open .menu__accbody > * { overflow: visible; }

/* ---------- 117 · Modales a la densidad del resto de la app ---------- */
.modal__card {
  padding: 16px;
  border-radius: 12px;
  max-height: calc(100vh - 32px);
}
.modal__head {
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.modal__title { font-size: 14px; }
.modal__head .btn--ghost { width: 26px; height: 26px; }
.modal__head .btn--ghost svg { width: 15px; height: 15px; }
.modal__foot {
  margin-top: 16px;
  padding-top: 12px;
}
.modal__foot .btn--primary { height: 30px; padding: 0 14px; font-size: 12.5px; border-radius: 6px; }
.modal__foot .link-cancel { font-size: 12.5px; }

.radio-card { padding: 9px 11px; gap: 9px; border-radius: 6px; }
.radio-card + .radio-card { margin-top: 6px; }
.radio-card .t { font-size: 12.5px; }
.radio-card .d { font-size: 12px; line-height: 1.45; }
.radio-card input { width: 14px; height: 14px; margin-top: 1px; }
.modal .field__hint { font-size: 11.5px; }
/* sin Cancelar (la X cierra): la acción principal se alinea a la derecha */
.modal__foot:has(> :only-child) { justify-content: flex-end; }

/* ---------- 118 · Input con icono de búsqueda dentro del rail ---------- */
.field-search { position: relative; }
.field-search > svg {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-muted); pointer-events: none;
}
.field-search .input { padding-left: 28px; }
.field-search .input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ---------- 119 · Modo experto: métricas veladas hasta aceptar el aviso ---------- */
.unlock {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0; border: 0; background: none;
  font: inherit; font-size: 11.5px; font-weight: 500;
  color: var(--primary); cursor: pointer;
  text-transform: none; letter-spacing: 0;
}
.unlock svg { width: 12px; height: 12px; }
.unlock:hover { text-decoration: underline; text-underline-offset: 2px; }

/* bloqueado: la cabecera cede el sitio al enlace y los valores se velan */
body:not(.expert-on) .dt thead th[data-col="metricas"] { font-size: 0; }
body:not(.expert-on) .dt thead th[data-col="metricas"] .tip { display: none; }
body:not(.expert-on) .td-metrics {
  filter: blur(3.5px);
  opacity: .55;
  user-select: none;
  cursor: pointer;
}
body.expert-on .unlock { display: none; }

/* modal del aviso */
.mx-lead { font-size: 12.5px; line-height: 1.55; color: var(--text-secondary); margin: 0 0 12px; }
.mx-list { margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.mx-list > div { display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: start; }
.mx-list dt { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mx-list dd { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text-secondary); }
.mx-warn {
  margin: 0; padding: 9px 11px; border-radius: 6px;
  background: var(--bg-canvas); border: 1px solid var(--border-soft);
  font-size: 11.5px; line-height: 1.5; color: var(--text-secondary);
}

/* ---------- 120 · Multiselect de una sola línea, como el resto de controles ---------- */
.ts-wrapper.multi .ts-control {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.ts-wrapper.multi .ts-control::-webkit-scrollbar { height: 0; }
.ts-wrapper.multi.has-items .ts-control {
  padding: 2px 24px 2px 9px;
}
.ts-wrapper.multi .ts-control > .item { flex: none; }
.ts-wrapper.multi .ts-control > input { flex: 1 0 40px; min-width: 40px; }
/* con chips dentro, el placeholder no debe verse ni ocupar */
.ts-wrapper.multi.has-items .ts-control > input::placeholder { color: transparent; }
.ts-wrapper.multi .ts-control > .item { line-height: 16px; }
.ts-wrapper.multi .ts-control { height: 30px; }

/* ---------- 121 · Desplegables a la misma escala que sus controles ---------- */
.ts-dropdown,
.ts-dropdown .option,
.ts-dropdown .optgroup-header,
.ts-dropdown .no-results {
  font-size: 12.5px;
}
.ts-dropdown .option { padding: 6px 9px; line-height: 1.35; }
.ts-dropdown .optgroup-header { padding: 6px 9px 3px; font-size: 11px; }
.ts-dropdown .no-results { padding: 8px 9px; }

/* ---------- 122 · Resumen de filtros con la sección plegada (patrón Apollo) ---------- */
.frail__sum { display: none; }
.frail__sec--activa:not(.frail__sec--open) .frail__sum {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 12px 10px;
}
.fsum { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 11.5px; }
.fsum__k { color: var(--text-muted); }
.fsum__v {
  display: inline-flex; align-items: center; gap: 4px;
  max-width: 100%;
  padding: 2px 4px 2px 7px;
  border-radius: 5px;
  background: var(--bg-chip);
  color: var(--text-primary);
}
.fsum__v > button {
  display: inline-flex; padding: 0; border: 0; background: none;
  color: var(--text-muted); cursor: pointer;
}
.fsum__v > button svg { width: 11px; height: 11px; }
.fsum__v > button:hover { color: var(--text-primary); }

/* punto azul: esta sección tiene filtros puestos */
.frail__sec--activa > .frail__head::before {
  content: '';
  width: 5px; height: 5px; margin-right: 7px;
  border-radius: 50%;
  background: var(--primary);
  flex: none;
}

/* ---------- 123 · Filtros de inclusión con el checkbox de la tabla ---------- */
.checkrow { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.checkrow input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 15px; height: 15px; margin: 1px 0 0;
  border: 1.5px solid #C9CDD3;
  border-radius: 4px;
  background: var(--bg-surface);
  cursor: pointer; position: relative; flex: none;
  transition: background var(--transition), border-color var(--transition);
}
.checkrow input[type="checkbox"]:hover { border-color: var(--primary); }
.checkrow input[type="checkbox"]:checked { background: var(--primary); border-color: var(--primary); }
.checkrow input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checkrow input[type="checkbox"]:focus-visible { box-shadow: 0 0 0 2px var(--focus-ring); }
.checkrow__txt { display: flex; flex-direction: column; gap: 1px; }
.checkrow__label { font-size: 12.5px; color: var(--text-primary); }
.checkrow__desc { font-size: 11.5px; line-height: 1.4; color: var(--text-muted); }

/* el valor neutro de un select ("Todos") se lee como estado base, no como filtro */
.ts-wrapper.single.estado-base .ts-control > .item { color: var(--text-muted); }

/* ---------- 124 · La franja del sidebar cierra en la misma línea que la topbar ---------- */
.sidebar { padding-top: 0; }
.sidebar__top {
  height: 56px;
  padding: 0 10px 0 16px;
  box-sizing: border-box;
}
.nav-mini .sidebar__top { padding: 0; justify-content: center; }
.sidebar__nav { padding-top: 14px; }

/* ---------- 124 · La franja del sidebar cierra en la misma línea que la topbar ---------- */
.sidebar { padding-top: 0; }
.sidebar__top {
  height: 56px;
  padding: 0 10px 0 16px;
  box-sizing: border-box;
}
.nav-mini .sidebar__top { padding: 0; justify-content: center; }
.sidebar__nav { padding-top: 14px; }
.nav-mini .sidebar { padding-top: 0; }

/* ---------- 125 · Desplegable con pestañas de ámbito (filtro de listas) ---------- */
.ts-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-surface);
  position: sticky; top: 0; z-index: 1;
}
.ts-tabs button {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 4px;
  border: 0; border-bottom: 2px solid transparent;
  background: none; cursor: pointer;
  font: inherit; font-size: 11.5px; font-weight: 500;
  color: var(--text-secondary);
}
.ts-tabs button svg { width: 13px; height: 13px; }
.ts-tabs button:hover { color: var(--text-primary); }
.ts-tabs button.is-on { color: var(--primary); border-bottom-color: var(--primary); }

/* cada pestaña acota las opciones visibles */
.ts-dropdown[data-ambito="mias"] .option[data-scope="equipo"],
.ts-dropdown[data-ambito="equipo"] .option[data-scope="mias"] { display: none; }

/* ---------- 126 · Ficha de sitio: cabecera fija y datos a la densidad del sistema ---------- */
.drawer__head { align-items: center; }
.drawer__id { display: flex; align-items: center; gap: 8px; min-width: 0; }
.drawer__id .fi { font-size: 15px; border-radius: 2px; flex: none; }
.drawer__dom {
  margin: 0;
  font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drawer__ext { display: inline-flex; color: var(--text-muted); }
.drawer__ext svg { width: 13px; height: 13px; }
.drawer__ext:hover { color: var(--primary); }

.drawer__resumen { padding-bottom: 14px; }
.dprice { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.dprice__v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dprice__k { font-size: 11.5px; color: var(--text-secondary); }

.dfacts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  margin: 0;
}
.dfact {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-soft);
}
.dfact dt {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-secondary); white-space: nowrap;
}
.dfact dt .tip { width: 13px; height: 13px; }
.dfact dt .tip svg { width: 12px; height: 12px; }
.dfact dd {
  margin: 0;
  font-size: 12.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.dfact dd .fi { margin-right: 3px; }

.dsec {
  margin: 16px 0 4px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted);
}

/* el bloque de métricas solo existe en modo experto */
.dexpert { display: none; }
body.expert-on .dexpert { display: block; }
.dexpert-off {
  display: flex; align-items: center; gap: 7px;
  margin: 14px 0 0; padding: 8px 10px;
  border: 1px solid var(--border-soft); border-radius: 6px;
  background: var(--bg-canvas);
  font-size: 11.5px; line-height: 1.45; color: var(--text-secondary);
}
.dexpert-off svg { width: 13px; height: 13px; flex: none; color: var(--text-muted); }
body.expert-on .dexpert-off { display: none; }

/* las pestañas del panel arrancan pegadas al resumen */
.drawer__body .modal-tabs { margin: 0 0 12px; }
.dfact dd { white-space: nowrap; }
.dfact dt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 127 · Barras de país: el relleno es un bloque, si no ignora el ancho ---------- */
.cbar__fill { display: block; }

/* ---------- 127 · Barras de país: el relleno es un bloque, si no ignora el ancho ---------- */
.cbar__fill { display: block; }
/* el resto de países: mismo formato, peso visual menor */
.cbar__ico { display: inline-flex; color: var(--text-muted); }
.cbar__ico svg { width: 14px; height: 14px; }
.cbar--otros span:nth-child(2) { color: var(--text-secondary); }
.cbar--otros .cbar__fill { background: #C9CDD3; }
.cbar--otros .cbar__pct { color: var(--text-secondary); }
/* el resto de países: mismo formato, peso visual menor */
.cbar__ico { display: inline-flex; color: var(--text-muted); }
.cbar__ico svg { width: 14px; height: 14px; }
.cbar--otros span:nth-child(2) { color: var(--text-secondary); }
.cbar--otros .cbar__fill { background: #C9CDD3; }
.cbar--otros .cbar__pct { color: var(--text-secondary); }
.dexpert-off { align-items: center; gap: 9px; }
.dexpert-off > span { flex: 1; }
.dexpert-off .btn { flex: none; height: 26px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.dexpert-off { align-items: center; gap: 9px; }
.dexpert-off > span { flex: 1; }
.dexpert-off .btn { flex: none; height: 26px; padding: 0 10px; font-size: 12px; border-radius: 6px; }

/* ---------- 128 · Miga de pan y cabecera con subtítulo ---------- */
.crumbs {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px;
  font-size: 12px; color: var(--text-muted);
}
.crumbs a { color: var(--text-secondary); text-decoration: none; }
.crumbs a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.crumbs__sep { color: var(--border); }
.page-head__sub { margin: 2px 0 0; font-size: 12.5px; color: var(--text-secondary); }

/* punto de color de una lista (patrón del punto de proyecto, §4.12) */
.listdot {
  display: inline-block; flex: none;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted);
}

/* ---------- 129 · Estado vacío (DESIGN.md §4.14) ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 56px 24px; text-align: center;
}
/* sin esto, display:flex gana al atributo hidden y el estado vacío se ve siempre */
.empty[hidden] { display: none; }
.empty__ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg-hover); color: var(--text-muted);
}
.empty__ico svg { width: 22px; height: 22px; }
.empty__title { margin: 0; font-size: 14px; font-weight: 600; }
.empty__hint { margin: 0; max-width: 320px; font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); }

/* ---------- 130 · Pantalla de listas ---------- */
.listname { display: inline-flex; align-items: center; gap: 8px; }
.listname a { font-size: 12.5px; font-weight: 600; color: var(--text-primary); text-decoration: none; }
.listname a:hover { text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.dt-search { width: 240px; }
.dt-spacer { margin-left: auto; }
.row-actions--end { justify-content: flex-end; }
.dt .col-sep:last-child { width: 44px; }

/* selector de color del modal de lista nueva */
.swatches { display: flex; gap: 8px; }
.swatch { position: relative; display: inline-flex; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.swatch span {
  width: 22px; height: 22px; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 2px transparent;
  transition: box-shadow var(--transition);
}
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--primary); }
.swatch input:focus-visible + span { box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--focus-ring); }

/* ---------- 131 · Cabecera de la ficha de lista ---------- */
.page-head--tight { margin-bottom: 10px; }
.page-head--tight h1 { display: flex; align-items: center; gap: 9px; font-size: 20px; }
.page-head--tight .listdot { width: 9px; height: 9px; }
.page-head__actions { display: flex; align-items: center; gap: 8px; }
.content--full .crumbs { margin-bottom: 4px; }
/* el buscador de la barra cumple la métrica única (§4.13): 30 px y 12,5 */
.dt-toolbar .input { height: 30px; font-size: 12.5px; }
/* ficha de lista: sin rail, la tabla ocupa todo el ancho */
.catalog-body--solo { grid-template-columns: 1fr; }

/* ---------- 132 · Cabecera de lista: identidad y acciones en una sola fila ---------- */
.listhead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.listhead__id { min-width: 0; }
.listhead__id h1 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 20px; }
.listhead__id .listdot { width: 9px; height: 9px; }
.listhead__acts { display: flex; align-items: center; gap: 6px; }
.listhead__div { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }

/* ---------- 133 · Diálogo de confirmación (§4.35) ---------- */
.confirm { width: 380px; }
.confirm__body { display: flex; align-items: flex-start; gap: 12px; }
.confirm__ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  background: var(--bg-hover); color: var(--text-secondary);
}
.confirm__ico svg { width: 17px; height: 17px; }
.confirm__ico--danger { background: var(--red-bg); color: var(--red-text); }
.confirm__title { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.confirm__txt { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); }
.confirm__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.btn--danger { background: var(--red-text); color: #fff; border: 0; }
.btn--danger:hover { background: #9B1C1C; }

/* ---------- 134 · Buscador de sitios para añadir a una lista ---------- */
.addlist { list-style: none; margin: 4px 0 0; padding: 0; max-height: 260px; overflow-y: auto; }
.addlist__it {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: 6px;
  font-size: 12.5px;
}
.addlist__it:hover { background: var(--bg-hover); }
.addlist__dom { font-weight: 600; }
.addlist__meta { color: var(--text-secondary); font-size: 12px; }
.addlist__precio { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.addlist__it .btn { flex: none; height: 26px; padding: 0 10px; font-size: 12px; }
.addlist__it .btn:disabled { opacity: .55; cursor: default; }
.addlist__vacio { padding: 14px 8px; font-size: 12.5px; color: var(--text-secondary); text-align: center; }
#modal-add .modal__foot { justify-content: space-between; }

/* ---------- 135 · Barra de selección: sin recuadro, integrada en la tarjeta ---------- */
.bulk-bar {
  border-top: 0;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  padding: 10px 16px;
  font-size: 12.5px;
}
.bulk-bar .link-cancel { margin-left: 0; }

/* ---------- 136 · Tabla de listas: sin scroll horizontal forzado ---------- */
/* El mínimo de 910px es para las 9 columnas del catálogo. Una tabla con pocas
   columnas lo hereda y provoca un scroll horizontal falso que deja la columna
   fija tapando a la siguiente. Estas tablas se ajustan a su contenido. */
/* Ojo con el peso: `.tbody-scroll .dt` (0,2,0) impone los 910px, así que la
   anulación tiene que ir igual de cualificada o no se aplica. */
.tbody-scroll .dt--auto { min-width: 0; }
.dt--auto th:nth-child(3), .dt--auto td:nth-child(3) { width: 60px; }

/* ---------- 137 · Pipeline: tablero kanban ---------- */
.board__desc { margin: 0 0 0 4px; font-size: 12px; color: var(--text-secondary); }
.viewbar__search { width: 220px; }

.board-wrap { flex: 1; min-height: 0; display: flex; }
.board {
  flex: 1; min-height: 0;
  display: flex; align-items: stretch; gap: 12px;
  overflow-x: auto; overflow-y: hidden;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: #D3D6DB transparent;
}
.board[hidden] { display: none; }
.board::-webkit-scrollbar { height: 8px; }
.board::-webkit-scrollbar-thumb {
  background: #D3D6DB; border-radius: var(--radius-full);
  border: 2px solid transparent; background-clip: content-box;
}
.board::-webkit-scrollbar-track { background: transparent; }

/* columna */
.bcol {
  flex: none;
  width: 264px;
  height: 100%;
  display: flex; flex-direction: column;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.bcol__head {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 8px 4px 10px;
}
.bcol__grip { display: inline-flex; color: var(--border); cursor: grab; flex: none; }
.bcol__grip svg { width: 13px; height: 13px; }
.bcol:hover .bcol__grip { color: var(--text-muted); }
.bcol__nombre {
  flex: 1; min-width: 0;
  font-size: 12.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bcol__n {
  flex: none; min-width: 20px; padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-hover);
  font-size: 11px; font-weight: 600; text-align: center;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.bcol__suma {
  margin: 0 10px 6px;
  font-size: 11.5px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.bcol__cards {
  flex: 1; min-height: 40px;
  overflow-y: auto;
  padding: 0 8px 4px;
  display: flex; flex-direction: column; gap: 7px;
  scrollbar-width: thin; scrollbar-color: #D3D6DB transparent;
}
.bcol__cards::-webkit-scrollbar { width: 8px; }
.bcol__cards::-webkit-scrollbar-thumb {
  background: #D3D6DB; border-radius: var(--radius-full);
  border: 2px solid transparent; background-clip: content-box;
}
.bcol__add {
  flex: none;
  display: flex; align-items: center; gap: 6px;
  margin: 4px 8px 8px;
  padding: 6px 8px;
  border: 0; border-radius: 7px;
  background: none; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--text-secondary);
}
.bcol__add:hover { background: var(--bg-hover); color: var(--text-primary); }
.bcol__add svg { width: 14px; height: 14px; }
.bcol__vacio {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 20px 8px;
  font-size: 11.5px; color: var(--text-muted);
}
.bcol__vacio svg { width: 18px; height: 18px; }

/* botón de nueva columna al final de la tira */
.bcol-add {
  flex: none; align-self: flex-start;
  display: flex; align-items: center; gap: 6px;
  width: 176px; padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: none; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--text-secondary);
}
.bcol-add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.bcol-add svg { width: 15px; height: 15px; }

/* tarjeta */
.bcard {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px 7px;
  cursor: grab;
}
.bcard[hidden] { display: none; }
.bcard:hover { border-color: #D8DBE0; box-shadow: 0 1px 3px rgba(17, 24, 39, .06); }
.bcard::before {
  content: '';
  position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--franja, transparent);
}
/* por defecto la franja la marca la prioridad; el color propio manda sobre ella */
.bcard[data-prio="2"] { --franja: var(--amber-text); }
.bcard[data-prio="3"] { --franja: var(--red-text); }
.bcard__top { display: flex; align-items: center; gap: 6px; }
.bcard__id { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.bcard__id .fi { font-size: 12px; border-radius: 2px; flex: none; }
.bcard__dom {
  font-size: 12.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bcard__menu { flex: none; width: 22px; height: 22px; opacity: 0; }
.bcard:hover .bcard__menu, .bcard__menu[aria-expanded="true"] { opacity: 1; }
.bcard__menu svg { width: 14px; height: 14px; }
.bcard__mid { display: flex; align-items: center; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.bcard__precio { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* mientras es una estimación del catálogo va en gris; el negro se gana al acordar */
.bcard__precio:not(.is-acordado) { color: var(--text-secondary); font-weight: 600; }
.bcard__met { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 11.5px; }
.bcard__met .k { color: var(--text-muted); }
.bcard__met .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.bcard__pie {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 6px; font-size: 11px; color: var(--text-secondary);
}
.bcard__accion { display: inline-flex; align-items: center; gap: 4px; }
.bcard__accion svg { width: 12px; height: 12px; }
.bcard__accion.is-vencida { color: var(--red-text); font-weight: 600; }
.bcard__cont { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); }
.bcard__cont svg { width: 12px; height: 12px; margin-right: 2px; vertical-align: -2px; }

/* estados de arrastre (SortableJS) */
.bcard--fantasma { opacity: .4; background: var(--primary-soft); border-style: dashed; }
.bcard--arrastrando { cursor: grabbing; box-shadow: 0 8px 20px rgba(17, 24, 39, .14); }
.bcol--fantasma { opacity: .5; }
.bcol__cards.sortable-drag-over { background: var(--primary-soft); border-radius: 8px; }

/* ---------- 138 · Ficha de tarjeta: notas ---------- */
.notaform { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.notaform__in { height: auto; padding: 8px 9px; line-height: 1.45; resize: vertical; font-family: inherit; }
.notaform .btn { align-self: flex-start; }
.notas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
/* .nota redefinida como card en §145 */
.nota__txt { margin: 0 0 3px; font-size: 12.5px; line-height: 1.5; }
.nota__meta { margin: 0; font-size: 11px; color: var(--text-muted); }
.notas__vacio { font-size: 12.5px; color: var(--text-muted); }
.bcard__c { display: inline-flex; align-items: center; }
/* alta de un medio propio, fuera del catálogo */
.addlist__crear { border-top: 1px solid var(--border-soft); margin-top: 4px; padding-top: 9px; border-radius: 0; }
.addlist__crear:hover { background: none; }
.addlist__ico { display: inline-flex; color: var(--primary); }
.addlist__ico svg { width: 15px; height: 15px; }
.bcard__propio { display: inline-flex; color: var(--text-muted); flex: none; }
.bcard__propio svg { width: 13px; height: 13px; }

/* ---------- 139 · Condiciones acordadas en la ficha del pipeline ---------- */
/* .dcampos retirado: lo sustituye .dform de §143 */
.dinput { display: flex; align-items: center; gap: 6px; }
.dinput .input { flex: 1; min-width: 0; }
.dinput__pre, .dinput__post { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.dtotal {
  margin: 0 0 10px; padding: 7px 10px;
  border-radius: 6px; background: var(--bg-canvas);
  border: 1px solid var(--border-soft);
  font-size: 12px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.dtotal[hidden] { display: none; }
.bcard__precio.is-acordado { color: var(--green-text); }

/* ---------- 140 · Contactos del medio ---------- */
.contactos { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.contacto {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-soft); border-radius: 7px;
}
.contacto__id { min-width: 0; }
.contacto__nombre { font-size: 12.5px; font-weight: 600; }
.contacto__vias { display: flex; flex-direction: column; gap: 2px; margin-left: auto; text-align: right; }
.contacto__via {
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px;
  font-size: 12px; color: var(--text-secondary); text-decoration: none;
}
.contacto__via:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.contacto__via svg { width: 12px; height: 12px; flex: none; }
.contacto__del { flex: none; opacity: 0; }
.contacto:hover .contacto__del { opacity: 1; }
.contactos__vacio { font-size: 12.5px; color: var(--text-muted); }
.ofertas__vacio { font-size: 12.5px; color: var(--text-muted); }
.dtel { display: flex; gap: 8px; }
.dtel .ts-wrapper { width: 132px; flex: none; }
.dtel .input { flex: 1; min-width: 0; }
.swatch--none span { background: var(--bg-surface); border: 1px dashed var(--border); position: relative; }
.swatch--none span::after {
  content: ''; position: absolute; left: 3px; right: 3px; top: 50%;
  height: 1px; background: var(--border); transform: rotate(-45deg);
}

/* ---------- 141 · Pipelines colgando del menú lateral ---------- */
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 4px 12px; }
.nav-sub__it {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12.5px; color: var(--text-secondary);
  text-decoration: none;
}
.nav-sub__it:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-sub__it.is-on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-sub__txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-mini .nav-sub { display: none; }
/* display:flex gana al atributo hidden; sin esto la lista nunca se pliega. */
.nav-sub[hidden] { display: none; }
/* los ítems de menú no parten palabras */
.menu__item { white-space: nowrap; }

/* ---------- 142 · Fila del sub-menú con sus acciones ---------- */
.nav-sub__row { position: relative; display: flex; align-items: center; }
.nav-sub__row .nav-sub__it { flex: 1; min-width: 0; padding-right: 4px; }
.nav-sub__menu {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  margin-right: 4px;
  border: 0; border-radius: 6px;
  background: none; color: var(--text-muted); cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition);
}
.nav-sub__menu svg { width: 14px; height: 14px; }
.nav-sub__row:hover .nav-sub__menu,
.nav-sub__menu[aria-expanded="true"] { opacity: 1; }
.nav-sub__menu:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-sub__row .menu { top: calc(100% + 2px); right: auto; left: 8px; min-width: 170px; }

/* ---------- 143 · Ficha del pipeline: controles a la métrica única (§4.13) ---------- */
/* El cajón no vive dentro de ningún contexto compacto (.frail, .content--compact),
   así que heredaba el .input base de 44 px y la ficha se veía el doble de grande
   que el resto de la aplicación. Aquí se le aplica la misma métrica. */
.drawer__body .input,
.drawer__body .ts-wrapper .ts-control {
  height: 30px;
  min-height: 30px;
  padding: 0 9px;
  font-size: 12.5px;
  border-radius: 6px;
}
.drawer__body .ts-wrapper .ts-control { padding-right: 26px; }
.drawer__body textarea.input { height: auto; min-height: 56px; padding: 8px 9px; }
.drawer__body .label { margin-bottom: 4px; font-size: 12px; }
/* movida a regla global: .label .tip */

/* El cajón tiene hasta cinco pestañas en un ancho elástico (420–600 px). Con el
   gap de 24 y la letra a 14 del resto de la app no caben: el contador se parte a
   una segunda línea. Se aprietan a la densidad del cajón y, cuando ni así entran
   —cajón en su mínimo—, la tira desliza en horizontal en vez de romperse. */
.drawer__body .modal-tabs {
  gap: 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.drawer__body .modal-tabs::-webkit-scrollbar { display: none; }
.drawer__body .modal-tabs .tab {
  white-space: nowrap;
  flex: none;
  font-size: 12.5px;
  padding: 10px 2px;
}
.ofertas__intro { margin: 0 0 10px; font-size: 11.5px; color: var(--text-secondary); }

/* línea de contexto de un modal, encima de su control */
.modal__txt { margin: 0 0 10px; font-size: 13px; line-height: 1.5; }
.aviso__link { margin-left: 8px; color: var(--primary); font-weight: 600; text-decoration: none; }
.aviso__link:hover { text-decoration: underline; text-underline-offset: 2px; }
.drawer__body .field + .field { margin-top: 10px; }

/* rejilla del bloque Trato */
.dform {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  align-items: start;
  margin-bottom: 10px;
}
/* `.field + .field` lleva margin-top para campos apilados; dentro de la rejilla
   empujaba la segunda columna 16 px hacia abajo y descuadraba las dos mitades. */
.dform > .field + .field { margin-top: 0; }
.dform .field--ancho { grid-column: 1 / -1; }
.dform__sep {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  font-size: 11.5px; color: var(--text-muted);
}
.dacciones { display: flex; align-items: center; gap: 10px; }
.dacciones .btn { flex: none; }
.dguardado { font-size: 11.5px; color: var(--green-text); }
.dguardado[hidden] { display: none; }

/* ---------- 144 · Ficha del pipeline: alta de notas y contactos ---------- */
/* el pie de la pestaña Negociación usa el patrón de los modales, a su densidad */
.drawer__body .modal__foot { margin-top: 14px; padding-top: 12px; }
.dguardado { font-size: 11.5px; color: var(--green-text); font-weight: 600; }

/* moneda dentro del campo de precio: un control más, misma métrica */
.dinput__sel { flex: none; }
.dinput .ts-wrapper.single { width: 96px; flex: none; }

/* firma del autor en la nota y en el pie del modal */
.avatar--xs { width: 18px; height: 18px; }
.nota__meta {
  display: flex; align-items: center; gap: 7px;
  margin-top: 10px; padding-top: 8px;
  border-top: 1px solid var(--border-soft);
}
.modal__firma {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-secondary);
}

/* una fila por vía de contacto: email, móvil o fijo, tantas como haga falta */
.mc-via { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mc-via__t {
  flex: none; width: 52px;
  font-size: 11.5px; font-weight: 600; color: var(--text-secondary);
}
.mc-via .mc-val { flex: 1; min-width: 0; }
.mc-via .iti { flex: 1; min-width: 0; }
.mc-via__del { flex: none; }
.mc-add { display: flex; gap: 6px; margin-bottom: 8px; }

/* el calendario de flatpickr con el vestido del sistema */
.flatpickr-calendar {
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .08);
  font-family: var(--font-ui);
  font-size: 12.5px;
}
.flatpickr-day.selected, .flatpickr-day.selected:hover {
  background: var(--primary); border-color: var(--primary);
}
.flatpickr-day.today { border-color: var(--primary); }
.flatpickr-months .flatpickr-month { color: var(--text-primary); }
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year { font-size: 13px; font-weight: 600; }

/* ---------- 145 · Notas con formato, y acciones de fila en notas y contactos ---------- */
/* botón de alta de cada panel: a la derecha, con aire antes de la lista */
.panel__acts { display: flex; justify-content: flex-end; margin-bottom: 14px; }

/* la nota es una card: cuerpo arriba y firma separada por un filete */
.nota {
  position: relative;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  border-left: 2px solid var(--border);
}
.nota__cuerpo { font-size: 12.5px; line-height: 1.55; padding-right: 26px; }
.nota__cuerpo p { margin: 0 0 6px; }
.nota__cuerpo p:last-child { margin-bottom: 0; }
.nota__cuerpo ul, .nota__cuerpo ol { margin: 0 0 6px; padding-left: 18px; }
.nota__cuerpo a { color: var(--primary); }
/* una sola entrada a las acciones, como en las filas del catálogo */
.nota__menu { position: absolute; top: 6px; right: 6px; opacity: 0; }
.nota:hover .nota__menu, .nota:focus-within .nota__menu, .nota__menu[aria-expanded="true"] { opacity: 1; }
.contacto__menu { flex: none; opacity: 0; }
.contacto:hover .contacto__menu, .contacto:focus-within .contacto__menu, .contacto__menu[aria-expanded="true"] { opacity: 1; }

/* editor Quill con el vestido del sistema */
#mn-editor { border: 1px solid var(--border); border-top: 0; border-radius: 0 0 6px 6px; }
.ql-toolbar.ql-snow {
  border: 1px solid var(--border); border-radius: 6px 6px 0 0;
  padding: 5px 6px; background: var(--bg-canvas);
}
.ql-container.ql-snow { border: 0; font-family: var(--font-ui); font-size: 12.5px; }
.ql-editor { min-height: 120px; padding: 9px; line-height: 1.55; }
.ql-editor.ql-blank::before { color: var(--text-muted); font-style: normal; left: 9px; }
.ql-snow .ql-stroke { stroke: var(--text-secondary); }
.ql-snow .ql-fill { fill: var(--text-secondary); }
.ql-snow .ql-active .ql-stroke { stroke: var(--primary); }
.ql-snow .ql-active .ql-fill { fill: var(--primary); }
.ql-snow.ql-toolbar button:hover { background: var(--bg-hover); border-radius: 4px; }

/* intl-tel-input a la métrica única */
.iti { width: 100%; }
.iti__tel-input, .mc-via .iti input.mc-val { width: 100%; }
.iti--separate-dial-code .iti__selected-dial-code { font-size: 12.5px; }
.iti__country-list, .iti__dropdown-content {
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .08);
  font-size: 12.5px;
}
.iti__search-input { font-size: 12.5px; padding: 8px 9px; }

/* ---------- 146 · Ofertas en una sola moneda, la del perfil ---------- */
body:not(.moneda-eur) .offers .col-eur { display: none; }
body.moneda-eur .offers .col-usd { display: none; }
.offers td.num { white-space: nowrap; }

/* Pie alineado a la izquierda. Hace falta la especificidad del contexto porque
   `.modal__foot:has(> :only-child)` —que empuja a la derecha los pies de un solo
   botón— vale (0,2,0) y le ganaría a una clase suelta. */
.drawer__body .modal__foot--izq { justify-content: flex-start; }


/* ---------- 147 · Modales a la métrica única (§4.13) ---------- */
/* Mismo agujero que tuvo el cajón: la card del modal no vive en ningún contexto
   compacto y heredaba el .input base de 44 px. Congruencia: 30 px en todos. */
.modal__card .input,
.modal__card .ts-wrapper .ts-control {
  height: 30px;
  min-height: 30px;
  padding: 0 9px;
  font-size: 12.5px;
  border-radius: 6px;
}
.modal__card .ts-wrapper .ts-control { padding-right: 26px; }
.modal__card textarea.input { height: auto; min-height: 56px; padding: 8px 9px; }
.modal__card .label { margin-bottom: 4px; font-size: 12px; }
.modal__card .field + .field { margin-top: 10px; }
/* dentro de la rejilla el espacio lo da el gap; el margin descolgaba la 2ª columna */
.modal__card .dform > .field + .field { margin-top: 0; }


.viewbar__right { display: flex; align-items: center; gap: 10px; }

/* ---------- 148 · Móvil y tablet (DESIGN.md §3: off-canvas) ---------- */
/* Ningún modal puede ser más ancho que la pantalla, tenga el ancho que tenga en línea. */
.modal__card { max-width: calc(100vw - 28px); }
.nav-burger { display: none; }
.frail-close { display: none; }

/* Tablet (701–1080): el sidebar se pliega solo a raíl de iconos — lo hace
   initResponsive() añadiendo .nav-mini, que ya existe como modo manual. */

@media (max-width: 900px) {
  /* 100vh mide el viewport con la barra del navegador retraída: el pie de la
     tabla y del sidebar quedaban debajo de ella sin scroll posible. dvh mide
     el viewport real en cada momento. */
  .main-col--app { height: 100dvh; }
  .sidebar { height: 100dvh; }

  /* EL «borde blanco» de la derecha: la barra de scroll de la página. Los
     móviles reales la pintan flotante e invisible; este motor la pinta con su
     canal blanco por encima de todo, velo incluido. Fuera. */
  html { scrollbar-width: none; }
  html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; }
}

@media (max-width: 700px) {
  .app, .app.nav-mini { grid-template-columns: 1fr; }
  .nav-burger { display: inline-flex; }

  /* sidebar off-canvas: cerrado fuera de pantalla, la hamburguesa lo trae */
  .sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: min(300px, 84vw);
    z-index: 76;
    transform: translateX(-105%);
    transition: transform 230ms ease;
    box-shadow: 16px 0 40px rgba(17, 24, 39, .16);
  }
  .app.nav-open .sidebar { transform: none; }
  .app::before {
    content: ''; position: fixed; inset: 0;
    background: rgba(17, 24, 39, .5);
    z-index: 75;
    opacity: 0; pointer-events: none;
    transition: opacity 230ms ease;
  }
  .app.nav-open::before { opacity: 1; pointer-events: auto; }
  .nav-collapse { display: none; }   /* plegar a mini no aplica en el panel */

  .topbar { gap: 8px; padding: 0 12px; }
  .topbar .search { width: auto; flex: 1; min-width: 0; }
  .topbar .search:focus-within { width: auto; }

  .content { padding: 14px 12px 40px; }
  .listhead__acts { flex-wrap: wrap; justify-content: flex-end; }

  /* La columna fija de dominio se comía la pantalla. En móvil: fuera la
     columna de checkboxes (seleccionar en lote no es gesto de pulgar), celdas
     con menos colchón y el dominio recortado con elipsis. */
  .dt th:first-child, .dt td:first-child { display: none; }
  /* §97 clava la columna a 205 px con anchos deterministas: aquí se re-clava corta */
  .dt th:nth-child(2), .dt td:nth-child(2) {
    left: 0;
    width: 144px; min-width: 144px; max-width: 144px;
  }
  /* con la especificidad de §36 (.content--compact ...), que si no gana */
  .dt td, .dt th,
  .content--compact .dt tbody td, .content--compact .dt thead th { padding-left: 8px; padding-right: 8px; }
  .dom, .content--compact .dom { min-width: 0; max-width: 128px; }
  .dom__main { min-width: 0; gap: 6px; }
  .dom__main a {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 98px; display: inline-block;
  }
  .dom__main .ext { display: none; }
  .dom__sub { display: none; }   /* los tags caben en la ficha, no aquí */
  .listname { max-width: 132px; }
  .listname a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .search .kbd { display: none; }   /* ⌘F no existe en un móvil */

  /* Las sugerencias ancladas a un buscador estrecho desbordan su panel:
     a ancho de pantalla, con scroll propio y sin partir filas. */
  .topbar .suggest {
    position: fixed;
    left: 10px; right: 10px; top: 54px;
    width: auto;
    max-height: 60vh;
    overflow-y: auto;
  }
  .suggest__item { white-space: nowrap; min-width: 0; }
  .suggest__item .meta { flex: none; }

  /* Notificaciones y perfil: colgaban de un ancla absoluta de la topbar y en
     móvil salían cortados por la izquierda. A ancho de pantalla, como las
     sugerencias. */
  .topbar .menuwrap .menu {
    position: fixed;
    left: 10px; right: 10px; top: 54px;
    width: auto; min-width: 0;
    max-height: 70vh; overflow-y: auto;
    z-index: 60;   /* por encima de las sugerencias (55): comparten rectángulo */
  }

  /* avisos y confirmaciones dentro de la pantalla */
  .toast { left: 12px; right: 12px; bottom: 12px; width: auto; max-width: none; z-index: 110; }
  .confirm { max-width: calc(100vw - 28px); }
  .iti__country-list, .iti__dropdown-content { max-width: calc(100vw - 40px); }

  /* cajón a pantalla completa y fichas a una columna */
  .drawer__panel { width: 100vw; border-left: 0; }
  .dfacts { grid-template-columns: 1fr; }
  .dform { grid-template-columns: 1fr; }
  .mc-add { flex-wrap: wrap; }

  /* kanban: columna a casi pantalla completa y con imán, en vez de 264px de
     escritorio flotando en un lienzo de 1900 */
  .board { scroll-snap-type: x mandatory; scroll-padding-left: 12px; }
  .bcol { min-width: 84vw; scroll-snap-align: start; }

  /* viewbar partida en dos filas: cada fila ocupa el ancho y alinea lo suyo */
  .viewbar { row-gap: 8px; }
  .viewbar .viewbar__search, .viewbar input[type="search"] { flex: 1 1 160px; width: auto; min-width: 0; }
  .viewbar .viewbar__spacer { display: none; }
  .viewbar .viewbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
}

/* Catálogo en pantallas cortas: el rail de filtros pasa a panel flotante */
@media (max-width: 900px) {
  /* también la variante rail-off: su (0,2,0) le ganaba a la regla simple y
     metía la tabla en la columna de 0 px */
  .catalog-body, .catalog-body.rail-off { grid-template-columns: 1fr; gap: 0; }
  /* con los mismos dos niveles que las reglas de escritorio que pisa
     (.main-col--app .frail-side, .catalog-body .frail-side) */
  .main-col--app .frail-side,
  .catalog-body .frail-side {
    position: fixed; inset: 56px auto 0 0;
    width: min(320px, 88vw);
    height: auto; max-height: none;
    border-radius: 0;
    z-index: 72;
    border-right: 1px solid var(--border);
    box-shadow: 16px 0 40px rgba(17, 24, 39, .14);
    background: var(--bg-surface);
    /* cerrado = fuera de pantalla; se anula el opacity:0 del rail-off de escritorio */
    display: flex;
    opacity: 1; pointer-events: auto;
    transform: translateX(-105%);
    visibility: hidden;
  }
  .catalog-body:not(.rail-off) .frail-side { transform: none; visibility: visible; }
  /* la transición solo tras el primer pintado (.rail-anim): si no, el cierre
     automático del arranque se ve como un panel saliendo de la pantalla */
  .rail-anim .frail-side {
    transition: transform 240ms cubic-bezier(.32, .72, .33, 1), visibility 0s 240ms;
  }
  .rail-anim:not(.rail-off) .frail-side {
    transition: transform 240ms cubic-bezier(.32, .72, .33, 1);
  }

  /* el interior traía un ancho fijo de 240 px y bailaba dentro del panel */
  .catalog-body .frail-side__inner { width: 100%; }

  /* La tabla reparte su holgura (min-width 910) entre todas las columnas y la
     fija quedaba el doble de ancha que su texto. El sobrante, a la última. */
  .dt th:last-child, .dt td:last-child, .dt .col-sep:last-child { width: 100%; }

  /* velo detrás del panel, con fundido */
  .catalog-body:has(.frail-side)::before {
    content: '';
    position: fixed; inset: 0;
    background: rgba(17, 24, 39, .5);
    z-index: 71;
    opacity: 0; pointer-events: none;
  }
  .catalog-body:has(.frail-side):not(.rail-off)::before { opacity: 1; pointer-events: auto; }
  .rail-anim.catalog-body:has(.frail-side)::before { transition: opacity 240ms ease; }

  .frail-close { display: inline-flex; margin-left: auto; }
}

/* ---------- 149 · Panel (DESIGN.md §4.37): KPIs y filas-enlace ---------- */
.content--panel { max-width: 1160px; }
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.kpi__v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi__k { font-size: 12.5px; color: var(--text-secondary); }

/* "Ver todos": el chip gris tipo "See All" de la referencia (--bg-chip existe
   para esto desde el día uno y no se había estrenado) */
.chiplink {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px;
  background: var(--bg-chip);
  color: var(--text-secondary);
  border-radius: 8px;
  font-size: 12px; font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.chiplink:hover { background: #E8EAED; color: var(--text-primary); }
.chiplink svg { width: 12px; height: 12px; }

/* fila-enlace: la unidad de las cards del panel (chollos, pipelines, listas) */
.rowlink {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 4px;
  border-top: 1px solid var(--border-soft);
  text-decoration: none; color: inherit;
  font-size: 12.5px;
}
.rowlink:hover { background: var(--bg-hover); }
.rowlink__id { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.rowlink__t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowlink__c { width: 64px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-secondary); flex: none; }
.rowlink__c--fuerte { color: var(--text-primary); font-weight: 600; }
.rowlink__c--via { width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.rowlink__meta { color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rowlink > svg { width: 14px; height: 14px; color: var(--text-muted); flex: none; }
.rowhead {
  display: flex; align-items: center; gap: 10px;
  padding: 0 4px 6px;
  font-size: 11.5px; font-weight: 500; color: var(--text-muted);
}
.rowhead .rowlink__id { flex: 1; }
.rowhead .rowlink__c { color: var(--text-muted); }
.rowhead__hueco { width: 14px; flex: none; }

/* actividad dentro de card: los items de notificación pierden su borde externo */
.card .notif__item { padding-left: 4px; padding-right: 4px; }
.notif__ico--baja { background: var(--blue-bg); color: var(--blue-text); }

.panel-grid { grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 900px) {
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .rowlink__c--via { display: none; }
  .rowhead .rowlink__c--via { display: none; }
}
