/* CRM SASOFTCO - estilos
   Marca SASOFTCO: tipografía Lato y paleta corporativa
   (navy #194896, azul profundo #1755ab, azul #1379da, cielo #2ec6ea),
   tomadas de los logos oficiales y del Portafolio v3.4. */
@font-face { font-family: 'Lato'; src: url('marca/Lato-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Lato'; src: url('marca/Lato-Semibold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Lato'; src: url('marca/Lato-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Lato'; src: url('marca/Lato-Black.ttf') format('truetype'); font-weight: 900; font-display: swap; }

:root {
  /* Paleta corporativa */
  --navy: #194896;
  --azul-profundo: #1755ab;
  --azul: #1379da;
  --cielo: #2ec6ea;
  /* Neutros del manual */
  --fondo: #f3f6f9;
  --tarjeta: #ffffff;
  --texto: #2b3a4c;
  --suave: #5d6b7c;
  --borde: #dde3ea;
  --borde-2: #c5cfdb;
  --papel: #e9edf2;
  /* Uso */
  --primario: var(--azul-profundo);
  --primario-osc: var(--navy);
  --f1: #0e8fb0;          /* cielo, oscurecido para que se lea como texto */
  --f2: var(--azul);
  --f3: var(--navy);
  --alta: var(--navy);
  --exploracion: var(--cielo);
  /* Colores de estado (no son de marca: alertas) */
  --ganado: #1f9d55;
  --rojo: #d23f3f;
  --radio: 10px;
  --sombra: 0 1px 2px rgba(25, 72, 150, .06), 0 1px 3px rgba(25, 72, 150, .08);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); color: var(--texto); font: 14px/1.5 'Lato', 'Helvetica Neue', Arial, sans-serif; }
h1, h2, .kpi b { color: var(--navy); }
h1 { font-weight: 900; letter-spacing: -.01em; }
a { color: var(--primario); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 0 0 12px; }
h3 { font-size: 13px; margin: 18px 0 8px; color: var(--suave); text-transform: uppercase; letter-spacing: .04em; }
.sub { color: var(--suave); font-size: 13px; }
.rojo { color: var(--rojo); }

/* Encabezado superior */
.top { display: flex; align-items: center; gap: 24px; background: linear-gradient(90deg, var(--navy) 0%, var(--azul-profundo) 100%); color: #fff; padding: 0 24px; height: 64px; position: sticky; top: 0; z-index: 10; border-bottom: 3px solid var(--cielo); }
.marca { color: #fff; display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.marca:hover { text-decoration: none; }
.marca img { height: 44px; width: auto; display: block; }
.marca .modulo { font-weight: 900; font-size: 15px; letter-spacing: .12em; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.35); color: var(--cielo); }
.top nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.top nav a { color: #d6e3f5; padding: 8px 12px; border-radius: 6px; white-space: nowrap; font-weight: 600; }
.top nav a:hover { background: rgba(255,255,255,.10); text-decoration: none; }
.top nav a.activo { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 0 -2px 0 var(--cielo); }

main { padding: 24px; max-width: 1500px; margin: 0 auto; }
.encabezado { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
/* Filtros arriba a la derecha, en la misma fila del título, en todas las pantallas:
   el título ocupa el espacio libre y los filtros quedan alineados a la derecha */
.encabezado > div:first-child { flex: 1 1 320px; min-width: 0; }
.encabezado > .filtros { justify-content: flex-end; }
.miga { margin: 0 0 4px; font-size: 13px; color: var(--suave); }

/* Botones */
.btn { display: inline-block; border: 1px solid var(--borde); background: #fff; color: var(--texto); padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600; white-space: nowrap; }
.btn:hover { background: #f0f3f8; text-decoration: none; }
.btn-primario { background: var(--primario); border-color: var(--primario); color: #fff; }
.btn-primario:hover { background: var(--primario-osc); }
.top .btn-primario { background: var(--cielo); border-color: var(--cielo); color: var(--navy); font-weight: 700; }
.top .btn-primario:hover { background: #5fd5f0; }
/* Usuario conectado y botón Salir, a la derecha del encabezado */
.usuario-menu { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.usuario-menu a { color: #d6e3f5; font-weight: 600; font-size: 13px; }
.usuario-menu a:hover { color: #fff; }
.usuario-menu form { margin: 0; }
.btn-salir { font: inherit; font-size: 13px; font-weight: 600; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.45);
  border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.btn-salir:hover { background: rgba(255,255,255,.12); }

/* Pantalla de inicio de sesión */
.pagina-login { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--azul-profundo) 100%); }
.login-caja { width: 100%; max-width: 380px; padding: 16px; }
.login-marca { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 18px; }
.login-marca img { height: 40px; }
.login-marca .modulo { font-weight: 900; font-size: 18px; letter-spacing: .12em; color: var(--cielo); padding-left: 12px; border-left: 1px solid rgba(255,255,255,.35); }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form h1 { margin: 0 0 4px; font-size: 22px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.login-form .btn-primario { width: 100%; justify-content: center; padding: 10px; }
.login-form.ancho-fijo { max-width: 480px; }
.aviso.error { background: #fdeeee; border-color: #f1c4c4; color: var(--rojo); }
.btn-claro { background: transparent; }
.btn-peligro { color: var(--rojo); border-color: #f1c4c4; background: #fff; }
.btn-peligro:hover { background: #fdeeee; }
.btn-chico { padding: 4px 10px; font-size: 13px; }
.btn-x, .borrar button { border: 0; background: none; color: var(--suave); cursor: pointer; font-size: 18px; line-height: 1; }
.btn-x:hover, .borrar button:hover { color: var(--rojo); }

/* Tarjetas */
.tarjeta { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); padding: 18px; margin-bottom: 18px; }
.tarjeta.sin-relleno { padding: 0; overflow-x: auto; }
.tarjeta-cab { display: flex; justify-content: space-between; align-items: baseline; }
.vacio { color: var(--suave); text-align: center; padding: 20px; margin: 0; }
.aviso { background: #e8f5ec; border: 1px solid #b9e2c6; color: #165c33; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.aviso.error { background: #fdeeee; border-color: #f1c4c4; color: #8c2323; }

/* Indicadores */
/* Tarjetas en fila: cada una toma el ancho que necesita su contenido (así la cantidad y el monto caben
   en una sola línea) y el espacio que sobra se reparte entre todas */
.kpis { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.kpis > .kpi { flex: 1 1 auto; min-width: 160px; }
/* En computador, siempre en una sola fila; los números se achican un poco en pantallas medianas para caber */
@media (min-width: 1000px) {
  .kpis { flex-wrap: nowrap; }
  .kpis > .kpi { min-width: 0; }
  .kpis .kpi b { font-size: clamp(16px, 1.42vw, 22px); }
}
.kpi { background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px 16px; box-shadow: var(--sombra); color: var(--texto); }
.kpi:hover { text-decoration: none; }
.kpi span { display: block; color: var(--suave); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
/* Todos los números de una tarjeta (cantidad y valor) con el mismo tamaño en todas las pantallas;
   si el valor no cabe al lado de la cantidad, baja a la línea siguiente */
.kpi b { font-size: 22px; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.kpi small { font-size: inherit; color: var(--suave); font-weight: 400; }
.kpi.alerta { border-color: #f1c4c4; background: #fff7f7; }
.kpi.alerta b { color: var(--rojo); }

/* Embudo tipo Excel */
.embudos { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 18px; }
.embudo { padding: 0; overflow: hidden; }
.embudo h2 { margin: 0; padding: 12px 16px; color: #fff; font-size: 13px; letter-spacing: .03em; }
.embudo h2.alta { background: var(--navy); color: #fff; }
.embudo h2.exploracion { background: var(--azul); color: #fff; }
.embudo { border-top: 0; }
.embudo table { width: 100%; border-collapse: collapse; }
.embudo td { padding: 7px 16px; border-bottom: 1px solid var(--borde); }
.embudo td a { color: var(--texto); }
.fila-fase td { background: var(--papel); font-weight: 700; font-size: 13px; color: var(--navy); }
.num { text-align: right; white-space: nowrap; }
.conteo { font-weight: 700; width: 56px; font-size: 15px; }
.conteo.cero { color: #c0c6d0; font-weight: 400; }
.embudo .total td { background: #f7f9fc; font-weight: 700; border-bottom: 0; }

/* Tablas */
.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--suave); padding: 10px 14px; border-bottom: 1px solid var(--borde); background: #fafbfd; }
.tabla td { padding: 10px 14px; border-bottom: 1px solid var(--borde); vertical-align: top; }
.tabla tbody tr { cursor: pointer; }
.tabla tbody tr:hover { background: #f7f9fc; }
.lista { width: 100%; border-collapse: collapse; }
.lista td { padding: 9px 4px; border-bottom: 1px solid var(--borde); vertical-align: top; }
.lista tr:last-child td { border-bottom: 0; }
.vencida { color: var(--rojo); font-weight: 600; }
.consecutivo { color: #c00000; font-weight: 700; }

/* Insignias y puntos */
.insignia { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef2f8; }
.insignia.fase1 { background: #e0f6fc; color: #0b7894; }
.insignia.fase2 { background: #e3effc; color: var(--azul); }
.insignia.fase3 { background: #e4eaf5; color: var(--navy); }
.insignia.fase4 { background: #f1f2f4; color: #59606c; }
.insignia.ganado { background: #e3f5ea; color: #157043; }
.etiqueta { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #f1f2f4; color: #3b4351; }
.etiqueta.alta { background: #e4eaf5; color: var(--navy); font-weight: 700; }
.etiqueta.exploracion { background: #e0f6fc; color: #0b7894; font-weight: 700; }
.punto { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #c0c6d0; }
.punto.alta, .ficha.alta .punto { background: var(--alta); }
.punto.exploracion, .ficha.exploracion .punto { background: var(--exploracion); }
.leyenda { color: var(--suave); font-size: 13px; }

/* Filtros */
.filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filtros.barra { margin-bottom: 14px; }
.filtros input[type=search] { min-width: 280px; flex: 1; }
/* Barra de filtros sobre las tablas: todo en una sola línea en pantallas de computador. La búsqueda y
   las listas se reparten el ancho (la búsqueda el doble); los botones conservan su tamaño. */
@media (min-width: 1000px) {
  .filtros.barra { flex-wrap: nowrap; }
  .filtros.barra input[type=search] { flex: 2 1 0; min-width: 0; }
  .filtros.barra select { flex: 1 1 0; min-width: 0; }
  .filtros.barra .btn, .filtros.barra .check { flex: none; white-space: nowrap; }
}
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #cfd5df; border-radius: 8px; background: #fff; color: var(--texto); max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b8cdf0; border-color: var(--primario); }
.check { display: flex; gap: 6px; align-items: center; color: var(--suave); }

/* Formularios */
.formulario label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; margin-bottom: 12px; }
.formulario label input, .formulario label select, .formulario label textarea { font-weight: 400; width: 100%; }
.rejilla { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.rejilla .ancho { grid-column: 1 / -1; }
.nueva-entidad { display: grid; grid-template-columns: 2fr 1fr; gap: 0 16px; background: #f7f9fc; border: 1px dashed #cfd5df; border-radius: 8px; padding: 12px 12px 0; margin-bottom: 12px; }
.nueva-entidad.oculto { display: none; }
.acciones { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.derecha { margin-left: auto; }
.en-linea { display: flex; gap: 8px; }
.en-linea select { flex: 1; }

/* Detalle */
.dos-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.dos-columnas.ancha-izq { grid-template-columns: 2fr 1fr; }
.datos { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; margin: 0; }
.datos dt { color: var(--suave); }
.datos dd { margin: 0; }
.datos .grande { font-size: 20px; font-weight: 700; }
.notas { margin-top: 14px; padding: 12px; background: #f7f9fc; border-radius: 8px; white-space: normal; }
.historial { list-style: none; padding: 0; margin: 0; }
.historial li { padding: 6px 0; border-bottom: 1px dashed var(--borde); display: flex; gap: 10px; }
.historial li .sub { min-width: 95px; }
.linea-tiempo { list-style: none; padding: 0; margin: 0; }
.linea-tiempo li { border-left: 3px solid var(--borde); padding: 2px 0 12px 14px; margin-left: 4px; }
.linea-tiempo p { margin: 6px 0; }
.lt-cab { display: flex; gap: 8px; align-items: center; }
.lt-cab .borrar { margin-left: auto; }
.proxima { display: flex; gap: 8px; align-items: center; background: #f2f6fd; padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.proxima.vencida { background: #fdeeee; color: var(--rojo); }
.proxima.hecha { opacity: .6; text-decoration: line-through; }
.check-btn { width: 20px; height: 20px; border: 2px solid #9aa6b8; border-radius: 5px; background: #fff; cursor: pointer; padding: 0; font-size: 12px; line-height: 1; color: var(--ganado); flex: none; }
.compacto label { margin-bottom: 10px; }

/* Tablero Kanban */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.grupo-fase { background: var(--papel); border-radius: 12px; padding: 10px; flex: none; border-top: 4px solid var(--borde-2); }
.grupo-fase.f1 { border-top-color: var(--cielo); }
.grupo-fase.f2 { border-top-color: var(--azul); }
.grupo-fase.f3 { border-top-color: var(--navy); }
.titulo-fase { font-weight: 700; font-size: 13px; padding: 2px 6px 10px; }
.f1 .titulo-fase { color: var(--f1); } .f2 .titulo-fase { color: var(--f2); } .f3 .titulo-fase { color: var(--f3); } .f4 .titulo-fase { color: #59606c; }
.columnas { display: flex; gap: 10px; }
.columna { width: 230px; background: #f6f8fb; border-radius: 10px; display: flex; flex-direction: column; min-height: 180px; }
.col-cab { padding: 10px; border-bottom: 1px solid var(--borde); }
.col-cab .cod { font-weight: 700; color: var(--suave); font-size: 12px; }
.col-cab .nom { display: block; font-weight: 600; font-size: 13px; line-height: 1.3; min-height: 34px; }
.col-cab .meta { font-size: 12px; color: var(--suave); }
.col-cuerpo { padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; transition: background .15s; border-radius: 0 0 10px 10px; }
.columna.sobre .col-cuerpo { background: #d5f1fa; }
/* Franja de color por ambos lados de cada negocio: azul oscuro = alta probabilidad, celeste = en exploración */
.ficha.alta { border-left: 3px solid var(--navy); border-right: 3px solid var(--navy); }
.ficha.exploracion { border-left: 3px solid var(--cielo); border-right: 3px solid var(--cielo); }
.ficha { display: block; background: #fff; border: 1px solid var(--borde); border-radius: 8px; padding: 10px; color: var(--texto); box-shadow: var(--sombra); cursor: grab; }
.ficha:hover { text-decoration: none; border-color: #b8cdf0; }
.ficha.arrastrando { opacity: .4; }
.ficha b { display: block; font-size: 13px; line-height: 1.3; }
.ficha .ent { display: block; color: var(--suave); font-size: 12px; margin: 4px 0 6px; }
.ficha .pie { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 13px; }

.dos-campos { display: grid; grid-template-columns: 90px 1fr; gap: 8px; }
.formulario small { font-weight: 400; }

/* Interruptor General / Detallado */
.interruptor { display: inline-flex; background: var(--papel); border-radius: 8px; padding: 3px; }
.interruptor a { padding: 6px 14px; border-radius: 6px; color: var(--suave); font-weight: 700; }
.interruptor a:hover { text-decoration: none; color: var(--navy); }
.interruptor a.activo { background: #fff; color: var(--navy); box-shadow: var(--sombra); }

/* Tablero general: todas las etapas en una pantalla, solo nombres de entidad */
.kanban.general { gap: 8px; overflow-x: visible; }
.kanban.general .grupo-fase { flex: var(--cols) 1 0; min-width: 0; padding: 8px 6px; }
.kanban.general .titulo-fase { font-size: 12px; padding: 0 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban.general .columnas { gap: 6px; }
.kanban.general .columna { flex: 1 1 0; width: auto; min-width: 0; min-height: 120px; }
.kanban.general .col-cab { padding: 6px 8px; }
.kanban.general .col-cab .nom { display: none; }
.kanban.general .col-cab .cod { font-size: 14px; color: var(--navy); font-weight: 900; }
.kanban.general .col-cab .meta { display: block; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban.general .col-cuerpo { padding: 5px; gap: 4px; }
.ficha.mini { padding: 4px 7px; font-size: 12px; font-weight: 600; line-height: 1.25; box-shadow: none; border-radius: 6px;
  overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

/* Gestión de Proyectos: mapa de procesos (un carril por proceso, etapas en flecha) */
.mapa { display: flex; flex-direction: column; align-items: stretch; }
.carril { display: grid; grid-template-columns: 250px 1fr; background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); overflow: hidden; }
.carril-cab { background: var(--c); color: #fff; padding: 14px 16px; display: flex; gap: 12px; align-items: center; }
.carril-cab h2 { color: #fff; font-size: 16px; font-weight: 900; margin: 0; line-height: 1.2; }
.carril-cab p { margin: 4px 0 0; font-size: 12px; line-height: 1.35; color: rgba(255,255,255,.85); }
.carril-num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.6); display: grid; place-items: center; font-weight: 900; font-size: 16px; }
.pasos { list-style: none; margin: 0; padding: 12px 14px; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; align-items: stretch; }
.paso { background: var(--t); padding: 10px 26px 10px 30px; min-height: 86px; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%, 16px 50%); }
.paso:first-child { padding-left: 14px; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%); border-radius: 8px 0 0 8px; }
.paso-num { font-size: 11px; font-weight: 900; color: var(--c); letter-spacing: .06em; }
.paso-num::before { content: 'ETAPA '; }
.paso b { font-size: 13px; line-height: 1.25; color: var(--navy); }
.paso small { font-size: 12px; line-height: 1.3; color: var(--suave); }
.paso-vivo { margin-top: 4px; align-self: flex-start; background: var(--c); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.paso-vivo:hover { text-decoration: none; filter: brightness(1.1); }
.vacio-paso { color: var(--suave); font-style: italic; }
.conector { text-align: center; color: var(--borde-2); font-size: 14px; line-height: 1; padding: 4px 0; }
.ciclo { margin: 12px 0 6px; padding: 10px 14px; border: 1px dashed var(--borde-2); border-radius: var(--radio); color: var(--suave); text-align: center; }
.editor-procesos { display: grid; grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); gap: 0 18px; }
.editor-proceso { scroll-margin-top: 84px; }
.rejilla-proceso { display: grid; grid-template-columns: 1fr 1.4fr 70px; gap: 0 12px; }
.rejilla-proceso input[type=color] { height: 38px; padding: 3px; cursor: pointer; }

/* Gestión de Proyectos: vista Ciclo */
.ciclo-tarjeta { display: flex; gap: 24px; align-items: center; justify-content: center; flex-wrap: wrap; }
.ciclo-svg { width: 100%; max-width: 860px; height: auto; display: block; font-family: 'Lato', Arial, sans-serif; }
.ciclo-etapa { cursor: help; }
.ciclo-etapa path { transition: filter .15s; }
.ciclo-etapa:hover path { filter: brightness(1.12) drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.ciclo-num { fill: #fff; font-weight: 900; font-size: 20px; text-anchor: middle; pointer-events: none; }
.ciclo-nombre { font-size: 13.5px; font-weight: 700; }
.ciclo-proceso { fill: #fff; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.ciclo-titulo { fill: var(--navy); font-size: 23px; font-weight: 900; }
.ciclo-marca { fill: var(--azul-profundo); font-size: 22px; font-weight: 900; letter-spacing: .18em; }
.ciclo-sub { fill: var(--suave); font-size: 14px; }
.ciclo-leyenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; min-width: 240px; }
.ciclo-leyenda li { display: flex; align-items: center; gap: 10px; }
.muestra { width: 18px; height: 18px; border-radius: 5px; flex: none; }
.etapas-edicion td { padding: 5px 4px; vertical-align: middle; }
.etapas-edicion input { width: 100%; }
.etapas-edicion .num-etapa { width: 24px; font-weight: 900; color: var(--suave); text-align: center; }
.etapas-edicion td.sub { width: 100px; font-size: 12px; }

@media (max-width: 900px) {
  .carril { grid-template-columns: 1fr; }
  .pasos { grid-template-columns: 1fr; }
  .paso, .paso:first-child { clip-path: none; border-radius: 8px; padding: 10px 14px; min-height: 0; }
  .editor-procesos, .rejilla-proceso { grid-template-columns: 1fr; }
  .kanban.general { overflow-x: auto; }
  .kanban.general .columna { min-width: 90px; }
  .dos-columnas, .dos-columnas.ancha-izq, .rejilla, .nueva-entidad { grid-template-columns: 1fr; }
  .embudos { grid-template-columns: 1fr; }
  main { padding: 16px; }
  .top { gap: 12px; padding: 0 12px; }
  .top .btn-primario { display: none; }
  .marca img { height: 34px; }
}

/* ---------- Configuración: metas, OKR, KPI/LPI y equipo comercial ---------- */
.pestanas { margin-bottom: 18px; flex-wrap: wrap; }
.tabla-scroll { overflow-x: auto; }
.tabla-metas td, .tabla-metas th { vertical-align: middle; }
.tabla-metas tbody tr, .tabla-edicion tbody tr { cursor: default; }
.tabla-metas tbody tr:hover, .tabla-edicion tbody tr:hover { background: transparent; }
.tabla-metas .total td { background: #f7f9fc; font-weight: 700; }
.tabla-metas input.pct { width: 84px; text-align: right; }
.tabla-metas input.dinero { width: 150px; text-align: right; }
.q-actual { background: #eef6fd !important; }
th.q-actual { color: var(--navy); }
#sumaPct.error { color: var(--rojo); }
.nota { color: var(--suave); font-size: 12px; margin: 12px 0 0; }
.explicacion p { margin: 0; color: var(--suave); }
.explicacion.tarjeta-cab { align-items: center; gap: 16px; }
.rejilla-3 { grid-template-columns: repeat(3, 1fr); }
.rejilla .ancho-2 { grid-column: span 2; }
.formulario label.check { flex-direction: row; align-items: center; align-self: end; padding-bottom: 8px; }
.formulario label.check input { width: auto; }

.progreso { display: inline-block; vertical-align: middle; width: 90px; height: 8px; border-radius: 4px; background: var(--papel); overflow: hidden; }
.progreso i { display: block; height: 100%; background: var(--borde-2); }
.progreso.ok i { background: var(--ganado); }
.progreso.medio i { background: #e0a020; }
.progreso.bajo i { background: var(--rojo); }
.cumple { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 10px; vertical-align: middle; }
.cumple.ok { background: #e3f4ea; color: #17733f; }
.cumple.medio { background: #fdf2dc; color: #8a5a00; }
.cumple.bajo { background: #fdeeee; color: #a12d2d; }
.cumple.sin { color: var(--suave); }

.tabla-edicion td, .tabla-edicion th { padding: 6px 6px; vertical-align: middle; }
.tabla-edicion input:not([type=checkbox]), .tabla-edicion select { width: 100%; min-width: 0; padding: 6px 8px; }
.tabla-edicion input.num-campo { width: 110px; text-align: right; }
.tabla-edicion .fila-nueva input::placeholder { color: var(--primario); font-weight: 600; }
.tabla-edicion tr.inactivo td { opacity: .55; }
.tabla-edicion .nowrap { white-space: nowrap; }
.tabla-edicion .num-campo + .num-campo { margin-top: 4px; }
.auto { display: inline-block; padding: 6px 8px; background: #eef6fd; border-radius: 6px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.tabla-indicadores .mini { display: flex; gap: 4px; margin-top: 4px; }
.tabla-indicadores .mini select { font-size: 12px; padding: 4px 6px; }
.tabla-indicadores .celda-q { min-width: 150px; }
.tabla-indicadores .celda-anio { font-size: 13px; }
.formulario .mini-campo { flex-direction: row; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 11px; color: var(--suave); text-transform: uppercase; }
.formulario .mini-campo input.num-campo { width: 105px; }

.objetivo-cab { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.objetivo-cab .periodo { background: var(--navy); color: #fff; font-weight: 900; font-size: 12px; padding: 4px 10px; border-radius: 6px; }
.objetivo-cab .objetivo-titulo { flex: 1; font-size: 16px; font-weight: 700; color: var(--navy); }
.objetivo-progreso { white-space: nowrap; }
.asesor.inactivo { opacity: .7; }

@media (max-width: 900px) {
  .rejilla-3 { grid-template-columns: 1fr; }
  .rejilla .ancho-2 { grid-column: auto; }
  .objetivo-cab { flex-wrap: wrap; }
}

/* ---------- Prospectos y propuestas ---------- */
.estado { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.estado.activo { background: #e3effc; color: var(--azul-profundo); }
.estado.pausa { background: #f1f2f4; color: #59606c; }
.estado.perdido { background: #fdeeee; color: #a12d2d; }
.estado.ganado { background: #e3f5ea; color: #157043; }
.nowrap { white-space: nowrap; }
.contadores { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0 12px; }
.contadores input { width: 100%; }
.lista-simple { list-style: none; margin: 0; padding: 0; }
.lista-simple li { padding: 8px 0; border-bottom: 1px solid var(--borde); }
.lista-simple li:last-child { border-bottom: 0; }
.pasar-negocio { border-top: 4px solid var(--ganado); }
.pasar-negocio.oculto-nuevo #convNuevo { display: none; }
@media (max-width: 900px) { .contadores { grid-template-columns: repeat(2, 1fr); } }
.embudo .fila-ganados td { color: #157043; font-weight: 700; }

/* ---------- Tablero detallado: pestañas por etapa y "Ver más" ---------- */
.pestanas-fase { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
/* Pestañas de etapa: las no elegidas en gris; la elegida rellena con el color de su etapa y texto blanco */
.pf { --color-fase: #59606c; display: block; padding: 10px 14px; border-radius: 10px; background: #eceff3; border: 1px solid var(--borde);
  border-top: 4px solid var(--borde-2); color: var(--suave); box-shadow: none; transition: background .15s, border-color .15s; }
.pf.f1 { --color-fase: var(--f1); } .pf.f2 { --color-fase: var(--f2); } .pf.f3 { --color-fase: var(--f3); }
.pf:hover { text-decoration: none; background: #e2e7ee; border-top-color: var(--color-fase); }
.pf-nombre { display: block; font-weight: 700; font-size: 13px; color: var(--suave); }
.pf-meta { display: block; font-size: 12px; color: var(--suave); }
.pf-meta b { font-size: 16px; color: #59606c; }
.pf.activo { background: var(--color-fase); border-color: var(--color-fase); box-shadow: 0 4px 12px rgba(25, 72, 150, .25); }
.pf.activo .pf-nombre, .pf.activo .pf-meta, .pf.activo .pf-meta b { color: #fff; }
.pf.sobre { background: #d5f1fa; border-color: var(--cielo); }
.kanban.detalle .grupo-fase { flex: 1 1 auto; min-width: 0; border-top-left-radius: 0; }
.kanban.detalle .titulo-fase { display: none; }
.kanban.detalle .columna { flex: 1 1 0; width: auto; min-width: 200px; }
.ficha.oculta { display: none; }
.ver-mas { margin: 0 8px 8px; padding: 6px; border: 1px dashed var(--borde-2); border-radius: 8px; background: #fff; color: var(--primario); font: inherit; font-weight: 700; font-size: 12px; cursor: pointer; }
.ver-mas:hover { background: #eef6fd; }
@media (max-width: 900px) { .pestanas-fase { grid-template-columns: repeat(2, 1fr); } }
.kpi.seleccionado { border-color: var(--primario); box-shadow: 0 0 0 2px #b8cdf0; }
#sumaAsesores.error { color: var(--rojo); }
.tabla-asesores td { white-space: nowrap; }
/* Totales de cada columna del tablero en negrita */
.col-cab .meta b { font-weight: 700; color: var(--navy); }
.kanban.general .col-cab .meta { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; }
.kanban.general .col-cab .meta .v { display: block; }

/* ---------- Tablero General: ventanita con los datos del negocio ---------- */
.globo-negocio { position: absolute; z-index: 50; width: 300px; max-width: calc(100vw - 20px); background: #fff; border: 1px solid var(--borde-2);
  border-top: 4px solid var(--navy); border-radius: 10px; box-shadow: 0 8px 24px rgba(25, 72, 150, .18); padding: 12px 14px; font-size: 12.5px;
  line-height: 1.4; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.globo-negocio.visible { opacity: 1; transform: none; }
.globo-negocio .g-titulo { font-weight: 700; font-size: 14px; color: var(--navy); line-height: 1.3; }
.globo-negocio .g-cliente { color: var(--suave); margin: 2px 0 8px; }
.globo-negocio dl { display: grid; grid-template-columns: 100px 1fr; gap: 4px 10px; margin: 0; }
.globo-negocio dt { color: var(--suave); }
.globo-negocio dd { margin: 0; }
.globo-negocio .g-sub { color: var(--suave); font-size: 11.5px; }
.globo-negocio .g-punto { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.globo-negocio .g-punto.alta { background: var(--alta); }
.globo-negocio .g-punto.exploracion { background: var(--exploracion); }
.globo-negocio .g-pie { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--borde); color: var(--suave); font-size: 11px; }
/* Montos en negrita dentro de las tarjetas de datos */
/* Cantidad y monto con el mismo tamaño: la cantidad va en una pastilla azul clara y el monto en
   gris oscuro, para que no se lean como un solo número (también si el monto baja de línea) */
.kpi .cant { font-style: normal; background: #e6f0fb; color: var(--azul-profundo); padding: 0 8px; border-radius: 6px; }
.kpi small.monto { font-weight: 700; color: var(--texto); }

/* Columna "Ítem" de las tablas (la agrega app.js) */
.tabla th.item, .tabla td.item { width: 1%; white-space: nowrap; text-align: right; }
.tabla td.item { color: var(--suave); }
.sub b.monto { color: var(--texto); }

/* ---------- Tablas ordenables ---------- */
.tabla th.ordenar { cursor: pointer; user-select: none; white-space: nowrap; }
/* Títulos de las columnas centrados en las tablas de listado (Negocios, Propuestas, Prospectos, Clientes) */
.tabla.ordenable thead th { text-align: center; }
.tabla th.ordenar:hover { color: var(--navy); }
.tabla th.ordenar::after { content: ' ↕'; opacity: .35; font-size: 11px; }
.tabla th.asc::after { content: ' ▲'; opacity: .9; }
.tabla th.desc::after { content: ' ▼'; opacity: .9; }
.tabla th.asc, .tabla th.desc { color: var(--navy); }

/* Tablero General: títulos de etapa y de columna centrados; sin el "·" suelto entre cantidad y valor */
.kanban.general .titulo-fase { text-align: center; }
.kanban.general .col-cab { text-align: center; }
.kanban.general .col-cab .meta .sep { display: none; }

/* Encabezado con los filtros siempre debajo del título (no cambian de lugar según el largo del subtítulo) */
.encabezado.apilado { flex-direction: column; align-items: flex-start; gap: 10px; }

/* ---------- Selector de varias semanas (casillas) ---------- */
.multi-semanas { position: relative; }
.multi-semanas > summary { list-style: none; cursor: pointer; padding: 8px 32px 8px 12px; border: 1px solid #cfd5df; border-radius: 8px; background: #fff;
  min-width: 190px; white-space: nowrap; position: relative; color: var(--texto); }
.multi-semanas > summary::-webkit-details-marker { display: none; }
.multi-semanas > summary::after { content: '▾'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--suave); }
.multi-semanas[open] > summary { outline: 2px solid #b8cdf0; border-color: var(--primario); }
.ms-panel { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; width: 270px; background: #fff; border: 1px solid var(--borde-2);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(25, 72, 150, .18); padding: 8px; }
.ms-lista { max-height: 300px; overflow-y: auto; }
.ms-op { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.ms-op:hover { background: #f0f5fc; }
.ms-op.actual { font-weight: 700; color: var(--navy); }
.ms-op input { width: auto; margin: 0; }
.ms-acciones { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--borde); margin-top: 6px; padding-top: 8px; }
.ms-op.oculta { display: none; }
