/* ==========================================================================
   INNCOME Empresas — sistema de diseño del panel EMPRESA (tipo 30)
   Mobile-first. Solo lo cargan las páginas empresa_* (vía includes/empresa_layout.php).
   Breakpoints: 600 (tablet vertical) · 1024 (tablet horizontal / notebook: sidebar de íconos)
                1280 (notebook / monitor: sidebar completo) · 1600 (monitor grande)
   ========================================================================== */

:root {
    /* Marca */
    --e-cyan: #43E9E8;
    --e-cyan-600: #1FCFCE;
    --e-cyan-50: #E7FCFC;
    --e-cyan-ink: #04696A;          /* "celeste" legible sobre blanco (6.6:1) */
    --e-navy-950: #070F26;
    --e-navy-900: #0B1736;
    --e-navy-800: #13234A;
    --e-navy-700: #1D3263;

    /* Neutros */
    --e-bg: #F3F6FB;
    --e-surface: #FFFFFF;
    --e-surface-2: #F8FAFD;
    --e-line: #E4E9F2;
    --e-line-2: #D3DAE6;
    --e-ink: #101828;
    --e-ink-2: #475467;
    --e-ink-3: #667085;            /* 4.97:1 sobre blanco, 4.59:1 sobre --e-bg (WCAG AA) */

    /* Semánticos */
    --e-orange: #F79009;  --e-orange-50: #FEF4E6;  --e-orange-ink: #B54708;
    --e-green: #12B76A;   --e-green-50: #ECFDF3;   --e-green-ink: #027A48;
    --e-amber: #F5A524;   --e-amber-50: #FFFAEB;   --e-amber-ink: #93370D;
    --e-red: #F04438;     --e-red-50: #FEF3F2;     --e-red-ink: #B42318;

    /* Forma */
    --e-r-sm: 10px;
    --e-r: 14px;
    --e-r-lg: 20px;
    --e-r-xl: 26px;
    --e-shadow-sm: 0 1px 2px rgba(11, 23, 54, .05), 0 1px 3px rgba(11, 23, 54, .04);
    --e-shadow: 0 4px 12px -2px rgba(11, 23, 54, .08), 0 2px 4px -2px rgba(11, 23, 54, .05);
    --e-shadow-lg: 0 24px 48px -16px rgba(11, 23, 54, .28);
    --e-ring: 0 0 0 4px rgba(67, 233, 232, .35);

    /* Movimiento */
    --e-ease: cubic-bezier(.16, 1, .3, 1);
    --e-fast: .15s;
    --e-med: .25s;

    /* Layout */
    --e-sidebar: 84px;
    --e-topbar: 60px;
    --e-tabbar: 68px;
    --e-font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body.emp {
    margin: 0;
    min-height: 100vh; min-height: 100dvh;
    font-family: var(--e-font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--e-ink);
    background: var(--e-bg);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    padding-bottom: calc(var(--e-tabbar) + env(safe-area-inset-bottom) + 12px);
}

.emp h1, .emp h2, .emp h3, .emp h4 {
    font-family: var(--e-font);
    color: var(--e-ink);
    letter-spacing: -.02em;
    margin: 0;
}

/* Neutraliza el azul de links de Bootstrap (`a`, `a:hover`) sin ganarle a las clases de
   componentes. Solo dentro de las zonas rediseñadas: el panel empresa (.emp), el QR público
   (.qr) y el contenido de las páginas de empresas del admin (.e-admin), para no tocar el
   sidebar viejo del admin. :where() no suma especificidad: gana por cargarse después. */
:where(.emp, .qr, .e-admin) a { color: inherit; text-decoration: none; }
:where(.emp, .qr, .e-admin) a:hover { color: inherit; }

/* Contenido de las páginas de empresas del admin (dentro del layout viejo del admin). */
.e-admin { font-family: var(--e-font); color: var(--e-ink); font-size: 15px; line-height: 1.5; padding: 4px 0 32px; }
.e-admin h1, .e-admin h2, .e-admin h3 { font-family: var(--e-font); color: var(--e-ink); letter-spacing: -.02em; margin: 0; }
.e-admin :focus-visible { outline: none; box-shadow: var(--e-ring); }
/* Card de empresa (admin): datos en dos columnas y cifras de actividad. */
.e-adm-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 0; }
.e-adm-datos dt { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--e-ink-3); }
.e-adm-datos dd { margin: 0; font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e-adm-cifras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; padding: 12px; border-radius: var(--e-r); background: var(--e-surface-2); border: 1px solid var(--e-line); }
.e-adm-cifras div { display: flex; flex-direction: column; align-items: center; text-align: center; }
.e-adm-cifras strong { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.e-adm-cifras span { font-size: .72rem; color: var(--e-ink-2); }
/* Gestión de créditos (admin) */
.e-cred-filtros { display: grid; gap: 0 14px; grid-template-columns: minmax(0, 1fr); align-items: end; }
@media (min-width: 768px) { .e-cred-filtros { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) 110px auto; } }
.e-cred-fila .e-btn { flex: 0 0 auto; }
@media (max-width: 599px) { .e-cred-fila { flex-wrap: wrap; } .e-cred-fila .e-btn { width: 100%; } }
.e-cred-carga { padding-top: 14px; border-top: 1px solid var(--e-line); }
.e-cred-rapidas { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.e-cred-rapidas .e-pill { border: 0; cursor: pointer; min-height: 32px; padding: 6px 14px; font-family: var(--e-font); }
.e-cred-rapidas .e-pill:hover { background: var(--e-cyan-50); color: var(--e-cyan-ink); }
.e-sheet.e-admin { padding: 0; }
/* Foco visible (teclado) en todo el panel; respeta el redondeado de cada componente. */
.emp :focus-visible { outline: none; box-shadow: var(--e-ring); }
.emp .tnum { font-variant-numeric: tabular-nums; }

.e-ico { width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.e-ico--sm { width: 16px; height: 16px; }
.e-ico--lg { width: 24px; height: 24px; }
.e-ico--xl { width: 32px; height: 32px; }

.emp-skip {
    position: absolute; left: 12px; top: -48px; z-index: 100;
    padding: 10px 14px; border-radius: var(--e-r-sm);
    background: var(--e-navy-900); color: #fff !important; font-weight: 600;
}
.emp-skip:focus { top: 12px; }

.emp-chip {
    display: inline-flex; align-items: center;
    padding: 3px 9px; border-radius: 999px;
    font-size: .64rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
    color: var(--e-navy-900); background: var(--e-cyan);
}

/* --------------------------------------------------------------------------
   Sidebar (≥1024)
   -------------------------------------------------------------------------- */
.emp-sidebar { display: none; }

@media (min-width: 1024px) {
    body.emp { padding-bottom: 0; }

    .emp-sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 40;
        width: var(--e-sidebar);
        display: flex; flex-direction: column; gap: 6px;
        padding: 18px 14px;
        color: #C9D3E8;
        background:
            radial-gradient(420px 260px at -20% -10%, rgba(67, 233, 232, .16), transparent 60%),
            linear-gradient(180deg, var(--e-navy-900), var(--e-navy-950));
        border-right: 1px solid rgba(255, 255, 255, .04);
    }

    .emp-sidebar__brand { display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; margin-bottom: 18px; }
    .emp-sidebar__logo, .emp-sidebar .emp-chip { display: none; }
    .emp-sidebar__mark { width: 52px; height: 52px; margin: -6px; }

    .emp-nav { display: flex; flex-direction: column; gap: 4px; }

    .emp-nav__link, .emp-sidebar__cta {
        position: relative;
        display: flex; align-items: center; justify-content: center; gap: 12px;
        height: 48px; padding: 0 14px; border-radius: var(--e-r);
        font-weight: 600; font-size: .92rem; color: #B7C2DB;
        transition: background var(--e-fast) ease, color var(--e-fast) ease;
    }
    .emp-nav__link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
    .emp-nav__link.is-active { background: rgba(67, 233, 232, .12); color: var(--e-cyan); }
    .emp-nav__link.is-active::before {
        content: ""; position: absolute; left: -14px; top: 12px; bottom: 12px; width: 3px;
        border-radius: 0 3px 3px 0; background: var(--e-cyan);
    }
    .emp-nav__label { display: none; white-space: nowrap; }

    .emp-sidebar__cta {
        margin-top: 14px;
        color: var(--e-navy-900); background: var(--e-cyan);
        box-shadow: 0 10px 24px -10px rgba(67, 233, 232, .65);
        transition: transform var(--e-fast) ease, background var(--e-fast) ease;
    }
    .emp-sidebar__cta:hover { background: #6BF0EF; color: var(--e-navy-900); transform: translateY(-1px); }

    .emp-sidebar__user {
        margin-top: auto;
        display: flex; align-items: center; justify-content: center; gap: 10px;
        padding: 10px; border-radius: var(--e-r);
        background: rgba(255, 255, 255, .04);
    }
    .emp-sidebar__who, .emp-sidebar__logout { display: none; }

    .emp-shell { margin-left: var(--e-sidebar); }
}

@media (min-width: 1280px) {
    :root { --e-sidebar: 264px; }

    .emp-sidebar { padding: 22px 18px; }
    .emp-sidebar__brand { justify-content: flex-start; padding: 0 8px; }
    .emp-sidebar__logo { display: block; height: 30px; width: auto; }
    .emp-sidebar .emp-chip { display: inline-flex; }
    .emp-sidebar__mark { display: none; }

    .emp-nav__link, .emp-sidebar__cta { justify-content: flex-start; }
    .emp-nav__link.is-active::before { left: -18px; }
    .emp-nav__label { display: inline; }

    .emp-sidebar__user { justify-content: flex-start; }
    .emp-sidebar__who { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
    .emp-sidebar__who strong { color: #fff; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .emp-sidebar__who small { color: #8C99B8; font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .emp-sidebar__logout {
        display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--e-r-sm);
        color: #8C99B8; transition: background var(--e-fast), color var(--e-fast);
    }
    .emp-sidebar__logout:hover { background: rgba(240, 68, 56, .14); color: #FF8A80; }
}

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */
.emp-topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px;
    height: calc(var(--e-topbar) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 16px 0;
    background: var(--e-navy-900);
    color: #fff;
}
.emp-topbar__brand { display: flex; align-items: center; gap: 8px; }
.emp-topbar__brand img { height: 24px; width: auto; }
.emp-topbar__hello { display: none; margin: 0; }

.emp-user { position: relative; margin-left: auto; }
.emp-user > summary { list-style: none; }
.emp-user > summary::-webkit-details-marker { display: none; }
.emp-user__btn { display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 999px; cursor: pointer; }
.emp-user__chev { width: 16px; height: 16px; color: #8C99B8; transition: transform var(--e-fast) ease; }
.emp-user[open] .emp-user__chev { transform: rotate(180deg); }
.emp-user__menu {
    position: absolute; right: 0; top: calc(100% + 8px);
    width: 260px; padding: 8px;
    background: var(--e-surface); color: var(--e-ink);
    border: 1px solid var(--e-line); border-radius: var(--e-r-lg);
    box-shadow: var(--e-shadow-lg);
    animation: e-pop var(--e-med) var(--e-ease) both;
    transform-origin: top right;
}
.emp-user__head { display: flex; flex-direction: column; padding: 10px 12px 12px; border-bottom: 1px solid var(--e-line); margin-bottom: 6px; line-height: 1.3; }
.emp-user__head small { color: var(--e-ink-3); overflow: hidden; text-overflow: ellipsis; }
.emp-user__menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--e-r-sm);
    font-weight: 600; font-size: .9rem; color: var(--e-ink-2);
}
.emp-user__menu a:hover { background: var(--e-surface-2); color: var(--e-ink); }
.emp-user__menu a.is-danger { color: var(--e-red-ink); }
.emp-user__menu a.is-danger:hover { background: var(--e-red-50); }

@media (min-width: 1024px) {
    .emp-topbar {
        height: 72px; padding: 0 32px;
        background: rgba(243, 246, 251, .82);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
        backdrop-filter: saturate(180%) blur(14px);
        color: var(--e-ink);
        transition: box-shadow var(--e-med) ease;
    }
    .emp-topbar.is-scrolled { box-shadow: 0 1px 0 var(--e-line); }
    .emp-topbar__brand { display: none; }
    .emp-topbar__hello { display: block; color: var(--e-ink-2); font-size: .92rem; }
    .emp-topbar__hello strong { color: var(--e-ink); }
    .emp-user__btn { background: var(--e-surface); border: 1px solid var(--e-line); padding: 4px 10px 4px 4px; }
}

/* --------------------------------------------------------------------------
   Contenido
   -------------------------------------------------------------------------- */
.emp-main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 18px 16px 24px; }

.emp-pagehead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.emp-pagehead__text { flex: 1 1 auto; min-width: 0; }
.emp-pagehead h1 { font-size: 1.6rem; font-weight: 800; line-height: 1.15; }
.emp-pagehead p { margin: 4px 0 0; color: var(--e-ink-2); font-size: .92rem; }
.emp-pagehead__actions { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
@media (max-width: 599px) { .emp-pagehead__actions > .e-btn { flex: 1 1 auto; padding: 0 12px; } }

@media (min-width: 600px) {
    .emp-main { padding: 24px 24px 32px; }
    .emp-pagehead__actions { width: auto; }
    .emp-pagehead h1 { font-size: 1.85rem; }
}
@media (min-width: 1024px) {
    .emp-main { padding: 8px 32px 48px; }
    .emp-pagehead { margin-bottom: 24px; }
    .emp-pagehead h1 { font-size: 2rem; }
}
@media (min-width: 1600px) {
    .emp-main { max-width: 1360px; }
}

/* Grilla de cards: 1 col en celular, se reacomoda sola según el ancho. */
.e-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.e-grid > * { min-width: 0; }
.e-grid--top { align-items: start; } /* cards de distinto alto: no estirarlas */

/* Resumen: la primera card (destacada) ocupa todo el ancho en celular/tablet y
   las demás van de a dos; en notebook/monitor quedan las tres en fila. */
.e-grid--resumen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.e-grid--resumen > :first-child { grid-column: 1 / -1; }
@media (min-width: 1024px) {
    .e-grid--resumen { grid-template-columns: 1.25fr 1fr 1fr; }
    .e-grid--resumen > :first-child { grid-column: auto; }
}
@media (max-width: 599px) {
    .e-grid--resumen .e-card { padding: 16px; }
    .e-grid--resumen .e-card__head { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* Visibilidad por dispositivo: lo que ya resuelve la barra inferior no se repite. */
@media (max-width: 1023px) { .e-only-desktop { display: none !important; } }
@media (min-width: 600px) {
    .e-grid { gap: 18px; }
    .e-grid--2, .e-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* 3 columnas si entran (tablet vertical ya entra), sin dejar una card huérfana. */
    .e-grid--3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
}
@media (min-width: 1024px) {
    .e-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.e-grid--auto { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }

.e-section { margin-top: 28px; }
.e-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.e-section__head h2 { font-size: 1.12rem; font-weight: 800; }
.e-section__head a { font-size: .86rem; font-weight: 700; color: var(--e-cyan-ink); }
.e-section__head a:hover { color: var(--e-cyan-ink); text-decoration: underline; }

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */
.e-card {
    position: relative;
    background: var(--e-surface);
    border: 1px solid var(--e-line);
    border-radius: var(--e-r-lg);
    box-shadow: var(--e-shadow-sm);
    padding: 18px;
}
@media (min-width: 600px) { .e-card { padding: 22px; } }

.e-card--link { display: block; cursor: pointer; transition: transform var(--e-med) var(--e-ease), box-shadow var(--e-med) var(--e-ease), border-color var(--e-med) ease; }
.e-card--link:hover { transform: translateY(-2px); box-shadow: var(--e-shadow); border-color: var(--e-line-2); }
.e-card--link:active { transform: translateY(0) scale(.995); }

.e-card--navy {
    color: #fff; border-color: transparent;
    background:
        radial-gradient(520px 240px at 110% -30%, rgba(67, 233, 232, .28), transparent 60%),
        linear-gradient(160deg, var(--e-navy-800), var(--e-navy-900));
    box-shadow: 0 18px 40px -20px rgba(11, 23, 54, .7);
}
.e-card--navy h2, .e-card--navy h3 { color: #fff; }
.e-card--navy .e-muted { color: #A9B6D3; }

.e-card--propia { border-color: #FAD7A0; box-shadow: 0 0 0 1px #FDEBCC inset, var(--e-shadow-sm); }
.e-card__title { font-size: 1.02rem; font-weight: 800; letter-spacing: -.01em; }
.e-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.e-card__foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* Card "agregar" (punteada, al final de una grilla). */
.e-card--add {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 104px; background: transparent; box-shadow: none;
    border: 2px dashed var(--e-line-2); color: var(--e-ink-2); font-weight: 700;
    transition: border-color var(--e-med) ease, color var(--e-med) ease, background var(--e-med) ease;
}
.e-card--add:hover { border-color: var(--e-navy-700); color: var(--e-navy-900); background: var(--e-surface); }

/* Card de obra: ícono · datos · "N hoy". */
.e-obra { display: flex; align-items: center; gap: 14px; }
.e-obra .e-item__title { margin-top: 6px; }
.e-obra__count { text-align: right; flex: 0 0 auto; }
.e-obra__count strong { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.e-obra__count small { color: var(--e-ink-3); font-size: .76rem; font-weight: 600; }
.e-obra__chev { color: var(--e-ink-3); transition: transform var(--e-med) var(--e-ease); }
.e-card--link:hover .e-obra__chev { transform: translateX(3px); color: var(--e-ink-2); }

.e-card__link { display: inline-flex; align-items: center; gap: 4px; margin-top: 14px; font-size: .86rem; font-weight: 700; color: var(--e-cyan-ink); }
.e-card__link:hover { color: var(--e-cyan-ink); text-decoration: underline; }
.e-card--navy .e-pill { color: #DCE4F5; background: rgba(255, 255, 255, .08); }
.e-card--navy .e-pill strong { color: #fff; }

.e-status__list { margin: 6px 0 0; padding-left: 18px; font-size: .86rem; }
.e-status__list li + li { margin-top: 2px; }

.e-card.is-off { opacity: .62; }
.emp [hidden] { display: none !important; }

/* Dos columnas: contenido principal + lateral (detalle de obra). En celular, una debajo de otra. */
.e-split { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.e-split > * { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1024px) { .e-split { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 24px; } }

.e-pillrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

/* Elección grande (Nueva obra: barrio o propia). */
.e-choice {
    display: flex; flex-direction: column; gap: 10px;
    padding: 22px; border-radius: var(--e-r-xl);
    border: 1.5px solid var(--e-line); background: var(--e-surface);
    transition: transform var(--e-med) var(--e-ease), box-shadow var(--e-med) var(--e-ease), border-color var(--e-med) ease;
}
.e-choice:hover { transform: translateY(-2px); box-shadow: var(--e-shadow); }
.e-choice h2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 1.15rem; font-weight: 800; }
.e-choice p { margin: 0; font-size: .9rem; color: var(--e-ink-2); }
.e-choice--barrio { color: #fff; border-color: transparent; background: radial-gradient(420px 200px at 110% -20%, rgba(67, 233, 232, .25), transparent 60%), linear-gradient(160deg, var(--e-navy-800), var(--e-navy-900)); }
.e-choice--barrio h2 { color: #fff; }
.e-choice--barrio p { color: #B7C2DB; }
.e-choice--barrio .e-iconbox { color: var(--e-cyan); background: rgba(67, 233, 232, .14); }
.e-choice--propia { border-color: #FAD7A0; background: linear-gradient(180deg, #FFFBF5, #fff); }
.e-choice--propia:hover { border-color: var(--e-orange); }
.e-choice.is-selected { box-shadow: 0 0 0 3px var(--e-cyan), var(--e-shadow); }

/* QR */
.e-qr { display: grid; place-items: center; padding: 14px; margin: 4px auto 14px; width: fit-content; background: #fff; border: 1px solid var(--e-line); border-radius: var(--e-r-lg); }
/* canvas incluido: qrcodejs lo dibuja a 600px (para la descarga) y en algunos navegadores no llega a cambiarlo por la img. */
.e-qr img, .e-qr canvas { display: block; width: 200px; height: auto; aspect-ratio: 1; max-width: 60vw; }
.e-copy { display: flex; gap: 8px; }
.e-copy .e-input { min-height: 44px; font-size: .82rem; color: var(--e-ink-2); background: var(--e-surface-2); }

/* Panel inferior (dialog nativo): sube desde abajo en celular, centrado en pantallas grandes. */
.e-sheet {
    width: 100%; max-width: 560px; max-height: 86vh; max-height: 86dvh;
    margin: auto auto 0; padding: 0; border: 0;
    border-radius: 24px 24px 0 0;
    background: var(--e-surface); color: var(--e-ink);
    box-shadow: var(--e-shadow-lg);
    font-family: var(--e-font);
}
.e-sheet[open] { display: flex; flex-direction: column; animation: e-sheet-up .38s var(--e-ease) both; }
.e-sheet::backdrop { background: rgba(7, 15, 38, .55); }
/* Blur solo en PC: en celular (Chrome) el backdrop-filter refleja la página detrás del panel. */
@media (min-width: 1024px) {
    .e-sheet::backdrop { -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
}
.e-sheet__view { display: flex; flex-direction: column; min-height: 0; } /* vistas dentro del mismo panel */
.e-sheet__head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px; }
.e-sheet__head h2 { flex: 1; font-size: 1.12rem; font-weight: 800; }
.e-sheet__search { padding: 0 20px 12px; border-bottom: 1px solid var(--e-line); }
.e-sheet__body { padding: 6px 16px calc(16px + env(safe-area-inset-bottom)); overflow-y: auto; }
@media (min-width: 600px) {
    .e-sheet { margin: auto; border-radius: 24px; max-height: 80vh; }
    .e-sheet[open] { animation: e-pop .25s var(--e-ease) both; }
}
/* Panel ancho (Marcar lista): en PC la lista va en dos columnas. */
@media (min-width: 900px) {
    .e-sheet--wide { max-width: 880px; }
    .e-sheet--wide .e-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
}
@keyframes e-sheet-up { from { transform: translateY(100%); } to { transform: none; } }

/* Menú de acciones por fila (<details>): botón "⋯" y opciones flotantes. */
.e-menu { position: relative; }
.e-menu > summary { list-style: none; cursor: pointer; }
.e-menu > summary::-webkit-details-marker { display: none; }
.e-menu__list {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
    min-width: 200px; padding: 6px;
    background: var(--e-surface); border: 1px solid var(--e-line); border-radius: var(--e-r);
    box-shadow: var(--e-shadow-lg);
    animation: e-pop var(--e-med) var(--e-ease) both; transform-origin: top right;
}
.e-menu__list form { margin: 0; }
.e-menu__item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 12px; border: 0; border-radius: var(--e-r-sm); background: none;
    font-family: var(--e-font); font-size: .9rem; font-weight: 600; color: var(--e-ink-2); text-align: left; cursor: pointer;
}
.e-menu__item:hover { background: var(--e-surface-2); color: var(--e-ink); }
.e-menu__item.is-danger { color: var(--e-red-ink); }
.e-menu__item.is-danger:hover { background: var(--e-red-50); }
.e-menu__item.is-ok { color: var(--e-green-ink); }
.e-menu__item.is-ok:hover { background: var(--e-green-50); }

/* Filtros tipo "segmented control". */
.e-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--e-r); background: #E8EDF5; overflow-x: auto; max-width: 100%; }
.e-tabs a, .e-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 10px; background: none; font-family: var(--e-font); font-size: .86rem; font-weight: 700; color: var(--e-ink-2); white-space: nowrap; cursor: pointer; transition: background var(--e-fast), color var(--e-fast); }
.e-tabs a:hover, .e-tabs button:hover { color: var(--e-ink); }
.e-tabs a.is-active, .e-tabs button.is-active { background: var(--e-surface); color: var(--e-ink); box-shadow: var(--e-shadow-sm); }
.e-tabs .e-count { font-size: .72rem; padding: 1px 7px; border-radius: 999px; background: rgba(16, 24, 40, .08); }
.e-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.e-toolbar .e-search { flex: 1 1 260px; max-width: 420px; }

/* Zona para soltar archivos (input file grande). */
.e-drop {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 30px 20px; text-align: center; cursor: pointer;
    border: 2px dashed var(--e-line-2); border-radius: var(--e-r-lg); background: var(--e-surface-2);
    transition: border-color var(--e-fast), background var(--e-fast);
}
.e-drop:hover, .e-drop.is-over { border-color: var(--e-cyan-600); background: var(--e-cyan-50); }
.e-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.e-drop strong { font-size: .98rem; }
.e-drop .e-hint { font-size: .82rem; }
.e-drop.has-file { border-style: solid; border-color: var(--e-green); background: var(--e-green-50); }

/* Filtros: panel inferior en celular/tablet; en notebook el mismo <dialog> se muestra fijo arriba de la lista. */
.e-filters__grid { display: grid; gap: 0 12px; grid-template-columns: minmax(0, 1fr); }
.e-filters__actions { display: flex; gap: 8px; }
.e-filters__actions .e-btn { flex: 1; }
@media (min-width: 600px) { .e-filters__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
    dialog.e-filters, dialog.e-filters[open] {
        position: static; display: block; width: auto; max-width: none; max-height: none; margin: 0 0 18px;
        border-radius: var(--e-r-lg); border: 1px solid var(--e-line); box-shadow: var(--e-shadow-sm); animation: none;
    }
    .e-filters .e-sheet__head { display: none; }
    .e-filters .e-sheet__body { padding: 18px 20px 4px; overflow: visible; }
    .e-filters__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr 1.4fr; align-items: end; }
    .e-filters__actions { padding-bottom: 16px; }
    .e-filters__actions .e-btn { flex: 0 0 auto; }
    .e-only-mobile { display: none !important; }
}
.e-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

/* Lista agrupada por día. */
.e-day + .e-day { margin-top: 18px; }
.e-day__head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 8px; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--e-ink-3); }
.e-times { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: .86rem; font-variant-numeric: tabular-nums; color: var(--e-ink); }
.e-times .e-ico { width: 14px; height: 14px; color: var(--e-ink-3); }
.e-times__live { color: var(--e-green-ink); }

.e-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
.e-pager span { font-size: .86rem; font-weight: 600; color: var(--e-ink-2); }

/* DNI con máscara 00.000.000: el input real es transparente encima y los números
   entran por la derecha empujando a los anteriores (lo dibuja empresa.js, data-dni). */
.e-dni {
    position: relative; height: 76px; cursor: text;
    background: var(--e-surface); border: 1.5px solid var(--e-line-2); border-radius: var(--e-r-lg);
    transition: border-color var(--e-fast) ease, box-shadow var(--e-fast) ease;
}
.e-dni:focus-within { border-color: var(--e-cyan-600); box-shadow: var(--e-ring); }
.e-dni__input:focus, .e-dni__input:focus-visible { outline: none; box-shadow: none; } /* el anillo lo pone el contenedor (también en el QR público, sin .emp) */
.e-dni__input {
    position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%;
    padding: 0; border: 0; background: transparent;
    color: transparent; caret-color: transparent; font-size: 16px; /* 16px: iOS no hace zoom al enfocar */
}
.e-dni__input::selection { background: transparent; }
.e-dni__mask {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 2.1rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--e-ink);
    pointer-events: none; overflow: hidden;
}
.e-dni__d { display: inline-block; width: .68em; text-align: center; }
.e-dni__d.is-pad { color: #CDD4E0; }
.e-dni__sep { width: .3em; text-align: center; color: var(--e-ink-3); }
.e-dni__d.is-shift { animation: e-dni-shift .2s var(--e-ease) both; }
.e-dni__d.is-new { animation: e-dni-in .24s var(--e-ease) both; color: var(--e-cyan-ink); }
.e-dni.is-full { border-color: var(--e-green); }
.e-dni.is-error:not(:focus-within) { border-color: var(--e-red); box-shadow: 0 0 0 4px rgba(240, 68, 56, .12); }
/* Cursor parpadeante a la derecha mientras el campo está activo. */
.e-dni:focus-within .e-dni__mask::after {
    content: ""; width: 2px; height: 1.1em; margin-left: 4px; border-radius: 2px;
    background: var(--e-cyan-600); animation: e-blink 1s steps(1) infinite;
}
@keyframes e-dni-shift { from { transform: translateX(.68em); } to { transform: none; } }
@keyframes e-dni-in { from { transform: translateX(.68em); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes e-blink { 50% { opacity: 0; } }
@media (max-width: 380px) { .e-dni__mask { font-size: 1.8rem; } }

/* max-w/max-h: en celular el QR no tapa el panel (canvas incluido, por si qrcodejs no llega a pasarlo a img). */
.e-qr--lg img, .e-qr--lg canvas { width: 260px; height: auto; aspect-ratio: 1; max-width: 60vw; max-height: 40dvh; object-fit: contain; }

/* Resultado de la marcación: aparece con un pequeño "pop". */
.e-marca-res { margin-bottom: 16px; animation: e-pop .35s var(--e-ease) both; }
.e-marca-res .e-iconbox { width: 52px; height: 52px; }
.e-marca-res .e-status__title { font-size: 1.12rem; }

/* Área tocable mínima (WCAG 2.2: 24px; apuntamos a 32px) en links de texto sueltos. */
.e-section__head a, .e-card__link { display: inline-flex; align-items: center; min-height: 32px; }
a.e-pill { min-height: 30px; }

/* Reporte semanal: misma marca en lista (filas dentro de una card) o en cards. */
.e-weeknav { display: inline-flex; align-items: center; gap: 8px; }
.e-weeknav span { min-width: 120px; text-align: center; font-weight: 700; font-size: .92rem; }
.e-rep {
    display: flex; flex-direction: column; padding: 4px 18px;
    background: var(--e-surface); border: 1px solid var(--e-line); border-radius: var(--e-r-lg); box-shadow: var(--e-shadow-sm);
}
.e-rep__item {
    display: grid; align-items: center; gap: 6px 16px; padding: 14px 0;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "head stats actions" "bar bar bar";
    border-bottom: 1px solid var(--e-line);
}
.e-rep__item:last-child { border-bottom: 0; }
.e-rep__head { grid-area: head; display: flex; align-items: center; gap: 12px; min-width: 0; }
.e-rep__stats { grid-area: stats; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.e-rep__stats strong { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.e-rep__actions { grid-area: actions; }
.e-rep__bar { grid-area: bar; display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: #EEF1F6; }
.e-rep__bar span { display: block; height: 100%; }
.e-rep__item.is-cero .e-rep__stats strong { color: var(--e-ink-3); }
@media (max-width: 599px) {
    .e-rep__item { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head stats" "bar bar" "actions actions"; }
    .e-rep__actions .e-btn { width: 100%; }
}
.e-rep--cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 14px;
    padding: 0; background: none; border: 0; box-shadow: none;
}
.e-rep--cards .e-rep__item {
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "stats" "bar" "actions";
    gap: 12px; padding: 18px;
    background: var(--e-surface); border: 1px solid var(--e-line); border-radius: var(--e-r-lg); box-shadow: var(--e-shadow-sm);
}
.e-rep--cards .e-rep__stats { align-items: flex-start; text-align: left; }
.e-rep--cards .e-rep__stats strong { font-size: 1.7rem; }
.e-rep--cards .e-rep__actions .e-btn { width: 100%; }
.e-rep__subtitle { font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--e-ink-3); margin: 0 0 4px; }
.e-rep__meter { flex-basis: 100%; height: 6px; border-radius: 999px; overflow: hidden; background: #EEF1F6; }
.e-rep__meter span { display: block; height: 100%; border-radius: 999px; }

.e-muted { color: var(--e-ink-2); }
.e-small { font-size: .84rem; }

/* Ícono en caja (usado en cards de obra, stats, estados). */
.e-iconbox {
    display: grid; place-items: center; flex: 0 0 auto;
    width: 44px; height: 44px; border-radius: 13px;
    color: var(--e-cyan-ink); background: var(--e-cyan-50);
}
.e-iconbox--navy { color: var(--e-cyan); background: rgba(67, 233, 232, .14); }
.e-iconbox--propia { color: var(--e-orange-ink); background: var(--e-orange-50); }
.e-iconbox--ok { color: var(--e-green-ink); background: var(--e-green-50); }
.e-iconbox--warn { color: var(--e-amber-ink); background: var(--e-amber-50); }
.e-iconbox--danger { color: var(--e-red-ink); background: var(--e-red-50); }

/* --------------------------------------------------------------------------
   Stat
   -------------------------------------------------------------------------- */
.e-stat { display: flex; flex-direction: column; gap: 2px; }
.e-stat__label { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--e-ink-3); }
.e-stat__value { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.e-stat__hint { font-size: .84rem; color: var(--e-ink-2); }
.e-card--navy .e-stat__label { color: var(--e-cyan); }
.e-card--navy .e-stat__hint { color: #A9B6D3; }
@media (min-width: 1024px) { .e-stat__value { font-size: 2.4rem; } }

/* --------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */
.e-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 0 18px;
    font-family: var(--e-font); font-size: .94rem; font-weight: 700; line-height: 1;
    border: 1.5px solid transparent; border-radius: var(--e-r);
    cursor: pointer; user-select: none; white-space: nowrap;
    transition: transform var(--e-fast) ease, background var(--e-fast) ease, box-shadow var(--e-fast) ease, color var(--e-fast) ease, border-color var(--e-fast) ease;
}
.e-btn:active { transform: translateY(1px) scale(.99); }
.e-btn:disabled, .e-btn.is-disabled { opacity: .5; pointer-events: none; }

.e-btn--primary { color: #fff; background: var(--e-navy-900); box-shadow: 0 10px 22px -12px rgba(11, 23, 54, .8); }
.e-btn--primary:hover { color: #fff; background: var(--e-navy-700); }
.e-btn--accent { color: var(--e-navy-900); background: var(--e-cyan); box-shadow: 0 10px 22px -12px rgba(31, 207, 206, .9); }
.e-btn--accent:hover { color: var(--e-navy-900); background: #6BF0EF; }
.e-btn--outline { color: var(--e-navy-900); background: var(--e-surface); border-color: var(--e-line-2); }
.e-btn--outline:hover { color: var(--e-navy-900); border-color: var(--e-navy-700); background: var(--e-surface-2); }
.e-btn--ghost { color: var(--e-ink-2); background: transparent; }
.e-btn--ghost:hover { color: var(--e-ink); background: rgba(16, 24, 40, .05); }
.e-btn--danger { color: var(--e-red-ink); background: var(--e-red-50); }
.e-btn--danger:hover { color: #fff; background: var(--e-red); }

.e-btn--lg { min-height: 56px; padding: 0 24px; font-size: 1rem; border-radius: var(--e-r-lg); }
.e-btn--sm { min-height: 36px; padding: 0 12px; font-size: .84rem; border-radius: var(--e-r-sm); }
.e-btn--block { width: 100%; }
.e-btn--icon { width: 44px; min-height: 44px; padding: 0; }

/* --------------------------------------------------------------------------
   Pills / badges
   -------------------------------------------------------------------------- */
.e-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    font-size: .74rem; font-weight: 700; line-height: 1.3; white-space: nowrap;
    color: var(--e-ink-2); background: #EEF1F6;
}
.e-pill .e-ico { width: 14px; height: 14px; }
.e-pill--barrio { color: #035E5E; background: var(--e-cyan-50); box-shadow: inset 0 0 0 1px #B8F4F3; }
.e-pill--propia { color: var(--e-orange-ink); background: var(--e-orange-50); box-shadow: inset 0 0 0 1px #FCD9A6; }
.e-pill--ok { color: var(--e-green-ink); background: var(--e-green-50); }
.e-pill--warn { color: var(--e-amber-ink); background: var(--e-amber-50); }
.e-pill--danger { color: var(--e-red-ink); background: var(--e-red-50); }
.e-pill--navy { color: #fff; background: var(--e-navy-900); }

.e-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.e-dot--live { position: relative; }
.e-dot--live::after {
    content: ""; position: absolute; inset: -4px; border-radius: 50%;
    border: 2px solid currentColor; opacity: 0;
    animation: e-ping 1.8s var(--e-ease) infinite;
}

/* --------------------------------------------------------------------------
   Avatar
   -------------------------------------------------------------------------- */
.e-avatar {
    display: inline-grid; place-items: center; flex: 0 0 auto;
    width: 40px; height: 40px; border-radius: 50%;
    font-size: .8rem; font-weight: 800; letter-spacing: .02em;
    color: var(--e-navy-800); background: #E6EBF5;
}
.e-avatar--cyan { color: var(--e-navy-900); background: var(--e-cyan); }
.e-avatar--sm { width: 32px; height: 32px; font-size: .7rem; }
.e-avatar--lg { width: 52px; height: 52px; font-size: 1rem; }

/* --------------------------------------------------------------------------
   Lista (personas, entradas, obras compactas)
   -------------------------------------------------------------------------- */
.e-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.e-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--e-line);
}
.e-list > .e-item:last-child { border-bottom: 0; }
.e-item__body { flex: 1 1 auto; min-width: 0; }
.e-item__title { display: block; font-weight: 700; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e-item__meta { display: block; font-size: .82rem; color: var(--e-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e-item__end { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
/* Meta en hasta 2 líneas (listas donde el detalle importa, como Tu gente). */
.e-item__meta--2l { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.e-item__dni { margin-left: 4px; font-size: .78rem; font-weight: 600; color: var(--e-ink-3); font-variant-numeric: tabular-nums; }
@media (max-width: 599px) { .e-item__dni { display: block; margin-left: 0; } } /* en celular, debajo del nombre */
@media (max-width: 599px) { .e-hide-mobile { display: none !important; } }
a.e-item { border-radius: var(--e-r); transition: background var(--e-fast) ease; }
a.e-item:hover { background: var(--e-surface-2); }

/* --------------------------------------------------------------------------
   Estado del día (semáforo) y alertas
   -------------------------------------------------------------------------- */
.e-status {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px; border-radius: var(--e-r-lg);
    border: 1px solid transparent;
}
.e-status__title { font-weight: 800; font-size: 1rem; line-height: 1.3; }
.e-status__text { font-size: .86rem; margin-top: 2px; }
.e-status--ok { background: var(--e-green-50); border-color: #ABEFC6; color: var(--e-green-ink); }
.e-status--warn { background: var(--e-amber-50); border-color: #FEDF89; color: var(--e-amber-ink); }
.e-status--danger { background: var(--e-red-50); border-color: #FECDCA; color: var(--e-red-ink); }
.e-status .e-iconbox { background: #fff; color: inherit; border-radius: 50%; }

.e-alert {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px; margin-bottom: 16px;
    border-radius: var(--e-r); border: 1px solid;
    font-size: .9rem; line-height: 1.45;
    animation: e-fade var(--e-med) ease both;
}
.e-alert .e-ico { margin-top: 1px; }
.e-alert--info { color: #1D3A8A; background: #EFF4FF; border-color: #D1E0FF; }
.e-alert--ok { color: var(--e-green-ink); background: var(--e-green-50); border-color: #ABEFC6; }
.e-alert--warn { color: var(--e-amber-ink); background: var(--e-amber-50); border-color: #FEDF89; }
.e-alert--danger { color: var(--e-red-ink); background: var(--e-red-50); border-color: #FECDCA; }

/* --------------------------------------------------------------------------
   Estado vacío
   -------------------------------------------------------------------------- */
.e-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 36px 20px; }
.e-empty .e-iconbox { width: 64px; height: 64px; border-radius: 20px; }
.e-empty .e-iconbox .e-ico { width: 28px; height: 28px; }
.e-empty h3 { font-size: 1.05rem; font-weight: 800; }
.e-empty p { margin: 0; max-width: 360px; color: var(--e-ink-2); font-size: .9rem; }

/* --------------------------------------------------------------------------
   Formularios
   -------------------------------------------------------------------------- */
.e-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.e-label { font-size: .84rem; font-weight: 700; color: var(--e-ink); }
.e-hint { font-size: .78rem; color: var(--e-ink-3); }

.e-input, .e-select, .emp .form-control, .emp .form-select {
    width: 100%; min-height: 48px; padding: 0 14px;
    font-family: var(--e-font); font-size: 1rem; color: var(--e-ink);
    background: var(--e-surface); border: 1.5px solid var(--e-line-2); border-radius: var(--e-r);
    transition: border-color var(--e-fast) ease, box-shadow var(--e-fast) ease;
}
.e-input::placeholder { color: var(--e-ink-3); }
.e-input:focus, .e-select:focus, .emp .form-control:focus, .emp .form-select:focus {
    outline: none; border-color: var(--e-cyan-600); box-shadow: var(--e-ring);
}
.e-select {
    appearance: none; padding-right: 40px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475467' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.e-input--lg { min-height: 64px; font-size: 1.5rem; font-weight: 700; text-align: center; letter-spacing: .18em; font-variant-numeric: tabular-nums; }

/* Buscador con ícono */
.e-search { position: relative; }
.e-search .e-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--e-ink-3); pointer-events: none; }
.e-search .e-input { padding-left: 44px; }

/* Opción grande seleccionable (radio/checkbox como card) */
.e-option { position: relative; display: block; cursor: pointer; }
.e-option + .e-option { margin-top: 8px; }
.e-option--check .e-option__check { border-radius: 7px; } /* checkbox: cuadrado */
.e-option > input { position: absolute; opacity: 0; pointer-events: none; }
.e-option__box {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-radius: var(--e-r);
    background: var(--e-surface); border: 1.5px solid var(--e-line-2);
    transition: border-color var(--e-fast) ease, box-shadow var(--e-fast) ease, background var(--e-fast) ease;
}
.e-option__check {
    display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid var(--e-line-2); flex: 0 0 auto; transition: all var(--e-fast) ease;
}
.e-option > input:checked + .e-option__box { border-color: var(--e-navy-900); box-shadow: 0 0 0 1px var(--e-navy-900) inset; background: var(--e-surface-2); }
.e-option > input:checked + .e-option__box .e-option__check { border-color: var(--e-navy-900); background: var(--e-navy-900); box-shadow: inset 0 0 0 4px #fff; }
.e-option > input:focus-visible + .e-option__box { box-shadow: var(--e-ring); }

/* --------------------------------------------------------------------------
   Barra inferior (celular / tablet) con botón central "Marcar"
   -------------------------------------------------------------------------- */
.emp-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    height: calc(var(--e-tabbar) + env(safe-area-inset-bottom));
    padding: 0 6px env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--e-line);
    box-shadow: 0 -8px 24px -16px rgba(11, 23, 54, .25);
}
.emp-tabbar__item, .emp-tabbar__fab {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px;
    height: var(--e-tabbar); padding-bottom: 10px;
    color: var(--e-ink-3); font-size: .7rem; font-weight: 700;
}
.emp-tabbar__ico {
    display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px;
    transition: background var(--e-med) var(--e-ease), color var(--e-med) var(--e-ease);
}
.emp-tabbar__item:hover { color: var(--e-ink-2); }
.emp-tabbar__item.is-active { color: var(--e-navy-900); }
.emp-tabbar__item.is-active .emp-tabbar__ico { background: var(--e-cyan); color: var(--e-navy-900); }
.emp-tabbar__item:active .emp-tabbar__ico { transform: scale(.92); }

.emp-tabbar__fab { position: relative; color: var(--e-navy-900); }
.emp-tabbar__fab-btn {
    display: grid; place-items: center;
    width: 58px; height: 58px; margin-top: -26px; margin-bottom: 2px;
    border-radius: 20px;
    color: var(--e-cyan);
    background: linear-gradient(160deg, var(--e-navy-700), var(--e-navy-900));
    box-shadow: 0 12px 24px -8px rgba(11, 23, 54, .55), 0 0 0 5px var(--e-bg);
    transition: transform var(--e-med) var(--e-ease), box-shadow var(--e-med) ease;
}
.emp-tabbar__fab-btn .e-ico { width: 26px; height: 26px; }
.emp-tabbar__fab:active .emp-tabbar__fab-btn { transform: scale(.94); }
.emp-tabbar__fab.is-active .emp-tabbar__fab-btn { color: var(--e-navy-900); background: var(--e-cyan); }

@media (min-width: 600px) {
    .emp-tabbar { left: 50%; right: auto; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); bottom: 14px; height: var(--e-tabbar); padding: 0 8px; border: 1px solid var(--e-line); border-radius: 24px; box-shadow: var(--e-shadow-lg); }
    body.emp { padding-bottom: calc(var(--e-tabbar) + 36px); }
}
@media (min-width: 1024px) { .emp-tabbar { display: none; } }

/* --------------------------------------------------------------------------
   Botón flotante de WhatsApp: encima de la barra inferior en celular/tablet,
   abajo a la derecha en notebook/monitor.
   -------------------------------------------------------------------------- */
.e-wa {
    position: fixed; z-index: 45; right: 16px;
    bottom: calc(var(--e-tabbar) + env(safe-area-inset-bottom) + 14px);
    display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
    background: #25D366;
    box-shadow: 0 10px 24px -8px rgba(37, 211, 102, .65), 0 2px 6px rgba(11, 23, 54, .18);
    transition: transform var(--e-med) var(--e-ease), box-shadow var(--e-med) ease;
}
.e-wa img { width: 30px; height: 30px; }
.e-wa:hover { transform: translateY(-2px) scale(1.05); }
.e-wa:active { transform: scale(.95); }
@media (min-width: 600px) { .e-wa { right: 24px; bottom: calc(var(--e-tabbar) + 32px); } } /* sobre la barra flotante */
@media (min-width: 1024px) { .e-wa { bottom: 24px; width: 58px; height: 58px; } }

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */
.e-toasts {
    position: fixed; z-index: 80; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 12px);
    display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
@media (min-width: 600px) { .e-toasts { left: auto; right: 24px; top: 24px; width: 380px; } }
.e-toast {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px; border-radius: var(--e-r);
    color: #fff; background: var(--e-navy-900);
    box-shadow: var(--e-shadow-lg);
    font-size: .9rem; font-weight: 600; line-height: 1.4;
    pointer-events: auto;
    animation: e-toast-in .35s var(--e-ease) both;
}
.e-toast.is-leaving { animation: e-toast-out .25s ease both; }
.e-toast--ok .e-ico { color: #4ADE9B; }
.e-toast--warn .e-ico { color: var(--e-amber); }
.e-toast--danger .e-ico { color: #FF8A80; }
.e-toast--info .e-ico { color: var(--e-cyan); }

/* --------------------------------------------------------------------------
   Skeleton
   -------------------------------------------------------------------------- */
.e-skel {
    display: block; border-radius: var(--e-r-sm);
    background: linear-gradient(90deg, #E9EDF4 0%, #F4F6FA 40%, #E9EDF4 80%);
    background-size: 200% 100%;
    animation: e-shimmer 1.3s linear infinite;
}

/* --------------------------------------------------------------------------
   Animaciones
   -------------------------------------------------------------------------- */
.e-rise { animation: e-rise .5s var(--e-ease) both; animation-delay: calc(var(--i, 0) * 55ms); }

@keyframes e-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes e-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes e-pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes e-ping { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes e-shimmer { to { background-position: -200% 0; } }
@keyframes e-toast-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes e-toast-out { to { opacity: 0; transform: translateY(-6px) scale(.98); } }

@media (prefers-reduced-motion: reduce) {
    .emp *, .emp *::before, .emp *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0ms !important;
        transition-duration: .01ms !important;
    }
}

/* Comprar créditos: tarjeta de tipo de crédito (nombre + precio arriba, cobertura con formato abajo). */
.e-tipocred .e-option__box {
    display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px;
}
.e-tipocred .e-option__box:not(:has(.e-tipocred__logo)) { grid-template-columns: auto minmax(0, 1fr) auto; }
.e-tipocred__logo { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; }
.e-tipocred__nombre { font-size: 1rem; line-height: 1.25; }
.e-tipocred__precio { display: flex; flex-direction: column; align-items: flex-end; text-align: right; line-height: 1.2; }
.e-tipocred__cobertura {
    grid-column: 1 / -1; margin-top: 10px; padding: 10px 12px; border-radius: var(--e-r-sm);
    background: var(--e-bg); color: var(--e-ink-2); font-size: .84rem; line-height: 1.5;
}
.e-tipocred__cobertura strong, .e-tipocred__cobertura b { color: var(--e-ink); }
.e-tipocred__cobertura p { margin: 0 0 6px; }
.e-tipocred__cobertura p:last-child { margin-bottom: 0; }
.e-tipocred__cobertura ul, .e-tipocred__cobertura ol { margin: 4px 0; padding-left: 18px; }
.e-option > input:checked + .e-option__box .e-tipocred__cobertura { background: var(--e-surface); }
/* Créditos del organizador: "¿para quién comprás?". En celular una fila por rol (ícono · texto · saldo);
   desde 720px, tres tarjetas (ícono y saldo arriba, nombre y leyenda abajo). La elegida queda en navy. */
.e-rolpick { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.e-rolcard { position: relative; display: block; cursor: pointer; }
.e-rolcard > input { position: absolute; opacity: 0; pointer-events: none; }
.e-rolcard__box {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ico txt saldo";
    align-items: center; gap: 4px 14px; height: 100%; padding: 14px 16px;
    border-radius: var(--e-r-lg); border: 1.5px solid var(--e-line-2); background: var(--e-surface);
    transition: border-color var(--e-fast) ease, box-shadow var(--e-fast) ease, background var(--e-fast) ease;
}
.e-rolcard:hover .e-rolcard__box { border-color: var(--e-navy-900); }
.e-rolcard__box .e-iconbox { grid-area: ico; transition: background var(--e-fast) ease, color var(--e-fast) ease; }
.e-rolcard__txt { grid-area: txt; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.e-rolcard__nombre { font-weight: 800; font-size: 1rem; line-height: 1.25; color: var(--e-ink); }
.e-rolcard__leyenda { font-size: .82rem; line-height: 1.4; color: var(--e-ink-2); }
.e-rolcard__saldo { grid-area: saldo; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.e-rolcard__saldo strong { font-size: 1.35rem; font-weight: 800; color: var(--e-ink); }
.e-rolcard__saldo small { font-size: .74rem; color: var(--e-ink-2); }
.e-rolcard > input:checked + .e-rolcard__box { border-color: var(--e-navy-900); background: var(--e-surface-2); box-shadow: 0 0 0 1px var(--e-navy-900) inset; }
.e-rolcard > input:checked + .e-rolcard__box .e-iconbox { color: #fff; background: var(--e-navy-900); }
.e-rolcard > input:focus-visible + .e-rolcard__box { box-shadow: var(--e-ring); }
@media (min-width: 720px) {
    .e-rolpick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .e-rolcard__box { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ico saldo" "txt txt"; align-items: start; gap: 12px; padding: 16px; }
    .e-rolcard__txt { gap: 4px; }
}

/* Destino del autoscroll: que no quede tapado por la barra de arriba. */
.e-scrollmt { scroll-margin-top: 84px; }

/* Sin zoom (doble toque); en celular los campos van a 16px para que iOS no haga zoom al enfocar. */
html { touch-action: manipulation; }
@media (max-width: 1023px) {
    body.emp input, body.emp select, body.emp textarea,
    body.adm input, body.adm select, body.adm textarea { font-size: 16px; }
}
/* Teclado abierto (clase puesta por empresa.js): la barra inferior fija no sube sobre el teclado. */
html.kb-open .emp-tabbar { display: none; }
html.kb-open body.emp { padding-bottom: 12px; }

/* --------------------------------------------------------------------------
   Buscador de lista larga (.e-combo + data-combo en empresa.js)
   -------------------------------------------------------------------------- */
.e-combo { position: relative; }
.e-combo__list {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
    margin: 0; padding: 6px; list-style: none; max-height: 260px; overflow-y: auto;
    background: var(--e-surface); border: 1px solid var(--e-line); border-radius: var(--e-r); box-shadow: var(--e-shadow-lg);
}
.e-combo__list[hidden] { display: none; }
.e-combo__list li { padding: 10px 12px; border-radius: var(--e-r-sm); font-size: .92rem; line-height: 1.35; color: var(--e-ink); cursor: pointer; }
.e-combo__list li[hidden] { display: none; }
.e-combo__list li:hover, .e-combo__list li.is-active { background: var(--e-cyan-50); color: var(--e-navy-900); }
.e-combo__list li.e-combo__vacio { color: var(--e-ink-3); cursor: default; background: none; }

/* Actividad: categorías + buscador en "Otros" (js/empresa.js, [data-actividad]; helper emp_actividad_field()) */
.e-actividad { display: flex; flex-direction: column; gap: 10px; }
.e-actividad .e-combo[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Rol ORGANIZADOR (prefijo e-org-). Pantalla pública del QR del evento.
   Misma estructura que la pública de Empresa (marcar_ingreso_empresa.php).
   -------------------------------------------------------------------------- */
body.e-org-pub {
    margin: 0; min-height: 100vh; min-height: 100dvh;
    font-family: var(--e-font); color: var(--e-ink); background: var(--e-bg);
    -webkit-font-smoothing: antialiased;
}
body.e-org-pub *, body.e-org-pub *::before, body.e-org-pub *::after { box-sizing: border-box; }
.e-org-pub__shell { width: 100%; max-width: 480px; margin: 0 auto; }
.e-org-pub__hero {
    position: relative; overflow: hidden;
    padding: calc(env(safe-area-inset-top) + 22px) 22px 64px; color: #fff;
    background:
        radial-gradient(520px 260px at 115% -20%, rgba(67, 233, 232, .32), transparent 60%),
        radial-gradient(380px 220px at -20% 120%, rgba(67, 233, 232, .12), transparent 60%),
        linear-gradient(160deg, var(--e-navy-800), var(--e-navy-950));
}
.e-org-pub__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 26px; }
.e-org-pub__top img { height: 26px; width: auto; }
.e-org-pub__eyebrow { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--e-cyan); }
.e-org-pub__eyebrow .e-ico { width: 16px; height: 16px; }
.e-org-pub__title { margin: 0; font-size: 1.75rem; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; color: #fff; overflow-wrap: anywhere; }
.e-org-pub__sub { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: .9rem; color: #B7C2DB; }
.e-org-pub__sub .e-ico { width: 16px; height: 16px; flex: 0 0 auto; }
.e-org-pub__when {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 20px; padding: 12px 16px;
    border-radius: var(--e-r); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
}
.e-org-pub__when strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.e-org-pub__when span { font-size: .86rem; color: #B7C2DB; }
.e-org-pub__card {
    position: relative; margin: -40px 14px 0; padding: 22px 20px 20px;
    background: var(--e-surface); border-radius: var(--e-r-xl);
    box-shadow: 0 24px 50px -24px rgba(11, 23, 54, .45), 0 1px 2px rgba(11, 23, 54, .06);
    animation: e-rise .5s var(--e-ease) both;
}
.e-org-pub__label { display: block; margin-bottom: 10px; font-size: .9rem; font-weight: 800; }
.e-org-pub__hint { margin: 10px 0 0; text-align: center; font-size: .8rem; color: var(--e-ink-3); }
.e-org-pub__res { text-align: center; padding: 6px 4px 18px; animation: e-pop .4s var(--e-ease) both; }
.e-org-pub__icon { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%; }
.e-org-pub__icon .e-ico { width: 38px; height: 38px; }
.e-org-pub__res--ok .e-org-pub__icon { color: var(--e-green-ink); background: var(--e-green-50); box-shadow: 0 0 0 8px rgba(18, 183, 106, .1); }
.e-org-pub__res--warn .e-org-pub__icon { color: var(--e-amber-ink); background: var(--e-amber-50); box-shadow: 0 0 0 8px rgba(245, 165, 36, .12); }
.e-org-pub__res--danger .e-org-pub__icon { color: var(--e-red-ink); background: var(--e-red-50); box-shadow: 0 0 0 8px rgba(240, 68, 56, .1); }
.e-org-pub__res--info .e-org-pub__icon { color: #1D3A8A; background: #EFF4FF; }
.e-org-pub__res h2 { margin: 0; font-size: 1.3rem; font-weight: 800; }
.e-org-pub__res p { margin: 6px 0 0; font-size: .95rem; line-height: 1.45; color: var(--e-ink-2); }
.e-org-pub__who { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; padding: 14px; border-radius: var(--e-r); background: var(--e-surface-2); border: 1px solid var(--e-line); }
.e-org-pub__who strong { display: block; font-size: 1.1rem; line-height: 1.25; overflow-wrap: anywhere; }
.e-org-pub__who span { font-size: .86rem; color: var(--e-ink-2); }
.e-org-pub__feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 20px 0 0; padding: 16px 0 0; list-style: none; border-top: 1px solid var(--e-line); }
.e-org-pub__feats li { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: .74rem; font-weight: 700; line-height: 1.25; color: var(--e-ink-2); }
.e-org-pub__feats .e-iconbox { width: 36px; height: 36px; border-radius: 11px; }
.e-org-pub__feats .e-ico { width: 18px; height: 18px; }
.e-org-pub__foot { padding: 18px 20px calc(env(safe-area-inset-bottom) + 22px); text-align: center; font-size: .78rem; color: var(--e-ink-3); }
.e-org-pub__foot strong { color: var(--e-ink-2); }
@media (min-width: 600px) {
    body.e-org-pub { display: flex; align-items: center; padding: 32px 0; background: radial-gradient(900px 480px at 50% -10%, #d6f7f7, transparent 60%), var(--e-bg); }
    .e-org-pub__hero { border-radius: var(--e-r-xl) var(--e-r-xl) 0 0; padding-top: 26px; }
}
@media (max-width: 360px) { .e-org-pub__title { font-size: 1.5rem; } }
@media (prefers-reduced-motion: reduce) { .e-org-pub__card, .e-org-pub__res { animation: none !important; } }

/* Resumen en vivo del formulario de evento y fila de datos clave. */
.e-org-resumen { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; padding: 12px 14px; border-radius: var(--e-r); background: var(--e-cyan-50); color: var(--e-cyan-ink); font-size: .9rem; font-weight: 600; }
.e-org-resumen[hidden] { display: none; }
.e-org-resumen .e-ico { flex: 0 0 auto; }

/* Fechas y horas del formulario de evento: una sola columna en celular (los campos date/time no entran de a dos
   y se salen de la tarjeta); dos columnas desde 600px. minmax(0, 1fr) evita que el contenido ensanche la grilla. */
.e-org-cuando { display: flex; flex-direction: column; }
.e-org-cuando .e-field { min-width: 0; }
.e-org-cuando .e-input { width: 100%; min-width: 0; max-width: 100%; }
@media (min-width: 600px) {
    .e-org-cuando { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
}

/* Formulario de evento en celular: los campos date/time/number traen un ancho mínimo propio en Safari (iOS) y
   Firefox y se salen de la tarjeta. Se les saca la apariencia nativa del contenedor y se les permite encogerse. */
.e-org-form, .e-org-form .e-card, .e-org-form .e-field, .e-org-form .e-org-cuando { min-width: 0; max-width: 100%; }
.e-org-form .e-input, .e-org-form .e-select {
    display: block; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box;
}
.e-org-form input[type="date"], .e-org-form input[type="time"], .e-org-form input[type="number"] {
    -webkit-appearance: none; appearance: none; min-width: 0; text-align: left;
}
.e-org-form input[type="date"]::-webkit-date-and-time-value,
.e-org-form input[type="time"]::-webkit-date-and-time-value { min-width: 0; text-align: left; margin: 0; }
.e-org-form .e-card__head > div { min-width: 0; }
.e-org-form .e-card__title, .e-org-form .e-card .e-muted { overflow-wrap: anywhere; }
