/* =========================
   RESET LOCAL
========================= */
.be3-portal-box,
.be3-rh-panel,
.be3-funcionario-panel,
.be3-holerites-panel,
.be3-portal-box *,
.be3-rh-panel *,
.be3-funcionario-panel *,
.be3-holerites-panel *{
    box-sizing:border-box;
}

/* =========================
   BOXES / PAINÉIS
========================= */
.be3-portal-box,
.be3-rh-panel,
.be3-funcionario-panel,
.be3-holerites-panel{
    width:100%;
    max-width:none;
    margin:0 0 16px;
    background:#fff;
    border:1px solid #e7e7e7;
    border-radius:16px;
    padding:24px;
    box-shadow:0 6px 20px rgba(0,0,0,0.04);
}

.be3-portal-box h2,
.be3-portal-box h3,
.be3-rh-panel h2,
.be3-rh-panel h3,
.be3-funcionario-panel h2,
.be3-funcionario-panel h3,
.be3-holerites-panel h2,
.be3-holerites-panel h3{
    margin:0 0 20px;
    color:#2b2b2b;
    line-height:1.2;
}

/* =========================
   ALERTAS
========================= */
.be3-portal-alert{
    margin:0 0 20px;
    padding:14px 16px;
    border-radius:12px;
    font-size:14px;
    line-height:1.5;
    border:1px solid transparent;
}

.be3-portal-alert-success{
    background:#ecfdf3;
    border-color:#b7ebc6;
    color:#166534;
}

.be3-portal-alert-error{
    background:#fef2f2;
    border-color:#fecaca;
    color:#991b1b;
}

/* =========================
   FORMULÁRIOS
========================= */
.be3-portal-form{
    display:grid;
    gap:18px;
    width:100%;
}

.be3-portal-field{
    display:flex;
    flex-direction:column;
    gap:8px;
    width:100%;
}

.be3-portal-field label{
    font-size:14px;
    font-weight:600;
    color:#374151;
}

.be3-portal-field input,
.be3-portal-field select,
.be3-portal-field textarea{
    width:100%;
    min-height:48px;
    padding:12px 14px;
    border:1px solid #d1d5db;
    border-radius:10px;
    background:#fff;
    color:#111827;
    font-size:15px;
    outline:none;
    transition:border-color .2s ease, box-shadow .2s ease;
}

.be3-portal-field input:focus,
.be3-portal-field select:focus,
.be3-portal-field textarea:focus{
    border-color:#d6a874;
    box-shadow:0 0 0 3px rgba(214,168,116,0.15);
}

/* INPUT FILE */
.be3-portal-field input[type="file"]{
    padding:10px 12px;
    min-height:54px;
    background:#fff;
}

/* =========================
   BOTÕES - PADRÃO ÚNICO
========================= */
.be3-portal-button,
.be3-portal-button:link,
.be3-portal-button:visited,
.be3-portal-button[type="submit"],
.be3-portal-form button,
.be3-portal-form input[type="submit"],
.be3-rh-holerite-actions a,
.be3-holerites-table a{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    min-height:48px;
    padding:12px 18px;
    border-radius:10px;
    border:1px solid #0f172a !important;
    background:#0f172a !important;
    color:#ffffff !important;
    font-weight:600;
    text-decoration:none !important;
    cursor:pointer;
    transition:all .2s ease;
    text-align:center;
    box-shadow:none !important;
    outline:none !important;
}

.be3-portal-button:hover,
.be3-portal-button:focus,
.be3-portal-form button:hover,
.be3-portal-form button:focus,
.be3-portal-form input[type="submit"]:hover,
.be3-portal-form input[type="submit"]:focus,
.be3-rh-holerite-actions a:hover,
.be3-holerites-table a:hover{
    background:#111c35 !important;
    border-color:#111c35 !important;
    color:#ffffff !important;
    transform:translateY(-1px);
}

.be3-portal-button:active,
.be3-portal-form button:active,
.be3-portal-form input[type="submit"]:active{
    transform:translateY(0);
}

/* NEUTRALIZA ELEMENTOR / TEMA */
.elementor-widget-shortcode .be3-portal-button,
.elementor-widget-shortcode .be3-portal-form button,
.elementor-widget-shortcode .be3-portal-form input[type="submit"]{
    background:#0f172a !important;
    border-color:#0f172a !important;
    color:#fff !important;
    box-shadow:none !important;
}

/* BOTÃO FULL WIDTH QUANDO NECESSÁRIO */
.be3-portal-form .be3-portal-button,
.be3-portal-form button.be3-portal-button{
    width:100%;
}

/* =========================
   RESUMO SUPERIOR DO RH
========================= */
.be3-rh-cards{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:16px;
    margin-bottom:20px;
    width:100%;
}

.be3-rh-card{
    min-height:96px;
    padding:18px 20px;
    border:1px solid #e5e7eb;
    border-radius:14px;
    background:#fff;
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:6px;
}

.be3-rh-card-label{
    font-size:14px;
    color:#6b7280;
}

.be3-rh-card strong{
    font-size:20px;
    line-height:1;
    color:#111827;
}

/* =========================
   FILTROS RH
========================= */
.be3-rh-filtros{
    display:grid;
    grid-template-columns:repeat(2, minmax(220px, 320px));
    gap:16px;
    margin-bottom:24px;
    width:100%;
}

.be3-rh-filtros > div{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.be3-rh-filtros label{
    font-size:14px;
    font-weight:600;
    color:#374151;
}

.be3-rh-filtros select{
    width:100%;
    min-height:48px;
    padding:12px 14px;
    border:1px solid #d1d5db;
    border-radius:10px;
    background:#fff;
    color:#111827;
}

/* =========================
   GRID DE HOLERITES RH
========================= */
.be3-rh-holerites-grid{
    width:100%;
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(360px, 1fr));
    gap:20px;
}

.be3-rh-holerite-card{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:16px;
    padding:20px;
    min-height:260px;
    display:flex;
    flex-direction:column;
    width:100%;
}

.be3-rh-holerite-top{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    margin-bottom:18px;
}

.be3-rh-holerite-top h3{
    margin:0;
    font-size:18px;
    color:#3b3b3b;
}

.be3-rh-holerite-info{
    display:grid;
    gap:10px;
    margin-bottom:20px;
}

.be3-rh-holerite-info p{
    margin:0;
    font-size:15px;
    line-height:1.5;
    color:#4b5563;
}

.be3-rh-holerite-info strong{
    color:#374151;
}

.be3-rh-holerite-actions{
    margin-top:auto;
    display:flex;
    flex-wrap:wrap;
    gap:12px;
}

.be3-rh-holerite-actions .be3-portal-button{
    min-width:180px;
}

/* =========================
   STATUS RH
========================= */
.be3-status{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:36px;
    padding:6px 14px;
    border-radius:999px;
    font-size:14px;
    font-weight:700;
    white-space:nowrap;
    border:1px solid transparent;
}

.be3-status-ok{
    background:#ecfdf3;
    color:#047857;
    border-color:#34d399;
}

.be3-status-pendente{
    background:#fff7ed;
    color:#c2410c;
    border-color:#fb923c;
}

/* =========================
   EMPTY STATE
========================= */
.be3-rh-empty-state,
.be3-empty{
    width:100%;
    min-height:220px;
    display:flex;
    align-items:center;
    justify-content:flex-start;
    padding:40px 0;
    color:#6b7280;
    font-size:18px;
    line-height:1.6;
}

/* =========================
   ÁREA DO FUNCIONÁRIO
========================= */
.be3-funcionario-header-card{
    width:100%;
    max-width:340px;
    margin:0 auto 24px;
    text-align:left;
}

.be3-funcionario-header-card h2{
    margin:0 0 12px;
    font-size:24px;
    line-height:1.2;
}

.be3-funcionario-header-card p{
    margin:0;
    color:#4b5563;
}

.be3-holerites-panel h2{
    margin:0 0 20px;
}

/* =========================
   TABELA DE HOLERITES FUNCIONÁRIO
========================= */
.be3-holerites-table-wrap{
    width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}

.be3-holerites-table{
    width:100%;
    border-collapse:collapse;
    min-width:760px;
}

.be3-holerites-table th,
.be3-holerites-table td{
    padding:16px 14px;
    border:1px solid #d9d9d9;
    text-align:left;
    vertical-align:middle;
}

.be3-holerites-table th{
    font-weight:700;
    color:#2b2b2b;
    background:#fafafa;
}

.be3-holerites-table td{
    color:#374151;
}

.be3-holerites-table .be3-portal-button{
    min-width:140px;
}

/* STATUS TEXTO FUNCIONÁRIO */
.be3-status-text-ok{
    color:#138a36;
    font-weight:700;
}

.be3-status-text-pendente{
    color:#c2410c;
    font-weight:700;
}

/* =========================
   RESPONSIVO
========================= */
@media (max-width: 768px){
    .be3-portal-box,
    .be3-rh-panel,
    .be3-funcionario-panel,
    .be3-holerites-panel{
        padding:18px;
        border-radius:14px;
    }

    .be3-rh-cards{
        grid-template-columns:1fr;
    }

    .be3-rh-filtros{
        grid-template-columns:1fr;
    }

    .be3-rh-holerites-grid{
        grid-template-columns:1fr;
    }

    .be3-rh-holerite-top{
        flex-direction:column;
        align-items:flex-start;
    }

    .be3-rh-holerite-actions{
        flex-direction:column;
    }

    .be3-rh-holerite-actions .be3-portal-button{
        width:100%;
        min-width:0;
    }

    .be3-funcionario-header-card{
        max-width:none;
        margin:0 0 20px;
    }

    .be3-funcionario-header-card h2{
        font-size:20px;
    }

    .be3-holerites-table thead{
        display:none;
    }

    .be3-holerites-table,
    .be3-holerites-table tbody,
    .be3-holerites-table tr,
    .be3-holerites-table td{
        display:block;
        width:100%;
    }

    .be3-holerites-table{
        min-width:0;
        border:none;
    }

    .be3-holerites-table tr{
        margin-bottom:16px;
        border:1px solid #e5e7eb;
        border-radius:14px;
        background:#fff;
        padding:14px;
        box-shadow:0 4px 12px rgba(0,0,0,0.03);
    }

    .be3-holerites-table td{
        border:none;
        border-bottom:1px solid #f0f0f0;
        padding:10px 0;
        text-align:left;
    }

    .be3-holerites-table td:last-child{
        border-bottom:none;
    }

    .be3-holerites-table td::before{
        content:attr(data-label);
        display:block;
        margin-bottom:6px;
        font-size:13px;
        font-weight:700;
        color:#6b7280;
        text-transform:uppercase;
        letter-spacing:.02em;
    }

    .be3-holerites-table .be3-portal-button{
        width:100%;
        min-width:0;
    }
}

/* ==========================================
   HOTFIX REAL - ÁREA DO FUNCIONÁRIO MOBILE
   COLAR NO FINAL DE TODO O CSS
========================================== */
@media only screen and (max-width: 768px){

    .be3-funcionario-mobile-fix{
        width:100% !important;
        max-width:100% !important;
        margin:0 0 16px !important;
        padding:16px !important;
        overflow:hidden !important;
    }

    .be3-funcionario-mobile-fix .be3-funcionario-header-card{
        width:100% !important;
        max-width:100% !important;
        margin:0 0 18px !important;
        padding:0 !important;
    }

    .be3-funcionario-mobile-fix .be3-funcionario-header-card h2{
        font-size:20px !important;
        line-height:1.2 !important;
        margin:0 0 10px !important;
    }

    .be3-funcionario-mobile-fix .be3-holerites-panel{
        width:100% !important;
        max-width:100% !important;
        margin:0 !important;
        padding:16px !important;
        overflow:hidden !important;
    }

    .be3-funcionario-mobile-fix .be3-holerites-panel h2{
        font-size:20px !important;
        margin:0 0 16px !important;
    }

    .be3-funcionario-mobile-fix .be3-holerites-table-wrap{
        width:100% !important;
        max-width:100% !important;
        overflow:visible !important;
    }

    .be3-funcionario-mobile-fix .be3-holerites-table-mobile{
        width:100% !important;
        min-width:0 !important;
        max-width:100% !important;
        border:none !important;
        border-collapse:separate !important;
        table-layout:auto !important;
    }

    .be3-funcionario-mobile-fix .be3-holerites-table-mobile thead{
        display:none !important;
    }

    .be3-funcionario-mobile-fix .be3-holerites-table-mobile,
    .be3-funcionario-mobile-fix .be3-holerites-table-mobile tbody,
    .be3-funcionario-mobile-fix .be3-holerites-table-mobile tr,
    .be3-funcionario-mobile-fix .be3-holerites-table-mobile td{
        display:block !important;
        width:100% !important;
        max-width:100% !important;
    }

    .be3-funcionario-mobile-fix .be3-holerites-table-mobile tr{
        margin:0 0 16px !important;
        padding:14px !important;
        border:1px solid #e5e7eb !important;
        border-radius:14px !important;
        background:#fff !important;
        box-shadow:0 4px 12px rgba(0,0,0,0.03) !important;
    }

    .be3-funcionario-mobile-fix .be3-holerites-table-mobile td{
        border:none !important;
        border-bottom:1px solid #f0f0f0 !important;
        padding:10px 0 !important;
        text-align:left !important;
        white-space:normal !important;
        overflow-wrap:break-word !important;
        word-break:break-word !important;
    }

    .be3-funcionario-mobile-fix .be3-holerites-table-mobile td:last-child{
        border-bottom:none !important;
    }

    .be3-funcionario-mobile-fix .be3-holerites-table-mobile td::before{
        content:attr(data-label) !important;
        display:block !important;
        margin-bottom:6px !important;
        font-size:12px !important;
        font-weight:700 !important;
        color:#6b7280 !important;
        text-transform:uppercase !important;
        letter-spacing:.03em !important;
    }

    .be3-funcionario-mobile-fix .be3-holerites-table-mobile .be3-portal-button,
    .be3-funcionario-mobile-fix .be3-holerites-table-mobile a.be3-portal-button{
        width:100% !important;
        min-width:0 !important;
        max-width:100% !important;
    }
}

.be3-func-holerites-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 24px;
    width: 100%;
}

.be3-func-holerite-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}

.be3-func-holerite-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.be3-func-holerite-top h3 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
}

.be3-func-holerite-info p {
    margin: 0 0 10px;
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
}

.be3-func-holerite-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

@media (max-width: 1024px) {
    .be3-func-holerites-grid {
        grid-template-columns: 1fr;
    }
}