* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: sans-serif; background: #f4f4f9; color: #333; }

.top-bar { 
    background: #3d509c; 
    color: white; 
    padding: 10px 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
}

/* Garante que o título dentro da barra seja igual nos dois */
.top-bar span, .top-bar h2 { 
    font-size: 1.1em; 
    font-weight: bold; 
    margin: 0; 
}

.btn-logout { 
    background: #d32f2f; 
    color: white; 
    border: none; 
    padding: 8px 15px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 0.9em; 
    font-weight: normal; 
    text-decoration: none; 
    display: inline-flex; 
    align-items: center; 
    gap: 5px;
    transition: background 0.3s;
}

.btn-logout:hover { 
    background: #b71c1c; 
}

/* Container Principal */
.main-container {
    max-width: 600px; /* <--- O PDF VAI RESPEITAR ISSO AGORA */
    margin: 30px auto; background: white;
    padding: 20px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.header-form { text-align: center; margin-bottom: 20px; }
.logo-small { max-width: 80px; }
h2 { color: #3e4095; }

/* Formulário */
.field { margin-bottom: 15px; }
.row { display: flex; gap: 10px; }
.half { width: 50%; }

label { display: block; margin-bottom: 5px; font-weight: bold; font-size: 14px; }
input, select, textarea {
    width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px;
}
textarea { height: 80px; resize: none; }

.btn-submit {
    width: 100%; padding: 15px; background: #00a556; color: white;
    border: none; border-radius: 6px; font-size: 16px; font-weight: bold; cursor: pointer;
}
.btn-submit:hover { background: #008f4a; }

/* --- AJUSTE MOBILE PADRONIZADO (36PX) --- */
@media (max-width: 700px) {
    .top-bar {
        flex-direction: column !important;
        height: auto !important;
        padding: 10px 15px !important; 
        gap: 6px !important;            
        box-sizing: border-box !important;
    }

    #displayEmail {
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 4px !important;
        font-size: 0.85em !important;
    }

    .top-bar div {
        display: flex !important;
        flex-direction: row !important; 
        width: 100% !important;
        gap: 10px !important;
        justify-content: center !important;
    }

    .btn-logout, #btnDashContainer, #btnLogoutMobile {
        flex: 1 !important;           
        height: 36px !important;       
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;        
        font-size: 0.82em !important;  
        white-space: nowrap !important;
        margin: 0 !important;
    }

    .row { flex-direction: column !important; gap: 0 !important; }
    .half { width: 100% !important; }
    .main-container { margin: 15px auto; width: calc(100% - 30px); }
}

/* EFEITOS DE HOVER (PC) */
@media (min-width: 701px) {
    .btn-logout:hover, 
    #btnDashContainer:hover, 
    #btnLogoutMobile:hover,
    .btn-submit:hover,
    .btn-filter:hover,
    .btn-action:hover {
        filter: brightness(0.85) !important; 
        box-shadow: 0 5px 15px rgba(0,0,0,0.3) !important;
        transform: translateY(-2px);
        transition: all 0.2s ease-in-out;
        cursor: pointer;
    }
}

/* REGRA DE SEGURANÇA PARA O PDF */
#layer-impressao-pdf {
    text-align: left !important;
}