/* crm.css — Estilos CRM NISSI Fase 2 */

/* Garantiza que hidden funcione en todos los Safari (UA stylesheet override) */
[hidden] { display: none !important; }

/* Scroll lock mientras haya un modal CRM abierto */
body.crm-modal-open { overflow: hidden; }

/* ── Variables de etapas ─────────────────────────────────────────────────── */
:root {
  --e1-bg:#F1EFE8; --e1-tx:#444441; --e1-bd:#888780;
  --e2-bg:#E6F1FB; --e2-tx:#0C447C; --e2-bd:#85B7EB;
  --e3-bg:#B5D4F4; --e3-tx:#042C53; --e3-bd:#185FA5;
  --e4-bg:#EEEDFE; --e4-tx:#3C3489; --e4-bd:#7F77DD;
  --e5-bg:#E1F5EE; --e5-tx:#085041; --e5-bd:#1D9E75;
  --e6-bg:#9FE1CB; --e6-tx:#04342C; --e6-bd:#0F6E56;
  --e7-bg:#FAECE7; --e7-tx:#712B13; --e7-bd:#D85A30;
  --e8-bg:#C9A84C; --e8-tx:#0D1B2A; --e8-bd:#0D1B2A;
  --e0-bg:#FCEBEB; --e0-tx:#791F1F; --e0-bd:#A32D2D;
}

/* ── Etapa badge ──────────────────────────────────────────────────────────── */
.etapa-badge {
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
}

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.crm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #0D1B2A;
  border-bottom: 1px solid #1e3050;
}
.crm-toolbar-left, .crm-toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Inputs / Selects ────────────────────────────────────────────────────── */
.crm-input {
  background: #111f31;
  border: 1px solid #2a4060;
  border-radius: 6px;
  color: #e8e4da;
  padding: 7px 10px;
  font-size: 13px;
  font-family: 'Montserrat', sans-serif;
  width: 100%;
  box-sizing: border-box;
}
.crm-input:focus { outline: 2px solid #C9A84C; border-color: #C9A84C; }
.crm-input-sm { padding: 4px 8px; font-size: 12px; }
.crm-select { background: #111f31; border: 1px solid #2a4060; border-radius: 6px; color: #e8e4da; padding: 7px 10px; font-size: 13px; }
.crm-select-sm { padding: 4px 8px; font-size: 12px; }

/* ── Botones ─────────────────────────────────────────────────────────────── */
.crm-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: none; border-radius: 6px; cursor: pointer;
  font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 13px;
  padding: 7px 14px; transition: opacity .15s;
  white-space: nowrap;
}
.crm-btn:disabled { opacity: .5; cursor: not-allowed; }
.crm-btn-gold    { background: #C9A84C; color: #0D1B2A; }
.crm-btn-ghost   { background: transparent; border: 1px solid #2a4060; color: #e8e4da; }
.crm-btn-ghost:hover { background: #1e3050; }
.crm-btn-danger  { background: #A32D2D; color: #fff; }
.crm-btn-sm  { padding: 5px 10px; font-size: 12px; }
.crm-btn-xs  { padding: 3px 8px;  font-size: 11px; }
.crm-link    { background: none; border: none; color: #C9A84C; cursor: pointer; font-size: 12px; text-decoration: underline; padding: 0; }

/* ── Lista prospectos ────────────────────────────────────────────────────── */
.crm-lista-wrap { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.crm-loading, .crm-empty { color: #6a8aaa; font-size: 14px; text-align: center; padding: 24px; }
.crm-error   { color: #e05555; font-size: 13px; }
.crm-ok      { color: #3ab86e; font-size: 13px; }

.prosp-card {
  background: #111f31;
  border-radius: 8px;
  padding: 12px 14px;
  border-left: 4px solid #2a4060;
  cursor: pointer;
  transition: background .12s;
}
.prosp-card:hover { background: #162840; }
.prosp-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.prosp-card-info { display: flex; flex-direction: column; gap: 2px; }
.prosp-nombre { font-weight: 700; font-size: 15px; color: #e8e4da; }
.prosp-tel, .prosp-correo { font-size: 13px; color: #7a9bbf; }
.prosp-card-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 12px; color: #6a8aaa; }
.prosp-asesor { color: #C9A84C; }
.prosp-card-seg { margin-top: 6px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.prosp-sin-seguimiento { color: #e0a040; font-weight: 600; }
.prosp-last-note-meta  { color: #6a8aaa; }
.prosp-proxima         { color: #7a9bbf; }
.prosp-proxima-vencida { color: #e05555; font-weight: 600; }

/* ── Paginación ──────────────────────────────────────────────────────────── */
.crm-paginacion { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 12px; color: #6a8aaa; font-size: 13px; }

/* ── Kanban ──────────────────────────────────────────────────────────────── */
.crm-kanban-wrap {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 12px; min-height: 60vh;
}
.kanban-col {
  flex: 0 0 220px; background: #0e1a28;
  border-radius: 8px; display: flex; flex-direction: column;
}
.kanban-col-header {
  padding: 8px 12px; display: flex; align-items: center;
  justify-content: space-between; gap: 6px;
}
.kanban-count { font-size: 11px; background: #1e3050; padding: 2px 7px; border-radius: 999px; color: #7a9bbf; }
.kanban-col-body { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.kanban-col-body.drag-over { background: #162840; border-radius: 6px; }
.kanban-card {
  background: #111f31; border-radius: 6px; padding: 10px 12px;
  cursor: pointer; display: flex; flex-direction: column; gap: 3px;
  border: 1px solid #1e3050;
}
.kanban-card:hover { background: #162840; }
.kanban-card-nombre { font-weight: 600; font-size: 13px; color: #e8e4da; }
.kanban-card-tel    { font-size: 12px; color: #7a9bbf; }
.kanban-card-asesor { font-size: 11px; color: #C9A84C; }

/* ── Ficha panel ─────────────────────────────────────────────────────────── */
.crm-ficha-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  z-index: 1000; display: flex; justify-content: flex-end;
}
.crm-ficha-panel {
  background: #0D1B2A; width: min(480px, 100vw);
  height: 100%; overflow-y: auto; position: relative;
  padding: 24px 20px; box-shadow: -4px 0 24px #000a;
}
.crm-ficha-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: #7a9bbf;
  font-size: 22px; cursor: pointer; line-height: 1;
}
.ficha-header   { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.ficha-nombre   { font-size: 20px; font-weight: 700; color: #e8e4da; margin: 0 0 4px; }
.ficha-tel, .ficha-correo { display: block; color: #C9A84C; font-size: 14px; text-decoration: none; }
.ficha-datos    { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: #7a9bbf; margin-bottom: 14px; }
.ficha-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

/* Seg form */
.ficha-seg-form-wrap { background: #0a1420; border-radius: 8px; padding: 14px; margin-bottom: 20px; }
.ficha-seg-form-wrap h4 { margin: 0 0 10px; font-size: 13px; color: #7a9bbf; font-weight: 600; }
.ficha-seg-form { display: flex; flex-direction: column; gap: 8px; }
.ficha-proxima  { display: flex; gap: 8px; flex-wrap: wrap; }
.ficha-proxima label { flex: 1; font-size: 12px; color: #6a8aaa; }

/* Historial */
.ficha-historial h4 { font-size: 13px; color: #7a9bbf; font-weight: 600; margin-bottom: 10px; }
.seg-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #1a2e44; align-items: flex-start; }
.seg-item:last-child { border-bottom: none; }
.seg-sistema .seg-icon { opacity: .5; }
.seg-icon  { font-size: 18px; flex-shrink: 0; }
.seg-body  { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.seg-tipo  { font-size: 13px; font-weight: 600; color: #e8e4da; }
.seg-nota  { font-size: 13px; color: #b0c4d8; margin: 2px 0 0; }
.seg-meta  { font-size: 11px; color: #4a6a8a; }

/* ── Modales ─────────────────────────────────────────────────────────────── */
.crm-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  z-index: 1100; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.crm-modal {
  background: #0D1B2A; border-radius: 10px;
  padding: 24px; width: 100%; max-width: 420px;
  box-shadow: 0 8px 40px #000c; position: relative;
  max-height: 90vh; overflow-y: auto;
}
.crm-modal-wide  { max-width: 560px; }
.crm-modal-sm    { max-width: 300px; }
.crm-modal-title { font-size: 16px; font-weight: 700; color: #e8e4da; margin: 0 0 16px; }
.crm-modal label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #7a9bbf; margin-bottom: 10px; }
.crm-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.crm-modal-close-x { position: absolute; top: 12px; right: 14px; background: none; border: none; color: #7a9bbf; font-size: 20px; cursor: pointer; }

/* Import */
.crm-import-dropzone {
  border: 2px dashed #2a4060; border-radius: 8px;
  padding: 24px; text-align: center; margin: 16px 0; color: #6a8aaa;
  cursor: pointer; transition: background .15s;
}
.crm-import-dropzone.drag-over { background: #162840; }
.crm-import-errores { font-size: 12px; color: #e0a040; max-height: 120px; overflow-y: auto; }

/* ── Recordatorios overlay ───────────────────────────────────────────────── */
.crm-rec-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 1050; display: flex; align-items: flex-end; justify-content: flex-end;
  padding: 0;
}
.crm-rec-panel {
  background: #0D1B2A; width: min(400px, 100vw);
  height: min(70vh, 600px); overflow-y: auto;
  border-radius: 12px 0 0 0; padding: 20px;
  box-shadow: -4px -4px 24px #000a;
}
.crm-rec-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.crm-rec-header h3 { margin: 0; flex: 1; font-size: 16px; color: #e8e4da; }
.crm-rec-badge { background: #A32D2D; color: #fff; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 700; }

.rec-item { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #1a2e44; }
.rec-item:last-child { border-bottom: none; }
.rec-vencido .rec-info { color: #e05555; }
.rec-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.rec-tipo  { font-size: 13px; font-weight: 600; color: #e8e4da; }
.rec-prosp { font-size: 12px; color: #C9A84C; }
.rec-fecha { font-size: 12px; color: #6a8aaa; }
.rec-nota  { font-size: 12px; color: #7a9bbf; }
.rec-acciones { display: flex; flex-direction: column; gap: 4px; }

/* FAB */
.crm-rec-fab {
  position: fixed; bottom: 24px; right: 24px;
  background: #C9A84C; color: #0D1B2A; border: none;
  border-radius: 50%; width: 52px; height: 52px;
  font-size: 22px; cursor: pointer; box-shadow: 0 4px 16px #000a;
  display: flex; align-items: center; justify-content: center;
  z-index: 900; transition: transform .15s;
}
.crm-rec-fab:hover { transform: scale(1.08); }
#crm-rec-fab-count {
  position: absolute; top: -4px; right: -4px;
  background: #A32D2D; color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 700; min-width: 18px;
  height: 18px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.crm-toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  background: #1a3050; color: #e8e4da; border-radius: 8px;
  padding: 10px 20px; font-size: 13px; z-index: 2000;
  box-shadow: 0 4px 16px #000a; animation: toast-in .2s ease;
  font-family: 'Montserrat', sans-serif;
}
.crm-toast-error { background: #3a1010; color: #e05555; }
.crm-toast-ok    { background: #0a2a1a; color: #3dbe8a; }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(10px); } }

/* ── Selector popup ──────────────────────────────────────────────────────── */
.crm-selector-opts { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }

/* ── Overlay bloqueante ──────────────────────────────────────────────────── */
.crm-bloqueante-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(5, 12, 22, 0.96);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  /* No backdrop-click, no ESC — solo cierra por acción */
}
.crm-bloqueante-panel {
  background: #0f1e30; border: 1px solid #1e3a58;
  border-radius: 14px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
  padding: 24px;
  font-family: 'Montserrat', sans-serif;
}
.crm-bl-counter {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  color: #6a8aaa; text-align: right; margin-bottom: 16px;
}
.crm-bl-nombre {
  font-size: 20px; font-weight: 700; color: #e8e4da; margin-bottom: 4px;
}
.crm-bl-tipo {
  font-size: 12px; font-weight: 600; color: #C9A84C;
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px;
}
.crm-bl-meta {
  font-size: 13px; color: #7a9bbf; margin-bottom: 6px;
}
.crm-bl-nota {
  font-size: 13px; color: #a0b8d0; background: #091627;
  border-left: 3px solid #1e3a58; padding: 8px 12px;
  border-radius: 0 6px 6px 0; margin: 10px 0;
}
.crm-bl-contacto {
  display: flex; gap: 8px; margin: 14px 0;
  flex-wrap: wrap;
}
.crm-bl-btn-call {
  background: #1a5c2a; color: #5de898; border: 1px solid #2a7a40;
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Montserrat', sans-serif;
}
.crm-bl-btn-wa {
  background: #0f3d20; color: #4cd679; border: 1px solid #1a6030;
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Montserrat', sans-serif;
}
.crm-bl-acciones {
  display: flex; flex-direction: column; gap: 8px; margin-top: 16px;
}
.crm-bl-sep { border: none; border-top: 1px solid #1e3a58; margin: 16px 0; }
.crm-bl-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.crm-bl-form label { font-size: 13px; color: #a0b8d0; }
.crm-bl-form select,
.crm-bl-form textarea,
.crm-bl-form input[type="date"],
.crm-bl-form input[type="time"] {
  background: #091627; border: 1px solid #1e3a58; color: #e8e4da;
  border-radius: 6px; padding: 8px 10px; font-size: 13px; width: 100%;
  font-family: 'Montserrat', sans-serif;
}
.crm-bl-form textarea { resize: vertical; min-height: 60px; }
.crm-bl-subtitle {
  font-size: 14px; font-weight: 600; color: #e8e4da; margin-bottom: 8px;
}

/* ── Panel KPI ───────────────────────────────────────────────────────────── */
/* ── KPI Panel ───────────────────────────────────────────────────────────── */
.crm-modal-kpi-wide { max-width: 860px; width: 96vw; }
.crm-kpi-tabs {
  display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid #1e3a58; padding-bottom: 6px;
}
.crm-kpi-tab {
  background: none; border: 1px solid transparent; color: #6a8aaa;
  padding: 5px 16px; border-radius: 6px 6px 0 0; cursor: pointer; font-size: 13px;
  font-family: 'Montserrat', sans-serif;
}
.crm-kpi-tab.active { background: #0d2033; border-color: #1e3a58; color: #e8e4da; }

/* Semáforo */
.kpi-verde   { color: #4cd679; font-weight: 700; }
.kpi-amarillo{ color: #e0c050; font-weight: 700; }
.kpi-rojo    { color: #e05555; font-weight: 700; }

/* Tabla comparativa CEO/Erik */
.crm-kpi-table-wrap { overflow-x: auto; }
.crm-kpi-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
  font-family: 'Montserrat', sans-serif;
}
.crm-kpi-table th {
  background: #091627; color: #6a8aaa; font-weight: 600;
  padding: 7px 10px; text-align: center; border-bottom: 1px solid #1e3a58;
  white-space: nowrap;
}
.crm-kpi-table th:first-child { text-align: left; }
.crm-kpi-table td {
  padding: 7px 10px; border-bottom: 1px solid #1a2e44; color: #c0d4e8;
  text-align: center;
}
.crm-kpi-table td.kpi-name { text-align: left; font-weight: 600; }
.crm-kpi-table tr:last-child td { border-bottom: none; }
.kpi-meta-small { color: #4a6a8a; font-size: 11px; margin-left: 2px; }

/* Tarjetas asesor */
.crm-kpi-asesor-name { font-weight: 700; font-size: 15px; margin-bottom: 12px; color: #e8e4da; }
.crm-kpi-periodo-label {
  font-size: 12px; color: #6a8aaa; margin: 14px 0 8px; font-weight: 600; letter-spacing: .3px;
}
.crm-kpi-cards { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.kpi-card {
  background: #0d2033; border: 1px solid #1e3a58; border-radius: 10px;
  padding: 12px 16px; min-width: 140px; flex: 1;
  border-left: 4px solid #1e3a58;
}
.kpi-card-verde   { border-left-color: #4cd679; }
.kpi-card-amarillo{ border-left-color: #e0c050; }
.kpi-card-rojo    { border-left-color: #e05555; }
.kpi-card-label   { font-size: 11px; color: #6a8aaa; margin-bottom: 6px; }
.kpi-card-valor   { font-size: 22px; font-weight: 700; color: #e8e4da; }
.kpi-card-meta    { font-size: 13px; color: #4a6a8a; margin-left: 2px; }
.kpi-card-pct     { font-size: 11px; color: #7a9bbf; margin-top: 4px; }
.kpi-card-esp     { font-size: 10px; color: #4a6a8a; margin-top: 2px; }
.kpi-card-meta-v  { font-size: 11px; color: #4a6a8a; margin-top: 4px; }
.kpi-badge-finde  { background: #1e3a58; color: #7a9bbf; border-radius: 4px; padding: 1px 5px; font-size: 10px; }

/* Barra de tendencia */
.crm-kpi-tendencia { margin-top: 16px; }
.kpi-bars { display: flex; align-items: flex-end; gap: 3px; height: 80px; overflow-x: auto; padding-bottom: 20px; }
.kpi-bar-wrap { display: flex; flex-direction: column; align-items: center; min-width: 24px; }
.kpi-bar { width: 18px; border-radius: 3px 3px 0 0; transition: height .2s; }
.kpi-bar-habil { background: #2a5a8a; }
.kpi-bar-finde { background: #1e3a58; }
.kpi-bar-label { font-size: 9px; color: #4a6a8a; margin-top: 2px; }

/* Heredado de la versión anterior */
.kpi-ok   { color: #4cd679; font-weight: 700; }
.kpi-late { color: #e0a055; font-weight: 700; }
.kpi-repr { color: #7a9bbf; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .crm-kanban-wrap { gap: 8px; padding: 8px; }
  .kanban-col { flex: 0 0 180px; }
  .crm-ficha-panel { width: 100vw; }
  .crm-rec-panel { width: 100vw; border-radius: 12px 12px 0 0; }
}

/* ── Parte 2: Cierres, Doble cara, Comisiones ───────────────────────────── */

/* Sección de cierre en ficha */
.ficha-cierre-wrap { background: #0a1420; border-radius: 8px; padding: 14px; margin-bottom: 20px; }
.ficha-cierre-wrap h4 { margin: 0 0 10px; font-size: 13px; color: #7a9bbf; font-weight: 600; }
.cierre-item { padding: 10px 0; border-bottom: 1px solid #1a2e44; }
.cierre-item:last-child { border-bottom: none; }
.cierre-cancelado { opacity: .5; }
.cierre-cancelado-badge { background: #5c1a1a; color: #e07777; border-radius: 4px; padding: 1px 6px; font-size: 10px; margin-bottom: 4px; display: inline-block; }
.cierre-datos { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.cierre-datos strong { color: #e8e4da; }
.cierre-datos em { color: #7a9bbf; font-style: normal; }
.cierre-datos span { color: #6a8aaa; font-size: 12px; }
.cierre-comisiones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 12px; color: #7a9bbf; }
.cierre-comisiones b { color: #e8e4da; }
.cierre-cobranza-label { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.cierre-cancelar-btn { margin-top: 4px; }

/* Doble cara en ficha */
.ficha-doble-cara { background: #0a1420; border-radius: 8px; padding: 12px; margin-bottom: 14px; }
.ficha-doble-cara h4 { margin: 0 0 8px; font-size: 13px; color: #7a9bbf; font-weight: 600; }
.dc-item { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 13px; }
.dc-quitar { color: #e05555; }
.dc-badge { background: #1e3a58; color: #6cb6e8; border-radius: 4px; padding: 1px 6px; font-size: 10px; }

/* Panel cierres CEO */
.crm-modal-wide { max-width: 900px !important; width: 95vw; }
.cierres-filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.cierres-filtros label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #7a9bbf; }
.cierres-tabla { width: 100%; border-collapse: collapse; font-size: 12px; }
.cierres-tabla th { background: #0a1420; padding: 7px 8px; text-align: left; color: #7a9bbf; font-weight: 600; border-bottom: 1px solid #1a2e44; }
.cierres-tabla td { padding: 7px 8px; border-bottom: 1px solid #0e1e30; color: #c8c4ba; vertical-align: middle; }
.cierres-tabla td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cierres-tabla tr:hover td { background: #0a1f30; }
.cierre-fila-cancelada td { opacity: .5; }
.cierres-totales { display: flex; gap: 24px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid #1a2e44; font-size: 13px; color: #7a9bbf; }
.cierres-totales b { color: #e8e4da; }

/* Modal cierre / cancelar */
.crm-help { font-size: 11px; color: #4a6a8a; margin: 2px 0; }

/* Proyecciones en la ficha */
.ficha-proy-wrap { margin-top:18px; }
.proy-item-ficha { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid rgba(255,255,255,.08); font-size:13px; }
.proy-item-meta { font-size:11px; color:#7a9bbf; margin-top:2px; }
.proy-item-meta code { font-size:11px; }

/* Estatus de cierre: Separado y Firmado en la gama dorada de "Cierre" */
.cierre-badge { display:inline-block; padding:2px 9px; border-radius:10px; font-size:11px; font-weight:700; border:1px solid; white-space:nowrap; }
.cierre-badge-separado { background:#F6EBC8; color:#6B5410; border-color:#D9BE6E; border-style:dashed; }
.cierre-badge-firmado  { background:#C9A84C; color:#0D1B2A; border-color:#8E7426; }
.cierre-badge-cancelado { background:#FCEBEB; color:#791F1F; border-color:#A32D2D; }
.cierre-pendiente { display:inline-block; margin-left:6px; padding:1px 7px; border-radius:10px; background:#fff1d6; color:#8b6914; font-size:11px; }
.cierre-firmar-btn { margin-top:8px; }

/* Importación de hojas de asesores */
.crm-import-guia { margin:0 0 10px 18px; padding:0; font-size:13px; line-height:1.6; color:#e8e4da; }
.crm-import-aviso { background:rgba(214,69,69,.12); border:1px solid rgba(214,69,69,.5); border-radius:8px; padding:8px 12px; font-size:12px; color:#f2c4c4; }
.crm-import-resumen { font-size:13px; }
.crm-import-bloque { margin:10px 0; padding:8px 12px; border:1px solid rgba(255,255,255,.12); border-radius:8px; font-size:13px; }
.crm-import-tabla-mapeo td { padding:3px 6px; font-size:12px; }
.imp-pill { display:inline-block; padding:1px 8px; border-radius:10px; font-size:11px; font-weight:600; background:rgba(255,255,255,.1); margin:1px 2px; }
.imp-nuevo { background:#1D9E75; color:#fff; } .imp-act { background:#185FA5; color:#fff; }
.imp-ajeno { background:#7a5a10; color:#fff; } .imp-error { background:#A32D2D; color:#fff; }
.imp-desconocido { margin:6px 0; } .imp-chips { display:flex; flex-wrap:wrap; gap:4px; margin-top:4px; }
.imp-chip { border:1px solid; border-radius:12px; padding:2px 9px; font-size:11px; font-weight:600; cursor:pointer; }
.imp-grupo { margin:10px 0; } .imp-grupo-t { margin-bottom:4px; }
.imp-fila { padding:6px 10px; border-left:3px solid rgba(255,255,255,.15); margin:3px 0; font-size:12px; }
.imp-fila-act { border-left-color:#185FA5; }
.imp-check { display:flex; gap:6px; align-items:flex-start; margin-top:4px; font-size:12px; color:#c9d6e3; }
.imp-rec { color:#E8D48A; }
.seg-importado { color:#C9A84C; font-weight:600; }
/* Contraste dentro del modal oscuro de importación */
#crm-modal-importar .crm-import-bloque, #crm-modal-importar .imp-fila, #crm-modal-importar .imp-desconocido,
#crm-modal-importar .crm-import-resumen, #crm-modal-importar summary, #crm-modal-importar .crm-import-errores { color:#e8e4da; }
#crm-modal-importar .imp-fila small, #crm-modal-importar .imp-grupo-t small, #crm-modal-importar .imp-desconocido small { color:#9fb3c8; }
#crm-modal-importar .imp-pill { background:rgba(255,255,255,.16); color:#e8e4da; }
#crm-modal-importar .imp-nuevo { background:#1D9E75; color:#fff; }
#crm-modal-importar .imp-act { background:#185FA5; color:#fff; }
#crm-modal-importar .imp-ajeno { background:#7a5a10; color:#fff; }
#crm-modal-importar .imp-error { background:#A32D2D; color:#fff; }
#crm-modal-importar label.imp-check { flex-direction:row; align-items:flex-start; gap:8px; color:#c9d6e3; }
#crm-modal-importar label.imp-check input { margin-top:2px; flex:0 0 auto; }
#crm-modal-importar label.imp-rec { color:#E8D48A; }
#crm-modal-importar .imp-fila strong { color:#fff; }

/* ── Google Calendar ── */
.gcal-ind { display: inline-block; min-width: 14px; margin-left: 4px; font-weight: 700; }
.gcal-ind.gcal-ok { color: #1D9E75; }
.gcal-ind.gcal-warn { color: #fff; background: #D85A30; border-radius: 8px; padding: 0 5px; }
#modal-gcal .gcal-texto { color: #e8e4da; font-size: 13px; line-height: 1.45; }
#modal-gcal .gcal-texto ul { margin: 6px 0 12px 18px; padding: 0; }
#modal-gcal .gcal-estado, #modal-gcal .gcal-pend { color: #e8e4da; font-size: 13px; }
#modal-gcal .gcal-aviso { background: #13243a; border-left: 4px solid #C9A84C; color: #e8e4da; padding: 8px 10px; border-radius: 6px; font-size: 13px; }
#modal-gcal .gcal-msg { color: #C9A84C; font-size: 13px; min-height: 1em; }
#modal-gcal a.crm-btn { text-decoration: none; display: inline-flex; align-items: center; }
#modal-gcal .gcal-deshabilitado { opacity: .5; pointer-events: none; }
.rec-gcal-link { font-size: 12px; color: #C9A84C; text-decoration: none; margin-top: 2px; }
.rec-gcal-link:hover { text-decoration: underline; }

/* ── ⏳ Contactar en el futuro ── */
.prosp-pausa { font-size: 12px; color: #2B4560; background: #E8EEF4; border: 1px dashed #6F8BA6; border-radius: 6px; padding: 2px 8px; }
.kanban-col-pausa { margin-left: 14px; border-left: 2px dashed #6F8BA6; padding-left: 10px; }
.kanban-card-pausa { display: block; font-size: 11px; color: #2B4560; background: #E8EEF4; border-radius: 4px; padding: 1px 6px; margin-top: 4px; }
.ficha-pausa { background: #E8EEF4; color: #2B4560; border: 1px dashed #6F8BA6; border-radius: 8px; padding: 10px 12px; margin: 10px 0; font-size: 13px; line-height: 1.5; }
.ficha-pausa .crm-help { color: #2B4560; }
.ficha-pausa-acciones { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.ficha-pausa-check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #b8c7d8; margin: 4px 0; }
.pausa-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.pausa-form label:nth-child(n+3), .pausa-form .pausa-cita, .pausa-form .crm-error { grid-column: 1 / -1; }
.pausa-cita { display: grid; grid-template-columns: 1fr 2fr; gap: 0 12px; }
.pausa-cita[hidden] { display: none; }
.pausa-etapas { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.pausa-etapa { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: #e8e4da; }
.pausa-etapa small { color: #C9A84C; }
.rec-etiqueta { display: inline-block; font-size: 12px; font-weight: 700; color: #2B4560; background: #E8EEF4; border-radius: 4px; padding: 1px 6px; }
.kpi-pausa { margin-top: 18px; }
.kpi-pausa h4 { color: #e8e4da; margin: 0 0 8px; }
.kpi-pausa-tabla { width: 100%; border-collapse: collapse; font-size: 13px; color: #e8e4da; }
.kpi-pausa-tabla th, .kpi-pausa-tabla td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #24384f; }
.kpi-pausa-tabla tfoot td { font-weight: 700; }
.kpi-pausa-venc { color: #D85A30; }
#crm-modal-importar .imp-pausa { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; padding: 6px 8px; background: #E8EEF4; border: 1px dashed #6F8BA6; border-radius: 6px; color: #2B4560; }
#crm-modal-importar .imp-pausa-t { font-size: 12px; font-weight: 700; }
#crm-modal-importar .imp-pausa-falta { color: #A32D2D; }
@media (max-width: 480px) { .pausa-form, .pausa-cita { grid-template-columns: 1fr; } }
.ficha-pausa .crm-btn-ghost { color: #2B4560; border-color: #6F8BA6; background: #fff; }
.ficha-pausa .crm-btn-ghost:hover { background: #dfe7ef; }
#modal-pausa .crm-help { margin-bottom: 12px; }
.crm-bl-salir { float: right; margin-top: -4px; }

/* ── Reparto en bloque (importación) y lista de vencidos ── */
#crm-modal-importar .imp-reparto-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 8px; padding: 8px; border: 1px dashed #6F8BA6; border-radius: 6px; }
#crm-modal-importar .imp-reparto-form label { display: flex; flex-direction: column; font-size: 11px; gap: 2px; }
#crm-modal-importar .imp-reparto-form input[type=number] { width: 70px; }
#crm-modal-importar .imp-reparto-form .crm-help, #crm-modal-importar .imp-reparto-form .crm-error { flex-basis: 100%; margin: 0; }
#crm-modal-importar .imp-reparto-ok { color: #085041; background: #E1F5EE; border-radius: 6px; padding: 6px 8px; }
.crm-bloqueante-panel:has(#bl-lista) { max-width: 640px; }
.bl-lista-todos { display: flex; gap: 6px; align-items: center; font-size: 12px; color: #a0b8d0; margin: 6px 0; }
.bl-lista { max-height: 50vh; overflow-y: auto; border: 1px solid #1e3a58; border-radius: 8px; }
.bl-fila { display: grid; grid-template-columns: 20px 1fr auto auto; gap: 8px; align-items: center; padding: 7px 10px; border-bottom: 1px solid #1e3a58; font-size: 13px; color: #e8e4da; cursor: pointer; }
.bl-fila:last-child { border-bottom: 0; }
.bl-fila-tipo { font-size: 11px; color: #C9A84C; }
.bl-fila-venc { font-size: 11px; color: #7a9bbf; white-space: nowrap; }
.bl-fila-cita { opacity: .7; cursor: default; }
.bl-modo { display: flex !important; flex-direction: row !important; gap: 6px; align-items: center; margin-top: 8px; }
.bl-lt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0 10px; }
.bl-lt-grid[hidden] { display: none; }
.cumpl-lotes-t { color: #e8e4da; margin: 16px 0 6px; font-size: 13px; }
.cumpl-lotes { margin: 0; padding-left: 18px; font-size: 12px; color: #c8d6e5; line-height: 1.7; }
.cumpl-lotes small { color: #7a9bbf; }
@media (max-width: 480px) { .bl-fila { grid-template-columns: 20px 1fr; } .bl-fila-tipo, .bl-fila-venc { grid-column: 2; } }
.bl-lt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin: 4px 0 4px 24px; }
.bl-lt-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #7a9bbf; margin: 0; }
.bl-lt-grid input { width: 100%; box-sizing: border-box; background: #091627; border: 1px solid #1e3a58; color: #e8e4da; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
#crm-modal-importar .imp-pausa .crm-input, #crm-modal-importar .imp-pausa .crm-select { width: auto; flex: 0 0 auto; margin: 0; }
#crm-modal-importar .imp-pausa .imp-pz-fecha { width: 150px; }
#crm-modal-importar .imp-pausa .imp-pz-hora { width: 110px; }
#crm-modal-importar .imp-pausa .imp-pz-nota { flex: 1 1 160px; min-width: 120px; }
#crm-modal-importar .imp-pausa .imp-pausa-t { flex-basis: 100%; }
@media (max-width: 480px) { .bl-lt-grid { grid-template-columns: 1fr; margin-left: 0; } }

/* ── Fecha vacía "Sin fecha" (Safari pinta la fecha de hoy en gris en un input date vacío) ── */
.fecha-segura { position: relative; display: inline-block; max-width: 100%; }
.pausa-form .fecha-segura, .crm-bl-form .fecha-segura, .bl-lt-grid .fecha-segura, .crm-modal label > .fecha-segura,
.ficha-proxima .fecha-segura { display: block; }
.fecha-segura > input { width: 100%; box-sizing: border-box; }
.fecha-segura-txt { display: none; }
.fecha-segura.vacia > input { color: transparent !important; border: 2px solid #A32D2D !important; background: #FCEBEB !important; }
.fecha-segura.vacia > input::-webkit-datetime-edit,
.fecha-segura.vacia > input::-webkit-datetime-edit-fields-wrapper,
.fecha-segura.vacia > input::-webkit-date-and-time-value { color: transparent !important; opacity: 0; }
.fecha-segura.vacia > .fecha-segura-txt { display: flex; position: absolute; inset: 0; align-items: center; padding: 0 34px 0 10px;
  color: #A32D2D; font-weight: 700; font-size: 13px; pointer-events: none; white-space: nowrap; overflow: hidden; }
/* Filtros: vacío = sin filtro (neutro, no es error) */
.fecha-segura.fecha-filtro.vacia > input { border: 1px solid #1e3a58 !important; background: #091627 !important; }
.fecha-segura.fecha-filtro.vacia > .fecha-segura-txt { color: #7a9bbf; font-weight: 400; }
#crm-modal-importar .imp-pausa .fecha-segura { flex: 0 0 150px; }
#crm-modal-importar .imp-falta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#crm-modal-importar .imp-resaltar { box-shadow: 0 0 0 3px #C9A84C; transition: box-shadow .3s; }

/* ── Aviso: base de datos pendiente de actualizar ── */
.bd-aviso { position: fixed; top: 0; left: 0; right: 0; z-index: 9000; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center;
  background: #FAECE7; color: #712B13; border-bottom: 2px solid #D85A30; padding: 10px 16px; font-size: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.bd-aviso button { background: #D85A30; color: #fff; border: 0; border-radius: 6px; padding: 6px 12px; font-weight: 700; cursor: pointer; font-size: 13px; }
.bd-resaltar { box-shadow: 0 0 0 3px #D85A30 !important; }

/* ── Revisión de repartos (CEO, solo lectura) ── */
.rv-resumen { color: #e8e4da; font-size: 14px; margin: 8px 0 14px; }
.rv-h { color: #e8e4da; font-size: 14px; margin: 16px 0 6px; }
.rv-tabla td small { display: block; color: #7a9bbf; font-size: 11px; }
.rv-tabla .rv-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rv-afectado td { background: rgba(216, 90, 48, .08); }
.rv-dif.rv-pos { color: #1D9E75; font-weight: 700; }
.rv-dif.rv-neg { color: #D85A30; font-weight: 700; }
.rv-alerta { font-size: 11px; color: #D85A30; }
.rv-check { display: flex !important; flex-direction: row !important; gap: 6px; align-items: center; }
.rv-acciones { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 10px 0; color: #e8e4da; }
.rv-acciones label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; flex: 1 1 380px; }
.rv-msg { flex-basis: 100%; margin: 0; font-size: 13px; }
.rv-msg.rv-ok { color: #1D9E75; }
.rv-btn { font-size: 12px; padding: 4px 8px; margin: 2px 0; white-space: nowrap; }
.rv-acc { min-width: 150px; }

/* ── Ajustar porcentajes (CEO) ── */
#modal-ajuste .aj-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
#modal-ajuste .aj-campos small, #modal-ajuste .aj-reparto small { color: #C9A84C; font-size: 11px; }
#modal-ajuste .aj-reparto { margin: 10px 0; color: #e8e4da; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
#modal-ajuste .aj-reparto strong { flex-basis: 100%; font-size: 13px; }
#modal-ajuste .aj-reparto label { flex-direction: row; align-items: center; gap: 6px; }
#modal-ajuste .aj-reparto input { width: 90px; }
#modal-ajuste .aj-tabla { width: 100%; margin-top: 8px; color: #e8e4da; font-size: 13px; }
#modal-ajuste .aj-tabla td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
#modal-ajuste .aj-cambia { color: #C9A84C; font-weight: 700; }
#modal-ajuste .aj-suma { color: #7a9bbf; font-size: 11px; }
#modal-ajuste .aj-pagado { background: #FAECE7; color: #712B13; border-radius: 6px; padding: 8px 10px; font-size: 13px; }
#modal-ajuste .aj-confirma { flex-direction: row; align-items: center; gap: 6px; color: #e8e4da; }
#modal-ajuste .aj-motivo { margin-top: 10px; }

/* ── Fecha real de firma: aviso de mes de KPI ── */
.fc-mes-aviso { background: #FAECE7; color: #712B13; border-radius: 6px; padding: 8px 10px; margin: -4px 0 10px; font-size: 13px; }
.fc-mes-aviso .fc-mes-check { display: flex !important; flex-direction: row !important; gap: 6px; align-items: center; color: #712B13 !important; margin: 6px 0 0 !important; font-size: 12px; }
.rv-integridad { background: #FAECE7; color: #712B13; border-radius: 6px; padding: 8px 10px; font-size: 13px; margin: 6px 0; }
.rv-diag-fondo { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.rv-diag { background: #0f1e30; color: #e8e4da; border: 1px solid #1e3a58; border-radius: 12px; padding: 18px 20px; width: 100%; max-width: 860px; max-height: 90vh; overflow-y: auto; }
.rv-diag h3 { margin: 0 0 4px; font-size: 16px; } .rv-diag h4 { margin: 14px 0 6px; font-size: 13px; }
.rv-diag th { text-align: left; color: #7a9bbf; font-weight: 600; white-space: nowrap; }
.rv-diag .rv-det { font-size: 11px; color: #a0b8d0; max-width: 360px; word-break: break-word; }

/* Filtro y etiqueta "Doble cara" */
.crm-conteo { font-size: 13px; color: #e8e4da; opacity: .85; align-self: center; white-space: nowrap; }
.dc-etiqueta { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: #EEEDFE; color: #3C3489; border: 1px solid #7F77DD; }

/* Catálogo (2026-10-14): tipologías con precio por m², marcas internas del CEO y "Actualizar precios" */
.cat-tipologias-wrap, .cat-tabla-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; margin-bottom:12px; }
.cat-tipologias, .cat-tabla { width:100%; border-collapse:collapse; font-size:13px; }
.cat-tipologias th, .cat-tipologias td, .cat-tabla th, .cat-tabla td { padding:6px 8px; border-bottom:1px solid #e3e6ec; text-align:left; vertical-align:top; }
.cat-tipologias th, .cat-tabla th { background:#0D1B2A; color:#e8e4da; font-weight:600; white-space:nowrap; }
.cat-marcas { display:flex; flex-wrap:wrap; gap:4px; margin:4px 0; }
.cat-marca { display:inline-block; font-size:11px; padding:2px 6px; border-radius:10px; border:1px solid #c9ccd3; background:#f4f5f7; color:#2b2f36; }
.cat-m-oculto { background:#FCEBEB; color:#791F1F; border-color:#A32D2D; }
.cat-m-sesion { background:#E6F1FB; color:#0C447C; border-color:#85B7EB; }
.cat-m-confirmar { background:#FAECE7; color:#712B13; border-color:#D85A30; }
.cat-m-pendiente { background:#FFF6DC; color:#6B5410; border-color:#C9A84C; border-style:dashed; }
.cat-m-sinact { background:#E8EEF4; color:#2B4560; border-color:#6F8BA6; }
.cat-ceo-bar { display:flex; gap:8px; flex-wrap:wrap; margin:0 0 12px; padding:0 12px; }
.cat-ceo-bar .btn, .cat-ceo-acciones .btn { font-size:13px; padding:7px 10px; }
.cat-ceo-acciones { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; }
.cat-modal-fondo { position:fixed; inset:0; background:rgba(13,27,42,.55); z-index:3000; display:flex; align-items:flex-start; justify-content:center; padding:24px 12px; overflow-y:auto; }
.cat-modal-fondo[hidden] { display:none; }
.cat-modal { background:#fff; color:#1d2530; border-radius:10px; width:min(980px,100%); max-width:100%; box-shadow:0 10px 40px rgba(0,0,0,.3); }
.cat-modal-head { display:flex; justify-content:space-between; align-items:center; padding:14px 16px; border-bottom:1px solid #e3e6ec; }
.cat-modal-head h3 { margin:0; font-size:17px; }
.cat-cerrar { background:none; border:0; font-size:20px; cursor:pointer; padding:4px 8px; color:#1d2530; }
.cat-modal-body { padding:14px 16px; }
.cat-modal-body h4 { margin:16px 0 6px; font-size:14px; color:#0D1B2A; }
.cat-ayuda { color:#5b6472; font-size:13px; }
.cat-error { color:#A32D2D; font-weight:600; }
.cat-ok { color:#0F6E56; font-weight:600; }
.cat-resumen { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.cat-resumen span { background:#f4f5f7; border-radius:6px; padding:6px 10px; font-size:13px; }
.cat-pie { position:sticky; bottom:0; background:#fff; padding:12px 0 4px; border-top:1px solid #e3e6ec; margin-top:12px; }
/* Editar proyecto (2026-10-14) */
.cat-form { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:10px; }
.cat-campo { display:flex; flex-direction:column; gap:3px; font-size:13px; color:#3b4350; }
.cat-campo input, .cat-campo select, .cat-campo textarea, .cat-coords input, .cat-tabla input { padding:7px 9px; border:1px solid #d0d5de; border-radius:6px; font-size:14px; width:100%; box-sizing:border-box; font-family:inherit; }
.cat-coords { display:grid; grid-template-columns:1fr auto; gap:8px; align-items:end; }
.cat-coords .cat-campo { grid-column:span 1; }
.cat-mini-mapa { height:240px; border-radius:8px; border:1px solid #d0d5de; margin-bottom:8px; }
.cat-fotos { display:grid; grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap:10px; margin-top:8px; }
.cat-foto { position:relative; border:1px solid #d0d5de; border-radius:8px; overflow:hidden; background:#f4f5f7; }
.cat-foto img { width:100%; height:100px; object-fit:cover; display:block; }
.cat-foto-portada { position:absolute; top:6px; left:6px; background:#C9A84C; color:#0D1B2A; font-size:11px; font-weight:700; padding:2px 6px; border-radius:8px; }
.cat-foto-acc { display:flex; gap:4px; padding:6px; flex-wrap:wrap; }
.cat-foto-acc .btn { padding:4px 8px; font-size:12px; min-width:32px; }
.cat-faltan { color:#712B13; }
.cat-permiso-erik { background:#fff; border:1px solid #e3e6ec; border-radius:8px; padding:12px 14px; margin-bottom:14px; font-size:14px; }
.cat-permiso-erik label { display:flex; gap:8px; align-items:flex-start; cursor:pointer; }
.prosp-llego { color:#5b6472; font-size:12px; }

/* Formulario de cita al pasar a "Cita agendada" (2026-10-22) */
.crm-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.crm-form-grid label { display:flex; flex-direction:column; gap:4px; font-size:13px; }
@media (max-width:480px) { .crm-form-grid { grid-template-columns:1fr; } }

/* 📅 Calendario interno (2026-10-22) */
.cal-vista { padding:16px; overflow-y:auto; height:calc(100vh - 60px); box-sizing:border-box; background:#fff; color:#1d2530; }
.cal-barra { display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between; margin-bottom:10px; }
.cal-titulo { margin:0; font-size:20px; color:#0D1B2A; }
.cal-filtros { display:flex; flex-wrap:wrap; gap:8px; }
.cal-aviso { background:#E6F1FB; color:#0C447C; border:1px solid #85B7EB; border-radius:6px; padding:8px 10px; font-size:13px; }
.cal-vencidas { margin-bottom:10px; }
.cal-vencidas h3 { margin:0 0 6px; font-size:15px; color:#A32D2D; }
.cal-venc-lista { display:flex; flex-direction:column; gap:6px; max-height:220px; overflow-y:auto; }
.cal-venc { display:flex; flex-wrap:wrap; gap:4px 12px; justify-content:space-between; text-align:left; background:#FCEBEB; border:1px solid #A32D2D; border-left-width:5px; border-radius:6px; padding:8px 10px; font-size:13px; color:#3a1010; cursor:pointer; }
.cal-sin-venc { color:#0F6E56; font-size:13px; margin:4px 0 10px; }
.cal-leyenda { display:flex; flex-wrap:wrap; gap:6px; margin:6px 0 10px; font-size:12px; }
.cal-ley { padding:2px 8px; border-radius:10px; border:1px solid #c9ccd3; background:#f4f5f7; }
.cal-ev-txt { white-space:normal; overflow:hidden; font-size:12px; line-height:1.25; padding:1px 2px; }
.cal-ev-as { opacity:.8; font-weight:400; }
/* Tipos (borde izquierdo / fondo) */
.fc .cal-t-llamada, .cal-ley.cal-t-llamada, .cal-venc.cal-t-llamada { --c:#185FA5; }
.fc .cal-t-mensaje, .cal-ley.cal-t-mensaje, .cal-venc.cal-t-mensaje { --c:#1D9E75; }
.fc .cal-t-cita, .cal-ley.cal-t-cita, .cal-venc.cal-t-cita { --c:#C9A84C; }
.fc .cal-t-recontacto, .cal-ley.cal-t-recontacto, .cal-venc.cal-t-recontacto { --c:#6F8BA6; }
.fc .cal-t-otra, .cal-ley.cal-t-otra, .cal-venc.cal-t-otra { --c:#7F77DD; }
.cal-ley[class*="cal-t-"] { border-left:4px solid var(--c); }
.fc .fc-event[class*="cal-t-"] { background:color-mix(in srgb, var(--c) 18%, #fff); border:1px solid var(--c); border-left:4px solid var(--c); color:#1d2530; }
.fc .fc-list-event[class*="cal-t-"] { background:transparent; border:0; }
.fc .fc-list-event[class*="cal-t-"] td { border-left:4px solid var(--c); }
/* Estados */
.fc .fc-event.cal-e-vencida, .cal-ley.cal-e-vencida { background:#FCEBEB; border-color:#A32D2D; color:#791F1F; }
.fc .fc-event.cal-e-hecha, .cal-ley.cal-e-hecha { opacity:.65; text-decoration:line-through; }
.fc .fc-event.cal-e-reprogramada, .cal-ley.cal-e-reprogramada { border-style:dashed; opacity:.6; }
.cal-ley.cal-e-vencida { color:#791F1F; } .cal-ley.cal-e-reprogramada { border-style:dashed; }
.fc .cal-feriado { background:#FFF6DC; }
.cal-fer-txt { font-size:10px; color:#6B5410; font-weight:400; }
.fc .fc-toolbar-title { font-size:17px; color:#0D1B2A; }
.fc .fc-button { font-size:13px; }
@media (max-width:767px) { .fc .fc-toolbar { flex-direction:column; gap:6px; } .cal-vista { padding:10px; } }
/* Detalle y motivo */
.cal-modal-fondo { position:fixed; inset:0; background:rgba(13,27,42,.55); z-index:3500; display:flex; align-items:center; justify-content:center; padding:16px; }
.cal-modal { background:#fff; color:#1d2530; border-radius:10px; width:min(460px,100%); max-height:90vh; overflow-y:auto; padding:14px 16px; box-shadow:0 10px 40px rgba(0,0,0,.3); }
.cal-modal-head { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.cal-modal-head h3 { margin:0; font-size:17px; }
.cal-cerrar { background:none; border:0; font-size:20px; cursor:pointer; padding:4px 8px; color:#1d2530; }
.cal-det { display:grid; grid-template-columns:auto 1fr; gap:4px 12px; font-size:14px; margin:12px 0; }
.cal-det dt { color:#5b6472; } .cal-det dd { margin:0; }
.cal-estado { padding:1px 8px; border-radius:10px; border:1px solid #c9ccd3; font-size:12px; }
.cal-estado.cal-e-vencida { background:#FCEBEB; color:#791F1F; border-color:#A32D2D; }
.cal-estado.cal-e-hecha { background:#E1F5EE; color:#085041; border-color:#1D9E75; }
.cal-estado.cal-e-reprogramada { border-style:dashed; }
.cal-acciones { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.cal-acciones .crm-btn { text-decoration:none; }
.cal-campo { display:flex; flex-direction:column; gap:4px; font-size:13px; margin:8px 0; }
/* Calendario: "Citas sin fecha" (2026-10-23) */
.cal-sinfecha { margin-bottom:10px; }
.cal-sinfecha h3 { margin:0 0 4px; font-size:15px; color:#6B5410; }
.cal-ayuda { font-size:12px; color:#5b6472; margin:0 0 6px; }
.cal-sf-lista { display:flex; flex-direction:column; gap:6px; max-height:220px; overflow-y:auto; }
.cal-sf { display:flex; flex-wrap:wrap; gap:6px 12px; align-items:center; justify-content:space-between; background:#FFF6DC; border:1px dashed #C9A84C; border-radius:6px; padding:8px 10px; font-size:13px; }
.cal-sf-sug { color:#6B5410; font-size:12px; }
.ct-sugerida { background:#FFF6DC; border:1px dashed #C9A84C; border-radius:6px; padding:6px 8px; }

/* 📈 Desempeño (2026-10-23) */
.des-vista { padding:16px; overflow-y:auto; height:calc(100vh - 60px); box-sizing:border-box; background:#fff; color:#1d2530; }
.des-barra { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.des-titulo { margin:0 8px 0 0; font-size:20px; color:#0D1B2A; }
.des-periodos { display:flex; border:1px solid #c9ccd3; border-radius:8px; overflow:hidden; }
.des-per { background:#fff; border:0; padding:7px 12px; cursor:pointer; font-size:13px; color:#1d2530; }
.des-per.activo { background:#0D1B2A; color:#e8e4da; }
.des-sub { color:#5b6472; font-size:12px; margin:6px 0 10px; }
.des-cards { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:10px; margin-bottom:12px; }
.des-card { display:flex; flex-direction:column; gap:3px; text-align:left; background:#fff; border:1px solid #e3e6ec; border-left:5px solid #c9ccd3; border-radius:8px; padding:10px 12px; font:inherit; color:inherit; cursor:pointer; }
.des-card.des-verde { border-left-color:#1D9E75; } .des-card.des-ambar { border-left-color:#C9A84C; } .des-card.des-rojo { border-left-color:#A32D2D; }
.des-card-t { font-size:12px; color:#5b6472; text-transform:uppercase; letter-spacing:.03em; }
.des-card-v { font-size:22px; font-weight:700; color:#0D1B2A; } .des-card-v small { font-size:13px; color:#5b6472; font-weight:400; }
.des-card-p, .des-card-r, .des-card-d { font-size:12px; color:#3b4350; }
.des-ritmo { height:6px; background:#eef0f4; border-radius:3px; overflow:hidden; } .des-ritmo span { display:block; height:100%; background:#C9A84C; }
.des-verde .des-ritmo span { background:#1D9E75; } .des-rojo .des-ritmo span { background:#A32D2D; }
.des-sec { border:1px solid #e3e6ec; border-radius:8px; padding:10px 12px; margin-bottom:12px; }
.des-sec h3 { margin:0 0 8px; font-size:15px; color:#0D1B2A; }
.des-recs { display:flex; flex-direction:column; gap:8px; }
.des-rec { display:flex; gap:10px; background:#FFF6DC; border:1px solid #E7D49A; border-radius:8px; padding:8px 10px; }
.des-rec p { margin:3px 0; font-size:13px; } .des-rec-n { font-weight:700; color:#6B5410; font-size:18px; }
.des-rec-a { color:#0D1B2A; font-weight:600; } .des-rec-i { color:#0F6E56; font-size:12px !important; }
.des-reglas summary { cursor:pointer; font-size:12px; color:#5b6472; margin-top:6px; }
.des-regla { font-size:12px; padding:3px 0; } .des-r-alerta { color:#791F1F; } .des-r-ok { color:#085041; } .des-r-datos_insuficientes { color:#5b6472; }
.des-embudo { display:flex; flex-direction:column; gap:4px; }
.des-emb-f { display:grid; grid-template-columns:150px 1fr 90px; gap:8px; align-items:center; font-size:13px; }
.des-emb-b { height:14px; background:#eef0f4; border-radius:3px; overflow:hidden; } .des-emb-b span { display:block; height:100%; background:#0D1B2A; }
.des-tiles { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:8px; }
.des-tiles div { background:#f6f7f9; border-radius:6px; padding:8px; display:flex; flex-direction:column; gap:2px; }
.des-tiles b { font-size:18px; color:#0D1B2A; } .des-tiles span { font-size:12px; color:#3b4350; }
.des-mini { font-size:12px; color:#5b6472; margin:6px 0 0; }
.des-tabla { width:100%; border-collapse:collapse; font-size:13px; } .des-tabla th, .des-tabla td { padding:5px 7px; border-bottom:1px solid #eef0f4; text-align:left; }
.des-tabla th { background:#0D1B2A; color:#e8e4da; font-weight:600; } .des-tabla small { color:#5b6472; }
.des-prom td { font-weight:700; background:#f6f7f9; }
.des-verde-t { color:#085041; } .des-ambar-t { color:#6B5410; } .des-rojo-t { color:#791F1F; }
.des-rank-wrap, .des-heat-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
.des-heat { border-collapse:collapse; font-size:11px; } .des-heat th, .des-heat td { padding:3px 5px; text-align:center; min-width:24px; }
.des-heat td { background:rgba(201,168,76, var(--a, 0)); } .des-conv td { background:#f6f7f9; color:#085041; font-weight:600; }
.des-chart { position:relative; height:240px; margin-top:6px; }
.des-link { background:none; border:0; color:#185FA5; text-decoration:underline; cursor:pointer; font:inherit; padding:0; }
.des-nombre { margin:4px 0 10px; color:#0D1B2A; }
.des-modal { width:min(900px, 100%); }
.des-modal-body { padding:10px 2px; }
.des-modal-body h4 { margin:14px 0 6px; color:#0D1B2A; }
.des-form { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:6px 0; }
.des-umb { display:grid; grid-template-columns:repeat(auto-fit, minmax(230px, 1fr)); gap:6px; }
.des-umb label { display:flex; flex-direction:column; font-size:12px; gap:2px; }
.des-in { width:84px; }
@media (max-width:767px) {
  .des-vista { padding:10px; } .des-cards { grid-template-columns:1fr 1fr; } .des-card-v { font-size:18px; }
  .des-emb-f { grid-template-columns:110px 1fr 70px; font-size:12px; }
}
@media (max-width:400px) { .des-cards { grid-template-columns:1fr; } }
/* Ficha: ✏️ junto al nombre (solo CEO, 2026-10-23) */
.ficha-nombre-fila { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.ficha-nombre-fila .ficha-nombre { margin:0; }
/* Doble cara: próxima acción del otro asesor (solo lectura, 2026-10-26) */
.ficha-proximas-otros { margin: -6px 0 14px; display: flex; flex-direction: column; gap: 4px; }
.ficha-proxima-otro   { font-size: 12px; color: #b9c7d6; background: rgba(255,255,255,.04); border: 1px dashed #3b5068; border-radius: 6px; padding: 6px 10px; }
