:root {
    --bg: #0b1220;
    --panel: #111b2e;
    --panel-2: #16243c;
    --line: rgba(255, 255, 255, 0.08);
    --text: #e8eef9;
    --muted: #9fb0cb;
    --accent: #f6c945;
}

html, body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: Inter, Segoe UI, Arial, sans-serif;
    background: radial-gradient(circle at top left, rgba(58,163,255,.16), transparent 20%),
                radial-gradient(circle at top right, rgba(246,201,69,.10), transparent 25%),
                var(--bg);
    color: var(--text);
}

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: rgba(10, 17, 31, 0.92);
    padding: 24px;
    border-color: var(--line) !important;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #f6c945, #f2b600);
    color: #101010;
    font-weight: 800;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.brand-subtitle {
    color: var(--muted);
    font-size: .9rem;
}

.custom-link {
    color: var(--text);
    background: rgba(255,255,255,.03);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.custom-link:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
}

.content-area {
    display: grid;
    grid-template-rows: 82px 1fr;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px;
    border-color: var(--line) !important;
    background: rgba(17, 27, 46, 0.72);
    backdrop-filter: blur(10px);
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.page-body {
    padding-inline: 28px !important;
}

.user-pill {
    background: rgba(255,255,255,.04);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px 14px;
    text-align: right;
}

.user-pill-name {
    font-weight: 700;
}

.user-pill-meta {
    color: var(--muted);
    font-size: .9rem;
}

.hero-card,
.stat-card,
.module-card,
.auth-card {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(22,36,60,.95), rgba(13,23,40,.95));
    border-radius: 22px;
    box-shadow: 0 20px 45px rgba(0,0,0,.22);
}

.hero-card {
    padding: 28px;
}

.stat-card {
    padding: 22px;
}

.stat-label {
    color: var(--muted);
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.module-card,
.auth-card {
    padding: 26px;
}

.custom-input {
    background-color: rgba(255,255,255,.03);
    border-color: var(--line);
    color: var(--text);
}

.custom-input:focus {
    background-color: rgba(255,255,255,.05);
    color: var(--text);
    border-color: rgba(246, 201, 69, .6);
    box-shadow: 0 0 0 .2rem rgba(246, 201, 69, .12);
}

.text-secondary {
    color: var(--muted) !important;
}

.validation-summary-errors,
.field-validation-error {
    color: #ff8c8c;
}

@media (max-width: 991.98px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding-inline: 16px;
    }

    .page-body {
        padding-inline: 16px !important;
    }
}

.empty-state-box {
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 16px;
    color: rgba(255, 255, 255, 0.75);
}

.report-mode-shell {
    display: block;
    min-height: 100vh;
}

.content-area-full {
    display: block;
    min-height: 100vh;
}

.page-body-report {
    padding: 0 !important;
    margin: 0 !important;
}

.user-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    justify-content: start;
}

@media (max-width: 1399.98px) {
    .user-dashboard-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .user-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: start;
    }
}

@media (max-width: 575.98px) {
    .user-dashboard-grid {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }
}

.user-group-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 28px;
    min-height: 220px;
    color: #fff;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.user-group-card:hover {
    transform: translateY(-4px);
    color: #fff;
}

.user-group-card::after {
    content: "";
    position: absolute;
    inset: auto -60px -60px auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    filter: blur(2px);
}

.user-group-icon {
    font-size: 3.6rem;
    line-height: 1;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.user-group-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

.user-group-footer {
    margin-top: auto;
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.user-group-badge {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.92rem;
}

.user-reports-shell {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.user-reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 420px));
    gap: 20px;
    justify-content: center;
}

.user-report-card {
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(22,36,60,.95), rgba(13,23,40,.95));
    box-shadow: 0 20px 45px rgba(0,0,0,.20);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.user-report-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.user-report-subtitle {
    color: var(--muted);
    margin: 0;
    min-height: 42px;
}

.user-report-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.user-pill-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 999px;
    padding: 8px 14px;
    color: #fff;
    font-weight: 700;
}

.report-viewer-shell {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #050b15;
}

.report-viewer-frame {
    width: 100%;
    height: 100vh;
    border: 0;
    background: #050b15;
}

.report-back-rail {
    position: fixed;
    top: 20px;
    left: 0;
    z-index: 1050;
    height: 44px;
    width: 14px;
    overflow: hidden;
    background: rgba(11, 18, 32, 0.96);
    border: 1px solid rgba(255,255,255,0.10);
    border-left: 0;
    border-radius: 0 14px 14px 0;
    box-shadow: 0 10px 35px rgba(0,0,0,.28);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px 0 10px;
    color: #fff;
    text-decoration: none;
    transition: width 0.22s ease;
    white-space: nowrap;
}

.report-back-rail:hover {
    width: 110px;
    color: #fff;
}

.report-back-rail span:first-child {
    font-size: 1rem;
    font-weight: 800;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
}

.profile-card-box {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(22,36,60,.95), rgba(13,23,40,.95));
    border-radius: 22px;
    box-shadow: 0 20px 45px rgba(0,0,0,.22);
    padding: 26px;
}

.profile-readonly-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 16px;
}

.profile-readonly-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 16px;
}

.profile-readonly-label {
    color: var(--muted);
    font-size: .84rem;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.profile-readonly-value {
    color: #fff;
    font-size: 1.02rem;
    font-weight: 700;
    word-break: break-word;
}

@media (max-width: 991.98px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-readonly-grid {
        grid-template-columns: 1fr;
    }
}

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0 15px;
    line-height: 1;
}

@media (max-width: 992px) {
    .app-shell {
        grid-template-columns: 1fr; 
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        z-index: 1050; 
        transform: translateX(-100%); 
        transition: transform 0.3s ease-in-out;
        box-shadow: 2px 0 15px rgba(0,0,0,0.5);
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
    }

    .mobile-menu-toggle {
        display: block; 
    }
}

@media (max-width: 991.98px) {
    .table-mobile-cards,
    .table-mobile-cards tbody,
    .table-mobile-cards tr,
    .table-mobile-cards td {
        display: block;
        width: 100%;
        /* Remove o flash azul/cinza nativo do touch em smartphones */
        -webkit-tap-highlight-color: transparent !important;
        outline: none !important;
    }

    .table-mobile-cards thead {
        display: none;
    }

    /* ZERA O FUNDO DE TUDO: Linha, Célula e Estados de clique/hover */
    .table-mobile-cards tr,
    .table-mobile-cards tr:hover,
    .table-mobile-cards tr:active,
    .table-mobile-cards td,
    .table-mobile-cards td:hover,
    .table-mobile-cards td:active,
    .table-mobile-cards.table-hover tbody tr:hover > *,
    .table-mobile-cards.table-hover tbody tr:active > * {
        background-color: transparent !important;
        background: transparent !important;
        --bs-table-accent-bg: transparent !important; /* Zera a variável de cor do Bootstrap 5 */
        --bs-table-bg: transparent !important;
        box-shadow: none !important;
        color: inherit !important;
    }

    .table-mobile-cards tr {
        margin-bottom: 16px;
        border: 1px solid var(--line) !important;
        border-radius: 16px;
        padding: 8px 16px;
    }

    .table-mobile-cards td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        border-bottom: 1px solid var(--line);
        text-align: right;
        color: #fff;
        word-break: break-all;
        overflow-wrap: break-word;
    }

    .table-mobile-cards td:last-child {
        border-bottom: none;
        justify-content: flex-end; 
        gap: 8px; 
    }

    .table-mobile-cards td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--muted);
        text-align: left;
        text-transform: uppercase;
        font-size: 0.8rem;
        margin-right: 15px;
    }
}

    /* Estilo para o botão flutuante de suporte na lateral esquerda */
    .support-back-rail {
        position: fixed;
        top: 58%; /* Ajuste aqui se quiser mais para cima ou para baixo */
        left: 0;
        z-index: 1050;
        height: 44px;
        width: 14px;
        overflow: hidden;
        background: rgba(11, 18, 32, 0.96);
        border: 1px solid rgba(255,255,255,0.10);
        border-left: 0;
        border-radius: 0 14px 14px 0;
        box-shadow: 0 10px 35px rgba(0,0,0,.28);
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 0 14px 0 10px;
        color: #fff;
        text-decoration: none;
        transition: width 0.22s ease;
        white-space: nowrap;
        transform: translateY(-50%);
    }
    
    /* Quando passa o mouse, ele expande para mostrar o texto "Voltar" */
    .support-back-rail:hover {
        width: 150px;
        color: #fff;
    }
    
    .support-back-rail span:first-child {
        font-size: 1rem;
        font-weight: 800;
    }