.geracao-page {
    background: #171e19;
    color: #f0f5ef;
}
.geracao-page *, .geracao-page *::before, .geracao-page *::after { box-sizing: border-box; }
.geracao-main.container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 1800px;
    gap: 22px;
    margin: 0 auto;
    padding: 28px clamp(18px, 2vw, 36px) 48px;
}
.geracao-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}
.geracao-eyebrow, .geracao-panel-heading span {
    color: #91d78d;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.geracao-heading h1 {
    margin: 8px 0;
    font-size: clamp(1.9rem, 3vw, 2.75rem);
    line-height: 1.15;
    letter-spacing: -.035em;
}
.geracao-heading p, .geracao-panel-heading p { margin: 0; color: #aab9ac; line-height: 1.5; }
.geracao-overview { display: flex; flex-wrap: wrap; gap: 10px; }
.geracao-overview span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border: 1px solid #496c4d;
    border-radius: 10px;
    background: #29432e;
    color: #dcebd9;
    font-size: .83rem;
    white-space: nowrap;
}
.geracao-overview strong { color: #fff; font-size: 1.3rem; }
.geracao-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #3b4b3f;
}
.geracao-page .geracao-tools button {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    height: 40px;
    min-height: 40px;
    margin: 0;
    padding: 0 13px;
    border: 1px solid #4a6350;
    border-radius: 8px;
    background: #304034;
    color: #edf5ec;
    font-size: .83rem;
    font-weight: 650;
    line-height: 1;
    box-shadow: none;
    transform: none;
}
.geracao-page .geracao-tools button:hover { background: #3a5140; transform: none; }
.geracao-page .geracao-tools .floating-button-upload { background: #2e7843; border-color: #2e7843; }
.geracao-page .geracao-tools .floating-button-descartar { border-color: #8d4c4c; color: #f3c4c0; }
.geracao-page .geracao-tools .floating-button-recusadas,
.geracao-page .geracao-tools .floating-button-indisponivel { border-color: #947438; color: #f5d492; }
.geracao-page .columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
    height: auto;
    margin: 0;
}
.geracao-page .column {
    min-width: 0;
    width: auto;
    padding: 16px;
    border: 1px solid #3b4b3f;
    border-radius: 15px;
    background: #222b25;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
}
.geracao-panel-heading {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 18px;
}
.geracao-panel-heading h2 { margin: 5px 0 0; color: #f0f5ef; font-size: 1.3rem; }
.geracao-panel-heading p { max-width: none; font-size: .85rem; text-align: left; }
.geracao-page .button-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 15px;
}
.geracao-page .button-container button {
    width: auto;
    min-width: 0;
    min-height: 40px;
    margin: 0;
    padding: 0 13px;
    border-radius: 8px;
    background: #304034;
    color: #f0f5ef;
    font-size: .82rem;
    font-weight: 650;
}
.geracao-page .button-container .action-button-gerar { background: #2e7843; }
.geracao-page .button-container .action-button-remove { background: #3a493d; }
.geracao-page .button-container .action-button-cancelar {
    border: 1px solid #8c5653;
    background: #42312f;
    color: #f4c9c4;
    transition: none;
}
.geracao-page .button-container .action-button-cancelar:not(:disabled):hover { background: #68403d; }
.geracao-page .button-container button:disabled,
.geracao-page .geracao-tools button:disabled { background: #334037; color: #86988a; opacity: .65; cursor: not-allowed; }
.geracao-page .geracao-table-hint { display: none; }
.geracao-page .table-container {
    width: 100%;
    height: auto;
    max-height: 540px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #3b4b3f;
    border-radius: 10px;
    scrollbar-color: #58705c #1c251f;
}
.geracao-page .table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}
.geracao-page .table thead { height: auto; background: #303c33; }
.geracao-page .table th, .geracao-page .table td {
    width: auto !important;
    padding: 10px 4px;
    border-bottom: 1px solid #3b4b3f;
    color: #e5eee4;
    font-size: .74rem;
    line-height: 1.35;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.geracao-page .table th:nth-child(1), .geracao-page .table td:nth-child(1) { width: 8% !important; }
.geracao-page .table th:nth-child(2), .geracao-page .table td:nth-child(2) { width: 11% !important; }
.geracao-page .table th:nth-child(3), .geracao-page .table td:nth-child(3) { width: 28% !important; }
.geracao-page .table th:nth-child(4), .geracao-page .table td:nth-child(4) { width: 5% !important; }
.geracao-page .table th:nth-child(5), .geracao-page .table td:nth-child(5) { width: 12% !important; }
.geracao-page .table th:nth-child(6), .geracao-page .table td:nth-child(6) { width: 12% !important; }
.geracao-page .table th:nth-child(7), .geracao-page .table td:nth-child(7) { width: 12% !important; }
.geracao-page .table th:nth-child(8), .geracao-page .table td:nth-child(8) { width: 12% !important; }
.geracao-page .table td:nth-child(3) { white-space: normal; overflow-wrap: anywhere; }
.geracao-page .table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #303c33;
    color: #c8d7c8;
    font-size: .7rem;
    font-weight: 700;
}
.geracao-page .table tbody tr:hover { background: #2d3b31; }
.geracao-page .table td:last-child { text-align: right; }
.geracao-page .acoes-linha { justify-content: flex-end; gap: 4px; }
.geracao-page .table td button.add,
.geracao-page .table td button.remove,
.geracao-page .table td button.descartar-item,
.geracao-page .table td button.cancelar-geracao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 31px;
    min-width: 31px;
    min-height: 31px;
    height: 31px;
    padding: 0;
    border-radius: 7px;
    box-shadow: none;
}
.geracao-page .table td button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.geracao-page .table td button.add { background: #2e7843; }
.geracao-page .table td button.remove { background: #45594a; }
.geracao-page .table td button.descartar-item,
.geracao-page .table td button.cancelar-geracao { border: 1px solid #945a58; background: #433130; color: #f6ceca; }
.geracao-page .table td button.add:hover { background: #3b9453; }
.geracao-page .table td button.remove:hover { background: #5a725f; }
.geracao-page .table td button.descartar-item:hover,
.geracao-page .table td button.cancelar-geracao:hover { background: #703b3a; }
.geracao-page .status-rejeitada-btn { min-height: 30px; background: #8d3939; }
.geracao-page .table td.status-gerada, .geracao-page .status-gerada { color: #a7e8a0; }
.geracao-page .table td.status-cancelada,
.geracao-page .table td.status-rejeitada,
.geracao-page .status-rejeitada,
.geracao-page .status-cancelada { color: #f0a9a4; }
@media (min-width: 1301px) {
    .geracao-page .table th:is(:nth-child(1), :nth-child(2), :nth-child(4), :nth-child(5), :nth-child(6), :nth-child(7), :nth-child(8)),
    .geracao-page .table td:is(:nth-child(1), :nth-child(2), :nth-child(4), :nth-child(5), :nth-child(6), :nth-child(7), :nth-child(8)) { text-align: center; }
    .geracao-page .acoes-linha { justify-content: center; }
}
.geracao-page .geracao-empty {
    margin: 12px 0 0;
    padding: 18px;
    border: 1px dashed #536856;
    border-radius: 9px;
    background: #1b261e;
    color: #acbdad;
    font-size: .86rem;
    text-align: center;
}
.geracao-page .geracao-empty[hidden] { display: none; }
.geracao-page .vencimento-input, .geracao-page .uf-input { width: min(100%, 260px); min-height: 42px; color-scheme: dark; }
.geracao-page button:focus-visible { outline: 3px solid #9de297; outline-offset: 2px; }
body.geracao-page .modal.geracao-dialog .modal-content {
    width: min(500px, calc(100% - 32px));
    padding: 0;
    border-radius: 18px;
    background: #253128;
    overflow-y: auto;
}
.geracao-dialog-header {
    position: relative;
    padding: 28px 30px 22px;
    border-bottom: 1px solid #405545;
    background: linear-gradient(145deg, #2c3d30, #253128 72%);
}
.geracao-dialog-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: #a7dfa2;
    font-size: .69rem;
    font-weight: 750;
    letter-spacing: .12em;
    text-transform: uppercase;
}
body.geracao-page .modal.geracao-dialog .modal-content h2 {
    margin: 0 40px 9px 0;
    font-size: 1.42rem;
    line-height: 1.2;
}
body.geracao-page .modal.geracao-dialog .modal-content .geracao-dialog-header p {
    max-width: 390px;
    margin: 0;
    color: #b9cbb9;
    font-size: .88rem;
    line-height: 1.5;
}
body.geracao-page .modal.geracao-dialog .modal-content .close {
    top: 22px;
    right: 22px;
    width: 32px;
    height: 32px;
    min-height: 32px;
    background: #3a5040;
}
.geracao-dialog-body { padding: 24px 30px 28px; }
.geracao-dialog-body label {
    display: block;
    margin-bottom: 9px;
    color: #e8f1e7;
    font-size: .86rem;
    font-weight: 700;
}
body.geracao-page .modal.geracao-dialog .modal-content .geracao-dialog-body input,
body.geracao-page .modal.geracao-dialog .modal-content .geracao-dialog-body select {
    display: block;
    width: 100%;
    height: 48px;
    min-height: 48px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid #607864;
    border-radius: 10px;
    background: #18241b;
    color: #f0f5ef;
    font-size: .98rem;
    text-align: left;
}
body.geracao-page .modal.geracao-dialog .modal-content .geracao-dialog-body input:focus,
body.geracao-page .modal.geracao-dialog .modal-content .geracao-dialog-body select:focus {
    border-color: #8cce8c;
    outline: 3px solid rgba(140, 206, 140, .18);
    box-shadow: none;
}
body.geracao-page .modal.geracao-dialog .modal-content .geracao-dialog-body input[aria-invalid="true"] { border-color: #e39791; }
body.geracao-page .modal.geracao-dialog .modal-content .geracao-dialog-error {
    margin: 9px 0 0;
    color: #f0aaa5;
    font-size: .8rem;
}
.geracao-dialog-error[hidden] { display: none; }
body.geracao-page .modal.geracao-dialog .modal-content .geracao-dialog-warning {
    margin: 0;
    padding: 13px 15px;
    border: 1px solid #765450;
    border-radius: 9px;
    background: #3c2f2d;
    color: #f2cbc6;
    font-size: .85rem;
}
.geracao-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 30px;
    border-top: 1px solid #405545;
    background: #202b23;
}
body.geracao-page .modal.geracao-dialog .modal-content .geracao-dialog-actions button:not(.close) {
    min-width: 112px;
    min-height: 44px;
    margin: 0;
    padding: 0 17px;
    border: 1px solid #516453;
    border-radius: 9px;
    background: #354639;
    font-size: .86rem;
    font-weight: 700;
}
body.geracao-page .modal.geracao-dialog .modal-content .geracao-dialog-actions button.confirm-button {
    min-width: 150px;
    border-color: #36834a;
    background: #2e7843;
    color: #fff;
}
body.geracao-page .modal.geracao-dialog .modal-content .geracao-dialog-actions button.danger-button {
    border-color: #aa5049;
    background: #963f3b;
}
body.geracao-page .modal.geracao-dialog .modal-content .geracao-dialog-actions button.danger-button:hover { background: #b34b44; }
body.geracao-page .modal.geracao-dialog .modal-content .geracao-dialog-actions button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 520px) {
    .geracao-dialog-header { padding: 24px 22px 20px; }
    .geracao-dialog-body { padding: 22px; }
    .geracao-dialog-actions { padding: 18px 22px; }
    body.geracao-page .modal.geracao-dialog .modal-content .close { top: 18px; right: 18px; }
    body.geracao-page .modal.geracao-dialog .modal-content .geracao-dialog-actions button:not(.close) { min-width: 0; flex: 1 1 0; }
}
@media (max-width: 1300px) {
    .geracao-page .table-container { max-height: none; overflow: visible; border: 0; }
    .geracao-page .table, .geracao-page .table tbody { display: block; width: 100%; }
    .geracao-page .table thead { display: none; }
    .geracao-page .table tbody { display: grid; gap: 10px; }
    .geracao-page .table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px 14px;
        padding: 14px;
        border: 1px solid #3b4b3f;
        border-radius: 10px;
        background: #1d2821;
    }
    body.geracao-page .table td:nth-child(n) {
        display: block;
        width: auto !important;
        min-width: 0;
        padding: 5px 0;
        border: 0;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .geracao-page .table td::before {
        display: block;
        margin-bottom: 4px;
        color: #9fb5a2;
        font-size: .68rem;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
    }
    .geracao-page .table td:nth-child(1)::before { content: 'Nota'; }
    .geracao-page .table td:nth-child(2)::before { content: 'Emissão'; }
    .geracao-page .table td:nth-child(3)::before { content: 'Cliente'; }
    .geracao-page .table td:nth-child(4)::before { content: 'UF'; }
    .geracao-page .table td:nth-child(5)::before { content: 'Valor NFe'; }
    .geracao-page .table td:nth-child(6)::before { content: 'Valor GNRE'; }
    .geracao-page .table td:nth-child(7)::before { content: 'Status'; }
    .geracao-page .table td:nth-child(8)::before { content: 'Ações'; }
    .geracao-page .table td:nth-child(3), .geracao-page .table td:nth-child(8) { grid-column: 1 / -1; }
    .geracao-page .table td:last-child { text-align: left; }
    .geracao-page .acoes-linha { justify-content: flex-start; }
}
@media (max-width: 760px) {
    .geracao-page .columns { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .geracao-main.container { padding: 20px 16px 40px; }
    .geracao-heading { align-items: flex-start; flex-direction: column; }
    .geracao-page .column { padding: 18px 14px; }
    .geracao-page .button-container button { flex: 1 1 auto; }
    .geracao-page .geracao-tools button { flex: 1 1 calc(50% - 5px); }
}
@media (max-width: 420px) {
    .geracao-page .geracao-tools button { flex-basis: 100%; }
}
