:root {
    --tl-bg: #fbf6f7;
    --tl-card: #ffffff;
    --tl-line: #f0d7dd;
    --tl-shadow: 0 16px 34px rgba(60, 20, 35, .10);
    --tl-text: #2a1b22;
    --tl-muted: #7a5a66;

    --tl-pink: #f2b8c7;
    --tl-pink-2: #f7c6d3;
    --tl-gold: #d6b06a;
}

/* HEADER base */
.tul-nav {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--tl-line);
}

.nav-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 14px 12px;
    position: relative;
}

/* ✅ toggle oculto (pero funcional) */
.nav-toggle {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* filas */
.nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.nav-top {
    padding-bottom: 8px;
}

.nav-bottom {
    padding-top: 8px;
    border-top: 1px solid rgba(240, 215, 221, .75);
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--tl-text);
}

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--tl-gold), var(--tl-pink));
    box-shadow: 0 8px 16px rgba(214, 176, 106, .32);
}

.brand-name {
    font-weight: 950;
    letter-spacing: .2px;
    font-size: 18px;
}

/* Role chip */
.role-chip {
    font-size: 11px;
    font-weight: 950;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--tl-line);
    background: linear-gradient(180deg, rgba(242, 184, 199, .22), rgba(214, 176, 106, .10));
    color: var(--tl-muted);
    white-space: nowrap;
}

/* Right of top row */
.nav-top-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* User pill */
.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--tl-line);
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 10px 20px rgba(60, 20, 35, .06);
    position: relative;
    overflow: hidden;
}

.user-pill::before {
    content: "";
    position: absolute;
    inset: -40px -70px auto auto;
    width: 150px;
    height: 150px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, rgba(242, 184, 199, .55), rgba(214, 176, 106, .16));
    transform: rotate(12deg);
    pointer-events: none;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 950;
    color: var(--tl-text);
    background: linear-gradient(180deg, rgba(242, 184, 199, .55), rgba(214, 176, 106, .22));
    border: 1px solid rgba(240, 215, 221, .95);
    flex: 0 0 auto;
}

.uinfo {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.uname {
    font-size: 13px;
    font-weight: 950;
    color: var(--tl-text);
}

.urole {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 900;
    color: var(--tl-muted);
}

/* Logout ghost */
.logout-ghost {
    border: 1px solid var(--tl-line);
    background: rgba(255, 255, 255, .70);
    padding: 10px 12px;
    border-radius: 999px;
    font-weight: 950;
    color: var(--tl-muted);
    cursor: pointer;
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
    white-space: nowrap;
}

.logout-ghost:hover {
    background: rgba(242, 184, 199, .22);
    color: var(--tl-text);
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(60, 20, 35, .08);
}

/* ========== NAV DESKTOP centrado ========== */
.nav-desktop {
    display: none;
    /* aparece en desktop */
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 18px;
    border: 1px solid var(--tl-line);
    background: rgba(255, 255, 255, .82);
    box-shadow: var(--tl-shadow);
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.nav-desktop a {
    text-decoration: none;
    font-weight: 900;
    font-size: 14px;
    color: var(--tl-muted);
    position: relative;
    padding: 8px 10px;
    border-radius: 999px;
}

.nav-desktop a:hover {
    color: var(--tl-text);
    background: rgba(242, 184, 199, .14);
}

.nav-desktop a.is-active {
    color: var(--tl-text);
    background: linear-gradient(180deg, rgba(242, 184, 199, .30), rgba(214, 176, 106, .14));
    border: 1px solid rgba(240, 215, 221, .9);
}

/* ========== HAMBURGER + MOBILE SHEET ========== */
.nav-burger {
    width: 42px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid var(--tl-line);
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 10px 18px rgba(60, 20, 35, .06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.nav-burger span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--tl-pink), var(--tl-gold));
}

/* Mobile container */
.nav-mobile {
    display: none;
}

.nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(42, 27, 34, .14);
    backdrop-filter: blur(2px);
}

.nav-sheet {
    position: fixed;
    top: 14px;
    left: 14px;
    right: 14px;
    border-radius: 22px;
    border: 1px solid var(--tl-line);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 22px 60px rgba(60, 20, 35, .18);
    overflow: hidden;
    transform: translateY(-8px);
    opacity: 0;
    transition: transform .16s ease, opacity .16s ease;
}

.sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(240, 215, 221, .75);
    background: linear-gradient(180deg, rgba(242, 184, 199, .22), rgba(255, 255, 255, .70));
}

.sheet-title {
    font-weight: 950;
    color: var(--tl-text);
}

.sheet-close {
    width: 38px;
    height: 36px;
    border-radius: 14px;
    border: 1px solid var(--tl-line);
    background: rgba(255, 255, 255, .70);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 950;
    color: var(--tl-muted);
}

.sheet-links {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 6px;
}

.sheet-links a {
    text-decoration: none;
    font-weight: 950;
    color: var(--tl-text);
    padding: 12px 12px;
    border-radius: 16px;
    border: 1px solid transparent;
}

.sheet-links a:hover {
    background: rgba(242, 184, 199, .16);
}

.sheet-links a.is-active {
    background: linear-gradient(180deg, rgba(242, 184, 199, .30), rgba(214, 176, 106, .12));
    border-color: rgba(240, 215, 221, .9);
}

.sheet-footer {
    padding: 12px 14px;
    border-top: 1px solid rgba(240, 215, 221, .75);
}

.mini-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-ava {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 950;
    color: var(--tl-text);
    background: linear-gradient(180deg, rgba(242, 184, 199, .55), rgba(214, 176, 106, .22));
    border: 1px solid rgba(240, 215, 221, .95);
}

.mini-name {
    font-weight: 950;
    color: var(--tl-text);
    font-size: 13px;
}

.mini-role {
    font-weight: 900;
    color: var(--tl-muted);
    font-size: 11px;
}

/* ✅ Toggle open (AHORA SÍ FUNCIONA) */
.nav-toggle:checked~.nav-mobile {
    display: block;
}

.nav-toggle:checked~.nav-mobile .nav-backdrop {
    display: block;
}

.nav-toggle:checked~.nav-mobile .nav-sheet {
    opacity: 1;
    transform: translateY(0);
}

/* ========== RESPONSIVE ========== */
@media (max-width:520px) {
    .uinfo {
        display: none;
    }

    /* solo avatar */
    .user-pill {
        padding: 8px;
    }

    .logout-ghost {
        padding: 10px 10px;
    }
}

/* >= 980px: layout desktop PRO */
@media (min-width:980px) {
    .nav-shell {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 10px 16px;
    }

    .nav-top,
    .nav-bottom {
        padding: 0;
        border: 0;
    }

    .nav-burger {
        display: none;
    }

    .nav-mobile {
        display: none !important;
    }

    .nav-desktop {
        display: flex;
        flex: 1 1 auto;
    }
}
