/* tareas — móvil primero, minimalista: fondo neutro, la marca solo donde hay que actuar.
   Todos los colores por variable; el bloque oscuro solo las redefine. */
:root {
    --brand: #9D162E;
    --brand-soft: #fbeef1;
    --bg: #f6f7f9;
    --panel: #ffffff;
    --border: #e6e9ef;
    --text: #1e293b;
    --muted: #6b7788;
    --suave: #9aa4b2;
    --ok: #15803d;
    --ok-soft: #e8f5ec;
    --ok-txt: #ffffff;
    --alerta: #c2410c;
    --alerta-soft: #fff1e8;
    --sombra: 0 1px 2px rgba(15, 23, 42, .05);
    --sombra-hoja: 0 -10px 40px rgba(15, 23, 42, .18);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --r: 14px;
    /* colores por rol: discretos, solo en el punto de la fila */
    --r-uca: #2563eb; --r-iiter: #7c3aed; --r-te: #9D162E; --r-ing: #d97706; --r-casa: #059669;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-tema="claro"]) {
        --brand: #e0506b;
        --brand-soft: #2a1419;
        --bg: #0e1116;
        --panel: #171b22;
        --border: #262c36;
        --text: #e7ebf2;
        --muted: #97a3b4;
        --suave: #677385;
        --ok: #4ade80;
        --ok-soft: #13261a;
        --ok-txt: #0e1116;
        --alerta: #fb923c;
        --alerta-soft: #2a1a0e;
        --sombra: 0 1px 2px rgba(0, 0, 0, .4);
        --sombra-hoja: 0 -10px 40px rgba(0, 0, 0, .6);
        --r-uca: #60a5fa; --r-iiter: #a78bfa; --r-te: #f0768c; --r-ing: #fbbf24; --r-casa: #34d399;
    }
}
:root[data-tema="oscuro"] {
    --brand: #e0506b;
    --brand-soft: #2a1419;
    --bg: #0e1116;
    --panel: #171b22;
    --border: #262c36;
    --text: #e7ebf2;
    --muted: #97a3b4;
    --suave: #677385;
    --ok: #4ade80;
    --ok-soft: #13261a;
    --ok-txt: #0e1116;
    --alerta: #fb923c;
    --alerta-soft: #2a1a0e;
    --sombra: 0 1px 2px rgba(0, 0, 0, .4);
    --sombra-hoja: 0 -10px 40px rgba(0, 0, 0, .6);
    --r-uca: #60a5fa; --r-iiter: #a78bfa; --r-te: #f0768c; --r-ing: #fbbf24; --r-casa: #34d399;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    background: var(--bg); color: var(--text); font-size: 16px; -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea { font: inherit; color: inherit; }
svg.ic { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.14em; flex: none; }

/* ── Login (mismo patrón que el resto de teApps) ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: var(--bg); }
.login-card { width: 100%; max-width: 24rem; background: var(--panel); border-radius: .9rem; padding: 2.25rem 2rem; box-shadow: 0 20px 45px rgba(15, 23, 42, .12); border: 1px solid var(--border); }
.login-logo { text-align: center; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--brand); font-size: 1.35rem; }
.login-app { text-align: center; font-weight: 700; margin-top: .2rem; }
.login-nota { margin: 1.3rem 0 0; font-size: .75rem; color: var(--muted); text-align: center; line-height: 1.5; }
.login-lead { text-align: center; color: var(--muted); font-size: .9rem; margin: .5rem 0 1.4rem; line-height: 1.5; }
.btn-google { width: 100%; display: flex; align-items: center; justify-content: center; gap: .6rem; padding: .8rem; border: 1px solid var(--border); border-radius: 12px; font-weight: 600; }
.login-sep { text-align: center; color: var(--suave); font-size: .85rem; margin: 1rem 0; }
.form label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .8rem; }
.form input { display: block; width: 100%; margin-top: .3rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.form-error { color: var(--alerta); font-size: .9rem; }
.btn-primary { background: var(--brand); color: #fff; border-radius: 12px; padding: .8rem 1rem; font-weight: 600; }
.btn-full { width: 100%; }

/* ── Cabecera de marca (la de todas las teApps) ── */
.te-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: calc(var(--safe-top) + .6rem) 1rem .6rem; background: #9D162E; color: #fff; }
.te-header-marca { display: flex; align-items: baseline; gap: .6rem; min-width: 0; }
.te-header-title { font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.te-header-sub { font-size: .8rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.te-header-user { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.te-header-email { font-size: .8rem; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-header-btn { color: #fff; border: 1px solid rgba(255, 255, 255, .45); border-radius: .45rem; padding: .3rem .55rem; font-size: .8rem; font-weight: 600; line-height: 1.2; display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.te-header-btn svg.ic { font-size: 16px; }
@media (max-width: 520px) { .te-header-email, .te-header-sub { display: none; } }

/* ── Estructura ── */
.app { max-width: 640px; margin: 0 auto; padding: .4rem 1rem calc(var(--safe-bottom) + 9.5rem); }
.cab { display: flex; align-items: flex-end; justify-content: space-between; padding: .6rem .1rem .9rem; }
.cab-tit { font-size: 2rem; font-weight: 750; letter-spacing: -.02em; margin: 0; line-height: 1.1; }
.cab-sub { color: var(--muted); font-size: .92rem; margin-top: .15rem; }
.cab-sub::first-letter, .dia-tit::first-letter { text-transform: uppercase; }
.chip-red { font-size: .75rem; color: var(--alerta); border: 1px solid currentColor; border-radius: 99px; padding: .1rem .5rem; }

/* ── Progreso del día ── */
.progreso { margin-bottom: .9rem; }
.barra { height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .4s ease; }
.progreso-txt { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); margin-top: .35rem; }

/* ── Agenda: una fila horizontal de citas ── */
.agenda { display: flex; gap: .5rem; overflow-x: auto; margin: 0 -1rem .8rem; padding: 0 1rem .2rem; scrollbar-width: none; }
.agenda::-webkit-scrollbar { display: none; }
.cita { flex: none; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: .45rem .7rem; font-size: .85rem; max-width: 70%; box-shadow: var(--sombra); }
.cita b { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; }
.cita span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cita.pasada { opacity: .45; }

.parte-breve { width: 100%; text-align: left; display: flex; gap: .6rem; align-items: flex-start; background: var(--brand-soft); border-radius: var(--r); padding: .75rem .85rem; margin-bottom: 1rem; font-size: .9rem; line-height: 1.35; }
.parte-breve .ic { color: var(--brand); margin-top: .15rem; }
.parte-breve small { display: block; color: var(--muted); font-size: .75rem; margin-bottom: .1rem; }

/* ── Grupos y filas ── */
.grupo { margin-bottom: 1.1rem; }
.grupo-tit { display: flex; justify-content: space-between; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 .2rem .4rem; }
.grupo-tit.alerta { color: var(--alerta); }
.grupo-tit.marca { color: var(--brand); }
/* Propuestas de Claude: tarjeta con lo que hará y dos botones grandes, pensados para el pulgar. */
.propuesta { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: var(--r); padding: .75rem .85rem; margin-bottom: .5rem; box-shadow: var(--sombra); }
.prop-tit { font-weight: 650; text-align: left; line-height: 1.3; }
.prop-txt { margin: .3rem 0 .65rem; font-size: .88rem; color: var(--muted); line-height: 1.4; }
.prop-botones { display: grid; grid-template-columns: 1fr 1.4fr; gap: .45rem; }
.prop-botones button { border-radius: 11px; padding: .6rem; font-weight: 650; font-size: .92rem; display: flex; align-items: center; justify-content: center; gap: .35rem; }
.prop-no { border: 1px solid var(--border) !important; }
.prop-si { background: var(--brand); color: #fff; }
.propuesta.en-cola { border-left-color: var(--ok); }
.prop-cola { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--ok); flex-wrap: wrap; }
.prop-cola button { margin-left: auto; color: var(--muted); font-size: .8rem; text-decoration: underline; }
.tarjeta { background: var(--panel); border-radius: var(--r); box-shadow: var(--sombra); border: 1px solid var(--border); overflow: hidden; }
.fila { display: flex; align-items: flex-start; gap: .7rem; padding: .75rem .8rem; border-top: 1px solid var(--border); transition: opacity .3s, transform .3s; }
.fila:first-child { border-top: 0; }
.fila.saliendo { opacity: 0; transform: translateX(30px); }
.circulo { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--suave); display: grid; place-items: center; margin-top: 1px; color: var(--ok-txt); font-size: 14px; transition: background .2s, border-color .2s; }
.circulo.urgente { border-color: var(--brand); }
.circulo.hecha { background: var(--ok); border-color: var(--ok); }
.fila-cuerpo { flex: 1; min-width: 0; text-align: left; }
.fila-tit { line-height: 1.3; word-wrap: break-word; }
.fila.hecha .fila-tit { color: var(--suave); text-decoration: line-through; }
.fila-meta { display: flex; flex-wrap: wrap; gap: .25rem .6rem; font-size: .78rem; color: var(--muted); margin-top: .2rem; align-items: center; }
.fila-meta .rol { display: inline-flex; align-items: center; gap: .3rem; }
.fila-meta .rol::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rc, var(--suave)); }
.fila-meta .tarde { color: var(--alerta); font-weight: 600; }
.fila-meta .nuevo { color: var(--brand); font-weight: 600; }
.vacio { text-align: center; color: var(--muted); padding: 2.2rem 1rem; }
.vacio b { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: .2rem; }
.mas { width: 100%; padding: .65rem; color: var(--muted); font-size: .88rem; }

/* ── Todas ── */
.buscar { display: flex; align-items: center; gap: .5rem; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 0 .8rem; margin-bottom: .6rem; color: var(--suave); }
.buscar input { flex: 1; border: 0; background: none; padding: .65rem 0; outline: none; color: var(--text); }
.roles { display: flex; gap: .4rem; overflow-x: auto; margin: 0 -1rem 1rem; padding: 0 1rem; scrollbar-width: none; }
.roles::-webkit-scrollbar { display: none; }
.pill { flex: none; border: 1px solid var(--border); background: var(--panel); border-radius: 99px; padding: .35rem .8rem; font-size: .85rem; }
.pill.sel { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ── Claude ── */
.parte { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); padding: .85rem .95rem; margin-bottom: .6rem; }
.parte-cab { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-bottom: .35rem; }
.parte-cab b { color: var(--brand); text-transform: uppercase; letter-spacing: .05em; }
.parte-txt { white-space: pre-wrap; font-size: .92rem; line-height: 1.45; margin: 0; font-family: inherit; }
.dia-tit { font-size: .85rem; font-weight: 700; color: var(--muted); margin: 1.1rem .2rem .5rem; }

/* ── Alta rápida y pestañas (fijas abajo) ── */
.alta { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + 4.1rem); width: calc(100% - 1.6rem); max-width: 620px; display: flex; gap: .4rem; align-items: center; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: .3rem .3rem .3rem .9rem; box-shadow: 0 6px 24px rgba(15, 23, 42, .12); z-index: 20; }
.alta input { flex: 1; border: 0; background: none; outline: none; padding: .6rem 0; min-width: 0; font-size: 16px; }
.alta-voz, .alta-ok { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }
.alta-voz { color: var(--muted); }
.alta-ok { background: var(--brand); color: #fff; }
.pestanas { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border); padding-bottom: var(--safe-bottom); z-index: 19; }
.pestanas button { position: relative; flex: 1; max-width: 200px; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .55rem 0 .5rem; font-size: .72rem; color: var(--suave); }
.pestanas button span { font-size: 22px; line-height: 1; }
.pestanas button.activa { color: var(--brand); }
.punto { position: absolute; top: .45rem; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }

/* ── Hojas ── */
.velo { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 40; }
.hoja { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; background: var(--panel); border-radius: 20px 20px 0 0; box-shadow: var(--sombra-hoja); padding: .5rem 1.1rem calc(var(--safe-bottom) + 1.1rem); z-index: 41; animation: sube .22s ease-out; }
@keyframes sube { from { transform: translate(-50%, 30%); opacity: .4; } }
.hoja-asa { width: 38px; height: 5px; border-radius: 99px; background: var(--border); margin: 0 auto .8rem; }
.hoja-titulo { width: 100%; border: 0; background: none; resize: none; outline: none; font-size: 1.25rem; font-weight: 650; line-height: 1.3; padding: 0; overflow: hidden; }
.hoja-meta { font-size: .8rem; color: var(--muted); margin: .2rem 0 .9rem; }
.campo { margin-bottom: .95rem; }
.campo-doble { display: grid; grid-template-columns: auto 1fr; gap: 1rem; }
.campo-et { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .4rem; }
.botones { display: flex; flex-wrap: wrap; gap: .35rem; }
.bt { border: 1px solid var(--border); border-radius: 10px; padding: .42rem .7rem; font-size: .88rem; background: var(--bg); }
.bt.sel { background: var(--text); color: var(--bg); border-color: var(--text); }
.bt.sel-marca { background: var(--brand); color: #fff; border-color: var(--brand); }
.fila-plazo { display: flex; align-items: center; gap: .8rem; }
.fila-plazo input[type=date] { flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: .45rem .6rem; background: var(--bg); min-height: 2.4rem; }
.interruptor { display: flex; align-items: center; gap: .4rem; font-size: .9rem; color: var(--muted); }
.interruptor input { width: 1.1rem; height: 1.1rem; accent-color: var(--brand); }
.notas { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); padding: .6rem .7rem; resize: vertical; outline: none; }
.acciones { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: .45rem; margin-top: 1.1rem; }
.acc { display: flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--border); border-radius: 12px; padding: .75rem .4rem; font-size: .9rem; font-weight: 600; }
.acc-ok { background: var(--ok); border-color: var(--ok); color: var(--ok-txt); }
.acc:disabled { opacity: .45; }
.bitacora { margin-top: 1rem; font-size: .82rem; color: var(--muted); }
.bitacora pre { white-space: pre-wrap; font-family: inherit; margin: .5rem 0 0; }

.hoja-voz { text-align: center; padding-top: 1.6rem; }
.hoja-voz .acciones { grid-template-columns: 1fr 1fr; }
.voz-anillo { width: 120px; height: 120px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 44px; color: #fff; background: var(--brand); transform: scale(var(--nivel, 1)); transition: transform .15s; box-shadow: 0 0 0 10px var(--brand-soft); }
.voz-tiempo { font-size: 1.6rem; font-variant-numeric: tabular-nums; font-weight: 650; margin-top: 1rem; }
.voz-pista { color: var(--muted); font-size: .9rem; margin: .4rem 1rem 0; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + 8.6rem); background: var(--text); color: var(--bg); padding: .6rem .6rem .6rem 1rem; border-radius: 12px; font-size: .9rem; z-index: 60; display: flex; align-items: center; gap: .8rem; box-shadow: 0 6px 24px rgba(0, 0, 0, .2); max-width: calc(100% - 2rem); }
.toast button { color: var(--brand-soft); font-weight: 700; padding: .2rem .5rem; }
.toast:not(:has(button)) { padding-right: 1rem; }
