/* =========================================================
   LOTERIAS DB — APLICAÇÃO INTERNA
   Estrutura Premium da base.html
========================================================= */

@import url("variables.css");
@import url("typography.css");
@import url("layout.css");
@import url("buttons.css");
@import url("cards.css");
@import url("forms.css");
@import url("tables.css");
@import url("badges.css");
@import url("alerts.css");
@import url("modals.css");
@import url("header.css");
@import url("sidebar.css");
@import url("footer.css");
@import url("animations.css");

/* =========================================================
   CORPO DA APLICAÇÃO
========================================================= */

body.ldb-app-body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(
            circle at top right,
            rgba(212, 175, 55, 0.08),
            transparent 30%
        ),
        #070b10;
    color: #f5f7fa;
}

.ldb-app-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
}

/* =========================================================
   SIDEBAR
========================================================= */

.ldb-app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 320px;
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    overflow-y: auto;

    background:
        linear-gradient(
            180deg,
            rgba(17, 22, 29, 0.98),
            rgba(7, 11, 16, 0.99)
        );

    border-right: 1px solid rgba(212, 175, 55, 0.18);
    box-shadow: 18px 0 45px rgba(0, 0, 0, 0.32);
    z-index: 1000;
}

/* Marca */

.ldb-sidebar-brand {
    padding: 0 4px 22px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ldb-sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 14px;
    color: inherit;
    text-decoration: none;
}

.ldb-sidebar-logo {
    width: 82px;
    height: 82px;
    object-fit: contain;
    flex: 0 0 82px;
    border-radius: 18px;
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.22),
        0 0 28px rgba(212, 175, 55, 0.24);
}

.ldb-sidebar-brand-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ldb-sidebar-brand-copy strong {
    color: #ffffff;
    font-size: 19px;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.ldb-sidebar-brand-copy span {
    color: #d4af37;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

/* Usuário */

.ldb-sidebar-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    margin-bottom: 22px;
    overflow: hidden;

    border: 1px solid rgba(212, 175, 55, 0.26);
    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            rgba(212, 175, 55, 0.10),
            rgba(255, 255, 255, 0.025)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 12px 28px rgba(0, 0, 0, 0.20);
}

.ldb-sidebar-user::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(
        180deg,
        #f4d467,
        #b8860b
    );
}

.ldb-sidebar-user-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;

    border-radius: 14px;

    color: #090b0e;
    background:
        linear-gradient(
            135deg,
            #f7dc77,
            #c28e11
        );

    border: 1px solid rgba(255, 255, 255, 0.20);

    box-shadow:
        0 0 0 4px rgba(212, 175, 55, 0.07),
        0 8px 18px rgba(0, 0, 0, 0.26);

    font-weight: 900;
    font-size: 18px;
}

.ldb-sidebar-user-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.ldb-sidebar-user-info strong {
    max-width: 100%;
    overflow: hidden;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ldb-sidebar-plan-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 9px;
    border-radius: 999px;
    color: #e6c85c;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.26);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.ldb-sidebar-user-info small {
    color: #8f9baa;
    font-size: 10px;
}

/* Menu */

.ldb-app-sidebar .menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ldb-app-sidebar .menu-item {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 14px;
    box-sizing: border-box;

    border: 1px solid transparent;
    border-radius: 13px;

    color: #c5ced8;
    background: transparent;
    text-decoration: none;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.ldb-app-sidebar .menu-item:hover {
    color: #ffffff;
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.18);
    transform: translateX(2px);
}

.ldb-app-sidebar .menu-item.is-active {
    position: relative;

    color: #ffffff;

    background:
        linear-gradient(
            90deg,
            rgba(212, 175, 55, 0.17),
            rgba(212, 175, 55, 0.04)
        );

    border-color: rgba(212, 175, 55, 0.34);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 8px 20px rgba(0, 0, 0, 0.16);
}

.ldb-app-sidebar .menu-item.is-active::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 9px;
    bottom: 9px;
    width: 3px;

    border-radius: 0 4px 4px 0;

    background:
        linear-gradient(
            180deg,
            #f5d96f,
            #b8860b
        );

    box-shadow: 0 0 12px rgba(212, 175, 55, 0.42);
}

.ldb-app-sidebar .menu-item.is-active .menu-icon {
    filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.35));
}

.ldb-app-sidebar .menu-icon {
    width: 28px;
    display: inline-flex;
    justify-content: center;
    font-size: 19px;
}

.ldb-app-sidebar .menu-text {
    flex: 1;
    color: inherit;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.25;
}

.ldb-app-sidebar .menu-dropdown-title {
    cursor: pointer;
}

.ldb-app-sidebar .menu-dropdown-content {
    padding: 4px 0 4px 18px;
}

.ldb-app-sidebar .menu-item-legal {
    min-height: 38px;
    font-size: 12px;
}

.ldb-app-sidebar .menu-admin {
    color: #f4d467;
}

/* Redes sociais */

.ldb-app-sidebar .sidebar-social {
    display: flex;
    gap: 10px;
    padding: 18px 4px;
}

.ldb-app-sidebar .social-btn {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}

.ldb-app-sidebar .social-btn img {
    width: 25px;
    height: 25px;
    object-fit: contain;
}

/* Rodapé da sidebar */

.ldb-app-sidebar .sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* =========================================================
   CONTEÚDO PRINCIPAL
========================================================= */

/* Cabeçalho superior */

.ldb-app-header {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    z-index: 1;
    width: 100%;
    max-width: 1580px;
    min-height: 92px;
    margin: 0 auto 36px;
    padding: 20px 22px;
    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    border: 1px solid rgba(212, 175, 55, 0.17);
    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            rgba(19, 25, 33, 0.96),
            rgba(12, 17, 23, 0.96)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.025),
        0 16px 40px rgba(0, 0, 0, 0.20);
}

.ldb-app-header-copy {
    min-width: 0;
}

.ldb-app-header-overline {
    display: block;
    margin-bottom: 5px;

    color: #d7b640;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.ldb-app-header-copy h1 {
    margin: 0;

    color: #ffffff;
    font-size: clamp(21px, 2vw, 28px);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.ldb-app-header-copy p {
    margin: 7px 0 0;

    color: #95a1af;
    font-size: 12px;
    line-height: 1.5;
}

.ldb-app-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ldb-app-header-plan {
    min-width: 128px;
    padding: 10px 14px;

    display: flex;
    flex-direction: column;
    gap: 2px;

    border: 1px solid rgba(212, 175, 55, 0.24);
    border-radius: 12px;

    background: rgba(212, 175, 55, 0.07);
    text-decoration: none;
}

.ldb-app-header-plan span {
    color: #8995a3;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.ldb-app-header-plan strong {
    color: #e4c95e;
    font-size: 12px;
    text-transform: uppercase;
}

.ldb-app-header-logout {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;

    color: #d5dbe2;
    background: rgba(255, 255, 255, 0.035);

    font-size: 19px;
    text-decoration: none;

    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.ldb-app-header-logout:hover {
    color: #ffffff;
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.10);
}

.ldb-app-main {
    grid-column: 2;
    min-width: 0;
    min-height: 100vh;
    margin-left: 0;
    padding: 34px;
    box-sizing: border-box;
    background:
        radial-gradient(
            circle at top right,
            rgba(212, 175, 55, 0.05),
            transparent 28%
        ),
        #080d13;
}

.ldb-app-content {
    width: 100%;
    max-width: 1580px;
    margin: 0 auto;
}

/* Compatibilidade temporária com páginas antigas */

.ldb-app-main .container,
.ldb-app-main .content-container,
.ldb-app-main .page-container {
    max-width: 100%;
}

.ldb-app-main h1,
.ldb-app-main h2,
.ldb-app-main h3,
.ldb-app-main h4 {
    color: #f7f8fa;
}

.ldb-app-main p,
.ldb-app-main label,
.ldb-app-main small {
    color: #aeb8c5;
}

/* Rodapé */

.ldb-app-main .footer-legal {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 40px;
    padding: 22px 12px 4px;
    color: #6f7b89;
    font-size: 11px;
}

.ldb-app-main .footer-legal a {
    color: #9ba7b5;
    text-decoration: none;
}

.ldb-app-main .footer-legal a:hover {
    color: #e2c65d;
}

/* =========================================================
   BOTÃO MOBILE
========================================================= */

.ldb-mobile-menu-toggle {
    display: none;
}

/* =========================================================
   RESPONSIVO
========================================================= */

@media (max-width: 960px) {
    .ldb-app-layout {
        display: block;
    }

    .ldb-app-sidebar {
        transform: translateX(-105%);
        transition: transform 0.25s ease;
    }

    body.menu-open .ldb-app-sidebar {
        transform: translateX(0);
    }

    .ldb-app-main {
        margin-left: 0;
        padding: 76px 18px 24px;
    }

    .ldb-mobile-menu-toggle {
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 1200;

        width: 44px;
        height: 44px;
        display: grid;
        place-items: center;

        color: #f4d467;
        background: #10161d;
        border: 1px solid rgba(212, 175, 55, 0.32);
        border-radius: 11px;
        font-size: 21px;
        cursor: pointer;
    }
        .ldb-app-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }

    .ldb-app-header-actions {
        width: 100%;
    }

    .ldb-app-header-plan {
        flex: 1;
    }
}

/* =========================================================
   PROTEÇÃO DO DESIGN SYSTEM CONTRA O CSS LEGADO
========================================================= */

body.ldb-app-body .ldb-app-main {
    background:
        radial-gradient(circle at top right,
            rgba(212, 175, 55, 0.05),
            transparent 28%),
        #080d13 !important;
}

body.ldb-app-body .ldb-app-content {
    background: transparent !important;
}