html, body {
    margin: 0;
    padding: 0;
    background: #111;
}

.al-root {
    display: flex;
    min-height: 100vh;
    background: #111;
    font-family: inherit;
}

/* ── Sidebar ── */
.al-sidebar {
    width: 220px;
    min-height: 100vh;
    background: linear-gradient(145deg, #2c2c2c, #1a1a1a);
    box-shadow: inset -4px 0 10px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    transition: width 0.25s ease;
    overflow: hidden;
}

.al-sidebar-collapsed {
    width: 60px;
    overflow: hidden;
}

.al-sidebar-collapsed .al-nav-text {
    display: none !important;
}

.al-sidebar-collapsed .al-brand span {
    display: none;
}

.al-sidebar-collapsed .al-nav-icon {
    display: flex;
    justify-content: center;
    width: 100%;
}

.al-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.2rem 1rem 1rem;
    border-bottom: 1px solid #3a3a3a;
    overflow: hidden;
    white-space: nowrap;
}

    .al-brand img {
        height: 36px;
        flex-shrink: 0;
        opacity: 0.9;
    }

    .al-brand span {
        color: #ddd;
        font-size: 1.05rem;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

/* ── Toggle button ── */
.al-toggle {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #3a3a3a;
    color: #aaa;
    cursor: pointer;
    padding: 6px 8px;
    text-align: right;
    font-size: 1.2rem;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

    .al-toggle:hover {
        color: #fff;
        background: rgba(255,255,255,0.05);
    }

.al-sidebar-collapsed .al-toggle {
    text-align: center;
}

.al-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1.2rem 0.75rem;
    flex: 1;
    overflow: hidden;
}

.al-sidebar-collapsed .al-nav {
    padding: 1.2rem 0.4rem;
}

/* ── Nav item wrapper for tooltip ── */
.al-nav-item {
    position: relative;
}

.al-sidebar-collapsed .al-nav-item:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 54px;
    top: 50%;
    transform: translateY(-50%);
    background: #1a1a2e;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 0.85rem;
    z-index: 1000;
    border: 1px solid #444;
    pointer-events: none;
}

.al-navlink {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    color: #ccc;
    text-decoration: none;
    font-size: 0.97rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
}

.al-sidebar-collapsed .al-navlink {
    justify-content: center;
    padding: 12px 0;
}

.al-nav-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
}

    .al-navlink:hover {
        background: rgba(255,255,255,0.07);
        color: #fff;
    }

    .al-navlink.active {
        background: rgba(40, 167, 69, 0.18);
        color: #28a745;
        font-weight: 600;
    }

/* ── Main ── */
.al-main {
    margin-left: 220px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
    min-width: 0;
}

.al-main-expanded {
    margin-left: 60px;
}

.al-header {
    background: #1a1a1a;
    border-bottom: 1px solid #2e2e2e;
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.al-league-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: auto;
}

.al-league-logo {
    height: 32px;
    width: 32px;
    object-fit: contain;
    border-radius: 4px;
}

.al-league-name {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.al-username {
    color: #ccc;
    font-size: 0.9rem;
}

.al-home {
    background: transparent;
    border: 1px solid #555;
    border-radius: 6px;
    color: #aaa;
    padding: 0.3rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

    .al-home:hover {
        border-color: #28a745;
        color: #28a745;
    }

.al-logout {
    background: transparent;
    border: 1px solid #555;
    border-radius: 6px;
    color: #aaa;
    padding: 0.3rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

    .al-logout:hover {
        border-color: #e50000;
        color: #e50000;
    }

.al-body {
    padding: 2rem;
    flex: 1;
    color: #ddd;
}

/* ── Hamburger (mobile only) ── */
.al-hamburger {
    display: none;
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    border-radius: 6px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}
.al-hamburger:hover { color: #fff; background: rgba(255,255,255,0.07); }

/* ── Mobile overlay backdrop ── */
.al-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1040;
}

/* ── Mobile layout (≤ 767px) ── */
@media (max-width: 767px) {
    .al-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 56px;
        height: 56px;
        z-index: 1100;
    }

    .al-sidebar {
        left: -220px;
        width: 220px !important;
        z-index: 1050;
        transition: left 0.25s ease;
    }
    .al-sidebar.al-sidebar-collapsed { width: 220px !important; }
    .al-sidebar.al-mobile-open       { left: 0; }

    /* Mostrar texto completo en mobile aunque desktop esté colapsado */
    .al-sidebar .al-nav-text,
    .al-sidebar .al-brand span        { display: inline !important; }
    .al-sidebar .al-nav-icon          { width: auto !important; justify-content: flex-start !important; }
    .al-sidebar .al-navlink           { justify-content: flex-start !important; padding: 0.65rem 1rem !important; }
    .al-sidebar .al-toggle            { display: none; }

    /* Contenido ocupa todo el ancho */
    .al-main { margin-left: 0 !important; }
    .al-body { padding: 1rem; }
    .al-header { padding-left: 60px; }

    /* Reducir elementos del header en pantallas pequeñas */
    .al-username { display: none; }
}
