/* Estructura del panel: sidebar, barra superior y navegacion movil */
:root { --sidebar-width: 256px; --nc-topbar-h: 68px; --nc-bottom-h: 62px; }

body {
    margin: 0;
    background: transparent;
    color: var(--nc-text);
    font-family: var(--nc-font);
    -webkit-font-smoothing: antialiased;
}

.wrapper { min-height: 100dvh; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--nc-sidebar-bg);
    border-right: 1px solid var(--nc-border);
    display: flex;
    flex-direction: column;
    height: 100dvh;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    overflow-y: auto;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--nc-s3);
    padding: var(--nc-s5) 20px var(--nc-s4);
    text-decoration: none;
    color: var(--nc-text);
    min-width: 0;
}
.sidebar-brand-text { min-width: 0; }
.sidebar-brand-title {
    display: block;
    font-weight: 700;
    font-size: 1.0625rem;
    letter-spacing: .02em;
    line-height: 1.2;
}
.sidebar-brand-subtitle {
    display: block;
    color: var(--nc-muted);
    font-size: var(--nc-fs-xs);
    margin-top: 2px;
    overflow-wrap: anywhere;
}
.sidebar-menu { padding: var(--nc-s2) var(--nc-s3); flex-grow: 1; }
.sidebar-footer {
    padding: var(--nc-s3);
    border-top: 1px solid var(--nc-border);
}
.menu-item {
    display: flex;
    align-items: center;
    gap: var(--nc-s3);
    min-height: var(--nc-touch);
    padding: var(--nc-s2) var(--nc-s3);
    color: var(--nc-nav-fg);
    text-decoration: none;
    border-radius: var(--nc-r-md);
    margin-bottom: 2px;
    font-weight: 500;
    font-size: var(--nc-fs-sm);
    border: 1px solid transparent;
    transition: background var(--nc-t) var(--nc-ease), color var(--nc-t) var(--nc-ease);
}
.menu-item .bi { color: var(--nc-nav-icon); font-size: 1.05rem; }
.menu-item:hover { background: var(--nc-nav-hover-bg); color: var(--nc-nav-hover-fg); }
.menu-item:hover .bi { color: var(--nc-nav-hover-fg); }
.menu-item.active {
    background: var(--nc-nav-active-bg);
    color: var(--nc-nav-active-fg);
    font-weight: 600;
    border-color: var(--nc-nav-active-edge);
    box-shadow: var(--nc-nav-active-shadow);
}
.menu-item.active .bi { color: var(--nc-nav-active-fg); }
.menu-item-danger, .menu-item-danger .bi { color: var(--nc-err-fg); }

/* Contenido */
.main-content { margin-left: var(--sidebar-width); min-height: 100dvh; min-width: 0; }

/* Barra superior */
.topbar {
    background: var(--nc-topbar-bg);
    padding: var(--nc-s3) var(--nc-s5);
    border-bottom: 1px solid var(--nc-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--nc-s4);
    position: sticky;
    top: 0;
    z-index: 1020;
    min-height: var(--nc-topbar-h);
}
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: var(--nc-fs-lg); font-weight: 650; margin: 0; line-height: 1.25; }
.topbar-title p {
    margin: 0;
    font-size: var(--nc-fs-xs);
    color: var(--nc-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-actions { display: flex; align-items: center; gap: var(--nc-s3); flex: none; }
.topbar-brand-mini { display: none; }
.nc-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--nc-primary-soft);
    color: var(--nc-ink);
    font-weight: 650;
    font-size: var(--nc-fs-sm);
    flex: none;
}

/* Navegacion inferior movil */
.bottom-nav { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 1199.98px) {
    :root { --sidebar-width: 224px; }
}

/* Telefono y tablet vertical: menu lateral desplegable + barra inferior */
@media (max-width: 991.98px) {
    .sidebar {
        width: min(300px, 84vw);
        transform: translateX(-102%);
        visibility: hidden;
        transition: transform 200ms var(--nc-ease), visibility 200ms;
        box-shadow: var(--nc-shadow-2);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .sidebar.is-open { transform: none; visibility: visible; }
    .sidebar-backdrop.is-open {
        display: block;
        position: fixed;
        inset: 0;
        background: var(--nc-backdrop);
        z-index: 1035;
    }
    .main-content { margin-left: 0; padding-bottom: calc(var(--nc-bottom-h) + env(safe-area-inset-bottom) + var(--nc-s4)); }
    .topbar { padding: var(--nc-s2) var(--nc-s4); min-height: 58px; }
    .topbar-brand-mini { display: block; }
    .topbar-brand-mini .nc-mark { width: 26px; height: 26px; display: block; }
    .topbar-title { flex: 1; }
    .topbar-title h1 { font-size: var(--nc-fs-md); }
    .bottom-nav {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        position: fixed;
        inset: auto 0 0 0;
        z-index: 1030;
        background: var(--nc-bottomnav-bg);
        border-top: 1px solid var(--nc-border);
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
    }
    .bottom-nav a, .bottom-nav button {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: var(--nc-bottom-h);
        padding: var(--nc-s1);
        background: none;
        border: 0;
        color: var(--nc-muted);
        font: inherit;
        font-size: .6875rem;
        font-weight: 500;
        text-decoration: none;
    }
    .bottom-nav .bi { font-size: 1.15rem; }
    .bottom-nav .active { color: var(--nc-ink); font-weight: 650; }
    .bottom-nav .active .bi {
        background: var(--nc-ink);
    }
}

@media (max-width: 575.98px) {
    .btn-copy-link span { display: none; }
    .btn-copy-link { width: var(--nc-touch); padding: 0; justify-content: center; }
    .topbar .nc-avatar { display: none; }
}
