:root {
  --fondo: #f4f1ea;
  --sup: #ffffff;
  --sup2: #faf8f3;
  --hundido: #ebe7dd;
  --tinta: #1d1f24;
  --tinta2: #55585f;
  --tinta3: #777a82;
  --linea: #e3dfd4;
  --linea2: #cfcabd;
  --accion: #1d1f24;
  --sobre-accion: #ffffff;
  --acento: #f2b134;
  --haciendo: #2e6fd6;
  --haciendo-suave: #e6eefc;
  --hecho: #2f8f5b;
  --hecho-suave: #e2f3e9;
  --alerta: #a35a00;
  --alerta-suave: #fbefd6;
  --peligro: #b3261e;
  --peligro-suave: #fbe6e3;
  --sombra: 0 1px 2px rgb(40 34 20 / 0.06), 0 6px 16px -8px rgb(40 34 20 / 0.16);
  --sombra-alta: 0 30px 70px -20px rgb(20 18 12 / 0.45);
  --r: 14px;
  --titulo: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --texto: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #15161a;
    --sup: #1e2026;
    --sup2: #23262d;
    --hundido: #101114;
    --tinta: #f1f0ec;
    --tinta2: #b9bac0;
    --tinta3: #94969e;
    --linea: #2c2f37;
    --linea2: #3d414b;
    --accion: #f1f0ec;
    --sobre-accion: #15161a;
    --haciendo: #7fb0ff;
    --haciendo-suave: #1c2a44;
    --hecho: #6fd39a;
    --hecho-suave: #17301f;
    --alerta: #f0b955;
    --alerta-suave: #3a2c10;
    --peligro: #ff8f86;
    --peligro-suave: #3d1c19;
    --sombra: inset 0 0 0 1px var(--linea);
    --sombra-alta: 0 0 0 1px var(--linea2), 0 30px 70px -20px rgb(0 0 0 / 0.8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { font-family: var(--texto); font-size: 16px; line-height: 1.4; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--fondo); color: var(--tinta); }
h1, h2, h3, p, ul, ol, dl, dd, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: left; touch-action: manipulation; }
a { color: inherit; }
:focus-visible { outline: 3px solid color-mix(in oklab, var(--haciendo) 70%, transparent); outline-offset: 2px; border-radius: 8px; }
.i { flex: none; }
h1, h2, .marca-app, .cifras dd, .avance b { font-family: var(--titulo); font-stretch: 90%; letter-spacing: -0.02em; }

/* ---------- Marco ---------- */
.marco { display: grid; grid-template-columns: 15.5rem 1fr; height: 100dvh; }
main { overflow-y: auto; padding: 2rem clamp(1rem, 3vw, 2.5rem) 4rem; min-width: 0; }
main > * { max-width: 78rem; margin-inline: auto; }

.lateral { display: flex; flex-direction: column; gap: 2px; padding: 1.1rem 0.75rem; background: var(--hundido); border-right: 1px solid var(--linea); overflow-y: auto; }
.marca-app { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.25rem; padding: 0 0.5rem 1rem; }
.logo { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 10px; background: #1d1f24; color: var(--acento); }
.lateral a, .lateral .nuevo { display: flex; align-items: center; gap: 0.65rem; min-height: 2.75rem; padding: 0 0.7rem; border-radius: 10px; text-decoration: none; font-weight: 550; color: var(--tinta2); }
.lateral a span:nth-child(2), .lateral .nuevo span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lateral a:hover, .lateral .nuevo:hover { background: color-mix(in oklab, var(--tinta) 6%, transparent); color: var(--tinta); }
.lateral a.activo { background: var(--sup); color: var(--tinta); box-shadow: var(--sombra); }
.lateral .nuevo { width: 100%; color: var(--tinta3); }
.grupo { font-size: 0.8125rem; font-weight: 600; color: var(--tinta3); padding: 1.1rem 0.7rem 0.35rem; }
.cuadro { width: 0.8rem; height: 0.8rem; border-radius: 4px; background: var(--c); flex: none; }
.cuadro.grande { width: 1.1rem; height: 1.1rem; border-radius: 6px; display: inline-block; margin-right: 0.6rem; }
.cuenta { font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--tinta3); background: color-mix(in oklab, var(--tinta) 7%, transparent); padding: 0.05rem 0.45rem; border-radius: 99px; }
.pie { margin-top: auto; display: flex; align-items: center; gap: 0.6rem; padding: 0.9rem 0.4rem 0; border-top: 1px solid var(--linea); }
.pie .nombre { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 99px; flex: none; font-weight: 700; font-size: 0.9375rem; color: #fff; background: var(--c); }
.avatar.chico { width: 1.5rem; height: 1.5rem; font-size: 0.75rem; }
.avatar.vacio { background: none; color: var(--tinta3); border: 1.5px dashed var(--linea2); }

/* ---------- Cabezas ---------- */
.cabeza { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2.5rem; margin-bottom: 1.5rem; }
.sobre { display: flex; align-items: center; gap: 0.35rem; color: var(--tinta2); font-size: 0.9375rem; margin-bottom: 0.15rem; }
h1 { font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.05; font-weight: 700; display: flex; align-items: center; }
h1 .boton { margin-left: 0.5rem; }
.descripcion { margin-top: 0.5rem; max-width: 44rem; color: var(--tinta2); }
.ayuda { color: var(--tinta2); font-size: 0.9375rem; max-width: 26rem; }
.enlaces { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.enlaces a { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 2rem; padding: 0 0.7rem; border-radius: 99px; background: var(--sup); box-shadow: var(--sombra); font-size: 0.9375rem; font-weight: 550; text-decoration: none; }
.cifras { display: flex; gap: 2rem; }
.cifras dt { font-size: 0.8125rem; color: var(--tinta2); }
.cifras dd { font-size: 2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.cifras .mal dd { color: var(--peligro); }
.avance { min-width: 14rem; }
.avance-texto { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.4rem; }
.avance b { font-size: 1.75rem; line-height: 1; font-variant-numeric: tabular-nums; }
.avance span { color: var(--tinta2); font-size: 0.9375rem; }
.avance-barra { height: 0.5rem; border-radius: 99px; background: var(--hundido); overflow: hidden; }
.avance-barra i { display: block; height: 100%; border-radius: 99px; background: var(--c); transition: width 400ms cubic-bezier(0.23, 1, 0.32, 1); }

/* ---------- Paneles y tareas ---------- */
.dos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; align-items: start; }
.pila { display: grid; gap: 1rem; }
.panel { background: var(--sup); border-radius: var(--r); box-shadow: var(--sombra); padding: 1rem; }
.panel h2, .columna h3 { display: flex; align-items: center; gap: 0.5rem; font-size: 1.0625rem; font-weight: 650; margin-bottom: 0.7rem; }
.panel.ahora { background: var(--haciendo-suave); box-shadow: none; }
.vacio { color: var(--tinta3); font-size: 0.9375rem; padding: 0.4rem 0.1rem; }

.tareas { display: grid; gap: 0.4rem; }
.tarea { display: flex; align-items: center; gap: 0.15rem; background: var(--sup); border-radius: 12px; box-shadow: var(--sombra); padding: 0 0.6rem 0 0; min-height: 3rem; }
.panel .tarea { background: var(--sup2); box-shadow: none; }
.panel.ahora .tarea { background: var(--sup); }
.marca { flex: none; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; }
.marca::before { content: ""; grid-area: 1 / 1; width: 1.35rem; height: 1.35rem; border-radius: 99px; border: 2px solid var(--linea2); transition: all 140ms ease; }
.marca .i { grid-area: 1 / 1; color: #fff; position: relative; }
.marca:hover::before { border-color: var(--haciendo); }
.e-haciendo .marca::before { border-color: var(--haciendo); background: conic-gradient(var(--haciendo) 0 50%, transparent 0); }
.e-hecho .marca::before { border-color: var(--hecho); background: var(--hecho); }
.cuerpo { flex: 1; min-width: 0; padding: 0.55rem 0; display: grid; gap: 0.3rem; }
.tarea .titulo { font-weight: 550; overflow-wrap: anywhere; }
.e-hecho .titulo { color: var(--tinta3); text-decoration: line-through; text-decoration-color: color-mix(in oklab, var(--tinta3) 50%, transparent); }
.meta { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.chip { display: inline-flex; align-items: center; gap: 0.3rem; max-width: 100%; font-size: 0.8125rem; font-weight: 550; color: var(--tinta2); background: color-mix(in oklab, var(--tinta) 6%, transparent); padding: 0.1rem 0.5rem; border-radius: 99px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip i { width: 0.5rem; height: 0.5rem; border-radius: 99px; background: var(--c); flex: none; }
.chip.bloqueo, .chip.vencida { color: var(--peligro); background: var(--peligro-suave); }
.chip.urgente { color: var(--alerta); background: var(--alerta-suave); }
.chip.decision { color: var(--hecho); background: var(--hecho-suave); }

.tablero { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.columna { background: var(--hundido); border-radius: var(--r); padding: 0.8rem; }
.punto { width: 0.6rem; height: 0.6rem; border-radius: 99px; background: var(--linea2); }
.c-haciendo .punto { background: var(--haciendo); }
.c-hecho .punto { background: var(--hecho); }
.agregar { display: flex; gap: 0.4rem; margin-bottom: 0.6rem; }

/* ---------- Controles ---------- */
input, textarea { width: 100%; min-height: 2.75rem; padding: 0.55rem 0.75rem; border-radius: 10px; border: 1.5px solid var(--linea2); background: var(--sup); }
textarea { resize: vertical; display: block; }
input:focus, textarea:focus { outline: none; border-color: var(--haciendo); box-shadow: 0 0 0 3px color-mix(in oklab, var(--haciendo) 22%, transparent); }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; min-height: 0; padding: 0; accent-color: var(--tinta); flex: none; }
label { display: grid; gap: 0.3rem; font-size: 0.9375rem; font-weight: 600; }
legend { font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.4rem; }
.casilla { display: flex; align-items: center; gap: 0.5rem; font-weight: 550; min-height: 2.75rem; }
.casilla.alta { align-self: end; }
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 2.75rem; padding: 0 1rem; border-radius: 10px; font-weight: 600; background: var(--sup); box-shadow: inset 0 0 0 1.5px var(--linea2); transition: transform 120ms ease, opacity 120ms ease; }
.boton:active { transform: scale(0.97); }
.boton.principal { background: var(--accion); color: var(--sobre-accion); box-shadow: none; }
.boton.icono { width: 2.75rem; padding: 0; flex: none; }
.boton.fantasma { background: none; box-shadow: none; color: var(--tinta2); }
.boton.fantasma:hover { background: color-mix(in oklab, var(--tinta) 7%, transparent); }
.boton.chico { min-height: 2.25rem; padding: 0 0.8rem; font-size: 0.9375rem; flex: none; }
.boton.ancho { width: 100%; }
.boton:disabled { opacity: 0.5; cursor: wait; }
.enlace { color: var(--tinta2); font-weight: 550; font-size: 0.9375rem; text-decoration: underline; text-underline-offset: 3px; min-height: 2.75rem; padding: 0 0.2rem; }
.enlace.peligro { color: var(--peligro); }

.barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.segmentos { display: inline-flex; background: var(--hundido); border-radius: 12px; padding: 3px; }
.segmentos > button, .segmentos label span { display: flex; align-items: center; gap: 0.4rem; min-height: 2.5rem; padding: 0 0.9rem; border-radius: 9px; font-weight: 600; font-size: 0.9375rem; color: var(--tinta2); cursor: pointer; }
.segmentos > button[aria-selected="true"], .segmentos input:checked + span { background: var(--sup); color: var(--tinta); box-shadow: var(--sombra); }
.segmentos label { display: block; position: relative; flex: 1; }
.segmentos label span { justify-content: center; }
.segmentos input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; }
.segmentos input:focus-visible + span { outline: 3px solid color-mix(in oklab, var(--haciendo) 70%, transparent); }
.segmentos.estado { display: flex; }
.filtros { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pildora { min-height: 2.5rem; padding: 0 0.9rem; border-radius: 99px; font-weight: 550; font-size: 0.9375rem; color: var(--tinta2); box-shadow: inset 0 0 0 1.5px var(--linea2); }
.pildora[aria-pressed="true"] { background: var(--tinta); color: var(--fondo); box-shadow: none; }

/* ---------- Notas y actividad ---------- */
.notas { max-width: 46rem; margin-inline: 0; display: grid; gap: 0.8rem; }
.nota-nueva { display: grid; gap: 0.6rem; }
.fila { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.lista-notas { display: grid; gap: 0.6rem; }
.lista-notas li { display: grid; gap: 0.5rem; }
.lista-notas li.decision { box-shadow: var(--sombra), inset 0 0 0 1.5px color-mix(in oklab, var(--hecho) 45%, transparent); }
.lista-notas .chip { justify-self: start; }
.lista-notas p { overflow-wrap: anywhere; }
.lista-notas footer { display: flex; align-items: center; gap: 0.5rem; color: var(--tinta2); font-size: 0.875rem; }
.lista-notas footer .enlace { margin-left: auto; min-height: 2rem; }
.actividad { display: grid; gap: 0.65rem; }
.actividad li { display: flex; gap: 0.55rem; font-size: 0.9375rem; color: var(--tinta2); }
.actividad b { color: var(--tinta); }
.actividad time { display: block; font-size: 0.8125rem; color: var(--tinta3); }
.archivados { margin-top: 2rem; color: var(--tinta3); font-size: 0.9375rem; }

/* ---------- Hoja ---------- */
dialog { border: 0; padding: 0; background: var(--sup); color: var(--tinta); border-radius: 20px; box-shadow: var(--sombra-alta); width: min(34rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 2rem); }
dialog::backdrop { background: rgb(18 18 22 / 0.55); }
dialog[open] { animation: sube 200ms cubic-bezier(0.23, 1, 0.32, 1); }
@keyframes sube { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.hoja-cuerpo { display: grid; gap: 0.9rem; padding: 1.1rem 1.25rem 1.25rem; }
.hoja-cuerpo header, .hoja-cuerpo footer { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.hoja-cuerpo header h2 { font-size: 1.4rem; }
.hoja-cuerpo footer { margin-top: 0.3rem; }
.origen { flex: 1; font-size: 0.8125rem; color: var(--tinta3); }
.titulo-grande { font-family: var(--titulo); font-stretch: 90%; font-size: 1.5rem; font-weight: 650; line-height: 1.2; border-color: transparent; padding-inline: 0.4rem; margin-inline: -0.4rem; width: calc(100% + 0.8rem); resize: none; }
.par { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.enlace-fila { grid-template-columns: 0.7fr 1.3fr; margin-bottom: 0.4rem; }
.opciones { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.opcion { display: flex; align-items: center; gap: 0.45rem; position: relative; min-height: 2.75rem; padding: 0 0.9rem; border-radius: 99px; box-shadow: inset 0 0 0 1.5px var(--linea2); font-weight: 550; cursor: pointer; }
.opcion input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; }
.opcion:has(input:checked) { background: var(--tinta); color: var(--fondo); box-shadow: none; }
.opcion:has(input:focus-visible) { outline: 3px solid color-mix(in oklab, var(--haciendo) 70%, transparent); }
.colores { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.colores label { position: relative; display: block; width: 2.75rem; height: 2.75rem; cursor: pointer; }
.colores input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; }
.colores span { position: absolute; inset: 0.35rem; border-radius: 99px; background: var(--c); }
.colores input:checked + span { box-shadow: 0 0 0 3px var(--sup), 0 0 0 5.5px var(--c); }

/* ---------- Entrada ---------- */
.entrada { min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem; }
.tarjeta-entrada { width: min(26rem, 100%); background: var(--sup); border-radius: 22px; box-shadow: var(--sombra-alta); padding: 1.75rem; display: grid; gap: 1rem; }
.tarjeta-entrada h1 { font-size: 2rem; }
.tarjeta-entrada form { display: grid; gap: 0.9rem; }
.tarjeta-entrada .marca-app { padding: 0; }
.tarjeta-entrada .enlace { justify-self: start; min-height: 2rem; }
.quienes { display: grid; gap: 0.5rem; }
.quienes button { display: flex; align-items: center; gap: 0.8rem; width: 100%; min-height: 4rem; padding: 0 1rem; border-radius: 14px; background: var(--sup2); box-shadow: inset 0 0 0 1.5px var(--linea); }
.quienes button:hover { box-shadow: inset 0 0 0 1.5px var(--tinta); }
.quienes span:nth-child(2) { flex: 1; display: grid; }
.quienes small { color: var(--tinta2); font-size: 0.875rem; }
.error { color: var(--peligro); background: var(--peligro-suave); padding: 0.6rem 0.8rem; border-radius: 10px; font-size: 0.9375rem; font-weight: 550; }

#avisos { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); display: grid; gap: 0.5rem; z-index: 50; pointer-events: none; width: max-content; max-width: calc(100vw - 2rem); }
.aviso { background: var(--tinta); color: var(--fondo); padding: 0.7rem 1rem; border-radius: 12px; font-weight: 550; box-shadow: var(--sombra-alta); animation: sube 220ms cubic-bezier(0.23, 1, 0.32, 1); }

/* ---------- Celular ---------- */
@media (max-width: 52rem) {
  .marco { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  main { order: -1; padding: 1.25rem 1rem 2rem; }
  .lateral { flex-direction: row; align-items: center; gap: 4px; padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--linea); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .lateral .marca-app, .lateral .grupo { display: none; }
  .lateral a, .lateral .nuevo { flex: none; width: auto; min-height: 3rem; max-width: 11rem; }
  .lateral a span:nth-child(2) { flex: none; }
  .lateral .nuevo span { display: none; }
  .pie { margin: 0 0 0 auto; padding: 0 0 0 0.5rem; border-top: 0; border-left: 1px solid var(--linea); flex: none; }
  .pie .nombre { display: none; }
  .dos, .tablero { grid-template-columns: 1fr; }
  .cifras { gap: 1.25rem; }
  .cifras dd { font-size: 1.6rem; }
  .avance { min-width: 100%; }
  .par { grid-template-columns: 1fr; }
  .enlace-fila { grid-template-columns: 1fr; }
  .casilla.alta { align-self: auto; }
  dialog { margin-bottom: 0; width: 100vw; max-width: 100vw; border-radius: 20px 20px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
