/* Gestión — section styles. Scoped to body[data-active-section="gestion"].
   Sidebar/topbar/main mirror /share for ecosystem consistency.
   Brand: blanco / negro / grises + var(--accent) (#1700FF). */

body[data-active-section="gestion"] {
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist','Inter Tight', system-ui, -apple-system, sans-serif;
  font-size: var(--wb-text-md);
  -webkit-font-smoothing: antialiased;
}

/* Box-sizing reset (alineado con app/share/facturas que ya lo tienen).
   Sin esto, los .sb-item con min-height:44px + padding:11px 16px renderan a
   66px en lugar de 44px (content-box suma el padding al alto). */
body[data-active-section="gestion"],
body[data-active-section="gestion"] *,
body[data-active-section="gestion"] *::before,
body[data-active-section="gestion"] *::after {
  box-sizing: border-box;
}

/* App shell — clone of /share's flex layout */
body[data-active-section="gestion"] .app.gestion-app {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

/* Sidebar — identical to share */
body[data-active-section="gestion"] .sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100dvh;
  overflow-y: auto;
  z-index: 50;
}
body[data-active-section="gestion"] .sb-header {
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  height: 52px;
  box-sizing: border-box;
}
body[data-active-section="gestion"] .sb-header img {
  height: 26px;
  width: auto;
  object-fit: contain;
  object-position: left center;
  display: block;
}
body[data-active-section="gestion"] .sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
body[data-active-section="gestion"] .sb-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  margin: 1px 8px;
  cursor: pointer;
  color: var(--muted);
  border-radius: var(--wb-radius-md);
  font-size: var(--wb-text-base);
  font-weight: 500;
  transition: all .15s ease;
  text-decoration: none;
}
body[data-active-section="gestion"] .sb-item:hover {
  background: var(--surface2);
  color: var(--text);
}
body[data-active-section="gestion"] .sb-item.active {
  background: var(--accent-bg);
  color: var(--accent);
}
body[data-active-section="gestion"] .sb-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .7;
}
body[data-active-section="gestion"] .sb-item.active svg { opacity: 1; }

body[data-active-section="gestion"] .sb-user {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background .15s ease;
  position: relative;
}
body[data-active-section="gestion"] .sb-user:hover { background: var(--surface2); }
body[data-active-section="gestion"] .sb-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--wb-radius-lg);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: var(--wb-text-sm);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
body[data-active-section="gestion"] .sb-user-info { flex: 1; min-width: 0; }
body[data-active-section="gestion"] .sb-user-info .name {
  font-weight: 600;
  font-size: var(--wb-text-base);
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-active-section="gestion"] .sb-user-info .role {
  font-size: var(--wb-text-xs);
  color: var(--muted);
}
body[data-active-section="gestion"] .sb-user-menu {
  position: absolute;
  bottom: 54px;
  left: 12px;
  right: 12px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: none;
  z-index: 310;
  overflow: hidden;
}
body[data-active-section="gestion"] .sb-user-menu.open { display: block; }
body[data-active-section="gestion"] .sb-user-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  color: var(--text2);
  font-size: var(--wb-text-base);
  cursor: pointer;
  transition: background .15s ease;
  text-decoration: none;
}
body[data-active-section="gestion"] .sb-user-menu a:hover { background: var(--surface3); }

/* Main / topbar / content — alineado con /app/ exacto */
body[data-active-section="gestion"] .gestion-app .main {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body[data-active-section="gestion"] .gestion-app .topbar {
  padding: 18px 24px 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  box-sizing: border-box;
}
body[data-active-section="gestion"] .gestion-app .topbar-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  font-family: 'Geist', 'Inter Tight', system-ui, sans-serif;
  letter-spacing: -0.01em;
}
body[data-active-section="gestion"] .gestion-app .topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
body[data-active-section="gestion"] .gestion-app .content {
  flex: 1;
  overflow-y: auto;
  padding: 6px 24px 20px;
}

/* Buttons → wb-components.css */

/* Status badges — extiende .tag base (de wb-components.css) con dot + colores semánticos */
.tag.lead-status {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  gap: 6px;
}
.tag.lead-status:before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.tag.lead-status.sin_contactar:before { background: var(--dim); }
.tag.lead-status.contactado:before { background: var(--text2); }
.tag.lead-status.negociacion:before { background: var(--accent); }
.tag.lead-status.presupuesto_enviado { border-color: var(--accent-border); }
.tag.lead-status.presupuesto_enviado:before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.tag.lead-status.cliente_activo { border-color: var(--green-bg); color: var(--green); }
.tag.lead-status.cliente_activo:before { background: var(--green); }
.tag.lead-status.descartado { border-color: var(--red-bg); color: var(--red); }
.tag.lead-status.descartado:before { background: var(--red); }

/* Priority — extiende .tag base + radius pill + lowercase + variants */
.tag.lead-priority {
  border-radius: var(--wb-radius-pill);
  border: 1px solid var(--border);
  color: var(--muted);
  text-transform: lowercase;
  padding: 3px 12px;
}
.tag.lead-priority.alta { color: var(--red); border-color: var(--red); }
.tag.lead-priority.media { color: var(--text2); }
.tag.lead-priority.baja { color: var(--dim); }

/* .stats / .stat / .stat-icon / .stat-val / .stat-label / .stat.clickable / .card → wb-components.css */

/* Pipeline + Actividad en 2 columnas (specific de gestion) */
body[data-active-section="gestion"] .gestion-dash-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 1100px) {
  body[data-active-section="gestion"] .gestion-dash-cols {
    grid-template-columns: 1fr;
  }
}
.gestion-dash-funnel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gestion-dash-funnel .row {
  display: grid;
  grid-template-columns: 170px 1fr 40px;
  align-items: center;
  gap: 12px;
}
.gestion-dash-funnel .bar {
  height: 8px;
  background: var(--surface2);
  border-radius: var(--wb-radius-sm);
  overflow: hidden;
}
.gestion-dash-funnel .bar > div {
  height: 100%;
  transition: width .3s;
  background: var(--accent);
  border-radius: var(--wb-radius-sm);
}
.gestion-dash-funnel .row strong {
  text-align: right;
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Listado — radius lg para alineamiento con .card de /app/ */
.lead-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--wb-text-base);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.lead-table th, .lead-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.lead-table th {
  font-size: var(--wb-text-xs);
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--surface2);
}
.lead-table tr {
  cursor: pointer;
  transition: background .12s;
}
.lead-table tbody tr:hover { background: var(--surface2); }
.lead-table tbody tr:last-child td { border-bottom: 0; }
.lead-table .lead-tags {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* Tag chip — extiende .tag base con dot lateral + variante tinted */
.tag.lead-tag-chip {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 3px 10px 3px 16px;
  position: relative;
}
.tag.lead-tag-chip:before {
  content: '';
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tag-color, var(--accent));
}
/* Variante tinted: fondo tintado sutil + borde tintado, texto siempre legible */
.tag.lead-tag-chip.tinted {
  background: color-mix(in srgb, var(--tag-color, var(--accent)) 14%, var(--surface2));
  color: var(--text);
  border-color: color-mix(in srgb, var(--tag-color, var(--accent)) 35%, var(--border));
}
[data-theme="light"] .tag.lead-tag-chip.tinted {
  background: color-mix(in srgb, var(--tag-color, var(--accent)) 12%, #ffffff);
  border-color: color-mix(in srgb, var(--tag-color, var(--accent)) 28%, var(--border));
}

/* Toolbar */
.gestion-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.gestion-toolbar input.search,
.gestion-toolbar select,
.gestion-toolbar input[type="text"],
.gestion-toolbar input[type="date"],
.gestion-toolbar input[type="email"] {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--wb-radius-lg);
  background: var(--surface2);
  color: var(--text);
  font-size: var(--wb-text-base);
  font-family: inherit;
}
.gestion-toolbar input.search { flex: 1; min-width: 220px; }
.gestion-toolbar input:focus,
.gestion-toolbar select:focus { outline: none; border-color: var(--accent); }

/* Chips para filtros activos no representados en selects (stale, followups) */
.gestion-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 10px;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: var(--wb-radius-pill);
  font-size: var(--wb-text-sm);
  font-weight: 500;
}
.active-filter-chip button {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font-size: var(--wb-text-md);
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--wb-radius-pill);
  font-weight: 700;
}
.active-filter-chip button:hover { background: rgba(0,0,0,.08); }

/* Kanban */
.gestion-kanban {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  align-items: start;
  overflow-x: auto;
}
.kanban-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  min-height: 320px;
}
.kanban-col h3 {
  font-size: var(--wb-text-xs);
  font-weight: 400;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Cossette Titre', sans-serif;
}
.kanban-col h3 .count {
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: var(--wb-radius-xl);
  font-size: var(--wb-text-xs);
  color: var(--text);
  font-weight: 700;
  font-family: 'Geist','Inter Tight', sans-serif;
  letter-spacing: 0;
}
.kanban-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  font-size: var(--wb-text-sm);
  color: var(--text);
  transition: all .15s ease;
}
.kanban-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.kanban-card:hover { background: var(--surface3); border-color: var(--border2); }
.kanban-card.dragging { opacity: 0.4; }
.kanban-col.drag-over { border-color: var(--accent); background: var(--surface); }

/* Drawer (lead ficha) */
.lead-drawer {
  position: fixed;
  top: 52px;
  right: 0;
  bottom: 0;
  width: min(640px, 100vw);
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--glass-border);
  z-index: 200;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .25s;
  box-shadow: var(--glass-shadow);
}
.lead-drawer[hidden] { display: none; }
.lead-drawer.open { transform: translateX(0); }
.lead-drawer-head {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
  z-index: 2;
}
.lead-drawer-head h2 {
  margin: 0 0 4px;
  font-size: var(--wb-text-lg);
  font-weight: 400;
  color: var(--white);
  font-family: 'Cossette Titre', sans-serif;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.lead-drawer-head .meta {
  font-size: var(--wb-text-sm);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lead-drawer-head .close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: var(--wb-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lead-drawer-head .close:hover { background: var(--surface2); color: var(--text); }
.lead-drawer-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0 24px;
  overflow-x: auto;
}
.lead-drawer-tabs .tab {
  background: none;
  border: 0;
  padding: 12px 14px;
  color: var(--muted);
  cursor: pointer;
  font-size: var(--wb-text-sm);
  font-weight: 600;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-family: inherit;
}
.lead-drawer-tabs .tab:hover { color: var(--text); }
.lead-drawer-tabs .tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.lead-drawer-body { padding: 18px 24px; }
.field-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.field-row label {
  font-size: var(--wb-text-sm);
  color: var(--muted);
  font-weight: 500;
}
.field-row input,
.field-row select,
.field-row textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--wb-radius-lg);
  background: var(--surface2);
  color: var(--text);
  font-size: var(--wb-text-base);
  font-family: inherit;
  width: 100%;
}
.field-row textarea { min-height: 80px; resize: vertical; }
.field-row input:focus,
.field-row select:focus,
.field-row textarea:focus { outline: none; border-color: var(--accent); }

/* Activity timeline */
.activity-item {
  border-left: 1px solid var(--border);
  padding: 8px 0 8px 14px;
  margin-left: 4px;
  font-size: var(--wb-text-sm);
  position: relative;
}
.activity-item:before {
  content: '';
  position: absolute;
  left: -4px;
  top: 12px;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--surface);
}
.activity-item .who { font-weight: 600; color: var(--text); }
.activity-item .when { color: var(--muted); margin-left: 6px; font-size: var(--wb-text-xs); }
.activity-item .body { margin-top: 4px; color: var(--text2); }

/* Modal */
.lead-modal-bg {
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9000;
}
.lead-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--wb-radius-2xl);
  padding: 24px;
  width: min(560px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  z-index: 9001;
  box-shadow: var(--glass-shadow);
}
.lead-modal h2 {
  margin: 0 0 16px;
  font-size: var(--wb-text-lg);
  font-weight: 400;
  color: var(--white);
  font-family: 'Cossette Titre', sans-serif;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.lead-modal .footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

/* .spinner / .loading-block → wb-components.css */

/* Mobile — alineado con /app/ exacto */
@media (max-width: 768px) {
  body[data-active-section="gestion"] .gestion-app .main { margin-left: 0; }
  body[data-active-section="gestion"] .sidebar {
    position: fixed;
    left: 0; top: 48px; bottom: 0;
    height: auto;
    z-index: 70;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--shadow);
  }
  body[data-active-section="gestion"] .sidebar.open { transform: translateX(0); }
  body[data-active-section="gestion"] .sb-header { display: none; }
  body[data-active-section="gestion"] .sb-item { min-height: 44px; padding: 11px 16px; }
  body[data-active-section="gestion"] .gestion-app .topbar { display: none; }
  body[data-active-section="gestion"] .sb-user-menu {
    position: fixed;
    left: 12px; right: 12px; bottom: 60px; top: auto;
    z-index: 310;
  }
  /* Kanban: columnas a ancho legible (~85vw) para que el usuario vea la
     columna activa y un atisbo de la siguiente. Antes 280px desbordaba en
     iPhone (5*280=1400 con vw=390). */
  .gestion-kanban { grid-template-columns: repeat(5, 85vw); }
  .lead-drawer { width: 100vw; }
  .gestion-toolbar { flex-wrap: wrap; }
  .gestion-toolbar input.search { min-width: 0; flex: 1 1 100%; }
  .gestion-toolbar select { flex: 1 1 calc(50% - 5px); min-width: 0; }
  /* Top actions: que envuelvan en mobile. El shell expone padding del topbar,
     scopeamos solo el contenedor propio de la sección. */
  body[data-active-section="gestion"] #gestionActions { flex-wrap: wrap; gap: 6px; }
  body[data-active-section="gestion"] #gestionActions .btn { padding: 6px 10px; font-size: 12px; min-height: 40px; }
  /* Footer del modal: botones touch-friendly en mobile */
  body[data-active-section="gestion"] .lead-modal .footer .btn { min-height: 44px; padding: 10px 16px; }
  /* Drawer ocupa pantalla completa pero debajo del header del shell */
  body[data-active-section="gestion"] .lead-drawer { top: 48px; }
}

/* ───── Chart de evolución (dashboard) ───── */
.seg { display:inline-flex; background:var(--surface2); border:1px solid var(--border); border-radius:var(--wb-radius-lg); overflow:hidden; }
.seg button { background:transparent; color:var(--text2); border:0; padding:6px 12px; cursor:pointer; font-size:var(--wb-text-sm); font-weight:600; display:inline-flex; align-items:center; gap:6px; border-right:1px solid var(--border); font-family:inherit; min-height: 44px; }
.seg button:last-child { border-right:0; }
.seg button.on { background:var(--accent-bg); color:var(--accent); }
.seg button:hover { color:var(--text); }
/* ──────────────────────────────────────────────────────────────
   Tarjeta "Evolución de leads"
   Padding y tipografía alineados con .gestion-dash-cols .card.
   ────────────────────────────────────────────────────────────── */
#gestionEvolutionCard { padding:18px 20px; }
.evo-header { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
.evo-controls { display:flex; gap:8px; align-items:center; }

/* ── Chart de barras (HTML+CSS, no SVG) ── */
.evo-chart-bars { padding:0; }
.evo-plot {
  display:grid;
  grid-template-columns: 28px 1fr;
  height:180px;
  position:relative;
  padding:6px 0 22px;       /* hueco arriba para los totales y abajo para labels X */
}
.evo-y-axis { position:relative; height:100%; }
.evo-tick { position:absolute; left:0; right:0; height:0; display:flex; align-items:center; }
.evo-tick-num { width:24px; text-align:right; font-size:var(--wb-text-xs); color:var(--muted); font-variant-numeric:tabular-nums; padding-right:6px; }
.evo-tick-line { position:absolute; left:28px; right:0; height:1px; background:repeating-linear-gradient(to right, var(--border) 0 2px, transparent 2px 6px); }
.evo-tick-line.base { background:var(--border); }
.evo-cols {
  display:flex; align-items:flex-end; gap:14px;
  padding:0 4px;
  position:relative;
}
.evo-col { flex:1; min-width:0; max-width:96px; display:flex; flex-direction:column; align-items:center; gap:6px; }
.evo-bar-wrap {
  width:100%; max-width:56px;
  height:152px;             /* coincide con plot height - padding label */
  display:flex; align-items:flex-end; justify-content:center;
}
.evo-bar {
  width:100%; min-width:18px;
  background:var(--surface2); border-radius:5px 5px 2px 2px;
  position:relative;
  transition:opacity .15s ease;
}
.evo-bar:hover { opacity:.86; }
.evo-bar-stack {
  position:absolute; inset:0;
  display:flex; flex-direction:column-reverse;
  border-radius:inherit; overflow:hidden;
}
.evo-seg { width:100%; transition:opacity .15s ease; }
.evo-bar-total {
  position:absolute; left:50%; top:-18px; transform:translateX(-50%);
  font-size:var(--wb-text-xs); font-weight:700; color:var(--text);
  font-variant-numeric:tabular-nums; pointer-events:none;
}
.evo-x { font-size:var(--wb-text-xs); color:var(--muted); font-weight:600; text-align:center; }

/* ── Chart de tarta ── */
.evo-chart-pie {
  display:grid;
  grid-template-columns: 180px 1fr;
  align-items:center;
  gap:24px;
  padding:6px 0;
  min-height:180px;
}
.evo-pie-svg { width:180px; height:180px; flex-shrink:0; }
.evo-chart-pie svg path { transition:transform .15s ease; transform-origin:80px 80px; }
.evo-chart-pie svg path:hover { transform:scale(1.03); }

/* ── Leyenda ── */
.evo-legend {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(160px, 1fr));
  gap:6px 18px;
  padding:14px 4px 0;
  margin-top:12px;
  border-top:1px dashed var(--border);
}
.evo-legend-item { display:inline-flex; align-items:center; gap:8px; font-size:var(--wb-text-base); color:var(--text2); }
.evo-legend-item .dot { width:10px; height:10px; border-radius:var(--wb-radius-sm); flex-shrink:0; }
.evo-legend-val { color:var(--muted); margin-left:auto; font-variant-numeric:tabular-nums; font-weight:600; font-size:var(--wb-text-sm); }

/* En el modo tarta la leyenda va al lado del donut, no debajo: sin border-top y ocupa la 2ª columna del grid */
.evo-chart-pie .evo-legend {
  border-top:0; margin-top:0; padding:0;
  grid-template-columns:1fr;
  gap:6px 0;
  align-self:center;
}

/* ── Mobile: header en una sola fila + iconos sin texto en "Barras/Tarta" ── */
@media (max-width: 560px) {
  #gestionEvolutionCard { padding:14px 14px; }
  .evo-header { gap:8px; }
  .evo-controls { gap:6px; }
  .evo-seg-type .evo-seg-label { display:none; }
  .evo-seg-type button { min-width:36px; padding:8px 10px; }
  .evo-chart-pie { grid-template-columns:1fr; justify-items:center; gap:14px; }
  .evo-chart-pie .evo-legend { grid-template-columns:repeat(2, 1fr); width:100%; max-width:340px; }
  .evo-plot { height:160px; padding-bottom:20px; }
  .evo-bar-wrap { height:138px; }
  .evo-col { gap:4px; }
}

/* Section content entrance: cada cambio de innerHTML anima los hijos directos */
body[data-active-section="gestion"] #gestionContent > * {
  animation: wb-fade-in-up var(--motion-medium) var(--ease-out) backwards;
}
