@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");
@import url("meseros-floating-bar.css?v=2");

:root {
    --menu-shadow: 0 24px 44px rgba(9, 9, 18, 0.34);
    --menu-accent: #ff6709;
    --menu-accent-soft: rgba(255, 103, 9, 0.14);
    --meseros-font-family: "Inter", "Inter Fallback", sans-serif;
    /* Dock / hoja móvil: misma familia cromática que la plantilla */
    --dock-accent: var(--menu-accent);
    --dock-accent-soft: #ff9a56;
    --dock-fab-deep: #d35400;
    --dock-icon-idle: #b4b6c2;
    --dock-icon-hover: #ff8f3d;
    --dock-halo: rgba(255, 103, 9, 0.38);
    --dock-halo-soft: rgba(255, 103, 9, 0.14);
    /* Cápsula flotante (referencia): mismo radio en las cuatro esquinas */
    --dock-bar-radius: 38px;
    --dock-float-margin-x: clamp(0.7rem, 3.5vw, 1.15rem);
    --dock-float-margin-bottom: calc(0.55rem + env(safe-area-inset-bottom, 0px));
    --dock-fab-size: 52px;
    --dock-fab-ring: 3px;
}

.meseros-shared-sidebar {
    width: 92px;
    flex: 0 0 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem 0.75rem;
    border-radius: 28px;
    background: rgba(31, 31, 46, 0.92);
    box-shadow: var(--menu-shadow);
}

.brand-badge {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #ffba74, var(--menu-accent));
    color: #1c2034;
    font-size: 1.35rem;
    font-weight: 800;
}

.meseros-shared-nav {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 0.5rem;
}

.nav-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.25rem;
    border-radius: 18px;
    color: #aaabc1;
    font-size: 0.73rem;
    text-align: center;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    border: 0;
    background-color: transparent;
    text-decoration: none;
}

.nav-link-item > span.nav-link-label {
    display: block;
    width: 100%;
    line-height: 1.2;
}

.nav-link-item:hover,
.nav-link-item:focus-visible,
.nav-link-item.is-active {
    color: #ffffff;
    background: rgba(255, 103, 9, 0.22);
    transform: translateY(-1px);
    outline: none;
}

.nav-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.04);
}

.nav-icon-wrap svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.theme-icon-moon {
    display: none;
}

/* Iconos +/- del FAB (menu hoja) */
.meseros-dock__fab .nav-mobile-fab__icons {
    position: relative;
    width: 26px;
    height: 26px;
    display: block;
}

.meseros-dock__fab .nav-mobile-fab__svg {
    position: absolute;
    left: 0;
    top: 0;
    width: 26px;
    height: 26px;
    display: block;
    transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.meseros-dock__fab .nav-mobile-fab__svg--x {
    opacity: 0;
}

.meseros-dock__fab:not(.is-open):hover .nav-mobile-fab__svg--plus,
.meseros-dock__fab:not(.is-open):focus-visible .nav-mobile-fab__svg--plus {
    opacity: 0;
}

.meseros-dock__fab:not(.is-open):hover .nav-mobile-fab__svg--x,
.meseros-dock__fab:not(.is-open):focus-visible .nav-mobile-fab__svg--x {
    opacity: 1;
}

.meseros-dock__fab.is-open .nav-mobile-fab__svg--plus {
    opacity: 0;
}

.meseros-dock__fab.is-open .nav-mobile-fab__svg--x {
    opacity: 1;
}

.meseros-nav-dock {
    display: none;
    width: 100%;
}

.meseros-nav-desktop {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    width: 100%;
}

.sidebar-profile {
    margin-top: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    padding: 0.7rem 0.55rem 0.65rem;
    cursor: pointer;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    transition: background 0.22s ease, border-color 0.22s ease, transform 0.18s ease, box-shadow 0.22s ease;
    position: relative;
}

.sidebar-profile:hover,
.sidebar-profile:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 122, 34, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
    outline: none;
}

.sidebar-profile__avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.sidebar-profile__avatar {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(255, 122, 34, 0.55);
    box-shadow: 0 0 0 3px rgba(255, 103, 9, 0.15);
}

.sidebar-profile__status {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #49d67d;
    border: 2px solid #1a1a28;
    box-shadow: 0 0 0 2px rgba(73, 214, 125, 0.25);
}

.sidebar-profile__text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    min-width: 0;
    width: 100%;
}

.sidebar-profile__name {
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    color: #f5f4fb;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-profile__role {
    display: block;
    font-size: 0.68rem;
    color: #aaabc1;
    line-height: 1.2;
}

.sidebar-profile__chevron {
    display: none;
    color: #aaabc1;
    opacity: 0.7;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.sidebar-profile:hover .sidebar-profile__chevron,
.sidebar-profile:focus-visible .sidebar-profile__chevron {
    opacity: 1;
    transform: translateY(1px);
}

body.theme-light .sidebar-profile {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(39, 34, 48, 0.08);
    box-shadow: 0 10px 22px rgba(120, 108, 96, 0.12);
}

body.theme-light .sidebar-profile:hover,
body.theme-light .sidebar-profile:focus-visible {
    background: #ffffff;
    border-color: rgba(255, 103, 9, 0.28);
    box-shadow: 0 14px 28px rgba(120, 108, 96, 0.16);
}

body.theme-light .sidebar-profile__status {
    border-color: #faf8f5;
}

body.theme-light .sidebar-profile__name {
    color: #2c2734;
}

body.theme-light .sidebar-profile__role,
body.theme-light .sidebar-profile__chevron {
    color: #726b79;
}

body.theme-light .meseros-shared-sidebar {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 30px rgba(153, 140, 122, 0.18);
}

body.theme-light .nav-link-item {
    color: #635d6b;
}

body.theme-light .nav-link-item:hover,
body.theme-light .nav-link-item:focus-visible,
body.theme-light .nav-link-item.is-active {
    color: #2c2734;
}

body.theme-light .nav-icon-wrap {
    background: rgba(39, 34, 48, 0.06);
}

body.theme-light .theme-icon-sun {
    display: none;
}

body.theme-light .theme-icon-moon {
    display: block;
}

@media (max-width: 991.98px) {
    .meseros-shared-sidebar {
        width: 100%;
        flex-basis: auto;
        flex-direction: row;
        justify-content: space-between;
        padding: 0.9rem 1rem;
        position: sticky;
        top: 0.75rem;
        z-index: 40;
        backdrop-filter: blur(10px);
    }

    .meseros-shared-nav {
        width: auto;
        flex-direction: row;
        align-items: center;
        margin-top: 0;
    }

    .nav-link-item {
        min-width: 72px;
        justify-content: center;
        align-self: center;
    }

    .nav-theme-toggle {
        min-width: 96px;
    }

    .sidebar-profile {
        margin-top: 0;
        width: auto;
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
        padding: 0.55rem 0.85rem 0.55rem 0.65rem;
        text-align: left;
    }

    .sidebar-profile__text {
        align-items: flex-start;
    }

    .sidebar-profile__chevron {
        display: flex;
        align-items: center;
        margin-left: 0.15rem;
    }
}

/* Vista ≤900px: barra flotante + FAB + panel hoja */
@media (max-width: 900.98px) {
    body {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 6.35rem);
    }

    body.meseros-mobile-menu-open {
        overflow: hidden;
        touch-action: none;
    }

    .meseros-shared-sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        max-width: none;
        box-sizing: border-box;
        gap: 0;
        padding: 0 var(--dock-float-margin-x) var(--dock-float-margin-bottom);
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        border: 0;
        backdrop-filter: none;
        overflow: visible;
        align-items: stretch;
        flex-direction: column;
        justify-content: flex-end;
        z-index: 45;
    }

    /* Gana a body.theme-light .meseros-shared-sidebar (fondo blanco 0.92) del layout escritorio */
    body.theme-light .meseros-shared-sidebar {
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    .meseros-shared-nav {
        width: 100%;
        max-width: none;
        margin: 0;
        display: block;
        padding: 0;
    }

    .meseros-nav-desktop {
        display: none !important;
    }

    .meseros-nav-dock {
        display: block;
        width: 100%;
    }

    .brand-badge,
    .sidebar-profile {
        display: none;
    }

    .meseros-dock {
        width: 100%;
        position: relative;
        padding-top: 1.85rem;
    }

    .meseros-dock__bar {
        position: relative;
        z-index: 0;
        width: 100%;
        background: #ffffff;
        border-radius: var(--dock-bar-radius);
        overflow: visible;
        box-shadow:
            0 12px 40px rgba(15, 12, 28, 0.12),
            0 4px 14px rgba(15, 12, 28, 0.06);
        padding: 0.55rem 0.75rem 0.45rem;
    }

    .meseros-dock__row {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.35rem;
        min-height: 3.45rem;
    }

    .meseros-dock__side {
        flex: 1 1 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: clamp(0.35rem, 2.5vw, 0.85rem);
        min-width: 0;
    }

    .meseros-dock__side--left {
        justify-content: flex-end;
        padding-right: 0.15rem;
    }

    .meseros-dock__side--right {
        justify-content: flex-start;
        padding-left: 0.15rem;
    }

    .meseros-dock__fabSlot {
        position: relative;
        flex: 0 0 5.5rem;
        width: 5.5rem;
        height: 3.25rem;
        pointer-events: none;
    }

    .meseros-dock__fabHalo {
        position: absolute;
        left: 50%;
        top: 0;
        transform: translate(-50%, -48%);
        width: 5.25rem;
        height: 5.25rem;
        border-radius: 50%;
        background: radial-gradient(
            circle,
            var(--dock-halo) 0%,
            var(--dock-halo-soft) 42%,
            rgba(255, 103, 9, 0.08) 68%,
            transparent 78%
        );
        pointer-events: none;
        z-index: 0;
        animation: meserosDockHaloPulse 3.2s ease-in-out infinite;
    }

    .meseros-dock__fab {
        position: absolute;
        left: 50%;
        top: 0;
        transform: translate(-50%, -52%);
        width: var(--dock-fab-size);
        height: var(--dock-fab-size);
        padding: 0;
        margin: 0;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: #ffffff;
        cursor: pointer;
        pointer-events: auto;
        -webkit-tap-highlight-color: transparent;
        z-index: 6;
        display: grid;
        place-items: center;
        transition: transform 0.32s cubic-bezier(0.34, 1.2, 0.64, 1);
    }

    .meseros-dock__fab:hover,
    .meseros-dock__fab:focus-visible {
        transform: translate(-50%, -52%) scale(1.05);
    }

    .meseros-dock__fab:active,
    .meseros-dock__fab.is-pressing {
        transform: translate(-50%, -52%) scale(1.02);
    }

    .meseros-dock__fabCore {
        position: relative;
        z-index: 2;
        width: var(--dock-fab-size);
        height: var(--dock-fab-size);
        border-radius: 50%;
        border: var(--dock-fab-ring) solid #ffffff;
        background: linear-gradient(160deg, var(--dock-accent-soft) 0%, var(--dock-accent) 52%, var(--dock-fab-deep) 100%);
        display: grid;
        place-items: center;
        box-shadow:
            0 2px 0 rgba(255, 255, 255, 0.38) inset,
            0 14px 28px rgba(255, 103, 9, 0.42);
        transition: transform 0.32s cubic-bezier(0.34, 1.2, 0.64, 1), box-shadow 0.32s ease;
    }

    .meseros-dock__fab:focus-visible {
        outline: 2px solid rgba(255, 122, 34, 0.65);
        outline-offset: 3px;
    }

    .meseros-dock__fab .nav-mobile-fab__icons,
    .meseros-dock__fab .nav-mobile-fab__svg {
        width: 28px;
        height: 28px;
    }

    .meseros-dock__item {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 3.1rem;
        min-height: 3.1rem;
        padding: 0.35rem;
        border-radius: 14px;
        color: var(--dock-icon-idle);
        text-decoration: none;
        background: transparent;
        transition: color 0.32s cubic-bezier(0.4, 0, 0.2, 1), transform 0.32s cubic-bezier(0.34, 1.2, 0.64, 1);
        -webkit-tap-highlight-color: transparent;
    }

    .meseros-dock__item:hover,
    .meseros-dock__item:focus-visible {
        color: var(--dock-icon-hover);
        outline: none;
    }

    .meseros-dock__iconWrap {
        display: grid;
        place-items: center;
        width: 3.15rem;
        height: 3.15rem;
        transition: transform 0.32s cubic-bezier(0.34, 1.2, 0.64, 1);
    }

    .meseros-dock-icon {
        width: 30px;
        height: 30px;
        overflow: visible;
        stroke-width: 1.85;
    }

    .meseros-dock-icon__stroke {
        stroke: currentColor;
        fill: none;
        stroke-dasharray: 1;
        stroke-dashoffset: 0;
        transition: stroke 0.34s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .meseros-dock__item.is-active .meseros-dock-icon {
        animation: meserosDockIconPop 0.38s cubic-bezier(0.34, 1.25, 0.64, 1);
    }

    .meseros-dock__item.is-active .meseros-dock-icon__stroke {
        stroke: var(--dock-accent);
        animation: meserosDockStrokeFill 0.38s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    .meseros-dock__item:not(.is-active) .meseros-dock-icon__stroke {
        animation: none;
    }

    .meseros-dock__item.is-pressing .meseros-dock__iconWrap {
        transform: scale(1.08);
    }

    .meseros-dock__indicator {
        margin: 0.35rem auto 0.1rem;
        width: 31%;
        max-width: 128px;
        height: 4px;
        border-radius: 999px;
        background: rgba(24, 22, 40, 0.12);
        transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    }

    body.theme-light .meseros-dock__bar {
        background: #ffffff;
        box-shadow:
            0 12px 36px rgba(120, 108, 96, 0.12),
            0 4px 12px rgba(120, 108, 96, 0.07);
    }

    body.theme-light .meseros-dock__indicator {
        background: rgba(39, 34, 48, 0.14);
    }

    /* Panel principal: sin fondo blanco semitransparente (el body marca el color de fondo) */
    body.theme-light .meseros-main,
    body.theme-light .pedidos-main,
    body.theme-light .mesas-main,
    body.theme-light .clientes-main,
    body.theme-light .productos-main,
    body.theme-light .reservas-main,
    body.theme-light .perfil-main,
    body.theme-light .arqueo-main,
    body.theme-light .comandas-main,
    body.theme-light .estaciones-main,
    body.theme-light .scheduler-main,
    body.theme-light .nuevo-pedido-main {
        background: transparent;
        box-shadow: none;
    }
}

@media (max-width: 575.98px) {
    body {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 6.1rem);
    }

    :root {
        --dock-bar-radius: 34px;
        --dock-float-margin-x: clamp(0.55rem, 3vw, 0.95rem);
        --dock-float-margin-bottom: calc(0.45rem + env(safe-area-inset-bottom, 0px));
    }

    .meseros-dock {
        padding-top: 1.65rem;
    }

    .meseros-dock__bar {
        border-radius: var(--dock-bar-radius);
        padding: 0.5rem 0.6rem 0.4rem;
    }

    .meseros-dock__fabSlot {
        flex-basis: 5rem;
        width: 5rem;
    }

    :root {
        --dock-fab-size: 48px;
    }

    .meseros-dock__fab .nav-mobile-fab__icons,
    .meseros-dock__fab .nav-mobile-fab__svg {
        width: 26px;
        height: 26px;
    }

    .meseros-dock__iconWrap {
        width: 2.95rem;
        height: 2.95rem;
    }

    .meseros-dock-icon {
        width: 28px;
        height: 28px;
        stroke-width: 1.8;
    }

    .meseros-dock__item {
        min-width: 2.95rem;
        min-height: 2.95rem;
    }
}

@keyframes meserosDockHaloPulse {
    0%,
    100% {
        transform: translate(-50%, -48%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -48%) scale(1.06);
        opacity: 0.88;
    }
}

@keyframes meserosDockStrokeFill {
    0% {
        stroke-dashoffset: 1;
        stroke: var(--dock-icon-idle);
    }
    45% {
        stroke-dashoffset: 0;
        stroke: var(--dock-icon-idle);
    }
    100% {
        stroke-dashoffset: 0;
        stroke: var(--dock-accent);
    }
}

@keyframes meserosDockIconPop {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .meseros-dock__fabHalo {
        animation: none;
    }

    .meseros-dock__item.is-active .meseros-dock-icon,
    .meseros-dock__item.is-active .meseros-dock-icon__stroke {
        animation: none;
    }

    .meseros-dock__item.is-active .meseros-dock-icon__stroke {
        stroke: var(--dock-accent);
    }
}

/* Panel completo y dock: solo vista compacta */
@media (min-width: 901px) {
    .meseros-mobile-sheet {
        display: none !important;
    }

    .meseros-nav-dock {
        display: none !important;
    }

    .meseros-nav-desktop {
        display: flex;
    }
}

.meseros-mobile-sheet[hidden] {
    display: none !important;
}

.meseros-mobile-sheet:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: block;
}

.meseros-mobile-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 8, 14, 0.55);
    backdrop-filter: blur(4px);
}

.meseros-mobile-sheet__panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #14141c;
    color: #f4f4fb;
    border-radius: 22px;
    margin: 0.5rem;
    max-height: calc(100dvh - 1rem);
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.meseros-mobile-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.15rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.meseros-mobile-sheet__brand {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.meseros-mobile-sheet__close {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #f4f4fb;
    display: grid;
    place-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.meseros-mobile-sheet__close:focus-visible {
    outline: 2px solid rgba(255, 122, 34, 0.65);
    outline-offset: 2px;
}

.meseros-mobile-sheet__nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meseros-mobile-sheet__link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 0.75rem;
    border-radius: 14px;
    color: #f0f0f8;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 0;
    width: 100%;
    text-align: left;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.meseros-mobile-sheet__link:hover,
.meseros-mobile-sheet__link:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.meseros-mobile-sheet__link.is-active {
    color: var(--menu-accent);
}

.meseros-mobile-sheet__theme-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 0.75rem;
    border-radius: 14px;
    color: #f0f0f8;
}

.meseros-mobile-sheet__theme-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.meseros-mobile-sheet__theme-label {
    flex: 1;
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    margin: 0;
}

.meseros-sheet-theme-switch {
    --sheet-switch-track: var(--menu-accent);
    --sheet-switch-travel: 24px;
    position: relative;
    width: 54px;
    height: 30px;
    flex-shrink: 0;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
}

.meseros-sheet-theme-switch:focus-visible {
    outline: 2px solid rgba(255, 122, 34, 0.65);
    outline-offset: 3px;
}

.meseros-sheet-theme-switch__track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--sheet-switch-track);
    pointer-events: none;
}

.meseros-sheet-theme-switch__thumb {
    position: absolute;
    left: 3px;
    top: 50%;
    width: 24px;
    height: 24px;
    margin-top: -12px;
    border-radius: 50%;
    background: #ffffff;
    pointer-events: none;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.meseros-sheet-theme-switch__thumb::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    margin: -3.5px 0 0 -3.5px;
    border-radius: 50%;
    background: var(--sheet-switch-track);
}

body.theme-light .meseros-sheet-theme-switch__thumb {
    transform: translateX(var(--sheet-switch-travel));
}

.meseros-mobile-sheet__icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.meseros-mobile-sheet__icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.meseros-mobile-sheet__icon .theme-icon-moon {
    display: none;
}

body.theme-light .meseros-mobile-sheet__icon .theme-icon-sun {
    display: none;
}

body.theme-light .meseros-mobile-sheet__icon .theme-icon-moon {
    display: block;
}

.meseros-mobile-sheet__foot {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.15rem calc(1rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.meseros-mobile-sheet__avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    object-fit: cover;
    flex-shrink: 0;
}

.meseros-mobile-sheet__user {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.meseros-mobile-sheet__user strong {
    font-size: 0.88rem;
    font-weight: 600;
    color: #f4f4fb;
}

.meseros-mobile-sheet__user span {
    font-size: 0.78rem;
    color: #9b96a8;
}

body.theme-light .meseros-mobile-sheet__panel {
    background: #faf8f5;
    color: #2c2734;
}

body.theme-light .meseros-mobile-sheet__head {
    border-bottom-color: rgba(39, 34, 48, 0.1);
}

body.theme-light .meseros-mobile-sheet__brand {
    color: #2c2734;
}

body.theme-light .meseros-mobile-sheet__close {
    color: #2c2734;
}

body.theme-light .meseros-mobile-sheet__link {
    color: #2c2734;
}

body.theme-light .meseros-mobile-sheet__link.is-active {
    color: #c55208;
}

body.theme-light .meseros-mobile-sheet__theme-row {
    color: #2c2734;
}

body.theme-light .meseros-mobile-sheet__theme-row:hover {
    background: rgba(39, 34, 48, 0.06);
}

body.theme-light .meseros-sheet-theme-switch {
    box-shadow: 0 2px 10px rgba(44, 39, 52, 0.12);
}

body.theme-light .meseros-mobile-sheet__foot {
    border-top-color: rgba(39, 34, 48, 0.1);
}

body.theme-light .meseros-mobile-sheet__user strong {
    color: #2c2734;
}

body.theme-light .meseros-mobile-sheet__user span {
    color: #726b79;
}

/* Modal perfil + log accesos */
body.meseros-profile-modal-open {
    overflow: hidden;
}

.meseros-profile-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    pointer-events: none;
}

.meseros-profile-modal[hidden] {
    display: none !important;
}

.meseros-profile-modal:not([hidden]) {
    pointer-events: auto;
}

.meseros-profile-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 6, 16, 0.62);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.meseros-profile-modal.is-open .meseros-profile-modal__backdrop {
    opacity: 1;
}

.meseros-profile-modal__panel {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    max-height: min(90vh, 680px);
    overflow: auto;
    background: linear-gradient(180deg, #262638 0%, #1e1e2e 100%);
    color: #f5f4fb;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    padding: 1.5rem 1.35rem 1.25rem;
    transform: translateY(16px) scale(0.97);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.28s ease;
}

.meseros-profile-modal.is-open .meseros-profile-modal__panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

body.theme-light .meseros-profile-modal__panel {
    background: linear-gradient(180deg, #ffffff 0%, #faf7f2 100%);
    color: #2c2734;
    border-color: rgba(39, 34, 48, 0.08);
    box-shadow:
        0 32px 64px rgba(120, 100, 80, 0.22),
        0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}

.meseros-profile-modal__accent {
    position: absolute;
    top: 0;
    left: 1.25rem;
    right: 1.25rem;
    height: 4px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, #ff6709 0%, #ff9a4d 50%, #48d88a 100%);
    opacity: 0.95;
}

.meseros-profile-modal__close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    z-index: 2;
}

.meseros-profile-modal__close:hover,
.meseros-profile-modal__close:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    transform: scale(1.05);
    outline: none;
}

body.theme-light .meseros-profile-modal__close {
    background: rgba(39, 34, 48, 0.06);
}

body.theme-light .meseros-profile-modal__close:hover,
body.theme-light .meseros-profile-modal__close:focus-visible {
    background: rgba(39, 34, 48, 0.1);
}

.meseros-profile-modal__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-top: 0.35rem;
}

.meseros-profile-modal__avatar-wrap {
    position: relative;
}

.meseros-profile-modal__avatar-wrap::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 103, 9, 0.55), rgba(72, 216, 138, 0.45));
    z-index: -1;
}

.meseros-profile-modal__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

body.theme-light .meseros-profile-modal__avatar {
    border-color: #ffffff;
}

.meseros-profile-modal__meta {
    min-width: 0;
    width: 100%;
}

.meseros-profile-modal__eyebrow {
    margin: 0 0 0.25rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #ff9a4d;
}

.meseros-profile-modal__name {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.15;
}

.meseros-profile-modal__role,
.meseros-profile-modal__empresa,
.meseros-profile-modal__email {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: #aaabc1;
    line-height: 1.35;
}

body.theme-light .meseros-profile-modal__role,
body.theme-light .meseros-profile-modal__empresa,
body.theme-light .meseros-profile-modal__email {
    color: #726b79;
}

.meseros-profile-modal__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-bottom: 1.15rem;
}

.meseros-profile-modal__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    text-align: center;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.72rem 0.85rem;
    border-radius: 999px;
    border: 0;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.meseros-profile-modal__btn:hover,
.meseros-profile-modal__btn:focus-visible {
    transform: translateY(-1px);
    outline: none;
}

.meseros-profile-modal__btn--primary {
    color: #2c2734;
    background: #ffffff;
    box-shadow: 0 12px 22px rgba(14, 13, 28, 0.16);
}

.meseros-profile-modal__btn--primary:hover,
.meseros-profile-modal__btn--primary:focus-visible {
    box-shadow: 0 16px 28px rgba(14, 13, 28, 0.2);
}

body.theme-light .meseros-profile-modal__btn--primary {
    background: #ffffff;
    color: #2c2734;
}

.meseros-profile-modal__btn--logout {
    color: #ffffff;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 12px 22px rgba(192, 57, 43, 0.28);
}

.meseros-profile-modal__btn--logout:hover,
.meseros-profile-modal__btn--logout:focus-visible {
    box-shadow: 0 16px 28px rgba(192, 57, 43, 0.34);
}

.meseros-profile-modal__log {
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.85rem 0.9rem 0.75rem;
}

body.theme-light .meseros-profile-modal__log {
    background: rgba(39, 34, 48, 0.04);
    border-color: rgba(39, 34, 48, 0.08);
}

.meseros-profile-modal__log-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.meseros-profile-modal__log-head h3 {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #aaabc1;
}

body.theme-light .meseros-profile-modal__log-head h3 {
    color: #726b79;
}

.meseros-profile-modal__log-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 103, 9, 0.15);
    color: #ff9a4d;
}

body.theme-light .meseros-profile-modal__log-badge {
    background: rgba(255, 103, 9, 0.12);
    color: #c55208;
}

.meseros-profile-modal__log-body {
    max-height: 220px;
    overflow-y: auto;
}

.meseros-profile-log {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meseros-profile-log__item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem 0.65rem;
    align-items: center;
    padding: 0.6rem 0.7rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.78rem;
}

body.theme-light .meseros-profile-log__item {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(120, 108, 96, 0.08);
}

.meseros-profile-log__icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.meseros-profile-log__item--login .meseros-profile-log__icon {
    background: rgba(72, 216, 138, 0.18);
    color: #48d88a;
}

.meseros-profile-log__item--logout .meseros-profile-log__icon {
    background: rgba(255, 103, 9, 0.18);
    color: #ff6709;
}

.meseros-profile-log__content {
    min-width: 0;
}

.meseros-profile-log__tipo {
    display: block;
    font-weight: 700;
    line-height: 1.2;
}

.meseros-profile-log__fecha {
    display: block;
    margin-top: 0.12rem;
    color: #aaabc1;
    font-size: 0.72rem;
}

body.theme-light .meseros-profile-log__fecha {
    color: #726b79;
}

.meseros-profile-log__ip {
    font-size: 0.68rem;
    font-weight: 600;
    color: #888;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

body.theme-light .meseros-profile-log__ip {
    background: rgba(39, 34, 48, 0.06);
    color: #726b79;
}

.meseros-profile-log__empty,
.meseros-profile-log__loading {
    margin: 0;
    font-size: 0.8rem;
    color: #aaabc1;
    padding: 0.75rem 0.35rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.meseros-profile-log__empty-icon {
    font-size: 1.25rem;
    opacity: 0.7;
}

body.theme-light .meseros-profile-log__empty,
body.theme-light .meseros-profile-log__loading {
    color: #726b79;
}

.meseros-mobile-sheet__foot[data-open-profile-modal] {
    cursor: pointer;
    border-radius: 0 0 18px 18px;
    transition: background 0.2s ease;
}

.meseros-mobile-sheet__foot[data-open-profile-modal]:hover,
.meseros-mobile-sheet__foot[data-open-profile-modal]:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

body.theme-light .meseros-mobile-sheet__foot[data-open-profile-modal]:hover,
body.theme-light .meseros-mobile-sheet__foot[data-open-profile-modal]:focus-visible {
    background: rgba(39, 34, 48, 0.06);
}

@media (prefers-reduced-motion: reduce) {
    .meseros-profile-modal__backdrop,
    .meseros-profile-modal__panel {
        transition: none;
    }

    .meseros-profile-modal.is-open .meseros-profile-modal__panel {
        transform: none;
    }
}

