/* RemindGab · Sistema de diseño compartido (landing, acceso, app y panel admin) */

:root {
    color-scheme: dark;
    --content-max: 1600px;
    --bg: #090c1b;
    --bg-2: #0f1330;
    --surface: rgba(255, 255, 255, 0.055);
    --surface-2: rgba(255, 255, 255, 0.09);
    --surface-3: rgba(255, 255, 255, 0.13);
    --surface-solid: #141938;
    --overlay: rgba(4, 6, 18, 0.62);
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --text: #f3f5ff;
    --text-2: rgba(226, 232, 255, 0.74);
    --text-3: rgba(226, 232, 255, 0.5);
    --a1: 124, 89, 255;
    --a2: 66, 199, 255;
    --a3: 255, 126, 182;
    --violet: rgb(var(--a1));
    --blue: #42c7ff;
    --mint: #6ef0c1;
    --pink: #f472b6;
    --amber: #fbbf24;
    --red: #ff6b81;
    --green: #34d399;
    --grad: linear-gradient(135deg, rgb(var(--a1)) 0%, rgb(var(--a2)) 100%);
    --grad-brand: linear-gradient(135deg, color-mix(in srgb, rgb(var(--a1)) 88%, white) 0%, color-mix(in srgb, rgb(var(--a1)), rgb(var(--a3))) 55%, rgb(var(--a3)) 100%);
    --grad-mint: linear-gradient(135deg, #42c7ff, #6ef0c1);
    --ring: 0 0 0 4px rgba(var(--a1), 0.25);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.18);
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
    --shadow-lg: 0 30px 90px rgba(0, 0, 0, 0.5);
    --blur: blur(22px) saturate(150%);
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 26px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Segoe UI Variable Display", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    --p-baja: #34d399;
    --p-media: #42c7ff;
    --p-alta: #fbbf24;
    --p-urgente: #ff6b81;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Tema claro (elegido o por sistema) */
:root[data-theme="claro"] {
    color-scheme: light;
    --bg: #f3f4fb;
    --bg-2: #e9ebf8;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-2: rgba(255, 255, 255, 0.92);
    --surface-3: #ffffff;
    --surface-solid: #ffffff;
    --overlay: rgba(20, 24, 52, 0.38);
    --border: rgba(24, 30, 72, 0.1);
    --border-strong: rgba(24, 30, 72, 0.2);
    --text: #141a33;
    --text-2: #4a5275;
    --text-3: #8088a8;
    --shadow-sm: 0 4px 14px rgba(36, 42, 90, 0.08);
    --shadow: 0 18px 50px rgba(36, 42, 90, 0.12);
    --shadow-lg: 0 30px 90px rgba(36, 42, 90, 0.2);
    --p-media: #1fa7e0;
    --p-alta: #e9a100;
    --p-baja: #16b37e;
}

@media (prefers-color-scheme: light) {
    :root[data-theme="sistema"] {
        color-scheme: light;
        --bg: #f3f4fb;
        --bg-2: #e9ebf8;
        --surface: rgba(255, 255, 255, 0.72);
        --surface-2: rgba(255, 255, 255, 0.92);
        --surface-3: #ffffff;
        --surface-solid: #ffffff;
        --overlay: rgba(20, 24, 52, 0.38);
        --border: rgba(24, 30, 72, 0.1);
        --border-strong: rgba(24, 30, 72, 0.2);
        --text: #141a33;
        --text-2: #4a5275;
        --text-3: #8088a8;
        --shadow-sm: 0 4px 14px rgba(36, 42, 90, 0.08);
        --shadow: 0 18px 50px rgba(36, 42, 90, 0.12);
        --shadow-lg: 0 30px 90px rgba(36, 42, 90, 0.2);
        --p-media: #1fa7e0;
        --p-alta: #e9a100;
        --p-baja: #16b37e;
    }
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    min-height: 100dvh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(var(--a1), 0.35); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Scrollbars discretos */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

/* Fondo aurora animado (solo CSS, sin imágenes pesadas) */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--bg); }
.aurora::before, .aurora::after, .aurora i {
    content: ""; position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5;
    animation: aurora-move 22s var(--ease) infinite alternate;
}
.aurora::before { width: 55vmax; height: 55vmax; left: -15vmax; top: -20vmax; background: radial-gradient(circle, rgba(var(--a1), 0.55), transparent 65%); }
.aurora::after { width: 45vmax; height: 45vmax; right: -12vmax; bottom: -18vmax; background: radial-gradient(circle, rgba(var(--a2), 0.4), transparent 65%); animation-delay: -8s; }
.aurora i { width: 30vmax; height: 30vmax; right: 20vw; top: 30vh; background: radial-gradient(circle, rgba(var(--a3), 0.28), transparent 65%); animation-delay: -14s; }
:root[data-theme="claro"] .aurora::before, :root[data-theme="claro"] .aurora::after, :root[data-theme="claro"] .aurora i { opacity: 0.28; }
@media (prefers-color-scheme: light) { :root[data-theme="sistema"] .aurora::before, :root[data-theme="sistema"] .aurora::after, :root[data-theme="sistema"] .aurora i { opacity: 0.28; } }
@keyframes aurora-move { to { transform: translate3d(6vw, 5vh, 0) scale(1.12); } }

/* ---------- Superficies ---------- */
.glass {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
}
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { font-size: 1.02rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head .muted { font-size: 0.85rem; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.gradient-text { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Botones ---------- */
.btn {
    --h: 42px;
    min-height: var(--h); padding: 0 16px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface-2); color: var(--text);
    font-weight: 650; font-size: 0.92rem; white-space: nowrap;
    transition: transform 0.18s var(--ease), background 0.18s, border-color 0.18s, box-shadow 0.18s, opacity 0.18s;
    -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 10px 26px rgba(var(--a1), 0.32); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.08); box-shadow: 0 14px 32px rgba(var(--a1), 0.42); }
.btn-brand { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: 0 10px 26px rgba(var(--a3), 0.3); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-danger { background: rgba(255, 107, 129, 0.14); border-color: rgba(255, 107, 129, 0.35); color: var(--red); }
.btn-danger:hover { background: rgba(255, 107, 129, 0.22); border-color: rgba(255, 107, 129, 0.5); }
.btn-success { background: rgba(52, 211, 153, 0.15); border-color: rgba(52, 211, 153, 0.35); color: var(--green); }
.btn-sm { --h: 34px; padding: 0 12px; font-size: 0.84rem; }
.btn-lg { --h: 50px; padding: 0 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { width: var(--h); padding: 0; border-radius: 12px; }
.btn-icon.round { border-radius: 50%; }
.btn .spinner { width: 16px; height: 16px; }
.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.is-busy::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.7s linear infinite; }
.btn:not(.btn-primary):not(.btn-brand).is-busy::after { border-color: var(--border-strong); border-top-color: var(--text); }

/* ---------- Formularios ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .label { font-size: 0.82rem; font-weight: 650; color: var(--text-2); }
.field small { color: var(--text-3); font-size: 0.78rem; }
.input, .select, .textarea {
    width: 100%; min-height: 44px; padding: 0 14px;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--surface); color: var(--text); outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.textarea { padding: 12px 14px; min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238890b5' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.select option { background: var(--surface-solid); color: var(--text); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(var(--a1), 0.7); box-shadow: var(--ring); background: var(--surface-2); }
.input.is-invalid, .is-invalid .input { border-color: rgba(255, 107, 129, 0.7); box-shadow: 0 0 0 4px rgba(255, 107, 129, 0.14); }
.input[type="date"], .input[type="time"] { padding-right: 10px; }
.input[type="color"] { padding: 4px; width: 48px; min-height: 40px; cursor: pointer; }
.form-grid { display: grid; gap: 14px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.input-group { position: relative; }
.input-group .input { padding-left: 42px; }
.input-group > svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.form-error { padding: 11px 14px; border-radius: var(--radius-sm); background: rgba(255, 107, 129, 0.12); border: 1px solid rgba(255, 107, 129, 0.3); color: var(--red); font-size: 0.88rem; }
.form-ok { padding: 11px 14px; border-radius: var(--radius-sm); background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.3); color: var(--green); font-size: 0.88rem; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 600; font-size: 0.9rem; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); transition: background 0.2s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transition: transform 0.25s var(--spring); }
.switch input:checked + i { background: var(--grad); border-color: transparent; }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { box-shadow: var(--ring); }

.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 650; color: var(--text-2); white-space: nowrap; transition: background 0.2s, color 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.is-active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }
.seg .count { font-size: 0.72rem; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); }

/* ---------- Chips, badges, avatares ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 0.77rem; font-weight: 650; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.cat { background: color-mix(in srgb, var(--c, rgb(var(--a1))) 16%, transparent); border-color: color-mix(in srgb, var(--c, rgb(var(--a1))) 38%, transparent); color: var(--text); }
.badge { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 22px; padding: 0 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.01em; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge.ok { background: rgba(52, 211, 153, 0.14); color: var(--green); border-color: rgba(52, 211, 153, 0.3); }
.badge.warn { background: rgba(251, 191, 36, 0.14); color: var(--amber); border-color: rgba(251, 191, 36, 0.3); }
.badge.bad { background: rgba(255, 107, 129, 0.14); color: var(--red); border-color: rgba(255, 107, 129, 0.3); }
.badge.info { background: rgba(66, 199, 255, 0.14); color: var(--blue); border-color: rgba(66, 199, 255, 0.3); }
.badge.violet { background: rgba(var(--a1), 0.16); color: color-mix(in srgb, rgb(var(--a1)) 62%, white); border-color: rgba(var(--a1), 0.35); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c, var(--text-3)); }
.prio-baja { --c: var(--p-baja); } .prio-media { --c: var(--p-media); } .prio-alta { --c: var(--p-alta); } .prio-urgente { --c: var(--p-urgente); }
.counter { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 0.68rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.avatar { --s: 38px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden; background: var(--grad-brand); color: #fff; font-weight: 800; font-size: calc(var(--s) * 0.38); letter-spacing: 0.02em; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.kbd { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border-radius: 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; font-size: 0.72rem; font-weight: 700; color: var(--text-3); font-family: var(--font); }

/* ---------- Estados vacíos y carga ---------- */
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 34px 16px; color: var(--text-2); }
.empty .big { font-size: 2.6rem; line-height: 1; animation: float 4s ease-in-out infinite; }
.empty strong { color: var(--text); font-size: 1rem; }
.skeleton { border-radius: var(--radius-sm); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-3) 50%, var(--surface) 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--border-strong); border-top-color: var(--violet); animation: spin 0.7s linear infinite; }
.view-loading { display: grid; place-items: center; min-height: 40vh; }

/* ---------- Modales (centrados en escritorio, hoja inferior en móvil) ---------- */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
    background: var(--overlay); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    animation: fade-in 0.2s ease both;
}
.modal-backdrop.is-closing { animation: fade-out 0.2s ease both; }
.modal {
    position: relative; width: min(var(--w, 560px), 100%); max-height: min(88dvh, 900px);
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); animation: modal-in 0.32s var(--ease) both;
}
:root:not([data-theme="claro"]) .modal { background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)), var(--surface-solid); }
.is-closing .modal { animation: modal-out 0.2s ease both; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px; }
.modal-head h2 { font-size: 1.15rem; flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.modal-body { padding: 6px 20px 20px; overflow-y: auto; overscroll-behavior: contain; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px calc(16px + var(--safe-bottom)); border-top: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }
.sheet-handle { display: none; }
@media (max-width: 640px) {
    .modal-backdrop { place-items: end center; padding: 0; }
    .modal { width: 100%; max-height: 92dvh; border-radius: 26px 26px 0 0; border-bottom: 0; animation: sheet-in 0.36s var(--ease) both; }
    .is-closing .modal { animation: sheet-out 0.22s ease both; }
    .sheet-handle { display: block; width: 42px; height: 5px; border-radius: 99px; background: var(--border-strong); margin: 10px auto 0; flex: none; }
    .modal-head { padding-top: 10px; }
    .modal-foot .btn { flex: 1; }
    .modal-foot .hint { display: none; }
    .form-grid.cols-2 { grid-template-columns: 1fr; }
}

/* ---------- Menús desplegables ---------- */
.menu {
    position: fixed; z-index: 120; min-width: 210px; padding: 6px;
    background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-lg);
    animation: pop-in 0.18s var(--ease) both; transform-origin: top right;
}
.menu button, .menu a { width: 100%; min-height: 40px; padding: 0 12px; display: flex; align-items: center; gap: 10px; border-radius: 10px; font-size: 0.9rem; font-weight: 550; text-align: left; color: var(--text); }
.menu button:hover, .menu a:hover, .menu .is-focus { background: var(--surface-2); }
.menu svg { width: 18px; height: 18px; color: var(--text-2); flex: none; }
.menu .danger, .menu .danger svg { color: var(--red); }
.menu hr { border: 0; height: 1px; background: var(--border); margin: 6px 4px; }
.menu .menu-label { padding: 8px 12px 4px; font-size: 0.72rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
    pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow);
    animation: toast-in 0.4s var(--spring) both; font-size: 0.9rem;
}
.toast.is-leaving { animation: toast-out 0.25s ease both; }
.toast .ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: 1rem; background: var(--surface-2); }
.toast.ok .ico { background: rgba(52, 211, 153, 0.16); color: var(--green); }
.toast.error .ico { background: rgba(255, 107, 129, 0.16); color: var(--red); }
.toast p { flex: 1; min-width: 0; }
.toast .btn { --h: 30px; }

/* ---------- Animaciones ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -150% 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.94) translateY(-4px); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(var(--a1), 0.5); } 100% { box-shadow: 0 0 0 14px rgba(var(--a1), 0); } }
.shake { animation: shake 0.5s both; }
.stagger > * { animation: rise-in 0.5s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: 0.04s; } .stagger > *:nth-child(3) { animation-delay: 0.08s; } .stagger > *:nth-child(4) { animation-delay: 0.12s; }
.stagger > *:nth-child(5) { animation-delay: 0.16s; } .stagger > *:nth-child(6) { animation-delay: 0.2s; } .stagger > *:nth-child(7) { animation-delay: 0.24s; } .stagger > *:nth-child(n+8) { animation-delay: 0.28s; }

@media (max-width: 640px) {
    .toasts { left: 16px; right: 16px; width: auto; top: calc(12px + env(safe-area-inset-top, 0px)); bottom: auto; }
    @keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(0.95); } }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Pantallas ultrapanorámicas: laterales con tarjetas de la app (landing y acceso) ---------- */
.ambient { display: none; }
@media (min-width: 2400px) {
    .ambient { display: block; position: fixed; inset: 0; z-index: -1; pointer-events: none; --amb-gap: 1700px; }
    .amb-col { position: absolute; top: 0; bottom: 0; width: calc((100vw - var(--amb-gap)) / 2); display: flex; flex-direction: column; justify-content: space-evenly; align-items: center; padding: 90px 0 40px; }
    .amb-left { left: 0; }
    .amb-right { right: 0; }
    .amb-card { width: min(320px, 82%); display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); opacity: 0.82; animation: amb-in 0.9s var(--ease) both, float 7s ease-in-out infinite; }
    .amb-col > :nth-child(odd) { margin-right: 16%; }
    .amb-col > :nth-child(even) { margin-left: 16%; }
    .amb-col > :nth-child(1) { animation-delay: 0.1s, -1s; } .amb-col > :nth-child(2) { animation-delay: 0.25s, -3s; } .amb-col > :nth-child(3) { animation-delay: 0.4s, -5s; } .amb-col > :nth-child(4) { animation-delay: 0.55s, -2s; } .amb-col > :nth-child(5) { animation-delay: 0.7s, -4s; }
    .amb-card > div { display: grid; flex: 1; min-width: 0; gap: 1px; }
    .amb-card strong { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .amb-card small { color: var(--text-2); font-size: 0.76rem; }
    .amb-emo { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; background: color-mix(in srgb, var(--c, rgb(var(--a1))) 24%, transparent); flex: none; }
    .amb-ok { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 0.75rem; color: #043; background: var(--grad-mint); flex: none; }
    .amb-push img { width: 38px; height: 38px; border-radius: 11px; align-self: flex-start; }
    .amb-acts, .amb-chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
    .amb-acts i, .amb-chips i { font-style: normal; font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); }
    .amb-chips i { background: rgba(var(--a1), 0.25); }
    .amb-nl { display: grid; gap: 4px; }
    .amb-nl strong { white-space: normal; }
    .amb-cal { display: grid; gap: 10px; }
    .amb-cal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
    .amb-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
    .amb-cal-grid span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; font-size: 0.7rem; color: var(--text-2); background: rgba(255, 255, 255, 0.05); }
    .amb-cal-grid span.is-today { background: var(--grad); color: #fff; font-weight: 800; }
    .amb-ring svg { width: 52px; height: 52px; transform: rotate(-90deg); flex: none; }
    .amb-ring circle { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 7; }
    .amb-ring circle.b { stroke: #6ef0c1; stroke-linecap: round; stroke-dasharray: 151; stroke-dashoffset: 41; }
    .amb-ring strong { white-space: normal; }
}
@keyframes amb-in { from { opacity: 0; filter: blur(6px); } }
@media (min-width: 2800px) { .ambient { --amb-gap: 1900px; } }
@media (min-width: 3600px) { .ambient { --amb-gap: 2300px; } .amb-card { zoom: 1.25; } }
@media (prefers-reduced-motion: reduce) { .amb-card { animation: none; } }

/* Acceso: el contenido crece en pantallas muy anchas */
@media (min-width: 2400px) {
    .auth-page .ambient { --amb-gap: 1600px; }
    .auth-page .auth-shell { zoom: 1.2; min-height: calc(100dvh / 1.2); }
}
@media (min-width: 2800px) { .auth-page .ambient { --amb-gap: 1800px; } .auth-page .auth-shell { zoom: 1.35; min-height: calc(100dvh / 1.35); } }
@media (min-width: 3600px) and (min-height: 1500px) { .auth-page .ambient { --amb-gap: 2100px; } .auth-page .auth-shell { zoom: 1.55; min-height: calc(100dvh / 1.55); } }
@media (min-width: 2400px) and (max-height: 1150px) { .auth-page .auth-shell { zoom: 1.1; min-height: calc(100dvh / 1.1); } }

/* ---------- Apariencia personal (data-* en <html>, ver app/lib/appearance.php) ---------- */
:root[data-acento="azul"] { --a1: 59, 130, 246; --a2: 34, 211, 238; --a3: 129, 140, 248; }
:root[data-acento="cielo"] { --a1: 14, 165, 233; --a2: 45, 212, 191; --a3: 96, 165, 250; }
:root[data-acento="turquesa"] { --a1: 20, 184, 166; --a2: 56, 189, 248; --a3: 74, 222, 128; }
:root[data-acento="verde"] { --a1: 34, 197, 94; --a2: 45, 212, 191; --a3: 163, 230, 53; }
:root[data-acento="ambar"] { --a1: 245, 158, 11; --a2: 250, 204, 21; --a3: 249, 115, 22; }
:root[data-acento="naranja"] { --a1: 249, 115, 22; --a2: 251, 191, 36; --a3: 244, 63, 94; }
:root[data-acento="rojo"] { --a1: 239, 68, 68; --a2: 249, 115, 22; --a3: 236, 72, 153; }
:root[data-acento="rosa"] { --a1: 236, 72, 153; --a2: 168, 85, 247; --a3: 251, 113, 133; }
:root[data-acento="grafito"] { --a1: 100, 116, 139; --a2: 148, 163, 184; --a3: 71, 85, 105; }
/* El fondo oscuro toma un toque del color elegido. */
:root[data-theme="oscuro"][data-acento]:not([data-acento="violeta"]) { --bg: color-mix(in srgb, #080a14 92%, rgb(var(--a1))); --surface-solid: color-mix(in srgb, #12152a 90%, rgb(var(--a1))); }
@media (prefers-color-scheme: dark) { :root[data-theme="sistema"][data-acento]:not([data-acento="violeta"]) { --bg: color-mix(in srgb, #080a14 92%, rgb(var(--a1))); --surface-solid: color-mix(in srgb, #12152a 90%, rgb(var(--a1))); } }

/* Fondo */
:root[data-fondo="suave"] .aurora::before, :root[data-fondo="suave"] .aurora::after, :root[data-fondo="suave"] .aurora i { animation: none; opacity: 0.32; }
:root[data-fondo="liso"] .aurora::before, :root[data-fondo="liso"] .aurora::after, :root[data-fondo="liso"] .aurora i { display: none; }

/* Tarjetas: sólidas (más rápidas en móviles modestos) o con alto contraste */
:root[data-estilo="solido"] { --blur: none; --surface: var(--surface-solid); --surface-2: color-mix(in srgb, var(--surface-solid) 90%, var(--text)); --surface-3: color-mix(in srgb, var(--surface-solid) 82%, var(--text)); }
:root[data-estilo="contraste"] { --blur: none; --surface: var(--surface-solid); --border: color-mix(in srgb, var(--text) 32%, transparent); --border-strong: color-mix(in srgb, var(--text) 55%, transparent); --text-2: color-mix(in srgb, var(--text) 88%, transparent); --text-3: color-mix(in srgb, var(--text) 70%, transparent); }

/* Esquinas */
:root[data-esquinas="suaves"] { --radius-xs: 6px; --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; }
:root[data-esquinas="rectas"] { --radius-xs: 3px; --radius-sm: 4px; --radius: 6px; --radius-lg: 8px; }
:root[data-esquinas="rectas"] .btn, :root[data-esquinas="rectas"] .seg, :root[data-esquinas="rectas"] .seg button, :root[data-esquinas="rectas"] .chip, :root[data-esquinas="rectas"] .badge, :root[data-esquinas="rectas"] .rem, :root[data-esquinas="rectas"] .tile, :root[data-esquinas="rectas"] .input, :root[data-esquinas="rectas"] .select { border-radius: 6px; }
:root[data-esquinas="suaves"] .rem, :root[data-esquinas="suaves"] .tile { border-radius: 12px; }

/* Tamaño de letra y densidad */
:root[data-texto="pequeno"] { font-size: 15px; }
:root[data-texto="pequeno"] body { font-size: 14px; }
:root[data-texto="grande"] { font-size: 17.5px; }
:root[data-texto="grande"] body { font-size: 16.5px; }
:root[data-densidad="compacta"] .card { padding: 13px; }
:root[data-densidad="compacta"] .rem { padding: 6px 8px 6px 10px; gap: 9px; }
:root[data-densidad="compacta"] .rem-emoji { width: 34px; height: 34px; font-size: 1.05rem; }
:root[data-densidad="compacta"] .rem-list { gap: 5px; }

/* Animaciones reducidas (además de respetar la preferencia del sistema) */
:root[data-movimiento="reducido"] *, :root[data-movimiento="reducido"] *::before, :root[data-movimiento="reducido"] *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
.ico.flip { transform: rotate(180deg); }
