/* =========================================================
   Layout externo - Programa Fidelidade / Sorteios
   Arquivo: app/templates/theme4/css/sorteio-modern-layout.css
   Pode ser usado sem alterar os formulários internos do Adianti.
   ========================================================= */

:root {
    --sorteio-bg: #f6f8fc;
    --sorteio-surface: #ffffff;
    --sorteio-surface-soft: #f9fbff;
    --sorteio-border: rgba(15, 23, 42, .08);
    --sorteio-border-strong: rgba(15, 23, 42, .12);
    --sorteio-text: #101828;
    --sorteio-icon-background: #f1f1f1;
    --sorteio-icon-text: #8c8c8c;
    --sorteio-text-muted: #667085;
    --sorteio-text-soft: #98a2b3;
    --sorteio-primary: var(--main-color);
    --sorteio-primary-dark: #1d4ed8;
    --sorteio-primary-soft: #f1f1f1;
    --sorteio-shadow-sm: 0 8px 24px rgba(15, 23, 42, .05);
    --sorteio-shadow-md: 0 18px 45px rgba(15, 23, 42, .08);
    --sorteio-sidebar-width: 264px;
    --sorteio-header-height-mobile: 74px;
    --sorteio-border-radius: var(--field-border-radius);
}

/* Base */
body.sorteio-logged.builder-template-layout {
    margin: 0;
    min-height: 100vh;
    color: var(--sorteio-text);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .08), transparent 34rem),
        linear-gradient(180deg, #ffffff 0%, var(--sorteio-bg) 42%, #ffffff 100%);
    font-family: "Sora", "Noto Sans", Arial, sans-serif;
    overflow-x: hidden;
}

body.sorteio-logged.builder-template-layout * {
    box-sizing: border-box;
}

/* Menu lateral */
.sorteio-logged-header {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: var(--sorteio-sidebar-width);
    min-height: 100vh;
    padding: 26px 18px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    background: rgba(255, 255, 255, .88);
    border-right: 1px solid var(--sorteio-border);
    box-shadow: 12px 0 34px rgba(15, 23, 42, .04);
    backdrop-filter: blur(18px);
}

.sorteio-logged-header-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 48px;
    padding: 0 8px 20px;
    border-bottom: 1px solid var(--sorteio-border);
}

.sorteio-form-container {
    width: calc(100% - 50px);
    margin-left: 25px;
    margin-top: 25px;
    border: 1px solid var(--panel-border-color);
    box-shadow: var(--box-shadow);
    border-radius: var(--panel-border-radius);
    background-color: var(--panel-background);
}

.sorteio-logged-logo img,
.sorteio-logged-logo svg {
    height: 40px;
    border-radius: var(--sorteio-border-radius);
    object-fit: contain !important;
    background-repeat: no-repeat;
    background-position: top center;
}

.sorteio-logged-logo i {
    background: var(--main-color);
    border-radius: var(--sorteio-border-radius);
    padding: 8px;
    color: white;
}

.sorteio-logged-header-nome {
    min-width: 0;
    line-height: 1.25;
}

.sorteio-logged-header-nome > div:first-child {
    max-width: 160px;
    overflow: hidden;
    color: var(--sorteio-text);
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sorteio-logged-header-nome > div:last-child {
    max-width: 160px;
    margin-top: 4px;
    overflow: hidden;
    color: var(--sorteio-text-muted);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Itens do menu */
.sorteio-logged-header-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.sorteio-logged-header-item {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #475467;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.sorteio-logged-header-item i {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 18px;
    transition: color .18s ease, transform .18s ease;
}

.sorteio-logged-header-item:hover {
    color: var(--sorteio-primary);
    background: var(--sorteio-primary-soft);
    border-color: rgba(37, 99, 235, .08);
    transform: translateX(2px);
}

.sorteio-logged-header-item:hover i {
    color: var(--sorteio-primary);
    transform: scale(1.05);
}

.sorteio-logged-header-item.active,
.sorteio-logged-header-item.is-active,
.sorteio-logged-header-item[data-active="true"] {
    color: var(--sorteio-primary);
    background: linear-gradient(135deg, rgba(37, 99, 235, .12), rgba(37, 99, 235, .04));
    border-color: rgba(37, 99, 235, .10);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .03);
}

.sorteio-logged-header-item.active i,
.sorteio-logged-header-item.is-active i,
.sorteio-logged-header-item[data-active="true"] i {
    color: var(--sorteio-primary);
}

/* Perfil / dropdown */
.sorteio-logged-header-perfil {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--sorteio-border);
}

.sorteio-logged-header-perfil .fast-drop {
    position: relative;
    width: 100%;
}

.sorteio-logged-header-perfil .fast-drop-label {
    width: 100%;
    min-height: 54px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--sorteio-text);
    background: var(--sorteio-surface-soft);
    border: 1px solid var(--sorteio-border);
    border-radius: 16px;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.sorteio-logged-header-perfil .fast-drop-label:hover {
    background: #fff;
    border-color: rgba(37, 99, 235, .18);
    box-shadow: var(--sorteio-shadow-sm);
    color: white;
}

.header-profile-photo.sorteio-header-logged-pessoa-nome {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    color: #fff;
    background: linear-gradient(135deg, #111827, #334155);
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
}

.sorteio-header-logged-pessoa {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sorteio-logged-header-perfil .fa-angle-down {
    margin-left: auto;
    color: var(--sorteio-text-soft);
    font-size: 13px;
}

.sorteio-fast-drop-open {
    min-width: 220px;
    padding: 10px;
    background: rgba(255, 255, 255, .98);
    border: 1px solid var(--sorteio-border);
    border-radius: 16px;
    box-shadow: var(--sorteio-shadow-md);
}

.sorteio-fast-drop-open .header-profile-name {
    padding: 10px 12px 12px;
    color: var(--sorteio-text);
    border-bottom: 1px solid var(--sorteio-border);
    font-size: 14px;
    font-weight: 750;
}

.sorteio-fast-drop-open a {
    min-height: 42px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475467;
    border-radius: 12px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
}

.sorteio-fast-drop-open a:hover {
    color: var(--sorteio-primary);
    background: var(--sorteio-primary-soft);
}

/* Área principal */
.sorteio-logged .container-main {
    width: calc(100% - var(--sorteio-sidebar-width));
    min-height: 100vh;
    margin-left: var(--sorteio-sidebar-width);
    /* padding: 34px 38px; */
}

.sorteio-logged .master-container,
.sorteio-logged .container-live {
    width: 100%;
    min-height: calc(100vh - 68px);
}

#adianti_content,
#adianti_div_content {
    width: 100%;
}

/* Harmonização com cards/formulários embutidos */
/* .sorteio-logged .container-live .panel,
.sorteio-logged .container-live .card,
.sorteio-logged .container-live .tpanel,
.sorteio-logged .container-live .tdatagrid_container {
    border-color: var(--sorteio-border) !important;
    border-radius: var(--sorteio-border-radius) !important;
    box-shadow: var(--sorteio-shadow-sm);
} */

.sorteio-logged .container-live .panel-heading,
.sorteio-logged .container-live .card-header {
    border-color: var(--sorteio-border) !important;
    background: #fff !important;
    border-radius: var(--sorteio-border-radius) var(--sorteio-border-radius) 0 0 !important;
}

/* Ajustes gerais de botões sem afetar classes específicas do sistema */
.sorteio-logged .container-live button:not(.swal-button),
.sorteio-logged .container-live .btn {
    border-radius: 12px;
}

/* Responsivo */
@media (max-width: 992px) {
    .sorteio-logged-header {
        inset: 0 0 auto 0;
        width: 100%;
        min-height: var(--sorteio-header-height-mobile);
        height: auto;
        padding: 12px 14px;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        border-right: 0;
        border-bottom: 1px solid var(--sorteio-border);
        overflow: visible;
    }

    .sorteio-logged-header-info {
        flex: 1;
        min-width: 0;
        padding: 0;
        border-bottom: 0;
    }

    /* .sorteio-logged-header-logo {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 13px;
    } */

    .sorteio-logged-header-nome > div:first-child,
    .sorteio-logged-header-nome > div:last-child {
        max-width: 36vw;
    }

    .sorteio-logged-header-items {
        display: none;
    }

    .sorteio-logged-header-perfil {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }

    .sorteio-logged-header-perfil .fast-drop-label {
        width: auto;
        min-height: 46px;
        padding: 4px 8px 4px 4px;
        border-radius: 999px;
    }

    .sorteio-fast-drop-open .items-responsive {
        display: flex !important;
    }

    .sorteio-logged .container-main {
        width: 100%;
        min-height: 100vh;
        margin-left: 0;
        /* padding: calc(var(--sorteio-header-height-mobile) + 22px) 16px 22px; */
    }

    .sorteio-header-logged-pessoa {
        display: none;
    }

    .sorteio-logged .container-live {
        margin-top: 55px;
    }

    .sorteio-logged .action-bar {
        margin-top: 25px !important;
    }
}

@media (max-width: 576px) {
    :root {
        --sorteio-header-height-mobile: 68px;
    }

    .sorteio-logged-header {
        padding: 10px 12px;
    }

    .sorteio-logged-header-nome > div:first-child {
        font-size: 13px;
    }

    .sorteio-logged-header-nome > div:last-child {
        font-size: 11px;
    }

    .sorteio-logged-header-perfil .fa-angle-down {
        display: none;
    }

    .sorteio-logged .container-main {
        padding-left: 12px;
        padding-right: 12px;
    }

    .sorteio-logged .container-live {
        margin-top: 55px;
    }

    .sorteio-logged .sorteio-form-container {
        width: 100% !important;
        margin-left: 0px;
        margin-right: 0px;
    }
}

.sorteio-logged-header,
.sorteio-logged .container-main,
.sorteio-logged .master-container,
.sorteio-logged .container-live {
    overflow: visible;
}

.sorteio-logged-header-perfil,
.sorteio-logged-header-perfil .fast-drop {
    position: relative;
}

.sorteio-logged-header-perfil .fast-drop-open,
.sorteio-fast-drop-open {
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    bottom: auto;
    max-width: min(280px, calc(100vw - 24px));
    max-height: min(420px, calc(100vh - 96px));
    overflow-y: auto;
    z-index: 99999;
}

.sorteio-logged-header-perfil .fast-drop-open.drop-up,
.sorteio-fast-drop-open.drop-up {
    top: auto !important;
    bottom: calc(100% + 10px) !important;
}

@media (max-width: 768px) {
    .sorteio-logged-header-perfil .fast-drop-open,
    .sorteio-fast-drop-open {
        position: fixed;
        top: auto !important;
        right: 16px;
        bottom: 16px;
        left: 16px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 32px);
        border-radius: 18px;
    }
}

.sorteio-logged-header-perfil {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--sorteio-border);
}

.sorteio-logged-header-perfil .btn-group {
    width: 100%;
    position: relative;
}

.sorteio-logged-header-perfil .dropdown-toggle {
    width: 100%;
    min-height: 58px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--sorteio-border) !important;
    border-radius: 16px !important;
    background: var(--sorteio-surface-soft) !important;
    box-shadow: none !important;
    color: var(--sorteio-text) !important;
    transition: all .18s ease;
}

.sorteio-logged-header-perfil .dropdown-toggle:hover,
.sorteio-logged-header-perfil .dropdown-toggle:focus,
.sorteio-logged-header-perfil.open .dropdown-toggle {
    background: #fff !important;
    border-color: rgba(37, 99, 235, .18) !important;
    box-shadow: var(--sorteio-shadow-sm) !important;
}

.sorteio-logged-header-perfil .dropdown-toggle::after,
.sorteio-logged-header-perfil .caret {
    margin-left: auto;
    color: var(--sorteio-text-soft);
}

.sorteio-header-logged-pessoa {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
}

.sorteio-logged-header-perfil .dropdown-menu {
    min-width: 240px;
    padding: 10px;
}

.sorteio-logged-header-perfil .dropdown-menu li {
    width: 100%;
    list-style: none;
}

.sorteio-logged-header-perfil .dropdown-menu li + li {
    margin-top: 4px;
}

.sorteio-logged-header-perfil .dropdown-menu a {
    min-height: 44px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475467 !important;
    border-radius: 12px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 650;
    transition: all .18s ease;
}

.sorteio-logged-header-perfil .dropdown-menu i {
    width: 18px;
    text-align: center;
}

@media (max-width: 992px) {

    .sorteio-logged-header-perfil {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }

    .sorteio-logged-header-perfil .dropdown-toggle {
        width: auto;
        min-height: 46px;
        padding: 4px 10px 4px 4px;
        border-radius: 999px !important;
    }

    .sorteio-logged-header-perfil .items-responsive {
        display: flex !important;
    }

    .sorteio-header-logged-pessoa {
        display: none;
    }
}

.login-wrapper-sorteio .card-footer {
    border-top: 0px !important;
}