/* ################# VARIÁVEIS DE IDENTIDADE ################# */
/* Tema Dark */
.dark-theme {
    --bg-body: rgba(26, 22, 20, 1);
    /* #1a1614 */
    --bg-card: rgba(37, 31, 28, 1);
    /* #251f1c */
    --bg-cardtd: rgba(61, 52, 48, 1);
    /* # */
    --bg-modal: rgba(26, 22, 20, 0.99);
    /* #1a1614 */
    --bg-input: rgba(45, 37, 33, 1);
    /* #2d2521 */
    --border-soft: rgba(61, 52, 48, 1);
    /* #3d3430 */
    /* #3d3430 */
    --border-shadow: rgba(101, 101, 101, 0.38);
    --primary-blue: rgba(0, 123, 255, 1);
    /* #007bff */
    --secundary-blue: rgba(0, 105, 217, 1);
    /* #0069d9 */
    --primary-orange: rgba(255, 136, 0, 1);
    /* #ff8800 */
    --secundary-orange: rgba(243, 156, 18, 1);
    /* #f39c12 */
    --total-orange: rgba(243, 156, 18, 0.38);
    --primary-red: rgba(220, 53, 69, 1);
    /* #dc3545 */
    --secundary-red: rgba(239, 4, 28, 0.776);
    /* #ef041c */
    --primary-gray: rgba(85, 85, 85, 1);
    /* cinza escuro médio */
    --secundary-gray: rgba(51, 51, 51, 1);
    /* cinza bem escuro */
    --primary-green: #4caf50;
    --secundary-green: #45a049;
    --text-MODE: rgba(224, 220, 217, 1);
    /* #e0dcd9 */
    --secundary-text-main: rgba(136, 136, 136, 1);
    /* cinza claro sobre fundo escuro */
    --text-white: rgba(255, 255, 255, 1);
    /* branco real */
    --text-black: rgba(26, 22, 20, 1);
    /* branco real */
    --text-default: rgba(255, 255, 255, 1);
    --select-color: rgba(45, 37, 33, 1);
    --select-font: rgba(238, 238, 238, 1);
    --select-border: rgba(51, 51, 51, 1);
    --tbody-tr: rgba(65, 45, 15, 0.05);
    /*rgba(243, 156, 18, 0.05); */
    ---bloco-lista: rgba(238, 238, 238, 1);


    --color-success: rgba(40, 167, 69, 1);
    /* verde sucesso */
    --color-warning: rgb(202, 152, 0);
    /* amarelo alerta */
    --color-info: rgba(23, 162, 184, 1);
    /* azul info */
    --color-error: rgba(220, 53, 69, 1);
    /* vermelho erro */
    --color-neutral-light: rgba(245, 245, 245, 1);
    --color-neutral-dark: rgba(45, 37, 33, 1);
    --menu-header-line: #f39c12;
}

/* Tema Light */
.light-theme {
    --menu-header-line: #f39c12;
    --bg-body: rgba(245, 245, 245, 1);
    --bg-card: rgba(255, 255, 255, 1);
    --bg-cardtd: rgba(209, 193, 186, 0.39);
    --bg-modal: rgba(250, 250, 250, 1);
    --bg-input: rgba(240, 240, 240, 1);
    --border-soft: rgba(200, 200, 200, 1);
    --border-shadow: rgba(61, 52, 48, 0.38);
    --primary-blue: rgba(0, 123, 255, 1);
    --secundary-blue: rgba(0, 105, 217, 1);
    --primary-orange: rgba(255, 136, 0, 1);
    --secundary-orange: rgba(243, 156, 18, 0.25);
    --total-orange: rgba(243, 156, 18, 0.38);
    --primary-red: rgba(220, 53, 69, 1);
    --secundary-red: rgba(239, 4, 28, 0.776);
    --primary-gray: rgba(85, 85, 85, 0.45);
    --secundary-gray: rgba(51, 51, 51, 1);
    --primary-green: #4caf50;
    --secundary-green: #45a049;



    --text-MODE: rgba(51, 51, 51, 1);
    --secundary-text-main: rgba(85, 85, 85, 1);
    --text-white: rgba(0, 0, 0, 1);
    --text-black: rgba(26, 22, 20, 1);
    /* branco real */
    --text-default: rgba(255, 255, 255, 1);
    --select-color: rgba(245, 245, 245, 1);
    --select-font: rgba(34, 34, 34, 1);
    --select-border: rgba(37, 31, 28, 1);
    /*--tbody-tr: rgba(240, 240, 240, 1);     */
    /*--tbody-tr: rgba(42, 42, 42, 1);       */
    --tbody-tr: rgba(243, 156, 18, 0.05);
    ---bloco-lista: rgba(42, 42, 42, 1);

    --color-success: rgba(40, 167, 69, 1);
    --color-warning: rgb(202, 152, 0);
    --color-info: rgba(23, 162, 184, 1);
    --color-error: rgba(220, 53, 69, 1);
    --color-neutral-light: rgba(245, 245, 245, 1);
    --color-neutral-dark: rgba(45, 37, 33, 1);
}


/* ################# RESET E ESTRUTURA ################# */
body {
    padding-top: 90px !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-MODE);
    margin: 0;
}

.container {
    max-width: 800px;
    margin: auto;
    padding: 0 20px 50px 20px;
}



/*  ############   ############ HEADER - MODAL(BARRA TOPO) ############   ############    */

/* Estilização rápida para o botão de tema não bugar o layout */
.btn-icon-tema {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: -10px;
}

.iconeGoggle {
    background: none;
    cursor: pointer;
    color: var(--primary-orange);
    padding-right: 5px;
}

.btn-icon-tema:hover,
.iconeGoggle:hover,
.btn-log:hover {
    transform: scale(1.5);
}



/* Cor dos ícones baseada no tema */
.dark-theme .fa-moon {
    color: rgba(255, 136, 0, 1);
}

/* Amarelo Lunar */
.light-theme .fa-sun {
    color: rgba(255, 136, 0, 1);
}

/* Laranja Solar */

/* #################  ################# HEADER FIXO (TOPO) ################# ################# */
.header-topo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--primary-orange);
    display: flex;
    justify-content: center;
    z-index: 1000;
}

.header-content {
    width: 100%;
    max-width: 800px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}


.btn-sair {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 45px !important;
    max-width: 40px !important;
    height: 32px !important;

    border: 1px solid var(--primary-red) !important;
    /* Borda forçada */
    color: var(--primary-red) !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: bold !important;
    text-decoration: none !important;
    transition: 0.3s !important;

    float: right !important;

    background: transparent !important;
}



.btn-sair:hover {
    background: var(--secundary-red) !important;
    color: var(--text-white) !important;
}

/* ################# CARDS E FORMULÁRIO ################# */
.card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    margin-bottom: 30px;
    box-shadow: 0 10px 30px var(--border-shadow);
    color: var(--text-MODE);
}

/* ################# DESTAQUES DINÂMICOS ################# */

.destaque-novo,
.destaque-lista {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 30px 0 20px 0;
    padding-bottom: 8px;
    position: relative;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-MODE);
}

/* A Linha Dinâmica */
.destaque-novo::after,
.destaque-lista::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    height: 1px;
    width: 100%;
}

/* O Badge Dinâmico */
.destaque-novo::before,
.destaque-lista::before {
    content: attr(data-label);
    /* Pega o texto do HTML */
    border-radius: 4px;
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
    line-height: 1.2;
    padding: 3px 8px;

}

/* --- ESTILO NOVO (Azul) --- */
.destaque-novo::before {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--text-MODE);

}

.destaque-novo::after {
    background: var(--primary-blue);
}

/* --- ESTILO LISTA (Laranja) --- */
.destaque-lista::before {
    background: transparent;
    border: 2px solid var(--primary-orange);
    color: var(--primary-orange);
}

.destaque-lista::after {
    background: var(--primary-orange);
}

/* --- ESTADO DE EDIÇÃO (Muda para Laranja) --- */
.destaque-novo.editando::before {
    border: 2px solid var(--primary-orange);
    color: var(--primary-orange);
}

.destaque-novo.editando::after {
    background: var(--primary-orange);
}

/* ################# ################# BOTÕES DE AÇÃO ################# ################# */

input {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border-radius: 6px;
    border: 1px solid var(--border-soft);
    background: var(--bg-input);
    color: var(--text-MODE);
    box-sizing: border-box;
    outline: none;
}

input:focus {
    border-color: var(--primary-blue);
}


/* ********  Correção do Autocomplete  ******** */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-MODE) !important;
    -webkit-box-shadow: 0 0 0px 1000px var(--bg-card) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/*############### CONTAINNER ############### CONTAINNER ############### CONTAINNER  ############### CONTAINNER ################# */
/*############### CONTAINNER DO FORMULÁRIO ###############*/

.form-container {
    background: var(--bg-card);
    /* Usa o fundo do card do tema */
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    margin-bottom: 20px;
}

/* Linha Flexível */
.form-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 15px;
    flex-wrap: wrap;
    /* Garante que em telas menores os campos quebrem linha */
}

/* Grupo de Controle */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Estilização da Label com o After Automático */
.form-group label {
    font-weight: bold;
    font-size: 0.85rem;
    margin-bottom: 2px;
    color: var(--text-MODE);
    cursor: pointer;
    letter-spacing: 0.3px;
}

/* Criamos uma classe específica para o texto da label que contém os dois pontos */
.label-text::after {
    content: ":";
    /* Removi o \a para evitar quebras forçadas desnecessárias */
    color: var(--primary-orange);
    margin-left: 2px;
}


/* Estilização Global de Inputs e Selects */
.form-group input[type="date"] {
    padding: 7px 12px;
    /* Ajuste fino para date picker */
    line-height: normal;
    appearance: none;
    -webkit-appearance: none;
}


.form-group input,
.form-group select {
    display: block;
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--border-soft);
    background-color: var(--bg-input);
    color: var(--text-MODE);
    font-family: inherit;
    transition: border-color 0.3s ease;
}


/* Estilo base do checkbox para casar com os inputs */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background-color: var(--bg-input, #2a2a2a);
    /* Cor de fundo do seu input */
    border: 1px solid var(--border-soft, #444);
    /* Borda padrão do tema */
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    transition: all 0.2s ease;
}

/* Efeito ao passar o mouse (Hover) */
input[type="checkbox"]:hover {
    border-color: var(--primary-orange, #ff3300);
}

/* Quando estiver marcado (Checked) */
input[type="checkbox"]:checked {
    background-color: var(--primary-orange, #ff3300);
}

/* 4. Criamos o "V" branco do check para quando estiver selecionado */
input[type="checkbox"]:checked::after {
    content: '✔';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-black) !important;
    font-size: 14px;
    font-weight: bold;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px var(--border-shadow);
}

/* Placeholder adaptável */
.form-group input::placeholder {
    color: var(--secundary-text-main);
    opacity: 0.7;
}


/* ============================================
   CAMPOS OBRIGATÓRIOS - BORDA ESQUERDA
   ============================================ */
.form-group.required input,
.form-group.required select,
.form-group.required textarea,
.form-group.required [type="date"],
.form-group.required [type="password"],
.form-group.required [type="email"],
.form-group.required [type="number"],
.form-group.required [type="tel"] {
    border-left: 4px solid var(--primary-orange);
    padding-left: 8px;
}

/* Asterisco no label para campos obrigatórios */
.form-group.required .label-text::after {
    content: " *";
    color: var(--primary-orange);
    font-weight: bold;
}

/* Tooltip opcional para campos obrigatórios */
.form-group.required:hover::after {
    content: "Campo obrigatório";
    position: absolute;
    background: var(--primary-orange);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: -8px;
    margin-left: 10px;
    white-space: nowrap;
    z-index: 10;
}

/* ============================================
   GRUPOS ESPECÍFICOS (opcional)
   ============================================ */
.form-group.small {
    flex: 0.5;
}

.form-group.medium {
    flex: 1.5;
}

.form-group.large {
    flex: 2;
}


/*---------------------------------------------------------------------------------------------------------*/

/* NOVO: BOTÃO MENU */
.btn-menu-open {
    background: none;
    border: 1px solid var(--border-soft);
    color: var(--primary-orange);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-acao {
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
    border: none;
    text-align: center;
    display: block;
    width: 100%;
    margin-bottom: 10px;
    text-decoration: none;
}

/* Ajustes para os Selects no padrão Usuarios.php */
select {
    background-color: var(--bg-card) !important;
    /* Usa a variável de fundo do card */
    color: var(--text-MODE) !important;
    border: 1px solid var(-select-color) !important;
}

/* Força a mesma fonte e estilo nos Selects */
select,
.form-group select {
    font-family: inherit;
    /* Herda a fonte do sistema/body */
    font-size: 0.9rem;
    background-color: var(--bg-input) !important;
    color: var(--text-MODE) !important;
    border: 1px solid var(--border-soft) !important;
    padding: 8px;
    border-radius: 4px;
    outline: none;
}

/* Estilização dos Selects padrão usuários.php */
select.form-control-custom,
.form-group select {
    background-color: var(--select-color) !important;
    color: var(--select-font) !important;
    border: 1px solid var(-select-color) !important;
    /*--select-border:  #333;*/
    padding: 10px;
    border-radius: 5px;
}

/* Corrigindo a invisibilidade dos textos no Modo Light */
body.light-mode .tabela-estilizada b,
body.light-mode .tabela-estilizada td {
    color: var(-select-color) !important;
    /* Texto escuro para fundo claro */
}

body.dark-mode .tabela-estilizada b,
body.dark-mode .tabela-estilizada td {
    color: #eee !important;
    /* Texto claro para fundo escuro */
}

/* Estilo da Lupa no Filtro */
.busca-container {
    position: relative;
    width: 100%;
}

.busca-container i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-orange);
}

.busca-container input {
    padding-left: 35px !important;
}


.tabela-estilizada b {
    color: var(--text-MODEs)
}


.hidden {
    display: none;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background: var(--bg-input);
    color: var(--primary-orange);
    font-size: 11px;
    text-transform: uppercase;
    border-bottom: 3px solid var(--primary-orange);
    padding: 15px;
    text-align: left;
}

tbody tr {
    border-bottom: 1px solid var(--secundary-orange);

    transition: 0.2s;
}

tbody tr:hover {
    background: var(--tbody-tr);
    border-bottom: 1px solid var(--primary-orange);
}

td {
    padding: 12px;
    font-size: 14px;
}

/* ################# EXTRAS ################# */
.avatar {
    width: 35px;
    height: 35px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid var(--border-soft);
    color: var(--text-white);
}

/* ################# TOGGLE SWITCH ADM ################# */
.switch-adm {
    position: relative;
    display: inline-block;
    width: 85px;
    height: 24px;
}

.switch-adm input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    z-index: 2;
}

input:checked+.slider {
    background-color: var(--primary-orange);
}

input:checked+.slider:before {
    transform: translateX(58px);
}

/* Texto dentro do Toggle */
.slider:after {
    content: 'COMUM';
    color: white;
    display: block;
    position: absolute;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 60%;
    font-size: 9px;
    font-weight: bold;
}

input:checked+.slider:after {
    content: 'ADMIN';
    left: 40%;
}




/* ############ ############ MSG ############ ############ */





/* Estilo para as mensagens de feedback */
.msg-alerta {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.5s ease-in;
}

.msg-sucesso {
    background: var(--color-success) !important;
    color: var(--primary-blue) !important;
    color: var(--text-white);
}

.msg-neutral {
    background: var(--color-neutral-light) !important;
    color: var(--primary-blue) !important;
    color: var(--text-white);
}

.msg-erro {
    background: var(---bloco-lista) !important;
    color: var(--primary-red) !important;
    border-left: 5px solid var(--primary-red);

}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}




/* ################# MODAL   ################# MODAL   ################# MODAL  ################# */

/* Ajuste no Modal Original */
#modalMenu {
    display: none;
    /* Começa escondido **FN  toggleMenu()** */
    position: fixed;
    z-index: 9999;
    position: fixed;
    top: 0;
    right: -100%;
    /* Começa fora da tela à direita */
    width: 100%;
    /* Ou a largura que você desejar, ex: 300px */
    height: 100%;
    background-color: var(--bg-modal);
    /*--bg-modal: #251f1c;*/
    z-index: 9999;
}

/* Use uma classe para mostrar */
#modalMenu.show {
    display: block !important;
}

/* Classe que o JavaScript vai adicionar para abrir */
#modalMenu.active {
    right: 0;
}

.modal-menu-full {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-modal) !important;
    z-index: 9998;
    padding: 40px;
    box-sizing: border-box;
    border-radius: 12px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 40px auto;
    box-shadow: 0 10px 30px var(--border-shadow);
}

.area-box h3 {
    border-bottom: 2px solid #f39c12;
    /* Aquela linha laranja que você gostou */
    padding-bottom: 8px;
    margin-bottom: 15px;
    color: var(--text-MODE);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    /* Espaço entre o ícone e o texto */
}

.area-box h3 i {
    color: #f39c12;
    /* Ícone na cor de destaque */
}

.modulo-header {
    font-size: 10px;
    font-weight: bold;
    color: #777;
    margin: 10px 0 5px 0;
    letter-spacing: 1px;
}


.modulo-item-link {
    display: block;
    color: var(--text-MODE);
    text-decoration: none;
    padding: 5px 0;
    transition: 0.3s;
}

.modulo-item-link:hover {
    color: #f39c12;
    padding-left: 5px;
}

/* MANTENDO  ESTILOS DE TABELA, TOGGLE, CARDS E BOTÕES IGUAIS AO ENVIADO... */

.azul {
    background-color: var(--primary-blue) !important;
    color: var(--text-default) !important;
}

.vermelho {
    background-color: var(--primary-red) !important;
    color: var(--text-default) !important;
}

.laranja {
    background-color: var(--primary-orange) !important;
    color: var(--text-white) !important;
}

.gray {
    background-color: var(--primary-gray) !important;
    color: var(--text-default) !important;
}

.verde {
    background-color: var(--primary-gray) !important;
    color: var(--text-default) !important;
}



/* ESTILO DO TOGGLE */
.switch-adm {
    position: relative;
    display: inline-block;
    width: 85px;
    height: 24px;
}

.switch-adm input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    z-index: 2;
}

input:checked+.slider {
    background-color: var(--primary-orange);
}

input:checked+.slider:before {
    transform: translateX(58px);
}

.slider:after {
    content: 'COMUM';
    color: white;
    display: block;
    position: absolute;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 60%;
    font-size: 9px;
    font-weight: bold;
}

input:checked+.slider:after {
    content: 'ADMIN';
    left: 40%;
}

/*
########################## SPAN com alinhamento  ########################## 
 */

/* Classe para alinhar conteúdo com largura fixa */
/* Classe simples para alinhar rótulo e valor */
.info-linha {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    width: 100%;
}

.info-linha .rotulo {
    min-width: 50px;
    /* Ajuste este valor conforme necessário */
    color: #888;
    font-size: 0.40rem;
    text-transform: uppercase;
}

.info-linha .valor {
    color: #fff;
    font-size: 0.65rem;
}


.margem-positiva {
    color: #17ec1e;
    font-weight: 900;
}

.margem-negativa {
    color: #f44336;
    font-weight: 900;
}

.margem-alerta {
    color: #FFFF00;
    font-weight: 900;
}

.margem-zero {
    color: #999;
    font-style: italic;
}