* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f4f6f9;
}

/* ================= HEADER ================= */

header {
    background-color: #2e7d32;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 30px;
}

header h1 {
    margin: 0;
    font-size: 22px;
}

.logo-esquerda,
.logo-direita {
    height: 60px;
}

/* ================= LAYOUT ================= */

.container {
    display: flex;
    gap: 20px;
    padding: 20px;
}

.form-left,
.form-right {
    background: #ffffff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.form-left {
    width: 40%;
    display: flex;
    flex-direction: column;
}

.form-right {
    width: 60%;
}

/* ================= CAMPOS ================= */

.form-left label {
    margin-top: 12px;
    font-weight: bold;
    font-size: 14px;
}

.form-left input,
.form-left textarea {
    padding: 0 12px;
    height: 42px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 14px;
}

.form-left > input,
.form-left > textarea {
    margin-top: 5px;
}

.form-left textarea {
    height: 120px;
    padding-top: 10px;
    resize: none;
}

/* ================= CAMPOS COM BOTÃO ================= */

.empresa-container {
    display: flex;
    width: 100%;
    margin-top: 5px;
}

.empresa-container input {
    flex: 1;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 14px;
    margin: 0;
}

/* BOTÃO PADRÃO (EMPRESA / OPERAÇÃO) */

.btn-search {
    width: 42px;
    height: 42px;
    border: 1px solid #ccc;
    border-left: none;
    background-color: #f8f8f8;
    cursor: pointer;
    border-radius: 0 8px 8px 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    transition: background 0.2s ease;
}

.btn-search:hover {
    background-color: #eaeaea;
}

/* ================= FRETE ================= */

.frete-container {
    margin-top: 5px;
    background-color: #e6e6e6;
    padding: 10px 15px;
    border-radius: 12px;
    display: flex;
    gap: 25px;
    align-items: center;
}

.frete-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}

.frete-option input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ================= TABELA ================= */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead {
    background-color: #e0e0e0;
}

th {
    padding: 8px;
    text-align: left;
}

td {
    padding: 5px;
}

/* CAMPO DESCRIÇÃO COM BOTÃO */

.item-container {
    display: flex;
    width: 100%;
}

.item-container input {
    flex: 1;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 13px;
}

.item-container button {
    width: 36px;
    height: 36px;
    border: 1px solid #ccc;
    border-left: none;
    background-color: #f8f8f8;
    border-radius: 0 6px 6px 0;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: background 0.2s ease;
}

.item-container button:hover {
    background-color: #eaeaea;
}

/* OUTROS INPUTS DA TABELA */

td input:not(.item-input) {
    width: 100%;
    padding: 6px;
    height: 36px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

/* ================= BOTÃO ADICIONAR ITEM ================= */

.btn-add {
    margin-top: 12px;
    padding: 8px 14px;
    background-color: #f8f8f8;
    border: 1px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;

    display: inline-flex;
    align-items: center;
    gap: 6px;

    transition: background 0.2s ease;
}

.btn-add:hover {
    background-color: #eaeaea;
}

/* ================= TOTAL ================= */

.total {
    margin-top: 15px;
    font-size: 18px;
    font-weight: bold;
}

/* ================= BOTÃO PDF ================= */

button:not(.btn-search):not(.item-container button):not(.btn-add) {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #2e7d32;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

button:not(.btn-search):not(.item-container button):not(.btn-add):hover {
    background-color: #256628;
}

/* ================= MODAL ================= */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    width: 500px;
    max-height: 550px;
    overflow-y: auto;
    padding: 20px;
    border-radius: 12px;
}

#pesquisaEmpresa,
#pesquisaMaterial {
    width: 100%;
    height: 40px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    margin-bottom: 10px;
}

.empresa-item {
    padding: 8px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.empresa-item:hover {
    background-color: #f0f0f0;
}

/* ================= RESPONSIVO ================= */

@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }

    .form-left,
    .form-right {
        width: 100%;
    }
}
/* ==============================
   CONFIGURAÇÃO PARA FIXAR RODAPÉ
============================== */

html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

body {
    min-height: 100vh;
}

/* Faz o conteúdo ocupar o espaço disponível */
.container {
    flex: 1;
}

/* ==============================
   CRÉDITO FIXO NO RODAPÉ
============================== */

.credito {
    text-align: center;
    padding: 12px 0;
    font-size: 14px;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
}

.credito a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    transition: 0.3s;
}

.credito a:hover {
    color: #0a66c2;
}
/* =========================
   RESPONSIVO MOBILE
========================= */

@media (max-width: 768px) {

    header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .logo-esquerda,
    .logo-direita {
        width: 120px;
        height: auto;
    }

    .container {
        flex-direction: column;
        padding: 10px;
    }

    .form-left,
    .form-right {
        width: 100%;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 6px;
    }

    input,
    textarea,
    button {
        width: 100%;
        font-size: 14px;
    }

    .empresa-container {
        flex-direction: column;
    }

    .empresa-container button {
        width: 100%;
        margin-top: 5px;
    }

    .btn-add {
        width: 100%;
        margin-top: 10px;
    }

    .total {
        text-align: center;
        font-size: 16px;
        margin-top: 10px;
    }

    footer.credito {
        text-align: center;
        font-size: 12px;
        padding: 15px 0;
    }

}
