@font-face { font-family: "Poppins"; src: url("fuentes/Poppins-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fuentes/Poppins-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fuentes/Poppins-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Lora"; src: url("fuentes/Lora-Variable.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }

:root {
  --fondo: #FAF7F2; --tinta: #2F3A36; --suave: #7D877F; --linea: #E4DED4; --papel: #FFFFFF;
  --principal: #6F8F78; --acento: #C9826B; --claro: #E7EFE8;
  --ok: #4F8A63; --mal: #C2554A; --radio: 16px;
  --sombra: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.04);
  --nav: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--fondo); }
body { margin: 0; font-family: "Poppins", system-ui, sans-serif; font-size: 15px; color: var(--tinta); background: var(--fondo); line-height: 1.45; }
a { color: inherit; text-decoration: none; }
#app { max-width: 720px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--nav) + env(safe-area-inset-bottom) + 24px); }

/* ---------- cabecera */
#top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 14px) 18px 12px; background: var(--fondo); }
#top h1 { flex: 1; margin: 0; font: 600 26px/1.15 "Lora", Georgia, serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#top.con-atras h1 { font-size: 21px; }
.atras { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--papel); border: 1px solid var(--linea); font-size: 26px; line-height: 1; padding-bottom: 3px; flex: none; }
.accion { font-weight: 500; font-size: 14px; color: var(--principal); padding: 8px 12px; border-radius: 20px; background: var(--claro); flex: none; }
#vista { padding: 4px 18px 0; }

/* ---------- navegación inferior */
#nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: flex; justify-content: center; background: var(--papel); border-top: 1px solid var(--linea); padding-bottom: env(safe-area-inset-bottom); }
#nav a { flex: 1; max-width: 180px; height: var(--nav); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 500; color: var(--suave); }
#nav svg { width: 24px; height: 24px; fill: currentColor; }
#nav a.activo { color: var(--principal); }
#nav a.activo svg { background: var(--claro); border-radius: 12px; padding: 2px 14px; width: 52px; box-sizing: content-box; height: 22px; }

/* ---------- textos */
.saludo p { margin: 0; color: var(--suave); font-size: 14px; }
.saludo h2 { margin: 0 0 14px; font: 600 28px "Lora", Georgia, serif; }
h3.sec { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 2px 10px; font-size: 15px; font-weight: 600; color: var(--principal); }
h3.sec a { font-size: 13px; font-weight: 500; color: var(--acento); }
.nota { color: var(--suave); font-size: 13.5px; margin: 8px 2px; }
.centro { text-align: center; }

/* ---------- botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 10px 18px; border: 0; border-radius: 14px; background: var(--principal); color: #fff; font: 500 15px "Poppins", sans-serif; cursor: pointer; text-align: center; }
.btn.sec { background: var(--papel); color: var(--tinta); border: 1px solid var(--linea); }
.btn.peligro { background: transparent; color: var(--mal); border: 1px solid color-mix(in srgb, var(--mal) 35%, transparent); }
.btn.bloque { display: flex; width: 100%; margin-top: 12px; }
.btn:active { transform: scale(.98); }
.acciones-fila { display: flex; gap: 10px; margin: 12px 0; }
.acciones-fila .btn { flex: 1; }
.archivo input { display: none; }

/* ---------- listas y filas */
.lista { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; box-shadow: var(--sombra); }
.fila { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 58px; border-top: 1px solid var(--linea); }
.fila:first-child { border-top: 0; }
a.fila:active { background: var(--claro); }
.fila-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fila-txt b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila-txt small { color: var(--suave); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista.grande .fila { min-height: 68px; }
.ic { font-size: 22px; width: 32px; text-align: center; }
.mas { color: var(--suave); font-size: 22px; }
.n { color: var(--suave); font-size: 12px; width: 20px; text-align: right; flex: none; }
.punto { width: 12px; height: 36px; border-radius: 6px; flex: none; }
.pill { font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: 20px; background: var(--claro); color: var(--principal); white-space: nowrap; flex: none; }
.pill.ok { background: color-mix(in srgb, var(--ok) 14%, white); color: var(--ok); }
.pill.mal { background: color-mix(in srgb, var(--mal) 13%, white); color: var(--mal); }
.fecha-chip { width: 44px; height: 46px; flex: none; border-radius: 12px; background: var(--claro); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.fecha-chip b { font-size: 17px; }
.fecha-chip small { font-size: 11px; color: var(--suave); text-transform: lowercase; }
.tipo { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; background: var(--suave); }
.t-feriado { background: var(--acento); } .t-nolab { background: var(--linea); } .t-efem { background: var(--principal); opacity: .5; }
.t-mesa { background: #8E6FB0; } .t-reunion { background: #4C8FB5; } .t-acto { background: #D9A441; } .t-entrega { background: #C2554A; } .t-otro { background: var(--suave); }

/* ---------- avisos */
.banner { display: block; padding: 14px 16px; border-radius: var(--radio); background: var(--claro); margin: 0 0 12px; }
.banner b { display: block; font-weight: 600; }
.banner span { font-size: 13px; color: var(--principal); }
.banner.mal { background: color-mix(in srgb, var(--mal) 12%, white); }
.banner.mal span { color: var(--mal); }
.banner.suave { background: var(--papel); border: 1px dashed var(--linea); margin-top: 22px; }
.chip-dia { padding: 10px 14px; border-radius: 12px; margin: 8px 0; font-weight: 500; font-size: 14px; }
.chip-dia.feriado { background: color-mix(in srgb, var(--acento) 15%, white); color: var(--acento); }
.vacio { text-align: center; padding: 34px 18px; background: var(--papel); border: 1px dashed var(--linea); border-radius: 20px; margin-top: 10px; }
.vacio-ic { font-size: 40px; }
.vacio h3 { margin: 8px 0 4px; font: 600 20px "Lora", serif; }
.vacio p { color: var(--suave); margin: 0 0 18px; }
.estado-lic { padding: 16px; border-radius: var(--radio); background: var(--claro); font-weight: 500; }
.estado-lic.ok { background: color-mix(in srgb, var(--ok) 13%, white); color: var(--ok); }
.estado-lic.mal { background: color-mix(in srgb, var(--mal) 12%, white); color: var(--mal); }
.codigo { font: 600 24px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 1px; text-align: center; padding: 18px; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); }

/* ---------- cursos */
.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tarjeta-curso { position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 120px; padding: 16px; border-radius: 18px; background: var(--papel); border: 1px solid var(--linea); box-shadow: var(--sombra); overflow: hidden; }
.tarjeta-curso::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 8px; background: var(--c); }
.tarjeta-curso b { font: 600 22px "Lora", serif; margin-top: 6px; }
.tarjeta-curso span { font-size: 13px; color: var(--suave); }
.tarjeta-curso small { margin-top: auto; font-size: 12px; color: var(--principal); font-weight: 500; }
.curso-cab { margin: -6px 0 8px; font-size: 13px; color: var(--suave); display: flex; align-items: center; gap: 8px; }
.curso-cab::before { content: ""; width: 26px; height: 6px; border-radius: 3px; background: var(--c); }
.tabs { display: flex; gap: 4px; background: var(--papel); border: 1px solid var(--linea); border-radius: 14px; padding: 4px; margin-bottom: 12px; overflow-x: auto; }
.tabs a { flex: 1; text-align: center; padding: 9px 8px; border-radius: 10px; font-size: 13.5px; font-weight: 500; color: var(--suave); white-space: nowrap; }
.tabs a.activo { background: var(--principal); color: #fff; }

/* ---------- asistencia */
.fecha-bar, .mes-bar { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.flecha { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--papel); border: 1px solid var(--linea); font-size: 24px; flex: none; }
.fecha-sel { position: relative; flex: 1; text-align: center; padding: 10px; background: var(--papel); border: 1px solid var(--linea); border-radius: 12px; }
.fecha-sel input { position: absolute; inset: 0; opacity: 0; width: 100%; }
.mes-bar b { flex: 1; text-align: center; font: 600 20px "Lora", serif; }
.fila-asis { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-top: 1px solid var(--linea); min-height: 56px; }
.fila-asis:first-child { border-top: 0; }
.fila-asis .nom { flex: 1; min-width: 0; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg { display: flex; gap: 4px; flex: none; }
.seg button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--linea); background: var(--fondo); color: var(--suave); font: 600 14px "Poppins", sans-serif; cursor: pointer; }
.seg button.on { color: #fff; border-color: transparent; }
.seg .e-P { background: var(--ok); } .seg .e-A { background: var(--mal); } .seg .e-T { background: #D9A441; } .seg .e-J { background: #4C8FB5; }
.totales { font-size: 12.5px; color: var(--suave); text-align: center; margin: 10px 0; }

/* ---------- tablas */
.tabla-wrap { overflow-x: auto; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th { text-align: center; font-weight: 500; font-size: 12px; color: var(--suave); padding: 10px 6px; border-bottom: 1px solid var(--linea); background: var(--fondo); }
.tabla th:first-child, .tabla td:first-child { text-align: left; padding-left: 14px; }
.tabla td { text-align: center; padding: 10px 6px; border-top: 1px solid var(--linea); white-space: nowrap; }
.tabla td:first-child { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.tabla td.ok { color: var(--ok); font-weight: 600; } .tabla td.mal { color: var(--mal); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 4px; }
.stats div { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 12px; text-align: center; }
.stats b { display: block; font-size: 22px; } .stats b.mal { color: var(--mal); } .stats b.ok { color: var(--ok); }
.stats small { color: var(--suave); font-size: 12px; }

/* ---------- formularios */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label, .bloque-txt { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--suave); }
.bloque-txt { margin-bottom: 12px; }
input, select, textarea { width: 100%; font: 400 16px "Poppins", sans-serif; color: var(--tinta); background: var(--papel); border: 1px solid var(--linea); border-radius: 12px; padding: 12px 14px; outline: none; min-height: 48px; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--principal); box-shadow: 0 0 0 3px var(--claro); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 13px; font-weight: 500; color: var(--suave); margin-bottom: 8px; padding: 0; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.colores { display: flex; flex-wrap: wrap; gap: 10px; }
.color input, .tema input { display: none; }
.color span { display: block; width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--papel); box-shadow: 0 0 0 1px var(--linea); }
.color input:checked + span { box-shadow: 0 0 0 3px var(--tinta); }
.horario-fila { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.horario-fila select { flex: 1.3; padding: 10px 8px; }
.horario-fila input { flex: 1; padding: 10px 6px; }
.horario-fila span { color: var(--suave); font-size: 13px; }
.x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--fondo); color: var(--mal); font-size: 22px; flex: none; cursor: pointer; }
.notas { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; }
.form .nota-fila { flex-direction: row; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; border-top: 1px solid var(--linea); color: var(--tinta); font-weight: 400; font-size: 14.5px; }
.nota-fila:first-child { border-top: 0; }
.nota-fila span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nota-fila input { width: 76px; flex: none; text-align: center; min-height: 42px; padding: 8px; }
.temas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.form .tema { flex-direction: row; align-items: center; gap: 10px; padding: 10px; background: var(--papel); border: 1px solid var(--linea); border-radius: 14px; color: var(--tinta); font-size: 14px; }
.tema span { display: flex; width: 44px; height: 30px; border-radius: 8px; overflow: hidden; background: var(--f); border: 1px solid var(--linea); }
.tema span i { flex: 1; } .tema span i:first-child { background: var(--p); } .tema span i:last-child { background: var(--a); }
.form .tema:has(input:checked) { border-color: var(--principal); box-shadow: 0 0 0 2px var(--principal); }

/* ---------- agenda */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 8px; }
.cal .cab { text-align: center; font-size: 12px; color: var(--suave); font-weight: 500; padding: 4px 0; }
.dia { aspect-ratio: 1 / 1.05; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 12px; font-size: 15px; }
.dia.finde { color: var(--suave); }
.dia.fuera { opacity: .3; }
.dia.fer span { color: var(--acento); font-weight: 600; }
.dia.hoy span { background: var(--claro); border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; font-weight: 600; color: var(--principal); }
.dia.sel { background: var(--principal); color: #fff; }
.dia.sel span { color: #fff !important; background: transparent !important; }
.dia i { display: flex; gap: 3px; height: 6px; }
.dia em { width: 6px; height: 6px; }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--suave); margin: 10px 2px 0; }
.leyenda span { display: flex; align-items: center; gap: 5px; }
.leyenda em { width: 8px; height: 8px; }

.pasos ol { margin: 0; padding-left: 22px; } .pasos li { margin: 6px 0; }
@supports (-webkit-touch-callout: none) { .oculto-ios { } }

#toast { position: fixed; left: 50%; bottom: calc(var(--nav) + env(safe-area-inset-bottom) + 16px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; max-width: calc(100% - 36px); transition: .25s; z-index: 10; text-align: center; }
#toast.ver { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 760px) {
  #vista { padding: 4px 24px 0; }
  #top { padding-left: 24px; padding-right: 24px; }
}

/* ---------- versión para la compu: un poco más ancha */
body.escritorio #app { max-width: 880px; }
body.escritorio #nav a { max-width: 200px; }

/* ---------- sincronización */
.sinc { display: inline-block; font-size: 12.5px; color: var(--principal); margin-top: 4px; }
.sinc::before { content: "☁ "; }
.sinc.offline { color: var(--suave); } .sinc.error { color: var(--mal); }
.sinc.sincronizando { color: var(--suave); }
.privacidad { margin-top: 18px; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 12px 16px; }
.privacidad summary { font-weight: 500; cursor: pointer; }
.privacidad p { font-size: 13.5px; color: var(--suave); }

/* ---------- agenda personal: notas, planner y hojas semanales */
textarea.auto { resize: none; overflow: hidden; min-height: 64px; line-height: 26px; padding: 10px 14px;
  background-color: var(--papel);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 25px, var(--linea) 25px, var(--linea) 26px);
  background-position: 0 9px; background-attachment: local; }
.fila-acc { display: block; margin: 8px 2px 4px; font-size: 13.5px; font-weight: 500; color: var(--acento); }
.fila-acc.centro { text-align: center; }
.dia.con-nota span { text-decoration: underline; text-decoration-color: var(--acento); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.planner-mes { display: grid; gap: 12px; }
@media (min-width: 640px) { .planner-mes { grid-template-columns: 1fr 1fr; } }
.sem-tit { flex: 1; text-align: center; display: flex; flex-direction: column; line-height: 1.2; }
.sem-tit b { font: 600 20px "Lora", serif; }
.sem-tit small { color: var(--suave); font-size: 13px; }
.semana-grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .semana-grid { grid-template-columns: 1fr 1fr; } }
.dia-card { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--sombra); }
.dia-card.hoy { border-color: var(--principal); box-shadow: 0 0 0 2px var(--claro); }
.dia-card header { display: flex; align-items: baseline; gap: 8px; }
.dia-card header b { font: 600 24px "Lora", serif; }
.dia-card header span { font-weight: 500; }
.dia-card header small { color: var(--suave); font-size: 12.5px; flex: 1; }
.dia-card header a { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--claro); color: var(--principal); font-size: 20px; flex: none; align-self: center; }
.dia-card.fer header b { color: var(--acento); }
.dia-card textarea.auto { border-color: transparent; padding-left: 4px; padding-right: 4px; min-height: 56px; }
.dia-card textarea.auto:focus { border-color: var(--principal); }
.dia-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.dia-items li { display: flex; align-items: center; gap: 8px; }
.dia-items li a { display: flex; align-items: center; gap: 8px; }
.dia-items li.feriado { color: var(--acento); font-weight: 500; }
.dia-items li.efemeride, .dia-items li.nolab { color: var(--suave); }
.dia-items .tipo { width: 8px; height: 8px; }
h3.sec .cuenta { font-size: 13px; font-weight: 500; color: var(--suave); }
.tareas .tarea { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-top: 1px solid var(--linea); min-height: 52px; }
.tareas .tarea:first-child { border-top: 0; }
.tarea span { flex: 1; min-width: 0; word-break: break-word; }
.tarea.hecha span { text-decoration: line-through; color: var(--suave); }
.check { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--suave); background: var(--papel); color: #fff; font-weight: 700; flex: none; cursor: pointer; }
.tarea.hecha .check { background: var(--principal); border-color: var(--principal); }
.tarea-nueva { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--linea); }
.tarea-nueva input { flex: 1; min-height: 44px; }
.tarea-nueva .btn { min-height: 44px; padding: 8px 14px; }
