@font-face { font-family: "Bricolage"; src: url("fuentes/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Instrument"; src: url("fuentes/instrument-sans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --naranja: #CC3D08;
  --naranja-oscuro: #A83206;
  --carbon: #1C1917;
  --hueso: #FFFAF5;
  --papel: #FFFFFF;
  --durazno: #FFD9C2;
  --durazno-suave: #FFEEE2;
  --gris: #5C534D;
  --linea: #EADFD5;
  --rojo: #B42318;
  --verde: #1E7A46;
  --radio: 12px;
  --sombra: 0 1px 2px rgb(28 25 23 / 6%), 0 4px 16px rgb(28 25 23 / 5%);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--hueso); color: var(--carbon); font: 16px/1.5 "Instrument", system-ui, sans-serif; }
h1, h2 { font-family: "Bricolage", "Instrument", sans-serif; line-height: 1.15; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
h2 { font-size: 1.15rem; }
a { color: var(--naranja); text-underline-offset: 2px; }
a:hover { color: var(--naranja-oscuro); }
small { font-size: .85em; }
.suave { color: var(--gris); }

.barra { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1.5rem; padding: .6rem 1.25rem; background: var(--papel); border-bottom: 1px solid var(--linea); flex-wrap: wrap; }
.marca { display: flex; align-items: center; gap: .5rem; text-decoration: none; }
.marca span { font: 600 .75rem "Instrument", sans-serif; letter-spacing: .08em; background: var(--durazno-suave); color: var(--naranja-oscuro); padding: .1rem .45rem; border-radius: 6px; }
.menu { display: flex; gap: .25rem; flex: 1; overflow-x: auto; }
.menu a { padding: .45rem .8rem; border-radius: 8px; color: var(--carbon); text-decoration: none; font-weight: 500; white-space: nowrap; }
.menu a:hover { background: var(--durazno-suave); }
.menu a[aria-current] { background: var(--carbon); color: var(--papel); }
.quien { display: flex; align-items: center; gap: .75rem; }
.quien a { color: var(--carbon); font-weight: 500; }
.quien form { margin: 0; }

.contenido { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.sin-menu .contenido { min-height: 100vh; display: grid; place-items: center; }

.encabezado { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.encabezado.chico { margin-bottom: .5rem; align-items: center; }
.encabezado.chico h2 { margin: 0; }
.miga { margin: 0 0 .25rem; font-size: .9rem; }
.acciones { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.ancho-completo { grid-column: 1 / -1; }

.tarjeta { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 1.25rem; box-shadow: var(--sombra); margin-bottom: 1.25rem; }
.tarjeta.centrada { text-align: center; max-width: 30rem; }
.tarjeta.angosta { max-width: 32rem; }
.acceso { width: min(100%, 26rem); }
.acceso h1 { margin-top: 1rem; }

.boton { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1.1rem; border-radius: 10px; border: 1px solid var(--naranja); background: var(--naranja); color: #fff; font: 600 .95rem "Instrument", sans-serif; text-decoration: none; cursor: pointer; }
.boton:hover { background: var(--naranja-oscuro); border-color: var(--naranja-oscuro); color: #fff; }
.boton.secundario { background: var(--papel); color: var(--carbon); border-color: var(--linea); }
.boton.secundario:hover { background: var(--durazno-suave); color: var(--carbon); }
.enlace { background: none; border: 0; padding: 0; color: var(--naranja); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.peligro { color: var(--rojo); }
:focus-visible { outline: 3px solid var(--naranja); outline-offset: 2px; }

.formulario { display: grid; gap: .85rem; }
.formulario.rejilla { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.formulario.en-linea { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0; }
.formulario.en-linea input:not([type=checkbox]), .formulario.en-linea select { width: auto; flex: 1 1 160px; }
label { display: grid; gap: .3rem; font-weight: 500; font-size: .92rem; }
.casilla-texto { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
input[type=radio], input[type=checkbox] { width: auto; flex: none; padding: 0; margin: 0; accent-color: var(--naranja-oscuro); }
input, select, textarea { width: 100%; padding: .6rem .7rem; border: 1px solid var(--linea); border-radius: 8px; background: var(--papel); color: var(--carbon); font: 400 1rem "Instrument", sans-serif; }
input:focus, select:focus, textarea:focus { border-color: var(--naranja); outline: none; box-shadow: 0 0 0 3px var(--durazno); }
textarea { resize: vertical; }

.aviso { padding: .7rem 1rem; border-radius: 10px; margin: 0 0 1rem; border-left: 4px solid var(--verde); background: #EAF6EF; }
.aviso-error { border-left-color: var(--rojo); background: #FDECEA; }

.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.cifra { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 1rem 1.25rem; display: grid; gap: .15rem; box-shadow: var(--sombra); }
.cifra span { color: var(--gris); font-size: .9rem; }
.cifra strong { font: 700 2rem "Bricolage", sans-serif; }
.cifra small { color: var(--gris); }

.dos-columnas { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 860px) { .dos-columnas { grid-template-columns: 1fr; } }

.embudo { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.embudo li { display: grid; grid-template-columns: 8.5rem 1fr auto; gap: .75rem; align-items: center; font-size: .92rem; }
.embudo-barra { height: .8rem; background: var(--durazno-suave); border-radius: 99px; overflow: hidden; }
.embudo-barra span { display: block; height: 100%; width: var(--ancho); background: var(--naranja); border-radius: 99px; }
.embudo-barra .etapa-perdido { background: var(--gris); }
.embudo-dato { color: var(--gris); white-space: nowrap; }
@media (max-width: 520px) { .embudo li { grid-template-columns: 1fr auto; } .embudo-barra { grid-column: 1 / -1; order: 3; } }

.lista-simple { list-style: none; margin: 0; padding: 0; }
.lista-simple li { padding: .6rem 0; border-bottom: 1px solid var(--linea); display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.lista-simple li:last-child { border-bottom: 0; }
.lista-simple li strong { margin-left: auto; }
.lista-simple.izquierda li strong { margin-left: 0; }

.etiqueta { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .8rem; font-weight: 600; background: var(--durazno-suave); color: var(--naranja-oscuro); border: 1px solid transparent; }
.etiqueta.etapa-ganado { background: #EAF6EF; color: var(--verde); }
.etiqueta.etapa-ganado::before { content: "✓ "; }
.etiqueta.etapa-perdido { background: #F1EDEA; color: var(--gris); }
.etiqueta.etapa-perdido::before { content: "✕ "; }

.lista-tareas { list-style: none; margin: 0 0 1rem; padding: 0; }
.tarea { display: grid; grid-template-columns: auto 1fr auto; gap: .75rem; align-items: start; padding: .6rem 0; border-bottom: 1px solid var(--linea); }
.tarea form { margin: 0; }
.tarea div { display: grid; }
.tarea.hecha strong { text-decoration: line-through; color: var(--gris); }
.casilla { width: 1.5rem; height: 1.5rem; border: 2px solid var(--gris); border-radius: 6px; background: var(--papel); cursor: pointer; font-weight: 700; color: var(--verde); line-height: 1; padding: 0; }
.vencida { color: var(--rojo); font-weight: 600; }

.filtros { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filtros input { flex: 2 1 260px; width: auto; }
.filtros select { flex: 1 1 160px; width: auto; }

.tabla-envoltura { overflow-x: auto; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); }
.tarjeta .tabla-envoltura { border: 0; }
.tabla { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tabla th { text-align: left; font-weight: 600; color: var(--gris); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; padding: .75rem 1rem; border-bottom: 1px solid var(--linea); }
.tabla td { padding: .7rem 1rem; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover { background: var(--hueso); }
.tabla .inactivo { opacity: .55; }
@media (max-width: 720px) {
  .tabla thead { display: none; }
  .tabla tr { display: block; padding: .75rem 1rem; border-bottom: 1px solid var(--linea); }
  .tabla td { display: flex; justify-content: space-between; gap: 1rem; padding: .2rem 0; border: 0; }
  .tabla td[data-titulo]::before { content: attr(data-titulo); color: var(--gris); font-size: .85rem; }
}

.datos { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 0; }
.datos dt { color: var(--gris); }
.datos dd { margin: 0; overflow-wrap: anywhere; }

.notas { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .75rem; }
.notas li { background: var(--hueso); border: 1px solid var(--linea); border-radius: 10px; padding: .75rem 1rem; }
.notas p { margin: 0 0 .25rem; white-space: normal; }

.zona-peligro { margin-top: 1rem; text-align: right; }

.pestanas { display: flex; gap: .25rem; margin-bottom: 1rem; flex-wrap: wrap; }
.pestanas a { padding: .45rem .9rem; border-radius: 99px; border: 1px solid var(--linea); background: var(--papel); color: var(--carbon); text-decoration: none; }
.pestanas a[aria-current] { background: var(--carbon); color: var(--papel); border-color: var(--carbon); }

.ayuda { margin-top: -.5rem; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: .9rem; overflow-x: auto; padding-bottom: 1rem; scroll-snap-type: x proximity; }
.columna { background: #F6EEE6; border-radius: var(--radio); display: flex; flex-direction: column; min-height: 18rem; scroll-snap-align: start; }
.columna header { padding: .8rem 1rem .6rem; border-top: 4px solid var(--naranja); border-radius: var(--radio) var(--radio) 0 0; }
.columna header.etapa-ganado { border-top-color: var(--verde); }
.columna header.etapa-perdido { border-top-color: var(--gris); }
.columna header h2 { font-size: 1rem; margin: 0; }
.columna header small { color: var(--gris); }
.columna-cuerpo { padding: .5rem; display: grid; gap: .5rem; align-content: start; flex: 1; border-radius: 0 0 var(--radio) var(--radio); }
.columna.sobre .columna-cuerpo { background: var(--durazno); outline: 2px dashed var(--naranja); outline-offset: -4px; }
.ficha { min-width: 0; overflow-wrap: anywhere; background: var(--papel); border: 1px solid var(--linea); border-radius: 10px; padding: .75rem; display: grid; gap: .3rem; cursor: grab; box-shadow: var(--sombra); font-size: .92rem; }
.ficha a { color: var(--carbon); text-decoration: none; }
.ficha a:hover { text-decoration: underline; }
.ficha > span { color: var(--gris); }
.ficha-pie { display: flex; justify-content: space-between; align-items: center; color: var(--carbon) !important; }
.ficha.arrastrando { opacity: .5; }
.ficha .mover { display: flex; gap: .4rem; align-items: center; margin: .25rem 0 0; }
.ficha .mover select { min-width: 0; padding: .3rem .4rem; font-size: .85rem; }

@media (max-width: 640px) {
  .barra { gap: .5rem; padding: .5rem 1rem; }
  .menu { order: 3; flex-basis: 100%; }
  .quien { margin-left: auto; }
  .contenido { padding: 1rem 1rem 3rem; }
}

.subtitulo { font-size: .95rem; margin: 1.25rem 0 .25rem; }
code { background: var(--durazno-suave); padding: .1rem .4rem; border-radius: 6px; font-size: .9em; }
.codigo { background: var(--carbon); color: #FFFAF5; padding: 1rem; border-radius: 10px; overflow-x: auto; font-size: .85rem; }
.token { display: block; margin-top: .4rem; padding: .5rem; overflow-wrap: anywhere; user-select: all; }

.tarjetas-enlace { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.tarjetas-enlace .tarjeta { text-decoration: none; color: var(--carbon); margin: 0; }
.tarjetas-enlace .tarjeta:hover { border-color: var(--naranja); }
.tarjetas-enlace h2 { color: var(--naranja-oscuro); }
.error-campo { color: var(--rojo); font-weight: 600; }
input[aria-invalid="true"] { border-color: var(--rojo); }
.ajustes .tarjeta { margin-bottom: 1.25rem; }

.nivel { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .8rem; font-weight: 600; border: 1px solid var(--linea); background: var(--papel); color: var(--carbon); white-space: nowrap; }
.nivel-aviso { background: #FFF3D6; border-color: #E8C46A; color: #6B4A00; }
.nivel-critico { background: #FFE0CC; border-color: #E8955E; color: #8A2E00; }
.nivel-agotado { background: #FDECEA; border-color: #D9786F; color: #8E1B10; }
.nivel-normal { background: #EAF6EF; border-color: #8CC4A2; color: #14583A; }

.consumo { display: grid; gap: .3rem; min-width: 11rem; }
.consumo-barra { height: .7rem; background: var(--durazno-suave); border-radius: 99px; overflow: hidden; border: 1px solid var(--linea); }
.consumo-barra span { display: block; height: 100%; width: var(--ancho); background: var(--verde); border-radius: 99px; }
.consumo-barra .nivel-aviso { background: #D9A400; }
.consumo-barra .nivel-critico { background: #D9531E; }
.consumo-barra .nivel-agotado { background: var(--rojo); }
.consumo-texto { font-size: .88rem; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

.alertas li { gap: .75rem; align-items: baseline; }
.alertas li a { color: var(--carbon); }
.resultado { margin-top: .35rem; font-size: .85rem; padding: .35rem .5rem; }
.linea li p { margin-bottom: .35rem; }
.lista-simple form { margin: 0; }
.lista-simple li .formulario.en-linea { margin-left: auto; }

.ampliacion { justify-content: space-between; }
.ampliacion { flex-wrap: wrap; }
.ampliacion .formulario.en-linea { margin-left: 0; flex-wrap: wrap; }
.ampliacion .formulario.en-linea select { flex: 0 0 auto; width: auto; }
.ampliacion .boton { white-space: nowrap; }

.compacto { display: flex; align-items: center; gap: .4rem; font-weight: 400; }
.compacto input { width: 7rem; }
@media (max-width: 640px) {
  .menu { overflow-x: visible; flex-wrap: wrap; flex-basis: 100%; }
  .menu a { padding: .4rem .6rem; }
}

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.slot { border: 1px solid var(--linea); border-radius: 10px; padding: .75rem .9rem; background: var(--papel); }
.slot header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .35rem; }
.slot p { margin: .25rem 0; font-size: .92rem; }
.slot-libre { background: var(--hueso); border-style: dashed; }

/* Conversaciones de WhatsApp: cada mensaje dice quién habla (Persona o Sara) con texto y con la posición, nunca solo con color. */
.chat { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.mensaje { max-width: min(42rem, 88%); padding: .55rem .8rem; border-radius: 12px; border: 2px solid var(--linea); background: var(--papel); }
.mensaje p { margin: .2rem 0 0; overflow-wrap: anywhere; }
.mensaje.de-persona { align-self: flex-start; border-left-width: 6px; }
.mensaje.de-sara { align-self: flex-end; background: var(--hueso); border-style: dashed; border-right-width: 6px; }
