/* Pendientes · tablero de taller */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fuentes/barlow-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fuentes/barlow-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fuentes/barlow-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fuentes/barlow-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --verde: #2f5a48;          /* tablero pintado */
  --verde-hoyo: #24483a;     /* perforaciones */
  --verde-tinta: #f1efe4;    /* letra sobre el tablero */
  --verde-tinta-2: #c9d8cf;
  --amarillo: #f2c230;       /* pintura de seguridad */
  --amarillo-hondo: #8c6a00; /* contorno de la ranura sobre claro */
  --fondo: #e7ebe4;
  --fila: #f8f8f3;
  --fila-borde: #d9dfd6;
  --tinta: #17201b;
  --tinta-2: #4b544d;
  --tinta-3: #6b736c;
  --pildora: #d8dfd5;
  --pildora-hover: #ccd5c9;
  --rojo: #b3301c;
  --foco: #1f6f8b;
  --sombra: 0 1px 2px rgba(23, 32, 27, .06), 0 6px 16px -10px rgba(23, 32, 27, .28);
  --sombra-alta: 0 4px 10px rgba(23, 32, 27, .12), 0 22px 40px -14px rgba(23, 32, 27, .45);
  --radio: 12px;
  --curva: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --verde: #23443a;
    --verde-hoyo: #1a342c;
    --verde-tinta: #eef0e6;
    --verde-tinta-2: #b4c7bc;
    --amarillo: #f2c230;
    --amarillo-hondo: #d6a92a;
    --fondo: #121714;
    --fila: #1b221e;
    --fila-borde: #29322c;
    --tinta: #e9ece6;
    --tinta-2: #b7beb6;
    --tinta-3: #8f978f;
    --pildora: #222b25;
    --pildora-hover: #2b352e;
    --rojo: #f0806b;
    --foco: #7cc3d8;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 18px -12px rgba(0, 0, 0, .7);
    --sombra-alta: 0 6px 14px rgba(0, 0, 0, .4), 0 24px 44px -16px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--fondo); scrollbar-color: var(--tinta-3) var(--fondo); scrollbar-width: thin; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--fondo); color: var(--tinta);
  font: 400 17px/1.35 "Barlow", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--amarillo); color: #17201b; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.ic { width: 22px; height: 22px; display: block; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2.5px solid var(--foco); outline-offset: 2px; }

/* ---------- banda (tablero perforado) ---------- */
.banda {
  background-color: var(--verde);
  background-image: radial-gradient(circle at center, var(--verde-hoyo) 2.1px, transparent 2.6px);
  background-size: 20px 20px;
  background-position: 10px 6px;
  color: var(--verde-tinta);
  padding: max(22px, env(safe-area-inset-top)) 0 20px;
}
.banda-in, .tablero { max-width: 640px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
.cabeza { display: flex; flex-direction: column; gap: 4px; }
h1 { margin: 0; font-weight: 700; font-size: 32px; line-height: 1.05; letter-spacing: -.012em; }
.cuenta { margin: 0; font-size: 16px; color: var(--verde-tinta-2); font-variant-numeric: tabular-nums; }
.cuenta b { color: var(--verde-tinta); font-weight: 700; }

.agregar { display: flex; gap: 10px; margin-top: 16px; }
.campo {
  flex: 1; min-width: 0; display: flex; align-items: center;
  background: var(--fila); color: var(--tinta);
  border-radius: var(--radio);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .14), inset 0 0 0 1px rgba(0, 0, 0, .04);
  transition: box-shadow .2s var(--curva);
}
.campo:focus-within { box-shadow: 0 0 0 3px var(--amarillo); }
.campo input[type="text"] {
  flex: 1; min-width: 0; height: 52px; border: 0; background: none; outline: none;
  padding: 0 4px 0 16px; font-size: 17px; caret-color: var(--tinta);
}
.campo input::placeholder { color: var(--tinta-3); }
.pick { position: relative; display: flex; }
.pick input[type="date"] { position: absolute; inset: 0; opacity: 0; pointer-events: none; width: 100%; }
.ico-btn {
  width: 48px; height: 48px; margin-right: 2px; border: 0; background: none; border-radius: 50%;
  display: grid; place-items: center; color: var(--tinta-2);
  transition: background-color .15s, color .15s;
}
.ico-btn:hover { background: var(--pildora); color: var(--tinta); }
.ico-btn.activo { color: var(--tinta); }
.btn-agregar {
  flex: none; width: 52px; height: 52px; border: 0; border-radius: 50%;
  background: var(--amarillo); color: #17201b;
  display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .22), 0 8px 16px -8px rgba(0, 0, 0, .5);
  transition: transform .18s var(--curva), box-shadow .18s var(--curva), filter .15s;
}
.btn-agregar .ic { width: 26px; height: 26px; }
.btn-agregar:hover { filter: brightness(1.05); }
.btn-agregar:active { transform: translateY(1px) scale(.97); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.fecha-elegida {
  margin: 10px 0 0; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 4px 4px 12px; border-radius: 99px;
  background: rgba(0, 0, 0, .18); color: var(--verde-tinta); font-size: 15px;
  animation: aparecer .25s var(--curva);
}

/* X redonda (cerrar / quitar) */
.x-redonda {
  width: 36px; height: 36px; border-radius: 50%; border: 0; flex: none;
  display: grid; place-items: center; background: rgba(255, 255, 255, .12); color: inherit;
  transition: background-color .15s, transform .15s var(--curva);
}
.x-redonda:hover { background: rgba(255, 255, 255, .22); }
.x-redonda:active { transform: scale(.92); }
.x-redonda.chica { width: 28px; height: 28px; }
.x-redonda.chica .ic { width: 18px; height: 18px; }

/* ---------- barra de filtros ---------- */
.barra { display: flex; align-items: center; gap: 8px; padding: 16px 0 10px; flex-wrap: wrap; }
.filtros { display: flex; gap: 6px; }
.filtro {
  height: 40px; padding: 0 14px; border: 0; border-radius: 99px;
  background: var(--pildora); color: var(--tinta-2); font-size: 16px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background-color .18s, color .18s;
}
.filtro:hover { background: var(--pildora-hover); color: var(--tinta); }
.filtro[aria-selected="true"] { background: var(--tinta); color: var(--fondo); }
.filtro .n { font-weight: 400; font-variant-numeric: tabular-nums; opacity: .8; }
.pie { display: flex; justify-content: center; padding: 14px 0 120px; }
.limpiar {
  height: 40px; padding: 0 12px 0 10px; border: 0; border-radius: 99px;
  background: none; color: var(--tinta-2); font-size: 15px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background-color .15s, color .15s;
}
.limpiar .ic { width: 20px; height: 20px; }
.limpiar:hover { background: var(--pildora); color: var(--tinta); }

/* ---------- filas ---------- */
.lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fila {
  position: relative;
  display: flex; align-items: center; gap: 4px;
  min-height: 60px; padding: 6px 4px 6px 6px;
  background: var(--fila); border-radius: var(--radio);
  box-shadow: var(--sombra);
  transition: background-color .2s;
}
.fila.entra { animation: entrar .38s var(--curva); }
@keyframes entrar { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
@keyframes aparecer { from { opacity: 0; transform: translateY(-4px); } }

.ranura { flex: none; width: 48px; height: 48px; padding: 0; border: 0; background: none; display: grid; place-items: center; border-radius: 10px; }
.ranura svg { width: 30px; height: 30px; overflow: visible; }
.r-borde { fill: none; stroke: var(--amarillo-hondo); stroke-width: 2.2; stroke-dasharray: 4.2 3.4; transition: stroke .2s; }
.r-relleno { fill: var(--amarillo); transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0); transition: transform .32s var(--curva); }
.r-check { fill: none; stroke: #17201b; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset .26s var(--curva) .12s; }
.ranura:hover .r-borde { stroke: var(--tinta); }
.hecha .r-relleno { transform: scaleY(1); }
.hecha .r-check { stroke-dashoffset: 0; }
.hecha .r-borde { stroke: var(--amarillo); stroke-dasharray: none; }
.hecha.recien .ranura svg { animation: colgar .5s var(--curva); }
@keyframes colgar { 0% { transform: translateY(-5px); } 55% { transform: translateY(1.5px); } 100% { transform: none; } }

.cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 6px 4px; }
.texto {
  all: unset; cursor: text; display: block; border-radius: 4px;
  font-size: 17px; line-height: 1.3; overflow-wrap: anywhere;
  text-decoration: line-through 1.5px transparent;
  transition: color .25s, text-decoration-color .3s var(--curva);
}
.texto:focus-visible { outline: 2.5px solid var(--foco); outline-offset: 2px; }
.hecha .texto { color: var(--tinta-2); text-decoration-color: var(--tinta-2); }
.vence { font-size: 14px; color: var(--tinta-2); margin-top: 2px; display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.vence:empty { display: none; }
.vence.hoy { color: var(--tinta); font-weight: 700; }
.vence.vencida { color: var(--rojo); font-weight: 700; }
.hecha .vence { color: var(--tinta-3); font-weight: 400; }

.asa {
  flex: none; width: 44px; height: 48px; border: 0; background: none; border-radius: 10px;
  color: var(--tinta-3); display: grid; place-items: center; cursor: grab; touch-action: none;
  transition: color .15s, background-color .15s;
}
.asa:hover { color: var(--tinta); background: var(--pildora); }
.lista.filtrada .asa { visibility: visible; }

/* arrastre */
.fila.arrastrando { z-index: 3; box-shadow: var(--sombra-alta); transition: none; cursor: grabbing; }
.fila.arrastrando .asa { cursor: grabbing; color: var(--tinta); }
.lista.ordenando .fila:not(.arrastrando) { transition: transform .22s var(--curva); }
body.agarrando { user-select: none; -webkit-user-select: none; cursor: grabbing; }

/* editor en línea */
.fila.editando { flex-direction: column; align-items: stretch; padding: 10px; box-shadow: 0 0 0 2px var(--amarillo-hondo), var(--sombra); }
.editor { display: flex; flex-direction: column; gap: 10px; animation: aparecer .22s var(--curva); }
.ed-texto {
  height: 48px; padding: 0 12px; border: 1.5px solid var(--fila-borde); border-radius: 10px;
  background: var(--fondo); font-size: 17px; outline: none; caret-color: var(--tinta);
}
.ed-texto:focus { border-color: var(--tinta-2); }
.ed-fila { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ed-fecha {
  display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 6px 0 10px;
  border: 1.5px solid var(--fila-borde); border-radius: 10px; color: var(--tinta-2);
}
.ed-fecha .ic { width: 20px; height: 20px; }
.ed-fecha input { border: 0; background: none; height: 38px; font-size: 16px; color: var(--tinta); outline: none; min-width: 0; width: 132px; }
.ed-fecha:focus-within { border-color: var(--tinta-2); }
.ed-sin-fecha, .ed-borrar {
  height: 42px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: var(--tinta-2); font-size: 15px;
  display: inline-flex; align-items: center; gap: 5px;
}
.ed-sin-fecha:hover { background: var(--pildora); color: var(--tinta); }
.ed-borrar { color: var(--rojo); }
.ed-borrar .ic { width: 20px; height: 20px; }
.ed-borrar:hover { background: color-mix(in srgb, var(--rojo) 12%, transparent); }
.ed-acciones { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.ed-listo {
  height: 42px; padding: 0 18px; border: 0; border-radius: 99px;
  background: var(--tinta); color: var(--fondo); font-weight: 700; font-size: 16px;
}
.ed-listo:hover { filter: brightness(1.15); }

/* fila que sale */
.fila.sale { animation: salir .26s var(--curva) forwards; pointer-events: none; }
@keyframes salir { to { opacity: 0; transform: translateX(28px); } }

/* ---------- vacío ---------- */
.vacio { text-align: center; padding: 40px 24px 60px; color: var(--tinta-2); animation: aparecer .3s var(--curva); }
.vacio-art { width: 160px; height: 96px; color: var(--tinta); display: block; margin: 0 auto 14px; }
.silueta { stroke: var(--amarillo-hondo); }
.vacio-t { margin: 0; font-weight: 700; font-size: 19px; color: var(--tinta); }
.vacio-s { margin: 6px auto 0; max-width: 30ch; font-size: 16px; }
.aviso-guardado { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--rojo) 12%, var(--fila)); color: var(--tinta); font-size: 15px; }

/* ---------- aviso con deshacer ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 20;
  width: min(560px, calc(100% - 24px));
  display: flex; align-items: center; gap: 6px;
  padding: 6px 6px 6px 16px; border-radius: 16px;
  background: #17201b; color: #f1efe4; box-shadow: var(--sombra-alta);
  transform: translateX(-50%);
  animation: toast-in .32s var(--curva);
}
@media (prefers-color-scheme: dark) { .toast { background: #e9ece6; color: #17201b; } .toast .x-redonda { background: rgba(0, 0, 0, .08); } .toast-btn { color: #6b5100 !important; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px); } }
.toast-t { flex: 1; min-width: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-btn {
  height: 40px; padding: 0 14px; border: 0; border-radius: 99px; background: none;
  color: var(--amarillo); font-weight: 700; font-size: 16px;
}
.toast-btn:hover { background: rgba(255, 255, 255, .1); }

@media (min-width: 720px) {
  .banda { padding: 36px 0 26px; }
  h1 { font-size: 38px; }
  .barra { padding-top: 22px; }
}
@media (hover: hover) {
  .fila .asa { opacity: .55; transition: opacity .15s, color .15s, background-color .15s; }
  .fila:hover .asa, .asa:focus-visible { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
