/* ==========================================================================
   SGEA-CFU (sistema visual compartido con el CRM de Rematrícula) — Panel general
   Paleta: morado vívido, blanco y grises. Sin librerías externas.
   ========================================================================== */

/* ---------- 1. Variables de diseño ---------- */
:root {
  /* Marca */
  --purple-50:  #f5f3ff;
  --purple-100: #ede9fe;
  --purple-200: #ddd6fe;
  --purple-300: #c4b5fd;
  --purple-400: #a78bfa;
  --purple-500: #8b5cf6;
  --purple-600: #7c3aed;   /* morado vívido principal */
  --purple-700: #6d28d9;
  --purple-900: #2e1065;

  /* Grises */
  --gray-25:  #fcfcfd;
  --gray-50:  #f7f7fa;
  --gray-100: #eff0f4;
  --gray-200: #e3e5eb;
  --gray-300: #cfd2db;
  --gray-400: #9aa0ae;
  --gray-500: #6b7180;
  --gray-600: #4b5160;
  --gray-700: #343946;
  --gray-900: #151821;

  /* Semánticos */
  --green-50:  #ecfdf5;  --green-600: #059669;
  --amber-50:  #fffbeb;  --amber-600: #d97706;
  --rose-50:   #fff1f2;  --rose-500:  #f43f5e;  --rose-600: #e11d48;
  --blue-50:   #eff6ff;  --blue-600:  #2563eb;

  /* Superficies */
  --bg: var(--gray-50);
  --surface: #ffffff;
  --border: var(--gray-200);
  --text: var(--gray-900);
  --text-muted: var(--gray-500);

  /* Medidas */
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 68px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(21, 24, 33, .05);
  --shadow: 0 1px 3px rgba(21, 24, 33, .06), 0 4px 16px rgba(21, 24, 33, .04);
  --shadow-lg: 0 12px 32px rgba(21, 24, 33, .12);

  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --transition: .2s ease;
}

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

html { -webkit-text-size-adjust: 100%; }

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

h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--purple-500);
  outline-offset: 2px;
  border-radius: 6px;
}

.sprite { display: none; }

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--gray-600);
  transition: background var(--transition), color var(--transition);
}
.icon-btn:hover { background: var(--gray-100); color: var(--gray-900); }

/* ---------- 3. Estructura general ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns var(--transition);
}

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

/* ---------- 4. Barra lateral ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 40;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 22px;
}

.sidebar__logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
  box-shadow: 0 6px 16px rgba(124, 58, 237, .35);
  flex-shrink: 0;
}

.sidebar__title {
  font-size: 15px;
  color: var(--gray-700);
  white-space: nowrap;
}
.sidebar__title strong { color: var(--gray-900); }

.sidebar__close { display: none; margin-left: auto; }

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar__section {
  padding: 16px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gray-400);
  white-space: nowrap;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 500;
  color: var(--gray-600);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: var(--gray-50); color: var(--gray-900); }

.nav-link.is-active {
  color: var(--purple-700);
  background: var(--purple-50);
}
.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--purple-600);
}

.nav-link__badge {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: #fff;
  background: var(--purple-600);
}

.sidebar__collapse {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--gray-25);
  color: var(--gray-500);
  font-size: 13px;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.sidebar__collapse:hover { background: var(--gray-100); color: var(--gray-900); }
.sidebar__collapse .icon { transition: transform var(--transition); }

/* Estado contraído (tablet o botón "Contraer menú") */
.app.is-collapsed { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }
.app.is-collapsed .sidebar__title,
.app.is-collapsed .sidebar__section,
.app.is-collapsed .nav-link span,
.app.is-collapsed .sidebar__collapse span { display: none; }
.app.is-collapsed .sidebar__brand { justify-content: center; padding-inline: 0; }
.app.is-collapsed .nav-link,
.app.is-collapsed .sidebar__collapse { justify-content: center; padding-inline: 0; }
.app.is-collapsed .nav-link__badge {
  position: absolute;
  top: 3px;
  right: 8px;
  min-width: 0;
  width: 8px;
  height: 8px;
  padding: 0;
  font-size: 0;
}
.app.is-collapsed .sidebar__collapse .icon { transform: rotate(180deg); }

/* ---------- 5. Barra superior ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 28px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar__menu { display: none; }

.search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 460px;
}
.search__icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--gray-400);
  pointer-events: none;
}
.search__input {
  width: 100%;
  height: 42px;
  padding: 0 44px 0 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--gray-50);
  font: inherit;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.search__input::placeholder { color: var(--gray-400); }
.search__input:focus {
  outline: none;
  background: #fff;
  border-color: var(--purple-400);
  box-shadow: 0 0 0 4px var(--purple-100);
}
.search__kbd {
  position: absolute;
  right: 10px;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 11px;
  color: var(--gray-500);
  background: #fff;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.period {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 4px 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.period__label { font-size: 12px; color: var(--text-muted); }
.period__select {
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--gray-900);
  cursor: pointer;
}
.period__select:focus { outline: none; }

.notif { position: relative; }
.notif-wrap { position: relative; }
.notif__panel { width: 340px; max-width: calc(100vw - 32px); max-height: min(70vh, 480px); overflow-y: auto; }
.notif__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px 8px; }
.notif__empty { padding: 14px 10px; color: var(--gray-500); font-size: .875rem; }
.profile__menu a.notif__item { flex-direction: column; align-items: flex-start; gap: 2px; font-size: .875rem; }
.notif__item small { color: var(--gray-500); font-size: .75rem; }
.notif__item.is-unread { background: var(--gray-50); font-weight: 600; }
.notif__dot {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--rose-500);
}

.profile { position: relative; }
.profile__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  transition: background var(--transition);
}
.profile__btn:hover,
.profile__btn[aria-expanded="true"] { background: var(--gray-100); }

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--purple-400), var(--purple-700));
}
.profile__info { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.profile__name { font-weight: 600; font-size: 13px; }
.profile__role { font-size: 12px; color: var(--text-muted); }
.profile__chevron { width: 16px; height: 16px; color: var(--gray-400); }

.profile__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-lg);
}
.profile__menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--gray-700);
}
.profile__menu a:hover { background: var(--gray-50); }
.profile__menu .icon { width: 18px; height: 18px; color: var(--gray-400); }
.profile__menu hr { margin: 6px 0; border: 0; border-top: 1px solid var(--border); }
.profile__menu .is-danger,
.profile__menu .is-danger .icon { color: var(--rose-600); }

/* ---------- 6. Contenido ---------- */
.content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head__title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.page-head__subtitle { margin-top: 4px; color: var(--text-muted); }
.page-head__subtitle strong { color: var(--gray-700); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.pill--sample {
  color: var(--purple-700);
  background: var(--purple-50);
  border: 1px dashed var(--purple-300);
}

/* Tarjeta genérica */
.card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.card__title { font-size: 16px; font-weight: 650; }
.card__subtitle { margin-top: 2px; font-size: 13px; color: var(--text-muted); }

.link {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple-600);
}
.link:hover { color: var(--purple-700); text-decoration: underline; }

/* ---------- 7. Tarjetas de indicadores ---------- */
/* 7 tarjetas sin huecos:
   - Escritorio: grilla de 12 columnas → 4 tarjetas arriba y 3 abajo.
   - Tablet: 3 columnas y la tarjeta destacada ocupa una fila completa (3 + 1 + 3).
   - Celular: 2 columnas y la destacada ocupa una fila completa (2 + 1 + 2 + 2).
   - Pantallas muy pequeñas: 1 columna. */
.kpis {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: 16px;
}
.kpis > .kpi { grid-column: span 3; }
.kpis > .kpi:nth-child(n + 5) { grid-column: span 4; }

.kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* Tarjeta destacada: la tasa de confirmación (la que mide la meta) */
.kpi--featured {
  color: #fff;
  border-color: transparent;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .18), transparent 45%),
    linear-gradient(140deg, var(--purple-500) 0%, var(--purple-700) 100%);
  box-shadow: 0 10px 28px rgba(124, 58, 237, .32);
}

.kpi__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kpi__label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.kpi--featured .kpi__label { color: rgba(255, 255, 255, .85); }

.kpi__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--purple-600);
  background: var(--purple-50);
}
.kpi--featured .kpi__icon { color: #fff; background: rgba(255, 255, 255, .18); }
.kpi--danger .kpi__icon { color: var(--rose-600); background: var(--rose-50); }
.kpi--neutral .kpi__icon { color: var(--gray-600); background: var(--gray-100); }

.kpi__value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}
.kpi--featured .kpi__foot { color: rgba(255, 255, 255, .85); }

.trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.trend .icon { width: 14px; height: 14px; stroke-width: 2.2; }
.trend--up { color: var(--green-600); background: var(--green-50); }
.trend--down { color: var(--rose-600); background: var(--rose-50); }
.trend--neutral { color: var(--gray-600); background: var(--gray-100); }
.kpi--featured .trend { color: #fff; background: rgba(255, 255, 255, .2); }

/* Barra de avance de la meta */
.goal { display: flex; flex-direction: column; gap: 6px; }
.goal__bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  overflow: hidden;
}
.goal__fill {
  height: 100%;
  border-radius: inherit;
  background: #fff;
  transition: width 1s ease;
}
.goal__text { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; font-size: 12px; }

/* ---------- 8. Gráfico + actividades ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--gray-100);
  flex-shrink: 0;
}
.segmented__btn {
  padding: 6px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.segmented__btn.is-active {
  color: var(--purple-700);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-700);
  transition: opacity var(--transition), background var(--transition);
}
.legend__item:hover { background: var(--gray-50); }
.legend__item[aria-pressed="false"] { opacity: .45; }
.legend__swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.legend__swatch--dashed {
  height: 0;
  width: 14px;
  border-radius: 0;
  border-top: 2px dashed;
}

.chart {
  position: relative;
  width: 100%;
}
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }

.chart__grid line { stroke: var(--gray-100); }
.chart__axis text { fill: var(--gray-400); font-size: 11px; font-family: var(--font); }
.chart__goal line { stroke: var(--purple-300); stroke-dasharray: 5 5; }
.chart__goal text { fill: var(--purple-600); font-size: 11px; font-weight: 600; font-family: var(--font); }
.chart__series path { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: opacity var(--transition); }
.chart__series circle { stroke: #fff; stroke-width: 2; }
.chart__area { transition: opacity var(--transition); }
.chart__hover-line { stroke: var(--gray-300); stroke-dasharray: 3 3; }
.chart__hit { fill: transparent; cursor: crosshair; }

.chart__tooltip {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 170px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--gray-900);
  color: #fff;
  font-size: 12px;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  z-index: 2;
}
.chart__tooltip strong { display: block; margin-bottom: 6px; font-size: 12px; }
.chart__tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.chart__tooltip-row span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--gray-300); }
.chart__tooltip-row i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* Actividades */
.activity {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
.activity__item {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
}
.activity__item + .activity__item { border-top: 1px solid var(--gray-100); }

.activity__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--purple-600);
  background: var(--purple-50);
}
.activity__icon .icon { width: 18px; height: 18px; }
.activity__icon--warn { color: var(--amber-600); background: var(--amber-50); }
.activity__icon--ok { color: var(--green-600); background: var(--green-50); }
.activity__icon--muted { color: var(--gray-600); background: var(--gray-100); }

.activity__title { font-weight: 600; font-size: 13px; }
.activity__detail { margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.activity__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 11px;
  color: var(--gray-400);
}

/* Etiquetas de contacto */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.tag .icon { width: 12px; height: 12px; stroke-width: 2.6; }
.tag--ok { color: var(--green-600); background: var(--green-50); }
.tag--fail { color: var(--rose-600); background: var(--rose-50); }
.tag--warn { color: #b45309; background: #fef3c7; }

/* ---------- 9. Tabla ---------- */
.table-wrap {
  margin: 0 -22px -22px;
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
.table th {
  padding: 11px 22px;
  border-block: 1px solid var(--border);
  background: var(--gray-25);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  color: var(--gray-500);
}
.table td {
  padding: 13px 22px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--purple-50); }
.table tbody tr:last-child td { border-bottom: 0; }

.student {
  display: flex;
  align-items: center;
  gap: 12px;
}
.student__avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: var(--purple-700);
  background: var(--purple-100);
  flex-shrink: 0;
}
.student__name { font-weight: 600; color: var(--gray-900); }
.student__code { font-size: 12px; color: var(--text-muted); }

/* Etapas de gestión (nombres exactos del pipeline) */
.stage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}
.stage::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.stage--pendiente   { color: var(--gray-600);   background: var(--gray-100); }
.stage--validada    { color: var(--purple-700); background: var(--purple-100); }
.stage--observada   { color: var(--amber-600);  background: var(--amber-50); }
.stage--cambio      { color: var(--blue-600);   background: var(--blue-50); }
.stage--confirma    { color: var(--green-600);  background: var(--green-50); }
.stage--conf-edit   { color: #0f766e;            background: #ccfbf1; }
.stage--no-remat    { color: var(--rose-600);   background: var(--rose-50); }
.stage--egresado    { color: var(--gray-500);   background: var(--gray-100); }

.remat {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  border-radius: 50%;
  color: #fff;
  background: var(--green-600);
  vertical-align: middle;
}
.remat .icon { width: 12px; height: 12px; stroke-width: 3; }

.contact-attempts { display: inline-flex; align-items: center; gap: 6px; }
.contact-attempts__dots { display: inline-flex; gap: 3px; }
.contact-attempts__dots i {
  width: 6px;
  height: 14px;
  border-radius: 2px;
  background: var(--gray-200);
}
.contact-attempts__dots i.is-fail { background: var(--rose-500); }
.contact-attempts--ok .contact-attempts__dots i { background: var(--green-600); }

.empty {
  padding: 28px 22px;
  text-align: center;
  color: var(--text-muted);
}

/* ---------- 10. Menú de celular ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(21, 24, 33, .45);
}

.bottom-nav { display: none; }

/* ---------- 11. Responsive ---------- */

/* Pantallas medianas: gráfico y actividades uno debajo del otro */
@media (max-width: 1279px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* Tablet: menú lateral contraído (solo íconos) */
@media (max-width: 1099px) {
  .app { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }
  .app .sidebar__title,
  .app .sidebar__section,
  .app .nav-link span,
  .app .sidebar__collapse { display: none; }
  .app .sidebar__brand { justify-content: center; padding-inline: 0; }
  .app .nav-link { justify-content: center; padding-inline: 0; }
  .app .nav-link__badge {
    position: absolute; top: 3px; right: 8px;
    min-width: 0; width: 8px; height: 8px; padding: 0; font-size: 0;
  }
  .profile__info { display: none; }

  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis > .kpi,
  .kpis > .kpi:nth-child(n + 5) { grid-column: auto; }
  .kpis > .kpi--featured { grid-column: 1 / -1; }
}

/* Celular: menú deslizable + barra inferior */
@media (max-width: 767px) {
  .app,
  .app.is-collapsed { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .app.is-menu-open .sidebar { transform: translateX(0); }

  /* Dentro del menú deslizable se muestran los textos completos */
  .app .sidebar__title,
  .app .sidebar__section,
  .app .nav-link span { display: initial; }
  .app .sidebar__brand { justify-content: flex-start; padding-inline: 8px; }
  .app .nav-link { justify-content: flex-start; padding-inline: 12px; }
  .app .nav-link__badge {
    position: static; width: auto; height: auto; min-width: 22px;
    padding: 1px 7px; font-size: 11px;
  }
  .sidebar__close { display: inline-grid; }

  .topbar { gap: 8px; padding: 0 16px; }
  .topbar__menu { display: inline-grid; }
  .search__kbd,
  .period__label { display: none; }
  .period { padding-left: 8px; }

  .content { gap: 16px; padding: 20px 16px 96px; }
  .page-head__title { font-size: 20px; }

  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpis > .kpi--featured { grid-column: 1 / -1; }
  .kpi { padding: 16px; }
  .kpi__value { font-size: 24px; }

  .card { padding: 16px; }
  .card__head { flex-wrap: wrap; }
  .table-wrap { margin: 0 -16px -16px; }
  .table th, .table td { padding-inline: 16px; }
  .col-optional { display: none; }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--border);
  }
  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--gray-500);
  }
  .bottom-nav a.is-active { color: var(--purple-600); background: var(--purple-50); }
}

@media (max-width: 420px) {
  .period { display: none; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpis > .kpi { grid-column: auto; }
}

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

/* ==========================================================================
   Inicio con los datos compartidos (Mi panel / Panel general)
   ========================================================================== */
.kpi--link { cursor: pointer; }
.kpi--link:focus-visible { outline: 2px solid var(--purple-500); outline-offset: 2px; }

/* "Para gestionar": tarjetas de alertas y pendientes */
/* El número de columnas depende del ancho de la tarjeta (consulta de contenedor) */
.worklist-wrap { container-type: inline-size; }
.worklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@container (min-width: 640px) { .worklist { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.work-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--gray-25);
}
.work-tile__head { display: flex; align-items: center; justify-content: space-between; }
.work-tile__icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--gray-500); background: var(--gray-100); }
.work-tile__icon .icon { width: 16px; height: 16px; }
.work-tile__n { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gray-400); }
.work-tile__title { font-size: 13px; font-weight: 650; line-height: 1.3; }
.work-tile__note { font-size: 12px; }
.work-tile__empty { font-size: 12px; color: var(--gray-400); }
.work-tile__list { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 0; padding: 0; list-style: none; font-size: 12px; }
.work-tile__list li { display: flex; flex-direction: column; min-width: 0; }
.work-tile__list a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gray-900); font-weight: 600; }
.work-tile__list a:hover { color: var(--purple-700); text-decoration: underline; }
.work-tile__list .muted { font-size: 11px; }
.work-tile__more {
  align-self: flex-start;
  margin-top: auto;
  padding: 4px 0 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--purple-700);
  cursor: pointer;
}
.work-tile__more:hover { text-decoration: underline; }
.work-tile--info, .work-tile--warn, .work-tile--danger, .work-tile--ok { background: #fff; }
.work-tile--info .work-tile__n { color: var(--purple-700); }
.work-tile--info .work-tile__icon { color: var(--purple-700); background: var(--purple-100); }
.work-tile--warn { border-color: #fde68a; }
.work-tile--warn .work-tile__n { color: var(--amber-600); }
.work-tile--warn .work-tile__icon { color: var(--amber-600); background: var(--amber-50); }
.work-tile--danger { border-color: #fecdd3; }
.work-tile--danger .work-tile__n { color: var(--rose-600); }
.work-tile--danger .work-tile__icon { color: var(--rose-600); background: var(--rose-50); }
.work-tile--ok .work-tile__n { color: var(--green-600); }
.work-tile--ok .work-tile__icon { color: var(--green-600); background: var(--green-50); }

/* Cartera por etapa (reutiliza .pbar de admin.css) */
.home-stages .pbar { grid-template-columns: 170px minmax(0, 1fr) 36px; }
.home-stages .stage { font-size: 10px; }

.activity__title a { color: inherit; }
.activity__title a:hover { color: var(--purple-700); text-decoration: underline; }
#periodNotice .notice { margin: 0; }




@media (max-width: 420px)  { .worklist { grid-template-columns: minmax(0, 1fr); } .home-stages .pbar { grid-template-columns: 130px minmax(0, 1fr) 30px; } }

/* Modo servidor: datos reales autorizados — no se muestra la etiqueta "Datos de ejemplo" */
.modo-servidor .pill--sample { display: none; }
