/* =================================================================
 * CRM-ANF · admin.css · v0.2
 * Estilo SaaS configurable vía tokens --crm-* inyectados desde Configuración.
 * ================================================================= */

/* Fallback de tokens si por alguna razón el bloque no se inyectó */
:root {
  --crm-primary-color:   #1d4ed8;
  --crm-primary-dark:    #1e3a8a;
  --crm-secondary-color: #6b7280;
  --crm-accent-color:    #d4af37;
  --crm-bg-color:        #f8fafc;
  --crm-card-bg:         #ffffff;
  --crm-text-color:      #0f172a;
  --crm-muted-text:      #64748b;
  --crm-success-color:   #047857;
  --crm-warning-color:   #b45309;
  --crm-danger-color:    #b91c1c;
  --crm-client-color:    #1d4ed8;
  --crm-lost-color:      #94a3b8;
}

.crm-anf-app {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  color: var(--crm-text-color);
  background: transparent;
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
}
.crm-anf-app *, .crm-anf-app *::before, .crm-anf-app *::after { box-sizing: border-box; }
.crm-anf-app h1, .crm-anf-app h2, .crm-anf-app h3 { color: var(--crm-text-color); margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.crm-anf-app h1 { font-size: 24px; }
.crm-anf-app h2 { font-size: 17px; }
.crm-anf-app p { margin: 0; }
.crm-anf-app a { color: var(--crm-primary-color); text-decoration: none; }
.crm-anf-app a:hover { text-decoration: underline; }
.crm-anf-app code { background: #f1f5f9; padding: 1px 5px; border-radius: 3px; font-size: 12px; font-family: ui-monospace, "Cascadia Code", Menlo, monospace; }

.crm-anf-eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--crm-muted-text); font-weight: 700; margin: 0; }
.crm-anf-sub-title { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--crm-muted-text); margin: 18px 0 8px; }
.crm-anf-sec-title { font-size: 15px; font-weight: 700; color: var(--crm-primary-dark); margin: 0 0 14px; padding-bottom: 8px; border-bottom: 2px solid #e2e8f0; }
.muted { color: var(--crm-muted-text); }

/* ---- Sidebar fija ---- */
.crm-anf-sidebar {
  background: linear-gradient(180deg, var(--crm-primary-dark), var(--crm-primary-color) 70%);
  color: #fff;
  border-radius: 14px;
  padding: 22px 18px;
  height: max-content;
  position: sticky;
  top: 50px;
  box-shadow: 0 8px 28px rgba(15,39,71,0.18);
}
.crm-anf-sidebar-header { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,0.18); }
.crm-anf-sidebar-eyebrow {
  display: block; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--crm-accent-color); font-weight: 700; margin-bottom: 4px;
}
.crm-anf-sidebar h3 { color: #fff; font-size: 18px; margin: 0; }
.crm-anf-sidebar-tag { margin: 6px 0 0; font-size: 12px; color: rgba(255,255,255,0.75); font-weight: 600; }
.crm-anf-sidebar-section { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.65); margin: 0 0 8px; font-weight: 700; }
.crm-anf-sidebar-block { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.12); }
.crm-anf-sidebar-block:last-child { border-bottom: none; }
.crm-anf-sidebar-kpi { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 5px 0; }
.crm-anf-sidebar-kpi .crm-anf-k { font-size: 12px; color: rgba(255,255,255,0.78); }
.crm-anf-sidebar-kpi strong { color: #fff; font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 700; }
.crm-anf-sidebar-kpi.success strong { color: #6ee7b7; }
.crm-anf-sidebar-kpi.warning strong { color: #fcd34d; }
.crm-anf-sidebar-kpi.danger strong  { color: #fca5a5; }
.crm-anf-funnel-mini { display: flex; flex-direction: column; gap: 4px; }
.crm-anf-funnel-row {
  display: flex; justify-content: space-between; padding: 6px 10px;
  background: rgba(255,255,255,0.08); border-radius: 6px; font-size: 12.5px;
}
.crm-anf-funnel-row strong { color: #fff; font-weight: 700; }
.crm-anf-funnel-row.success strong { color: #6ee7b7; }
.crm-anf-funnel-row.warning strong { color: #fcd34d; }
.crm-anf-funnel-row.danger  strong { color: #fca5a5; }
.crm-anf-funnel-row.muted   strong { color: rgba(255,255,255,0.55); }

/* ---- Main / contenido principal ---- */
.crm-anf-main { min-width: 0; }
.crm-anf-main.full { grid-column: 1 / -1; }
.crm-anf-main-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.crm-anf-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Cards ---- */
.crm-anf-card {
  background: var(--crm-card-bg);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(15,39,71,0.04);
}
.crm-anf-card.stat {
  border-top: 3px solid var(--crm-primary-color);
  display: flex; flex-direction: column; gap: 6px;
}
.crm-anf-card.stat.warning  { border-top-color: var(--crm-warning-color); }
.crm-anf-card.stat.danger   { border-top-color: var(--crm-danger-color);  }
.crm-anf-card.stat.success  { border-top-color: var(--crm-success-color); }
.crm-anf-card.stat.accent   { border-top-color: var(--crm-accent-color);  }
.crm-anf-card.stat.info     { border-top-color: var(--crm-primary-color); }
.crm-anf-stat-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--crm-muted-text); font-weight: 700; }
.crm-anf-stat-value { font-size: 26px; font-weight: 800; color: var(--crm-primary-dark); font-variant-numeric: tabular-nums; line-height: 1.15; }
.crm-anf-card.stat.warning .crm-anf-stat-value { color: var(--crm-warning-color); }
.crm-anf-card.stat.danger  .crm-anf-stat-value { color: var(--crm-danger-color); }
.crm-anf-card.stat.success .crm-anf-stat-value { color: var(--crm-success-color); }
.crm-anf-stat-foot { font-size: 12px; color: var(--crm-muted-text); }
.crm-anf-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.crm-anf-card-head h2 { margin: 0; }

.crm-anf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

/* ---- Funnel visual ---- */
.crm-anf-funnel { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.crm-anf-funnel-bar-row {
  display: grid; grid-template-columns: 200px 1fr 60px; align-items: center; gap: 12px;
}
.crm-anf-funnel-label { font-size: 13px; color: var(--crm-text-color); font-weight: 600; }
.crm-anf-funnel-bar-track {
  height: 22px; background: #eef2ff; border-radius: 999px; overflow: hidden; position: relative;
}
.crm-anf-funnel-bar {
  height: 100%; background: linear-gradient(90deg, var(--crm-primary-color), var(--crm-primary-dark));
  border-radius: 999px; transition: width 0.3s ease;
}
.crm-anf-funnel-count { font-size: 13px; font-weight: 700; color: var(--crm-primary-dark); text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Alertas inteligentes ---- */
.crm-anf-alerts { display: flex; flex-direction: column; gap: 8px; }
.crm-anf-alert {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 14px; border-radius: 8px; border-left: 4px solid;
  background: #fff; font-size: 13.5px;
}
.crm-anf-alert-info    { background: #eff6ff; border-color: var(--crm-primary-color); color: var(--crm-primary-dark); }
.crm-anf-alert-warning { background: #fffbeb; border-color: var(--crm-warning-color); color: #92400e; }
.crm-anf-alert-danger  { background: #fef2f2; border-color: var(--crm-danger-color);  color: #991b1b; }
.crm-anf-alert-success { background: #ecfdf5; border-color: var(--crm-success-color); color: #065f46; }
.crm-anf-alert strong { font-weight: 700; }

/* ---- Tablas ---- */
.crm-anf-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.crm-anf-table thead th {
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--crm-muted-text);
  padding: 10px 8px; border-bottom: 2px solid #e2e8f0; background: #fbfdff;
}
.crm-anf-table tbody td { padding: 12px 8px; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }
.crm-anf-table tbody tr:hover { background: #f8fafc; }
.crm-anf-table-list tbody tr td:first-child { width: 28px; }

/* ---- Botones ---- */
.crm-anf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: 13.5px;
  padding: 9px 18px; min-height: 38px;
  border-radius: 999px; border: 1.5px solid #e2e8f0;
  background: #fff; color: var(--crm-text-color); cursor: pointer; text-decoration: none;
  transition: all 0.15s ease; line-height: 1;
}
.crm-anf-btn:hover { border-color: var(--crm-primary-color); color: var(--crm-primary-color); text-decoration: none; }
.crm-anf-btn.primary { background: var(--crm-primary-color); color: #fff; border-color: var(--crm-primary-color); }
.crm-anf-btn.primary:hover { background: var(--crm-primary-dark); border-color: var(--crm-primary-dark); color: #fff; }
.crm-anf-btn.accent { background: var(--crm-accent-color); color: var(--crm-primary-dark); border-color: var(--crm-accent-color); font-weight: 700; }
.crm-anf-btn.accent:hover { filter: brightness(0.94); color: var(--crm-primary-dark); }
.crm-anf-btn.danger { color: var(--crm-danger-color); border-color: #f3c6c6; }
.crm-anf-btn.danger:hover { background: #fef2f2; color: var(--crm-danger-color); border-color: var(--crm-danger-color); }
.crm-anf-btn.ghost { background: transparent; }
.crm-anf-btn.small { padding: 6px 12px; font-size: 12px; min-height: 30px; }

/* ---- Forms ---- */
.crm-anf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}
.crm-anf-grid .crm-anf-span-2 { grid-column: 1 / -1; }
.crm-anf-field { display: flex; flex-direction: column; gap: 4px; }
.crm-anf-field > span { font-size: 12.5px; font-weight: 600; color: var(--crm-text-color); }
.crm-anf-field input,
.crm-anf-field select,
.crm-anf-field textarea {
  width: 100%; font: inherit; color: var(--crm-text-color);
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 12px; min-height: 38px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.crm-anf-field textarea { min-height: 84px; resize: vertical; }
.crm-anf-field input:focus,
.crm-anf-field select:focus,
.crm-anf-field textarea:focus {
  outline: none; border-color: var(--crm-primary-color); box-shadow: 0 0 0 3px rgba(29,78,216,0.18);
}
.crm-anf-field input[type="color"] { padding: 4px; min-height: 38px; cursor: pointer; }
.crm-anf-field.crm-anf-check-inline { flex-direction: row; align-items: center; gap: 8px; }
.crm-anf-check-inline input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }
.crm-anf-form-actions { display: flex; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #e2e8f0; flex-wrap: wrap; }
.crm-anf-import-form { display: flex; flex-direction: column; gap: 10px; }

/* ---- Filtros v0.2 ---- */
.crm-anf-filters-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px;
}
.crm-anf-filters-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; }
.crm-anf-filters-grid input, .crm-anf-filters-grid select {
  font: inherit; padding: 8px 12px; min-height: 38px; border: 1.5px solid #e2e8f0; border-radius: 8px;
}
.crm-anf-filters-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---- Lista de prospectos ---- */
.crm-anf-list-form { padding: 0; }
.crm-anf-list-form table { margin: 0; }
.crm-anf-list-form table th:first-child, .crm-anf-list-form table td:first-child { padding-left: 18px; }
.crm-anf-bulk-bar {
  display: flex; gap: 14px; align-items: center;
  padding: 14px 22px; background: var(--crm-bg-color); border-top: 1px solid #e2e8f0;
  border-radius: 0 0 12px 12px; font-size: 13px; flex-wrap: wrap;
}
.crm-anf-pagination { display: flex; gap: 6px; padding: 14px 22px; border-top: 1px solid #e2e8f0; flex-wrap: wrap; }
.crm-anf-page {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 10px;
  border-radius: 8px; border: 1.5px solid #e2e8f0; background: #fff;
  font-size: 13px; font-weight: 600; color: var(--crm-text-color); text-decoration: none;
}
.crm-anf-page.active { background: var(--crm-primary-color); color: #fff; border-color: var(--crm-primary-color); }

/* ---- Chips / semáforos ---- */
.crm-anf-chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: #eef2ff; color: var(--crm-primary-dark);
  font-size: 11.5px; font-weight: 700;
}
.crm-anf-mini-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: #fef3c7; color: #92400e;
  font-size: 10.5px; font-weight: 700; margin-left: 6px;
  letter-spacing: 0.04em;
}
.crm-anf-sem-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
}
.crm-anf-sem-dot {
  display: inline-block;
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
}
.crm-anf-sem-dot.verde     { background: var(--crm-success-color); }
.crm-anf-sem-dot.amarillo  { background: var(--crm-warning-color); }
.crm-anf-sem-dot.rojo      { background: var(--crm-danger-color); }
.crm-anf-sem-dot.gris      { background: var(--crm-lost-color); }
.crm-anf-sem-dot.azul      { background: var(--crm-client-color); }
.crm-anf-sem-verde         { color: var(--crm-success-color); }
.crm-anf-sem-amarillo      { color: var(--crm-warning-color); }
.crm-anf-sem-rojo          { color: var(--crm-danger-color); }
.crm-anf-sem-gris          { color: var(--crm-lost-color); }
.crm-anf-sem-azul          { color: var(--crm-client-color); }

/* ---- Notice ---- */
.crm-anf-notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid var(--crm-warning-color);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 18px 0;
}
.crm-anf-notice strong { display: block; color: var(--crm-warning-color); margin-bottom: 6px; }
.crm-anf-notice-success { background: #ecfdf5; border-color: #6ee7b7; border-left-color: var(--crm-success-color); }
.crm-anf-notice-success strong { color: var(--crm-success-color); }
.crm-anf-notice-danger  { background: #fef2f2; border-color: #fca5a5; border-left-color: var(--crm-danger-color); }
.crm-anf-notice-danger strong  { color: var(--crm-danger-color); }
.crm-anf-notice-info    { background: #eff6ff; border-color: #bfdbfe; border-left-color: var(--crm-primary-color); }
.crm-anf-notice-info strong    { color: var(--crm-primary-dark); }

/* ---- Vacíos ---- */
.crm-anf-empty { padding: 40px 24px; text-align: center; color: var(--crm-muted-text); }
.crm-anf-empty p { margin-bottom: 14px; }

/* ---- Vista de prospecto ---- */
.crm-anf-twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.crm-anf-twocol .crm-anf-card { margin-bottom: 0; }
.crm-anf-prospect-meta { margin-top: 6px; font-size: 13px; color: var(--crm-muted-text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crm-anf-prospect-meta .crm-anf-chip { font-size: 11px; }
.crm-anf-kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: 13.5px; }
.crm-anf-kv dt { color: var(--crm-muted-text); font-size: 12.5px; padding-top: 2px; }
.crm-anf-kv dd { margin: 0; color: var(--crm-text-color); font-weight: 600; }
.crm-anf-stage-form label { display: block; margin-bottom: 12px; font-size: 12.5px; font-weight: 600; }
.crm-anf-stage-form input, .crm-anf-stage-form select, .crm-anf-stage-form textarea {
  width: 100%; font: inherit; padding: 9px 12px; border: 1.5px solid #e2e8f0; border-radius: 8px;
}
.crm-anf-action-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Resumen comercial (summary strip) */
.crm-anf-summary-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; padding: 16px; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 16px;
}
.crm-anf-summary-block { display: flex; flex-direction: column; gap: 4px; }
.crm-anf-summary-label {
  font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--crm-muted-text); font-weight: 700;
}
.crm-anf-summary-block strong {
  font-size: 17px; color: var(--crm-primary-dark); font-variant-numeric: tabular-nums;
}

/* Sección de cierre condicional en prospect-form */
.crm-anf-close-section {
  background: #ecfdf5; border: 1px solid #6ee7b7;
  border-radius: 8px; padding: 14px 16px; margin: 12px 0;
}
.crm-anf-close-section h3 {
  font-size: 13px; color: var(--crm-success-color); margin: 0 0 10px;
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
}

/* ---- Timeline ---- */
.crm-anf-timeline { list-style: none; padding: 0; margin: 8px 0 0; position: relative; }
.crm-anf-timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: #e2e8f0;
}
.crm-anf-timeline li { position: relative; padding: 6px 0 6px 28px; }
.crm-anf-timeline-dot {
  position: absolute; left: 2px; top: 12px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--crm-primary-color); border: 3px solid #fff; box-shadow: 0 0 0 1px #e2e8f0;
}
.crm-anf-timeline-content strong { display: block; font-size: 13.5px; }
.crm-anf-timeline-content p { font-size: 12.5px; margin-top: 2px; }

/* ---- Choice grid (new prospect choice) ---- */
.crm-anf-choice-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  margin-top: 20px;
}
.crm-anf-choice-card {
  background: var(--crm-card-bg);
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 30px 26px;
  text-align: center;
  text-decoration: none;
  color: var(--crm-text-color);
  display: flex; flex-direction: column; gap: 12px; align-items: center;
  transition: all 0.15s ease;
}
.crm-anf-choice-card:hover {
  border-color: var(--crm-primary-color);
  box-shadow: 0 8px 24px rgba(29,78,216,0.14);
  transform: translateY(-2px);
  text-decoration: none;
}
.crm-anf-choice-icon { font-size: 40px; line-height: 1; color: var(--crm-primary-color); }
.crm-anf-choice-card h3 { font-size: 18px; color: var(--crm-primary-dark); margin: 0; }
.crm-anf-choice-card p { font-size: 13.5px; color: var(--crm-muted-text); margin: 0; }
.crm-anf-choice-cta {
  margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--crm-primary-color);
}

/* ---- ANF list (search + recent) ---- */
.crm-anf-search-list { margin-top: 16px; }
.crm-anf-search-results {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 10px; margin-top: 8px; max-height: 240px; overflow-y: auto;
}
.crm-anf-search-results a {
  display: block; padding: 8px 10px; border-radius: 6px;
  font-size: 13.5px; color: var(--crm-text-color); text-decoration: none;
}
.crm-anf-search-results a:hover { background: #fff; text-decoration: none; }

/* ---- Manual ---- */
.crm-anf-manual-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; }
.crm-anf-manual-nav { position: sticky; top: 60px; height: max-content; }
.crm-anf-manual-nav ul { list-style: none; padding: 0; margin: 0; }
.crm-anf-manual-nav li { margin-bottom: 6px; }
.crm-anf-manual-nav a { display: block; padding: 6px 10px; border-radius: 6px; font-size: 13px; }
.crm-anf-manual-nav a:hover { background: var(--crm-bg-color); text-decoration: none; }
.crm-anf-manual-body section { margin-bottom: 28px; }
.crm-anf-manual-body section:last-child { margin-bottom: 0; }
.crm-anf-manual-body section h2 { color: var(--crm-primary-dark); border-bottom: 2px solid #e2e8f0; padding-bottom: 6px; margin-bottom: 10px; }

/* ---- Save bar bajo ANF ---- */
.crm-anf-save-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 18px;
  border-top: 3px solid var(--crm-primary-color);
}
.crm-anf-save-bar strong { display: block; font-size: 14.5px; color: var(--crm-primary-dark); margin-bottom: 4px; }
.crm-anf-wizard-frame { margin: 0 0 18px; }

/* ---- Print imprimible ---- */
.crm-anf-print {
  /* Estilo neutro cuando se ve embebido; el template printable tiene su propio <style> */
  background: #fff;
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .crm-anf-app { grid-template-columns: 1fr; }
  .crm-anf-sidebar { position: relative; top: auto; }
  .crm-anf-twocol { grid-template-columns: 1fr; }
  .crm-anf-manual-grid { grid-template-columns: 1fr; }
  .crm-anf-manual-nav { position: relative; top: auto; }
  .crm-anf-kv { grid-template-columns: 1fr; }
  .crm-anf-kv dt { padding-top: 8px; }
  .crm-anf-choice-grid { grid-template-columns: 1fr; }
  .crm-anf-funnel-bar-row { grid-template-columns: 130px 1fr 48px; }
}
@media (max-width: 720px) {
  .crm-anf-app { font-size: 13.5px; }
  .crm-anf-grid { grid-template-columns: 1fr; }
  .crm-anf-table { font-size: 12.5px; }
  .crm-anf-main-header { flex-direction: column; align-items: stretch; }
  .crm-anf-actions { justify-content: stretch; }
  .crm-anf-actions .crm-anf-btn { flex: 1; }
}

/* =================================================================
 * v0.3 — nuevos selectores
 * ================================================================= */

/* Tabs en Configuración */
.crm-anf-tabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  margin-bottom: 18px;
  border-bottom: 2px solid #e2e8f0;
}
.crm-anf-tab {
  display: inline-block; padding: 10px 18px;
  font-size: 13.5px; font-weight: 600; color: var(--crm-muted-text);
  text-decoration: none; border-bottom: 3px solid transparent;
  margin-bottom: -2px; transition: all 0.15s;
}
.crm-anf-tab:hover { color: var(--crm-primary-color); text-decoration: none; }
.crm-anf-tab.active {
  color: var(--crm-primary-dark);
  border-bottom-color: var(--crm-primary-color);
}

/* Color picker grid */
.crm-anf-color-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.crm-anf-color-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 8px;
  background: #fbfdff; cursor: pointer;
}
.crm-anf-color-label { flex: 1; font-size: 13px; font-weight: 600; }
.crm-anf-color-row input[type="color"] {
  width: 44px; height: 36px; padding: 2px; border-radius: 6px;
  border: 1.5px solid #e2e8f0; cursor: pointer;
}
.crm-anf-coming-soon {
  font-size: 11.5px; font-style: italic; color: var(--crm-muted-text);
  background: #f1f5f9; padding: 4px 10px; border-radius: 999px;
}

/* Vista previa de marca */
.crm-anf-preview-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px; margin-top: 10px;
}
.crm-anf-preview-card {
  background: var(--crm-card-bg); border: 1px solid #e2e8f0;
  border-top: 3px solid var(--crm-primary-color); border-radius: 10px;
  padding: 16px; display: flex; flex-direction: column; gap: 6px;
}
.crm-anf-preview-buttons {
  flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center;
}
.crm-anf-preview-sidebar {
  background: linear-gradient(180deg, var(--crm-primary-dark), var(--crm-primary-color) 70%);
  color: #fff; border-radius: 10px; padding: 16px;
}
.crm-anf-preview-sidebar-header { padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.18); margin-bottom: 10px; }
.crm-anf-preview-sidebar-row {
  display: flex; justify-content: space-between; padding: 6px 10px;
  background: rgba(255,255,255,0.08); border-radius: 6px; font-size: 12.5px; margin-bottom: 4px;
}
.crm-anf-preview-sidebar-row strong { color: #fff; font-weight: 700; }
.crm-anf-preview-pdf {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden;
}
.crm-anf-preview-pdf-hero {
  background: var(--crm-primary-color); color: #fff; padding: 14px 16px;
  border-bottom: 3px solid var(--crm-accent-color);
}
.crm-anf-preview-pdf-hero small { font-size: 9px; letter-spacing: 0.15em; color: var(--crm-accent-color); font-weight: 700; display: block; margin-bottom: 4px; }
.crm-anf-preview-pdf-hero strong { font-size: 15px; }
.crm-anf-preview-pdf-body { padding: 14px 16px; }
.crm-anf-preview-score {
  background: var(--crm-primary-color); color: #fff; border-radius: 8px;
  padding: 12px 14px; display: flex; align-items: center;
}
.crm-anf-preview-score-num { font-size: 32px; font-weight: 800; line-height: 1; }
.crm-anf-preview-score-num small { font-size: 13px; opacity: 0.7; }

/* Productos */
.crm-anf-products-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 14px;
}
.crm-anf-product-card {
  border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 16px;
  background: var(--crm-card-bg);
}
.crm-anf-product-card.active { border-left: 4px solid var(--crm-primary-color); }
.crm-anf-product-card.inactive { opacity: 0.6; border-left: 4px solid #cbd5e1; }
.crm-anf-product-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; cursor: pointer; font-size: 14px;
}
.crm-anf-product-header strong { font-weight: 700; }
.crm-anf-product-rates { overflow-x: auto; }
.crm-anf-rate-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
}
.crm-anf-rate-table th, .crm-anf-rate-table td {
  padding: 4px 6px; text-align: center; border: 1px solid #e2e8f0;
}
.crm-anf-rate-table thead th {
  background: #fbfdff; font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; color: var(--crm-muted-text);
}
.crm-anf-rate-table tbody th { text-align: left; background: #fbfdff; font-weight: 600; }
.crm-anf-rate-table td { position: relative; }
.crm-anf-rate-input {
  width: 60px; padding: 4px 18px 4px 6px;
  border: 1px solid #e2e8f0; border-radius: 4px; font-size: 12px;
  text-align: right;
}
.crm-anf-rate-suffix {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 10.5px; color: var(--crm-muted-text); pointer-events: none;
}

/* Lista de etapas */
.crm-anf-list-stages { list-style: none; padding: 0; margin: 0; }
.crm-anf-list-stages li {
  padding: 8px 12px; background: #fbfdff; border: 1px solid #e2e8f0;
  border-radius: 6px; margin-bottom: 6px; font-size: 13px;
}

/* Datos pendientes en ficha */
.crm-anf-pending-card { border-left: 4px solid var(--crm-warning-color); }
.crm-anf-pending-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px;
}
.crm-anf-pending-list li {
  padding: 10px 14px; background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 6px; font-size: 13px;
}
.crm-anf-pending-list strong {
  display: block; color: #92400e; margin-bottom: 3px;
}
.crm-anf-pending-list span { font-size: 12px; }

/* Acciones rápidas (ficha) */
.crm-anf-quick-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
  padding: 14px; background: var(--crm-card-bg); border: 1px solid #e2e8f0;
  border-radius: 10px;
}

/* Resumen del preview de importación */
.crm-anf-preview-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; padding: 12px; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 8px;
}
.crm-anf-preview-summary > div {
  display: flex; flex-direction: column; gap: 2px; text-align: center;
}
.crm-anf-preview-summary strong {
  font-size: 22px; color: var(--crm-primary-dark); font-weight: 800;
}
.crm-anf-mini-badge.success { background: #d1fae5; color: #065f46; }
.crm-anf-mini-badge.info    { background: #dbeafe; color: #1e40af; }

/* =================================================================
 * v0.4 — Embudo comercial mejorado
 * ================================================================= */
.crm-anf-funnel-bar-row.empty .crm-anf-funnel-label { opacity: 0.55; }
.crm-anf-funnel-bar-row.empty .crm-anf-funnel-bar-track {
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
}
.crm-anf-funnel-bar-track {
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    height: 22px;
}
.crm-anf-funnel-bar {
    height: 100%;
    transition: width 0.4s ease;
    border-radius: 6px;
}
.crm-anf-funnel-bar.active {
    background: linear-gradient(90deg, var(--crm-primary-color), var(--crm-primary-dark));
}
.crm-anf-funnel-bar.client {
    background: linear-gradient(90deg, var(--crm-success-color, #10b981), #047857);
}
.crm-anf-funnel-bar.lost {
    background: linear-gradient(90deg, #fca5a5, #ef4444);
}
.crm-anf-funnel-count { font-weight: 700; }
.crm-anf-funnel-count small { font-weight: 400; margin-left: 2px; }

/* =================================================================
 * v0.4 — Cards superiores ANF
 * ================================================================= */
.crm-anf-anf-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.crm-anf-anf-stat {
    background: var(--crm-card-bg);
    border: 1px solid #e2e8f0;
    border-top: 3px solid var(--crm-primary-color);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.crm-anf-anf-stat strong {
    font-size: 26px;
    font-weight: 800;
    color: var(--crm-primary-dark);
    line-height: 1;
}
.crm-anf-anf-stat span.label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--crm-muted-text);
    font-weight: 600;
}
.crm-anf-anf-stat.success { border-top-color: var(--crm-success-color, #10b981); }
.crm-anf-anf-stat.success strong { color: #047857; }

/* =================================================================
 * v0.5 — Sistema visual profesional
 * ================================================================= */

/* Tipografía sistema en todo el CRM */
.crm-anf-app, .crm-anf-app input, .crm-anf-app select, .crm-anf-app textarea, .crm-anf-app button {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Jerarquía tipográfica v0.5 */
.crm-anf-app h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: var(--crm-text-color, #0F172A); margin: 0 0 6px; }
.crm-anf-app h2, .crm-anf-app .crm-anf-sec-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--crm-text-color, #0F172A); margin: 0 0 12px; }
.crm-anf-app h3, .crm-anf-app .crm-anf-sub-title { font-size: 15px; font-weight: 600; color: var(--crm-text-color, #0F172A); margin: 14px 0 8px; }
.crm-anf-app .crm-anf-eyebrow {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--crm-muted-text, #64748B);
  margin: 0;
}

/* Cards más limpias */
.crm-anf-card {
  background: var(--crm-card-bg, #fff);
  border: 1px solid var(--crm-border, #E2E8F0);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}

/* Botones más sobrios */
.crm-anf-app .crm-anf-btn {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--crm-border, #E2E8F0);
  background: #fff;
  color: var(--crm-text-color, #0F172A);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.crm-anf-app .crm-anf-btn:hover { background: #F8FAFC; border-color: #CBD5E1; text-decoration: none; }
.crm-anf-app .crm-anf-btn.primary {
  background: var(--crm-primary-color, #1D4ED8);
  border-color: var(--crm-primary-color, #1D4ED8);
  color: #fff;
}
.crm-anf-app .crm-anf-btn.primary:hover {
  background: var(--crm-primary-dark, #0B1F3A);
  border-color: var(--crm-primary-dark, #0B1F3A);
  color: #fff;
}
.crm-anf-app .crm-anf-btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--crm-muted-text, #64748B);
}
.crm-anf-app .crm-anf-btn.ghost:hover { background: #F1F5F9; color: var(--crm-text-color, #0F172A); }
.crm-anf-app .crm-anf-btn.accent {
  background: #B45309;  /* amber-700 para alertas accionables */
  border-color: #B45309;
  color: #fff;
}
.crm-anf-app .crm-anf-btn.accent:hover { background: #92400E; border-color: #92400E; }
.crm-anf-app .crm-anf-btn.danger {
  background: #B91C1C; border-color: #B91C1C; color: #fff;
}
.crm-anf-app .crm-anf-btn.small { font-size: 12px; padding: 5px 10px; }

/* SVG icons inline (sobrios, sin emojis) */
.crm-anf-icon {
  width: 16px; height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.crm-anf-icon.lg { width: 20px; height: 20px; }
.crm-anf-icon.sm { width: 14px; height: 14px; }

/* Alertas (sin emojis) */
.crm-anf-alert {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid;
  background: #fff;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.crm-anf-alert > div:first-child { flex: 1; }
.crm-anf-alert strong { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.crm-anf-alert span { font-size: 12.5px; color: var(--crm-muted-text, #64748B); display: block; }
.crm-anf-alert a { font-size: 13px; font-weight: 600; color: var(--crm-primary-color, #1D4ED8); text-decoration: none; white-space: nowrap; }
.crm-anf-alert-warning { border-left-color: #B45309; background: #FFFBEB; }
.crm-anf-alert-warning strong { color: #92400E; }
.crm-anf-alert-info { border-left-color: var(--crm-primary-color, #1D4ED8); background: #EFF6FF; }
.crm-anf-alert-danger { border-left-color: #B91C1C; background: #FEF2F2; }
.crm-anf-alert-danger strong { color: #991B1B; }
.crm-anf-alert-success { border-left-color: #047857; background: #ECFDF5; }
.crm-anf-alert-success strong { color: #065F46; }

/* Dashboard agrupado por categorías v0.5 */
.crm-anf-kpi-category {
  margin-bottom: 22px;
}
.crm-anf-kpi-category-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.crm-anf-kpi-category-header .crm-anf-eyebrow {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--crm-muted-text, #64748B);
}
.crm-anf-kpi-category-header::after {
  content: "";
  flex: 1; height: 1px;
  background: var(--crm-border, #E2E8F0);
}
.crm-anf-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.crm-anf-kpi-row.featured {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.crm-anf-kpi-card {
  background: var(--crm-card-bg, #fff);
  border: 1px solid var(--crm-border, #E2E8F0);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.crm-anf-kpi-card:hover { border-color: #CBD5E1; box-shadow: 0 2px 4px rgba(15,23,42,0.05); }
.crm-anf-kpi-card.featured {
  border-top: 3px solid var(--crm-primary-color, #1D4ED8);
}
.crm-anf-kpi-card .crm-anf-kpi-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--crm-muted-text, #64748B);
}
.crm-anf-kpi-card .crm-anf-kpi-value {
  font-size: 24px; font-weight: 700;
  color: var(--crm-text-color, #0F172A);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.crm-anf-kpi-card.featured .crm-anf-kpi-value { font-size: 28px; }
.crm-anf-kpi-card .crm-anf-kpi-hint {
  font-size: 11.5px; color: var(--crm-muted-text, #64748B); margin-top: 2px;
}
.crm-anf-kpi-card.success .crm-anf-kpi-value { color: #047857; }
.crm-anf-kpi-card.danger  .crm-anf-kpi-value { color: #B91C1C; }
.crm-anf-kpi-card.warning .crm-anf-kpi-value { color: #B45309; }

/* Notice cleaner */
.crm-anf-notice {
  background: #fff;
  border: 1px solid var(--crm-border, #E2E8F0);
  border-left: 4px solid var(--crm-primary-color, #1D4ED8);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 14px;
}
.crm-anf-notice strong { font-size: 13.5px; }
.crm-anf-notice p { margin: 4px 0 0; font-size: 13px; color: var(--crm-muted-text, #64748B); }
.crm-anf-notice-success { border-left-color: #047857; background: #ECFDF5; }
.crm-anf-notice-warning { border-left-color: #B45309; background: #FFFBEB; }
.crm-anf-notice-danger  { border-left-color: #B91C1C; background: #FEF2F2; }
.crm-anf-notice-info    { border-left-color: var(--crm-primary-color, #1D4ED8); background: #EFF6FF; }

/* Sidebar más sobrio */
.crm-anf-sidebar {
  background: linear-gradient(180deg, var(--crm-primary-dark, #0B1F3A), #0B1F3A);
  color: #fff;
  width: 280px;
  min-height: 100vh;
  padding: 20px 18px;
  position: sticky; top: 0;
  display: flex; flex-direction: column; gap: 16px;
}
.crm-anf-sidebar-header {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.crm-anf-sidebar-eyebrow {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.55);
  font-weight: 600;
}
.crm-anf-sidebar-header h3 {
  margin: 4px 0 2px;
  font-size: 15px; font-weight: 600;
  color: #fff;
}
.crm-anf-sidebar-tag {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  margin: 0;
}

/* Mobile responsive: convertir sidebar en bloque superior */
@media (max-width: 1100px) {
  .crm-anf-app { flex-direction: column; }
  .crm-anf-sidebar {
    width: 100%; min-height: auto;
    position: static;
    padding: 14px 16px;
  }
  .crm-anf-sidebar-block { display: inline-block; vertical-align: top; width: calc(50% - 8px); margin-right: 4px; }
}
@media (max-width: 640px) {
  .crm-anf-sidebar-block { width: 100%; }
}

/* Quick-actions más sobrias */
.crm-anf-quick-actions {
  background: #fff;
  border: 1px solid var(--crm-border, #E2E8F0);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 16px;
}

/* =================================================================
 * v0.5 — Modo sesión con cliente (ANF)
 * ================================================================= */
.crm-anf-consultive-bar {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.crm-anf-consultive-bar.active {
  background: #ECFDF5;
  border-color: #A7F3D0;
}
.crm-anf-consultive-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--crm-text-color, #0F172A);
  cursor: pointer;
}
.crm-anf-consultive-toggle input[type="checkbox"] {
  width: 16px; height: 16px;
  cursor: pointer;
}
.crm-anf-consultive-hint {
  font-size: 12px;
  color: var(--crm-muted-text, #64748B);
  flex: 1;
}

/* =================================================================
 * v0.5 — Refinamientos varios
 * ================================================================= */

/* Tabla más legible */
.crm-anf-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.crm-anf-table thead th {
  text-align: left;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--crm-muted-text, #64748B);
  padding: 10px 12px;
  border-bottom: 1px solid var(--crm-border, #E2E8F0);
  background: #FBFDFF;
}
.crm-anf-table tbody td {
  padding: 12px;
  border-bottom: 1px solid #F1F5F9;
}
.crm-anf-table tbody tr:hover { background: #FBFDFF; }

/* Chips/badges más profesionales */
.crm-anf-chip {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11.5px; font-weight: 600;
  border-radius: 999px;
  background: #EFF6FF;
  color: var(--crm-primary-color, #1D4ED8);
}

/* Manual estilo doc SaaS */
.crm-anf-manual-content {
  max-width: 760px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.7;
  color: var(--crm-text-color, #0F172A);
}
.crm-anf-manual-content h2 {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--crm-border, #E2E8F0);
  font-size: 22px;
}
.crm-anf-manual-content h3 { font-size: 17px; margin-top: 20px; }
.crm-anf-manual-content p, .crm-anf-manual-content li { font-size: 14.5px; }
.crm-anf-manual-content code {
  background: #F1F5F9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* Soporte: form centrado */
.crm-anf-support-form-wrap {
  max-width: 720px;
  margin: 0 auto;
}
.crm-anf-support-confidential-note {
  background: #EFF6FF;
  border-left: 3px solid var(--crm-primary-color, #1D4ED8);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--crm-text-color, #0F172A);
  margin-bottom: 14px;
}

/* Suscripción card */
.crm-anf-subscription-status {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px; font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.crm-anf-subscription-status.activa    { background: #ECFDF5; color: #065F46; }
.crm-anf-subscription-status.pendiente { background: #FFFBEB; color: #92400E; }
.crm-anf-subscription-status.vencida   { background: #FEF2F2; color: #991B1B; }
.crm-anf-subscription-status.suspendida{ background: #F1F5F9; color: #475569; }

/* =================================================================
 * v0.5.2 — Mi suscripción + línea de asesor
 * ================================================================= */

/* Línea de asesor debajo del h1 */
.crm-anf-advisor-line {
  font-size: 13px;
  color: var(--crm-muted-text, #64748B);
  margin: 4px 0 0;
  font-weight: 500;
}

/* Sidebar: bloque resumen de licencia */
.crm-anf-sidebar-licence {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  display: flex; flex-direction: column; gap: 4px;
  border-left: 3px solid var(--crm-accent-color, #0B1F3A);
}
.crm-anf-sidebar-licence .crm-anf-subscription-status {
  align-self: flex-start;
  font-size: 10px !important;
  padding: 2px 8px !important;
}
.crm-anf-sidebar-licence-line {
  font-size: 11.5px;
  color: rgba(255,255,255,0.85);
}
.crm-anf-sidebar-licence-link {
  font-size: 11.5px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  margin-top: 4px;
}
.crm-anf-sidebar-licence-link:hover {
  color: #fff;
}

/* Pantalla Mi suscripción */
.crm-anf-subscription-card {
  text-align: center;
  padding: 30px 24px;
}
.crm-anf-subscription-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.crm-anf-subscription-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.crm-anf-subscription-block .crm-anf-kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--crm-muted-text, #64748B);
}
.crm-anf-subscription-plan,
.crm-anf-subscription-due {
  font-size: 22px;
  font-weight: 700;
  color: var(--crm-text-color, #0F172A);
  letter-spacing: -0.01em;
}
.crm-anf-subscription-cta {
  padding-top: 14px;
  border-top: 1px solid var(--crm-border, #E2E8F0);
}
.crm-anf-app .crm-anf-btn.large {
  font-size: 15px;
  padding: 12px 24px;
}

/* =================================================================
 * v0.5.3 — Rediseño Dashboard: prioridades, embudo, work-list, insights
 * ================================================================= */

/* Sección: Prioridades comerciales (cards accionables) */
.crm-anf-priority-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}
.crm-anf-priority-card {
  background: var(--crm-card-bg, #fff);
  border: 1px solid var(--crm-border, #E2E8F0);
  border-left: 4px solid var(--crm-primary-color, #1D4ED8);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
  transition: box-shadow 0.15s, transform 0.15s;
}
.crm-anf-priority-card:hover {
  box-shadow: 0 4px 12px rgba(15,23,42,0.08);
}
.crm-anf-priority-card.warning { border-left-color: #B45309; background: #FFFBEB; }
.crm-anf-priority-card.danger  { border-left-color: #B91C1C; background: #FEF2F2; }
.crm-anf-priority-card.info    { border-left-color: var(--crm-primary-color, #1D4ED8); background: #EFF6FF; }
.crm-anf-priority-card.success { border-left-color: #047857; background: #ECFDF5; }
.crm-anf-priority-body { flex: 1; }
.crm-anf-priority-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--crm-text-color, #0F172A);
  margin: 0 0 4px;
}
.crm-anf-priority-text {
  font-size: 13px;
  color: var(--crm-muted-text, #64748B);
  line-height: 1.5;
  margin: 0;
}
.crm-anf-priority-card .crm-anf-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Sección: Embudo comercial rediseñado */
.crm-anf-funnel-card {
  padding: 22px 24px;
}
.crm-anf-funnel-bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 90px;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #F1F5F9;
}
.crm-anf-funnel-bar-row:last-child { border-bottom: none; }
.crm-anf-funnel-bar-row.empty { opacity: 0.55; }
.crm-anf-funnel-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--crm-text-color, #0F172A);
}
.crm-anf-funnel-bar-row.empty .crm-anf-funnel-label { color: var(--crm-muted-text, #64748B); font-weight: 400; }
.crm-anf-funnel-bar-track {
  height: 10px;
  background: #F1F5F9;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.crm-anf-funnel-bar-row.empty .crm-anf-funnel-bar-track {
  background: transparent;
  border: 1px dashed #E2E8F0;
  height: 8px;
}
.crm-anf-funnel-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--crm-primary-color, #1D4ED8);
  transition: width 0.3s ease;
}
.crm-anf-funnel-bar.active { background: linear-gradient(90deg, var(--crm-primary-color, #1D4ED8), #3B82F6); }
.crm-anf-funnel-bar.client { background: linear-gradient(90deg, #047857, #10B981); }
.crm-anf-funnel-bar.lost   { background: linear-gradient(90deg, #B91C1C, #EF4444); opacity: 0.7; }
.crm-anf-funnel-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--crm-text-color, #0F172A);
  text-align: right;
}
.crm-anf-funnel-count small { font-weight: 400; font-size: 11.5px; }

/* Sección: Lista de trabajo */
.crm-anf-work-table td { padding: 14px 12px; }
.crm-anf-work-table tbody tr { transition: background 0.12s; }
.crm-anf-sem-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 999px;
  background: #F1F5F9;
  color: var(--crm-text-color, #0F172A);
}
.crm-anf-sem-tag.crm-anf-sem-verde    { background: #ECFDF5; color: #065F46; }
.crm-anf-sem-tag.crm-anf-sem-amarillo { background: #FFFBEB; color: #92400E; }
.crm-anf-sem-tag.crm-anf-sem-rojo     { background: #FEF2F2; color: #991B1B; }
.crm-anf-sem-tag.crm-anf-sem-azul     { background: #EFF6FF; color: #1D4ED8; }
.crm-anf-sem-tag.crm-anf-sem-gris     { background: #F1F5F9; color: #475569; }
.crm-anf-sem-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; opacity: 0.75;
}

/* Sección: Insights comerciales */
.crm-anf-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.crm-anf-insight-card {
  background: var(--crm-card-bg, #fff);
  border: 1px solid var(--crm-border, #E2E8F0);
  border-top: 3px solid var(--crm-primary-color, #1D4ED8);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.crm-anf-insight-card.success { border-top-color: #047857; }
.crm-anf-insight-card.warning { border-top-color: #B45309; }
.crm-anf-insight-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--crm-muted-text, #64748B);
}
.crm-anf-insight-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--crm-text-color, #0F172A);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.crm-anf-insight-card.success .crm-anf-insight-value { color: #047857; }
.crm-anf-insight-card.warning .crm-anf-insight-value { color: #B45309; }
.crm-anf-insight-hint {
  font-size: 12px;
  color: var(--crm-muted-text, #64748B);
  margin-top: 2px;
}

/* v0.5.4: Insight sin datos suficientes */
.crm-anf-insight-value.muted {
  color: var(--crm-muted-text, #64748B);
  font-weight: 500;
  font-size: 16px;
  font-style: italic;
}

/* v0.5.4 — Grupos plegables de colores granulares */
.crm-anf-color-group {
  background: #FBFDFF;
  border: 1px solid var(--crm-border, #E2E8F0);
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 0;
}
.crm-anf-color-group summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--crm-text-color, #0F172A);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.crm-anf-color-group summary::before {
  content: "▸";
  color: var(--crm-muted-text, #64748B);
  font-size: 11px;
  transition: transform 0.15s;
}
.crm-anf-color-group[open] summary::before { transform: rotate(90deg); }
.crm-anf-color-group summary::-webkit-details-marker { display: none; }
.crm-anf-color-group .crm-anf-color-grid {
  padding: 8px 16px 14px;
}

/* Aplicar tokens granulares a componentes específicos */

/* Sidebar usa tokens de sidebar */
.crm-anf-sidebar {
  background: var(--crm-sidebar-bg, var(--crm-primary-dark, #0B1F3A)) !important;
  color: var(--crm-sidebar-text, #fff);
}
.crm-anf-sidebar-header h3 { color: var(--crm-sidebar-text, #fff); }
.crm-anf-sidebar-tag,
.crm-anf-sidebar-eyebrow { color: var(--crm-sidebar-muted, rgba(255,255,255,0.6)); }
.crm-anf-sidebar-kpi.success strong { color: var(--crm-sidebar-positive, #10B981); }
.crm-anf-sidebar-kpi.warning strong { color: var(--crm-sidebar-alert, #FBBF24); }

/* Botones usan tokens de botón */
.crm-anf-app .crm-anf-btn.primary {
  background: var(--crm-btn-primary-bg, var(--crm-primary-color, #1D4ED8));
  border-color: var(--crm-btn-primary-bg, var(--crm-primary-color, #1D4ED8));
  color: var(--crm-btn-primary-text, #fff);
}
.crm-anf-app .crm-anf-btn.primary:hover {
  background: var(--crm-btn-primary-hover, var(--crm-primary-dark, #0B1F3A));
  border-color: var(--crm-btn-primary-hover, var(--crm-primary-dark, #0B1F3A));
}
.crm-anf-app .crm-anf-btn.accent {
  background: var(--crm-btn-accent-bg, #B45309);
  border-color: var(--crm-btn-accent-bg, #B45309);
  color: var(--crm-btn-accent-text, #fff);
}

/* Dashboard usa tokens de dashboard */
.crm-anf-app h1 { color: var(--crm-dashboard-title, var(--crm-text-color, #0F172A)); }
.crm-anf-kpi-value,
.crm-anf-insight-value:not(.muted) { color: var(--crm-dashboard-number, var(--crm-text-color, #0F172A)); }

/* Semáforo usa tokens configurables */
.crm-anf-sem-tag.crm-anf-sem-verde { color: var(--crm-sem-verde, #065F46); }
.crm-anf-sem-tag.crm-anf-sem-amarillo { color: var(--crm-sem-amarillo, #92400E); }
.crm-anf-sem-tag.crm-anf-sem-rojo { color: var(--crm-sem-rojo, #991B1B); }
.crm-anf-sem-tag.crm-anf-sem-azul { color: var(--crm-sem-azul, #1D4ED8); }
.crm-anf-sem-tag.crm-anf-sem-gris { color: var(--crm-sem-gris, #475569); }

/* =================================================================
 * v0.6.0 — Contraste reforzado en sidebar (spec §17)
 * ================================================================= */

/* Marca del asesor: siempre visible */
.crm-anf-sidebar h3,
.crm-anf-sidebar-header h3 {
  color: #FFFFFF !important;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin: 4px 0 2px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.crm-anf-sidebar-tag {
  color: rgba(255,255,255,0.88) !important;
  font-size: 12.5px;
  margin: 0;
}
.crm-anf-sidebar-eyebrow {
  color: rgba(255,255,255,0.72) !important;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.crm-anf-sidebar-section {
  color: rgba(255,255,255,0.7) !important;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}
.crm-anf-sidebar-kpi .crm-anf-k {
  color: rgba(255,255,255,0.78) !important;
  font-size: 12px;
}
.crm-anf-sidebar-kpi strong {
  color: #FFFFFF !important;
  font-weight: 700;
  font-size: 15px;
}
.crm-anf-sidebar-kpi.success strong { color: #6EE7B7 !important; }
.crm-anf-sidebar-kpi.warning strong { color: #FBBF24 !important; }
.crm-anf-sidebar-kpi.danger strong  { color: #FCA5A5 !important; }
.crm-anf-funnel-mini .crm-anf-funnel-row {
  color: rgba(255,255,255,0.85) !important;
  font-size: 12.5px;
}
.crm-anf-funnel-mini .crm-anf-funnel-row strong {
  color: #FFFFFF !important;
}
.crm-anf-funnel-mini .crm-anf-funnel-row.success strong { color: #6EE7B7 !important; }
.crm-anf-funnel-mini .crm-anf-funnel-row.warning strong { color: #FBBF24 !important; }
.crm-anf-funnel-mini .crm-anf-funnel-row.danger strong  { color: #FCA5A5 !important; }
.crm-anf-funnel-mini .crm-anf-funnel-row.muted { opacity: 0.75; }

/* Licencia en sidebar: legible con contraste alto */
.crm-anf-sidebar-licence {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.18);
  border-radius: 8px;
  border-left: 3px solid rgba(255,255,255,0.35);
}
.crm-anf-sidebar-licence-line {
  color: rgba(255,255,255,0.92) !important;
  font-size: 11.5px;
}
.crm-anf-sidebar-licence-link {
  color: #93C5FD !important;
  font-weight: 600;
}
.crm-anf-sidebar-licence-link:hover { color: #FFFFFF !important; }

/* Separación entre bloques */
.crm-anf-sidebar-block {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.crm-anf-sidebar-block:last-child { border-bottom: none; }

/* Layout: cuando el sidebar aparece en más vistas, ajustar main widths */
.crm-anf-app { display: flex; align-items: stretch; }
.crm-anf-main { flex: 1; min-width: 0; padding: 24px 32px; }
.crm-anf-main.full { padding: 24px 32px; }

/* Focus visible en botones y enlaces (spec §17 accesibilidad) */
.crm-anf-app .crm-anf-btn:focus-visible,
.crm-anf-app a:focus-visible,
.crm-anf-app input:focus-visible,
.crm-anf-app select:focus-visible,
.crm-anf-app textarea:focus-visible {
  outline: 2px solid var(--crm-primary-color, #1D4ED8);
  outline-offset: 2px;
}
.crm-anf-frontend-link:focus-visible {
  outline: 2px solid rgba(255,255,255,0.7);
  outline-offset: 2px;
}

/* =================================================================
 * v0.6.1 — Notificaciones internas
 * ================================================================= */
.crm-anf-notif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.crm-anf-notif-item {
  background: #fff;
  border: 1px solid var(--crm-border, #E2E8F0);
  border-left: 4px solid var(--crm-primary-color, #1D4ED8);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.crm-anf-notif-item.urgent  { border-left-color: #B91C1C; background: #FEF2F2; }
.crm-anf-notif-item.warning { border-left-color: #B45309; background: #FFFBEB; }
.crm-anf-notif-item.info    { border-left-color: var(--crm-primary-color, #1D4ED8); background: #EFF6FF; }
.crm-anf-notif-item.success { border-left-color: #047857; background: #ECFDF5; }
.crm-anf-notif-body { flex: 1; }
.crm-anf-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.crm-anf-notif-header strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--crm-text-color, #0F172A);
}
.crm-anf-notif-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--crm-muted-text, #64748B);
  background: rgba(15,23,42,0.05);
  padding: 2px 8px;
  border-radius: 999px;
}
.crm-anf-notif-message {
  font-size: 13px;
  color: var(--crm-muted-text, #64748B);
  line-height: 1.5;
  margin: 0;
}
.crm-anf-notif-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .crm-anf-notif-item { flex-direction: column; align-items: stretch; }
  .crm-anf-notif-actions { flex-direction: row; align-items: center; }
}

/* =================================================================
 * v0.7.0 — Login frontend + listas de cumpleaños/renovaciones
 * ================================================================= */

/* Listas cumpleaños/renovaciones en Dashboard */
.crm-anf-list-card {
  background: var(--crm-card-bg, #fff);
  border: 1px solid var(--crm-border, #E2E8F0);
  border-radius: 10px;
  overflow: hidden;
}
.crm-anf-list-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #F1F5F9;
}
.crm-anf-list-row:last-child { border-bottom: none; }
.crm-anf-list-row.today {
  background: #ECFDF5;
  border-left: 3px solid #047857;
}
.crm-anf-list-row.past {
  opacity: 0.6;
}
.crm-anf-list-date {
  font-size: 15px;
  font-weight: 700;
  color: var(--crm-primary-color, #1D4ED8);
  text-align: center;
  padding: 8px 6px;
  background: #EFF6FF;
  border-radius: 8px;
  min-width: 50px;
}
.crm-anf-list-row.today .crm-anf-list-date {
  background: #047857;
  color: #fff;
}
.crm-anf-list-body {
  font-size: 13.5px;
}
.crm-anf-list-body strong {
  font-weight: 600;
  color: var(--crm-text-color, #0F172A);
}
.crm-anf-list-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .crm-anf-list-row {
    grid-template-columns: 50px 1fr;
  }
  .crm-anf-list-actions {
    grid-column: span 2;
    justify-content: flex-end;
  }
}

/* Toast para copiar */
.crm-anf-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #047857;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(4,120,87,0.3);
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.2s, opacity 0.2s;
}
.crm-anf-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* =================================================================
 * v0.7.1 — Login frontend premium (glassmorphism)
 * Todo scoped bajo .crm-anf-login-page para no impactar el resto del CRM.
 * ================================================================= */
.crm-anf-login-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  overflow: hidden;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #F8FAFC;
  background:
    radial-gradient(circle at 15% 20%, rgba(124, 58, 237, 0.35), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(236, 72, 153, 0.30), transparent 40%),
    linear-gradient(135deg, #0B1026 0%, #1E1B4B 45%, #111827 100%);
  box-sizing: border-box;
}
.crm-anf-login-page * { box-sizing: border-box; }

/* Círculos de luz decorativos */
.crm-anf-login-page .crm-anf-login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.crm-anf-login-page .crm-anf-login-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}
.crm-anf-login-page .crm-anf-login-glow-a {
  top: -100px; left: -80px;
  width: 340px; height: 340px;
  background: #7C3AED;
}
.crm-anf-login-page .crm-anf-login-glow-b {
  bottom: -120px; right: -100px;
  width: 380px; height: 380px;
  background: #EC4899;
}
.crm-anf-login-page .crm-anf-login-glow-c {
  top: 40%; left: 55%;
  width: 260px; height: 260px;
  background: #2563EB;
  opacity: 0.35;
}

/* Card central translúcida */
.crm-anf-login-page .crm-anf-login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  padding: 40px 40px 32px;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

/* Brand del asesor */
.crm-anf-login-page .crm-anf-login-brand {
  text-align: center;
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.crm-anf-login-page .crm-anf-login-brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  margin: 0 0 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.20);
}
.crm-anf-login-page .crm-anf-login-brand-line {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}

/* Título + subtítulo del panel */
.crm-anf-login-page .crm-anf-login-title {
  font-size: 22px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 8px;
  text-align: center;
  letter-spacing: -0.01em;
}
.crm-anf-login-page .crm-anf-login-subtitle {
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
  margin: 0 0 24px;
  text-align: center;
}

/* Mensajes dentro de la card */
.crm-anf-login-page .crm-anf-login-message {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: 13px;
  border: 1px solid transparent;
}
.crm-anf-login-page .crm-anf-login-message strong {
  font-weight: 700;
  color: #FFFFFF;
}
.crm-anf-login-page .crm-anf-login-message span {
  color: rgba(255, 255, 255, 0.85);
}
.crm-anf-login-page .crm-anf-login-message-error {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
}
.crm-anf-login-page .crm-anf-login-message-info {
  background: rgba(37, 99, 235, 0.20);
  border-color: rgba(37, 99, 235, 0.45);
}
.crm-anf-login-page .crm-anf-login-message-success {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
}

/* Formulario */
.crm-anf-login-page .crm-anf-login-form {
  display: block;
}
.crm-anf-login-page .crm-anf-login-field {
  margin-bottom: 16px;
}
.crm-anf-login-page .crm-anf-login-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.crm-anf-login-page .crm-anf-login-input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 14px;
  font-family: inherit;
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.crm-anf-login-page .crm-anf-login-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}
.crm-anf-login-page .crm-anf-login-input:hover {
  background: rgba(255, 255, 255, 0.14);
}
.crm-anf-login-page .crm-anf-login-input:focus {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.10);
}
.crm-anf-login-page .crm-anf-login-input:-webkit-autofill {
  -webkit-text-fill-color: #FFFFFF;
  -webkit-box-shadow: 0 0 0 40px rgba(30, 27, 75, 0.85) inset;
  caret-color: #FFFFFF;
}

/* Acciones: recordar sesión + olvidé contraseña */
.crm-anf-login-page .crm-anf-login-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 8px 0 22px;
  flex-wrap: wrap;
}
.crm-anf-login-page .crm-anf-login-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.80);
  cursor: pointer;
  user-select: none;
}
.crm-anf-login-page .crm-anf-login-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #7C3AED;
  margin: 0;
}
.crm-anf-login-page .crm-anf-login-forgot {
  font-size: 13px;
  color: #A5B4FC;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}
.crm-anf-login-page .crm-anf-login-forgot:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

/* Botón principal */
.crm-anf-login-page .crm-anf-login-button {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 20px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  color: #FFFFFF;
  background: linear-gradient(135deg, #7C3AED, #2563EB);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.crm-anf-login-page .crm-anf-login-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.45);
  filter: brightness(1.05);
}
.crm-anf-login-page .crm-anf-login-button:active {
  transform: translateY(0);
  filter: brightness(0.95);
}
.crm-anf-login-page .crm-anf-login-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
}

/* Foot */
.crm-anf-login-page .crm-anf-login-foot {
  margin: 20px 0 0;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

/* Responsive móvil */
@media (max-width: 520px) {
  .crm-anf-login-page {
    padding: 24px 12px;
  }
  .crm-anf-login-page .crm-anf-login-card {
    max-width: 92%;
    padding: 30px 24px 24px;
    border-radius: 22px;
  }
  .crm-anf-login-page .crm-anf-login-title {
    font-size: 20px;
  }
  .crm-anf-login-page .crm-anf-login-subtitle {
    font-size: 13px;
  }
  .crm-anf-login-page .crm-anf-login-input {
    height: 46px;
    font-size: 15px; /* previene zoom iOS */
  }
  .crm-anf-login-page .crm-anf-login-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* v0.7.2 — Logo configurable en login (opcional) */
.crm-anf-login-page .crm-anf-login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.crm-anf-login-page .crm-anf-login-logo img {
  max-width: 180px;
  max-height: 90px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}
/* Si la imagen es aproximadamente cuadrada (foto o logo cuadrado),
   usar variante circular más pequeña. Se activa con la clase extra .crm-anf-login-logo-square */
.crm-anf-login-page .crm-anf-login-logo-square img {
  max-width: 96px;
  max-height: 96px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.30);
  padding: 4px;
  background: rgba(255, 255, 255, 0.06);
}

/* v0.7.3 — Logo configurado en sidebar del dashboard */
.crm-anf-sidebar-logo {
  display: block;
  max-width: 120px;
  max-height: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto 14px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25));
}
/* Si el sidebar tiene fondo oscuro (default #0B1F3A) y el logo también es oscuro, opcionalmente se puede activar contenedor sutil */
.crm-anf-sidebar-header {
  text-align: center;
}

/* v0.7.3 — Chips para badges de estado en cumpleaños/renovaciones */
.crm-anf-list-body .crm-anf-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
  margin-left: 4px;
}
.crm-anf-chip.success  { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.crm-anf-chip.warning  { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }
.crm-anf-chip.danger   { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.crm-anf-chip.info     { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.crm-anf-chip.muted    { background: #F1F5F9; color: #64748B; border: 1px solid #E2E8F0; }

/* Empty state para agenda del mes */
.crm-anf-empty-state {
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
}
.crm-anf-empty-state p:first-child { margin-top: 0; }
.crm-anf-empty-state p:last-child { margin-bottom: 0; font-size: 13px; }

/* =================================================================
 * v0.7.3.1 — Botón "Cerrar sesión" en frontend + refuerzo del logo sidebar
 * ================================================================= */

/* Botón Cerrar sesión: pill con ícono, visible pero secundario */
.crm-anf-app .crm-anf-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.crm-anf-app .crm-anf-logout-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.40);
  color: #FFFFFF;
}
.crm-anf-app .crm-anf-logout-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
}
.crm-anf-app .crm-anf-logout-btn svg {
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .crm-anf-app .crm-anf-logout-btn span {
    display: none; /* solo ícono en móvil para ahorrar espacio */
  }
  .crm-anf-app .crm-anf-logout-btn {
    padding: 8px 10px;
  }
}

/* Refuerzo v0.7.3.1: el wrapper del logo sidebar asegura visibilidad y centrado */
.crm-anf-sidebar-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  width: 100%;
}
.crm-anf-sidebar-logo-wrap .crm-anf-sidebar-logo {
  display: block !important;
  max-width: 120px !important;
  max-height: 64px !important;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

/* Variante opcional con fondo blanco sutil si el logo es oscuro sobre barra oscura */
.crm-anf-sidebar-logo-wrap.has-bg {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  padding: 8px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* =================================================================
 * v0.7.3.2 — Botón "Cerrar sesión" flotante SIEMPRE visible
 * Independiente del shell (por si el tema WP oculta la topbar).
 * ================================================================= */
.crm-anf-floating-logout {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 99999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: #FFFFFF;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 999px;
  text-decoration: none !important;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  white-space: nowrap;
}
.crm-anf-floating-logout:hover {
  background: rgba(185, 28, 28, 0.94);
  border-color: rgba(255, 255, 255, 0.30);
  color: #FFFFFF;
  transform: translateY(-1px);
}
.crm-anf-floating-logout:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}
.crm-anf-floating-logout svg {
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .crm-anf-floating-logout {
    padding: 8px 12px;
    top: 10px;
    right: 10px;
  }
  .crm-anf-floating-logout span {
    display: none; /* solo ícono en móvil */
  }
}

/* v0.8.0-beta — Nota "impuestos" en sidebar de comisiones estimadas */
.crm-anf-sidebar-tax-note {
  font-size: 10.5px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.62);
  margin: 10px 0 0;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 2px solid rgba(251, 191, 36, 0.55);
  border-radius: 4px;
}
.crm-anf-sidebar-tax-note em {
  font-style: italic;
  color: rgba(255, 255, 255, 0.78);
}
