/* Limited Leads · layout y componentes propios (sobre estilos.css del manual v2) */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.lateral { background: var(--charcoal); color: var(--crema); padding: 26px 14px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.lateral .logo { width: 140px; margin: 0 10px 6px; }
.lateral .sub { margin: 0 10px 28px; font-size: 10px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: #8F887A; }
.lateral nav { display: grid; gap: 4px; }
.lateral nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; text-decoration: none; color: #CFC8B5; font-weight: 500; font-size: 14px; }
.lateral nav a svg { width: 19px; height: 19px; flex: none; }
.lateral nav a:hover { background: var(--charcoal-2); color: var(--crema); }
.lateral nav a.activo { background: var(--amarillo); color: var(--tinta); font-weight: 700; }
.lateral nav a .badge { margin-left: auto; background: var(--amarillo); color: var(--tinta); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.lateral nav a.activo .badge { background: var(--tinta); color: var(--amarillo); }
.lateral .yo { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--charcoal-3); }
.kicker-osc { font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: #8F887A; margin-bottom: 6px; }
.lateral select { width: 100%; background: var(--charcoal-2); color: var(--crema); border: 1px solid var(--charcoal-3); border-radius: 10px; padding: 9px 10px; font-size: 13px; font-weight: 600; }
.lateral .links { margin-top: 10px; }
.lateral .links button { color: #8F887A; font-size: 12px; font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.contenido { padding: 30px 34px 70px; min-width: 0; }
.cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.cab h1 { font-size: 34px; margin-top: 6px; }
.herr { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.herr input, .herr select { border: 1.5px solid var(--linea); background: var(--papel); border-radius: 999px; padding: 9px 14px; font-size: 14px; outline: none; }
.herr input:focus, .herr select:focus { border-color: var(--charcoal); }

.cinta-maqueta { position: fixed; right: 14px; bottom: 14px; background: var(--amarillo); color: var(--tinta); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; z-index: 50; box-shadow: var(--sombra); }

#toast:not(.visible) { opacity: 0; pointer-events: none; }
#toast { transition: transform .3s cubic-bezier(.2, .9, .3, 1.2), opacity .2s ease; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 24px; }
.kpi { background: var(--papel); border: 1px solid var(--linea); border-radius: 18px; padding: 16px 18px; }
.kpi b { display: block; font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi b small { font-size: 13px; font-weight: 600; color: var(--piedra); margin-left: 4px; }
.kpi span { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--piedra); }
.kpi.destacado { background: var(--charcoal); border-color: var(--charcoal); }
.kpi.destacado b { color: var(--amarillo); }
.kpi.destacado b small, .kpi.destacado span { color: #B9B2A0; }
.kpi.alerta b { color: var(--mal); }

/* Secciones de Hoy */
.grilla-hoy { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
.bloque { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio-g); padding: 18px; }
.bloque + .bloque { margin-top: 18px; }
.bloque > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.bloque > header h3 { display: flex; align-items: center; gap: 8px; }
.cuenta { background: var(--charcoal); color: var(--amarillo); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 9px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; cursor: pointer; border: 1px solid transparent; }
.item:hover { background: #F5EED9; border-color: var(--linea); }
.item + .item { margin-top: 4px; }
.item .cuerpo { flex: 1; min-width: 0; }
.item .cuerpo b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .cuerpo span { font-size: 13px; color: var(--piedra); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .der { display: flex; align-items: center; gap: 8px; flex: none; }
.cita { font-size: 13px; background: #F3EDDA; border-radius: 10px; padding: 6px 10px; margin-top: 6px; color: var(--charcoal); font-style: italic; white-space: normal !important; }

.av { width: 34px; height: 34px; border-radius: 50%; background: var(--charcoal); color: var(--amarillo); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; letter-spacing: .04em; }
.av.chico { width: 26px; height: 26px; font-size: 10px; }
.av.libre { background: transparent; color: var(--piedra); border: 1.5px dashed #CBBF9F; }

/* Chips */
.e-nuevo { background: var(--amarillo); color: var(--tinta); }
.e-contactado { background: var(--info-suave); color: var(--info); }
.e-conversando { background: #E6E0F3; color: #5B4A8B; }
.e-cotizacion { background: var(--alerta-suave); color: var(--alerta); }
.e-negociacion { background: #F3DCC8; color: #9A4B12; }
.e-ganado { background: var(--ok-suave); color: var(--ok); }
.e-perdido { background: var(--mal-suave); color: var(--mal); }
.chip.origen { background: #ECE6D4; color: var(--piedra); }
.chip.origen.meta { background: #DCE4F5; color: #2F4F9A; }
.chip.origen.web { background: #E2EEDF; color: #3E6B37; }
.chip.tag { background: transparent; box-shadow: inset 0 0 0 1px var(--linea); color: var(--piedra); text-transform: none; letter-spacing: 0; font-weight: 500; }
.chip.tag.urgente { box-shadow: none; background: var(--mal-suave); color: var(--mal); }
.vence { font-size: 12px; font-weight: 600; white-space: nowrap; }
.vence.atraso { color: var(--mal); }
.vence.hoy { color: var(--alerta); }

/* Pipeline */
.pipeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(212px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.columna { background: #EFE7D0; border-radius: 18px; padding: 10px; min-height: 300px; transition: background .12s ease, box-shadow .12s ease; }
.columna.sobre { background: #F9EFB5; box-shadow: inset 0 0 0 2px var(--amarillo); }
.columna > header { padding: 6px 6px 10px; }
.columna > header .t { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.columna > header .m { font-size: 12px; color: var(--piedra); font-weight: 500; margin-top: 2px; font-variant-numeric: tabular-nums; }
.columna.cierre { min-height: 0; }
.cierres { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.zona-cierre { border: 2px dashed #CBBF9F; border-radius: 18px; padding: 16px; text-align: center; color: var(--piedra); font-weight: 600; font-size: 13px; transition: all .12s ease; }
.zona-cierre b { display: block; font-size: 15px; color: var(--charcoal); }
.zona-cierre.ganado.sobre { background: var(--ok-suave); border-color: var(--ok); color: var(--ok); }
.zona-cierre.perdido.sobre { background: var(--mal-suave); border-color: var(--mal); color: var(--mal); }
.tarj { background: var(--papel); border: 1px solid var(--linea); border-radius: 14px; padding: 12px; cursor: grab; box-shadow: 0 1px 2px rgba(29,34,38,.05); }
.tarj + .tarj { margin-top: 8px; }
.tarj:hover { border-color: #CBBF9F; }
.tarj.arrastrando { opacity: .4; }
.tarj .emp { font-weight: 700; font-size: 14px; line-height: 1.25; }
.tarj .con { font-size: 12px; color: var(--piedra); margin-top: 2px; }
.tarj .pie { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.tarj .monto { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.tarj .monto small { font-weight: 500; color: var(--piedra); font-size: 11px; }
.tarj .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tarj .quieto { white-space: nowrap; font-size: 11px; color: var(--piedra); font-weight: 600; }
.tarj .quieto.mucho { color: var(--mal); }

/* Tabla */
.tabla-caja { background: var(--papel); border: 1px solid var(--linea); border-radius: 18px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--piedra); padding: 12px 14px; border-bottom: 1px solid var(--linea); white-space: nowrap; background: var(--papel); position: sticky; top: 0; }
td { padding: 11px 14px; border-bottom: 1px solid #EEE6D0; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #F8F3E4; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td b { font-weight: 600; }
td .sub { display: block; font-size: 12px; color: var(--piedra); }

/* Ficha */
.volver { display: inline-flex; align-items: center; gap: 6px; color: var(--piedra); font-size: 13px; font-weight: 600; text-decoration: none; margin-bottom: 10px; }
.volver:hover { color: var(--charcoal); }
.ficha-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ficha-cab h1 { font-size: 32px; }
.ficha-cab .linea2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.ficha-cab .acc { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.wa { background: #1FA855; color: #fff; }
.btn.wa svg { width: 18px; height: 18px; }
.etapas-barra { display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap; }
.etapas-barra button { flex: 1; min-width: 110px; border: 0; padding: 10px 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; cursor: pointer; background: #ECE4CC; color: var(--piedra); border-radius: 10px; }
.etapas-barra button:hover { background: #E3D9BC; color: var(--charcoal); }
.etapas-barra button.pasada { background: var(--charcoal-2); color: #CFC8B5; }
.etapas-barra button.actual { background: var(--amarillo); color: var(--tinta); font-weight: 800; }
.etapas-barra button.g.actual { background: var(--ok); color: #fff; }
.etapas-barra button.p.actual { background: var(--mal); color: #fff; }

.ficha { display: grid; grid-template-columns: 300px 1fr 280px; gap: 18px; align-items: start; }
.datos dl { margin: 0; display: grid; gap: 12px; }
.datos dt { font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--piedra); }
.datos dd { margin: 2px 0 0; font-weight: 500; font-size: 14px; word-break: break-word; }
.datos dd a { color: var(--charcoal); }
.datos h3 { margin-bottom: 14px; }

.nota-caja { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio-g); padding: 14px; margin-bottom: 16px; }
.nota-caja .tabs { display: inline-flex; background: #ECE4CC; border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 10px; }
.nota-caja .tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 12px; cursor: pointer; color: var(--piedra); }
.nota-caja .tabs button.activo { background: var(--charcoal); color: var(--crema); }
.nota-caja textarea { width: 100%; border: 1.5px solid var(--linea); background: #fff; border-radius: 12px; padding: 12px; min-height: 70px; resize: vertical; outline: none; font-size: 14px; }
.nota-caja textarea:focus { border-color: var(--charcoal); }
.nota-caja .pie { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.rapidas { display: flex; gap: 6px; flex-wrap: wrap; }
.rapidas button { border: 1px solid var(--linea); background: #fff; border-radius: 999px; padding: 5px 10px; font-size: 12px; cursor: pointer; color: var(--piedra); font-weight: 500; }
.rapidas button:hover { border-color: var(--charcoal); color: var(--charcoal); }

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 6px; bottom: 6px; width: 2px; background: var(--linea); }
.ev { position: relative; padding: 0 0 18px; }
.ev .pto { position: absolute; left: -26px; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--papel); border: 2px solid var(--linea); display: grid; place-items: center; }
.ev .pto svg { width: 12px; height: 12px; }
.ev.whatsapp .pto { background: #1FA855; border-color: #1FA855; color: #fff; }
.ev.estado .pto { background: var(--amarillo); border-color: var(--amarillo); }
.ev.comentario .pto, .ev.llamada .pto { background: var(--charcoal); border-color: var(--charcoal); color: var(--crema); }
.ev.seguimiento .pto { background: var(--info-suave); border-color: var(--info); color: var(--info); }
.ev .meta { font-size: 12px; color: var(--piedra); }
.ev .meta b { color: var(--charcoal); font-weight: 600; }
.ev .txt { margin-top: 3px; font-size: 14px; }
.ev .burbuja { margin-top: 6px; background: #DCF8C6; border-radius: 12px 12px 12px 4px; padding: 8px 12px; font-size: 13px; max-width: 520px; color: #1d2b1d; white-space: pre-wrap; }
.ev .caja-txt { margin-top: 6px; background: var(--papel); border: 1px solid var(--linea); border-radius: 12px; padding: 10px 12px; font-size: 14px; white-space: pre-wrap; }

.lado .bloque h3 { margin-bottom: 10px; }
.monto-grande { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.monto-grande small { font-size: 13px; font-weight: 600; color: var(--piedra); }
.prox { background: var(--info-suave); border-radius: 14px; padding: 12px; }
.prox.atraso { background: var(--mal-suave); }
.prox b { display: block; }

/* Ventas */
.dos { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; margin-bottom: 18px; }
.barras-mes { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 220px; padding-top: 10px; }
.barras-mes .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.barras-mes .b { width: 100%; max-width: 38px; background: var(--charcoal); border-radius: 8px 8px 3px 3px; min-height: 3px; position: relative; transition: height .4s ease; }
.barras-mes .col.actual .b { background: var(--amarillo); }
.barras-mes .col:hover .b { background: var(--charcoal-3); }
.barras-mes .col.actual:hover .b { background: #F2D200; }
.barras-mes .lbl { font-size: 11px; font-weight: 600; color: var(--piedra); text-transform: uppercase; letter-spacing: .06em; }
.barras-mes .val { font-size: 10px; font-weight: 700; color: var(--charcoal); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; }
.hbar + .hbar { border-top: 1px solid #EEE6D0; }
.hbar .nom { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.hbar .riel { height: 12px; background: #ECE4CC; border-radius: 999px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--charcoal); border-radius: 999px; }
.hbar .fill.am { background: var(--amarillo); }
.hbar .v { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; }
.hbar .v small { display: block; font-size: 11px; font-weight: 500; color: var(--piedra); }

/* Modal extra */
.modal .campo label { display: block; }
.wa-prev { background: #ECE5DD; border-radius: 16px; padding: 14px; margin: 6px 0 14px; }
.wa-prev .burbuja { background: #DCF8C6; border-radius: 12px 12px 4px 12px; padding: 10px 12px; font-size: 14px; white-space: pre-wrap; margin-left: auto; max-width: 90%; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.wa-prev .para { font-size: 12px; color: #54656F; margin-bottom: 8px; font-weight: 600; }
.plantillas { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.plantillas button { border: 1.5px solid var(--linea); background: var(--papel); border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.plantillas button.activo { background: var(--charcoal); color: var(--crema); border-color: var(--charcoal); }
.nota-modal { font-size: 12px; color: var(--piedra); background: #F3EDDA; border-radius: 10px; padding: 8px 10px; }

@media (max-width: 1200px) {
  .ficha { grid-template-columns: 1fr 1fr; }
  .ficha .lado { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
  .ficha .lado .bloque + .bloque { margin-top: 0; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; padding: 8px; z-index: 60; }
  .lateral .logo, .lateral .sub, .lateral .yo { display: none; }
  .lateral nav { grid-auto-flow: column; width: 100%; }
  .lateral nav a { flex-direction: column; gap: 3px; font-size: 10px; padding: 8px 4px; }
  .lateral nav a .badge { display: none; }
  .contenido { padding: 20px 16px 110px; }
  .cab h1 { font-size: 28px; }
  .grilla-hoy, .dos, .ficha { grid-template-columns: 1fr; }
  .cinta-maqueta { bottom: 84px; }
  .barras-mes .val { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi.destacado { grid-column: 1 / -1; }
  .kpi b { font-size: 24px; }
  .bloque { padding: 14px; }
  .bloque > header { flex-wrap: wrap; }
  .item { flex-wrap: wrap; padding: 10px 6px; }
  .item .cuerpo { flex-basis: calc(100% - 50px); }
  .item .der { width: 100%; padding-left: 46px; flex-wrap: wrap; }
  .hbar { grid-template-columns: 84px 1fr auto; }
  .cierres { grid-template-columns: 1fr 1fr; }
}
