body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #e6edf5;
    color: #222;
}

.topbar {
    background: #0b56a3;
    color: white;
    padding: 14px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.topbar-acoes {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-periodo {
    margin-left: 18px;
    padding-left: 18px;
    border-left: 1px solid rgba(255, 255, 255, 0.45);
}

.periodo-consulta-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto auto;
    gap: 24px;
    align-items: flex-end;
    margin-bottom: 18px;
}

.periodo-consulta-bar h2 {
    margin: 0 0 8px;
}

.periodo-consulta-form {
    display: grid;
    grid-template-columns: auto 230px;
    gap: 10px;
    align-items: center;
}

.periodo-consulta-form label {
    font-weight: bold;
}

.periodo-consulta-form select {
    width: 100%;
}

.periodo-consulta-bar .periodo-voltar {
    display: flex;
    align-items: center;
    height: 36px;
    box-sizing: border-box;
    margin-bottom: 0;
    white-space: nowrap;
}

.periodo-reabrir-form {
    margin: 0;
}

.periodo-reabrir-form .btn-secondary {
    height: 36px;
    box-sizing: border-box;
    white-space: nowrap;
}

.periodo-consulta-form select {
    height: 36px;
    box-sizing: border-box;
}

.periodo-consulta-bar .disabled,
.periodo-consulta-bar button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.periodo-consulta-bar > .periodo-aviso {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.periodo-estado {
    display: inline-block;
    font-size: 13px;
    font-weight: bold;
}

.periodo-estado.aberto {
    color: #168b35;
}

.periodo-estado.consulta {
    color: #8a5a00;
}

.periodo-aviso {
    margin-bottom: 16px;
    padding: 10px 12px;
    background: #fff5d9;
    border-left: 5px solid #c48700;
    font-weight: bold;
}

.formularios-atalho {
    display: flex;
    justify-content: flex-end;
    margin: -6px 0 16px;
}

.formularios-atalho .btn-link {
    margin-bottom: 0;
}

.formularios-card {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.formularios-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.formulario-download {
    border: 1px solid #c8d8ea;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.formulario-download h3 {
    margin-top: 0;
}

.formulario-download .btn-link {
    margin: 10px 0 0;
    text-align: center;
}

@media (max-width: 750px) {
    .formularios-grid {
        grid-template-columns: 1fr;
    }
}

.tabs {
    display: flex;
    gap: 6px;
    background: #0b56a3;
	 /* #dfe8f3 */
    padding: 10px 14px 0;
    overflow-x: auto;
}

.tabs a {
    background: white;
    padding: 12px 18px;
    border-radius: 8px 8px 0 0;
    text-decoration: none;
    color: #0b56a3;
    font-weight: bold;
    white-space: nowrap;
}

.content {
    padding: 24px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 22px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.resumo-grupo th {
    padding-top: 18px;
    background: #e8f1fb;
    color: #0b56a3;
    text-align: left;
    font-size: 16px;
}

.resumo-grupo:first-child th {
    padding-top: 12px;
}

.resumo-subtotal th,
.resumo-subtotal td {
    border-top: 2px solid #9fb6cc;
    background: #f4f7fa;
    font-weight: bold;
}

.resumo-subtotal th {
    text-align: right;
}

.form-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px;
    max-width: 650px;
}

.form-grid-lan {
    max-width: 100%;
    grid-template-columns: minmax(110px, 160px) minmax(0, 1fr);
}

.s24-cabecalho-grid {
    max-width: 900px;
    grid-template-columns: 70px minmax(150px, 190px) 70px minmax(190px, 260px);
    align-items: center;
}

.s24-cabecalho-grid .s24-tipo-label {
    grid-column: 1;
}

.s24-cabecalho-grid .radios {
    grid-column: 2 / 5;
}

@media (max-width: 760px) {
    .s24-cabecalho-grid {
        grid-template-columns: 110px minmax(0, 1fr);
    }
    .s24-cabecalho-grid .s24-tipo-label { grid-column: 1; }
    .s24-cabecalho-grid .radios { grid-column: 2; }
}

.form-grid-lan input,
.form-grid-lan select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

input, select, button {
    padding: 9px;
    font-size: 15px;
}

button {
    background: #0b56a3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

button:hover {
    background: #073f78;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 9px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.erro {
    background: #ffe1e1;
    border-left: 5px solid #c00;
    padding: 10px;
    margin-bottom: 12px;
}

.ok {
    background: #e2f8e6;
    border-left: 5px solid #168b35;
    padding: 10px;
    margin-bottom: 12px;
}

.login-body {
    display: flex;
    height: 100vh;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    padding: 28px;
    width: 320px;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.18);
}

.login-card label {
    display: block;
    margin-top: 12px;
}

.login-card input,
.login-card select,
.login-card button {
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
}

.layout-transacoes {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
}

.lista-transacoes table {
    font-size: 14px;
}

.linha-ativa {
    background: #d8eaff !important;
}

.lista-transacoes tbody tr {
    cursor: pointer;
}

.lista-transacoes tbody tr:hover {
    background: #eef5ff;
}

.num {
    text-align: right;
}

.btn-link {
    display: inline-block;
    background: #b5daec;
    color: #0b56a3;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    margin-bottom: 10px;
}

.radios {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 8px;
}

.linhas-s24 {
    margin-top: 22px;
}

.linhas-s24 input,
.linhas-s24 select {
    width: 100%;
    box-sizing: border-box;
}

.linhas-s24 th:nth-child(1),
.linhas-s24 td:nth-child(1) {
    width: 50px;
    text-align: center;
}

.campo-moeda {
    text-align: right;
}

.login-card select {
    padding: 10px;
}

.login-card .btn-link {
    display: block;
    margin-top: 14px;
    text-align: center;
}

.reservas-page {
    width: calc(100% - 48px);
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 0 40px;
    box-sizing: border-box;
}
.reservas-page h1 { margin: 0 0 16px; }
.reservas-page > p { margin: 0 0 16px; line-height: 1.5; }
.reservas-filtros { display:flex; gap:8px; margin:18px 0 24px; flex-wrap:wrap; }
.reservas-filtros .active { outline:2px solid #0b56a3; }
.reservas-tabela-wrap { overflow-x:auto; padding:20px; }
.reservas-tabela { min-width:1050px; }
.reservas-tabela .reserva-atrasada { background:#ffd9d9; }
.reservas-tabela .reserva-aberta { background:#fffbe5; }
.reservas-tabela .reserva-fechada { background:#edf3f7; color:#596673; }
.reserva-fecho-form { display:flex; gap:8px; align-items:center; }
.reserva-fecho-form input { min-width:145px; }
@media (max-width: 700px) {
    .reservas-page { width: calc(100% - 24px); padding-top:16px; }
    .reservas-tabela-wrap { padding:12px; }
}

.campo-moeda::-webkit-inner-spin-button,
.campo-moeda::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.linhas-fecho th:nth-child(1),
.linhas-fecho td:nth-child(1) {
    width: 28%;
    text-align: left;
}

.linhas-fecho th:nth-child(2),
.linhas-fecho td:nth-child(2) {
    width: 20%;
}

.linhas-fecho th:nth-child(3),
.linhas-fecho td:nth-child(3) {
    width: 24%;
}

.linhas-fecho th:nth-child(4),
.linhas-fecho td:nth-child(4) {
    width: 12%;
}

.ultimo-fecho-link {
    margin-top: 14px;
}

.total-box {
    margin-top: 18px;
    font-size: 20px;
    text-align: right;
}

textarea {
    width: 100%;
    min-height: 80px;
    margin-top: 8px;
    box-sizing: border-box;
    padding: 10px;
}

.botoes .btn-link {
    margin-bottom: 0;
    line-height: normal;
    display: inline-flex;
    align-items: center;
}

.btn-danger {
    background: #b00020;
}

.btn-danger:hover {
    background: #7f0017;
}

.tabs a.active {
    background: #e6edf5;
    color: #222;
    border-bottom: 2px solid #e6edf5;
}

.cards-novo {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 20px;
}

.card-opcao {
    display: block;
    background: #f7fbff;
    border: 1px solid #c8d8ea;
    border-radius: 10px;
    padding: 18px;
    text-decoration: none;
    color: #222;
}

.card-opcao:hover {
    background: #eaf3ff;
    border-color: #0b56a3;
}

.card-opcao h3 {
    margin-top: 0;
    color: #0b56a3;
}

.card-opcao.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.user-lancamento {
    margin-top: 12px;
    margin-bottom: 12px;
    padding: 10px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    column-gap: 18px;
    row-gap: 34px;
    align-items: start;
    margin-bottom: 60px;
}

.dashboard-cards-5 {
    grid-template-columns: repeat(5, minmax(170px, 1fr));
}

.saldo-card {
    margin-bottom: 0;
    height: auto;
}

.saldo-card h3 {
    margin-top: 0;
}

.saldo-tabela {
    width: 100%;
    margin-top: 12px;
}

.saldo-tabela td {
    border-bottom: none;
    padding: 5px 0;
}

.saldo-tabela td:first-child {
    width: 60%;
}

.saldo-tabela td:last-child {
    width: 40%;
    text-align: right;
    font-weight: bold;
}

.saldo-atual td {
    border-top: 1px solid #ddd;
    padding-top: 9px;
}

.valor-negativo td {
    color: #c00000;
}

.def-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
    align-items: start;
}

.def-lista {
    min-width: 0;
}

.def-form {
    min-width: 0;
}

.def-lista table {
    font-size: 13px;
}

.def-form .form-grid {
    max-width: none;
    grid-template-columns: 140px 1fr;
}

@media (max-width: 900px) {
    .def-grid {
        grid-template-columns: 1fr;
    }
}



@media (max-width: 1100px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-cards-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 650px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .dashboard-cards-5 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .periodo-consulta-bar {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .periodo-consulta-form {
        grid-template-columns: 1fr;
    }

    .topbar-periodo {
        display: block;
        margin: 4px 0 0;
        padding: 0;
        border-left: 0;
    }
}


@media (max-width: 900px) {
    .layout-transacoes {
        grid-template-columns: 1fr;
    }

    .radios {
        grid-template-columns: 1fr;
    }
}


/* Parâmetros gerais */
.config-form {
    max-width: none;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 24px;
    align-items: start;
}

.config-card {
    background: #f8fafc;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    padding: 18px;
}

.config-card h3 {
    margin-top: 0;
    margin-bottom: 18px;
    color: #0b56a3;
}

.config-form-grid {
    max-width: none;
    grid-template-columns: 170px 1fr;
}

.config-form-grid input,
.config-form-grid select {
    width: 100%;
    box-sizing: border-box;
}

.config-botoes {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 900px) {
    .config-grid {
        grid-template-columns: 1fr;
    }
}

/* Definições: lista à esquerda e edição à direita */ 
.layout-definicoes { 
	display: grid; 
	grid-template-columns: 4fr 3fr; 
	gap: 28px; 
	align-items: start; }

.form-admin {
    display: grid;
    grid-template-columns: 140px 2fr;
    gap: 12px;
    max-width: none;
    width: 100%;
}

.lista-admin {
    overflow-y: auto;
    max-height: 500px;
}

/* =========================================================
   Definições
   ========================================================= */

/* Parâmetros gerais */
.config-form {
    max-width: none;
    width: 100%;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 24px;
    align-items: start;
}

.config-card {
    background: #f8fafc;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    padding: 18px;
}

.config-card h3 {
    margin-top: 0;
    margin-bottom: 18px;
    color: #0b56a3;
}

.config-form-grid {
    max-width: none;
    grid-template-columns: 170px 1fr;
}

.config-form-grid input,
.config-form-grid select {
    width: 100%;
    box-sizing: border-box;
}

.config-botoes {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
}

/* Utilizadores e códigos: lista à esquerda, edição à direita */
.layout-definicoes {
    display: grid;
    grid-template-columns: 5fr 4fr;
    gap: 28px;
    align-items: start;
}

.lista-admin {
    min-width: 0;
    overflow-y: auto;
    max-height: 500px;
}

.lista-admin table {
    font-size: 14px;
}

.lista-admin tbody tr {
    cursor: pointer;
}

.lista-admin tbody tr:hover,
.lista-admin tbody tr.linha-ativa {
    background: #e8f1ff;
}

.lista-admin small {
    color: #555;
}

.form-admin {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    max-width: none;
    width: 100%;
    min-width: 0;
}

.form-admin input,
.form-admin select {
    width: 100%;
    box-sizing: border-box;
}

.form-admin .botoes {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.check-line {
    display: flex;
    gap: 8px;
    align-items: center;
}

.check-line input {
    width: auto;
}

.info {
    background: #eef5ff;
    border-left: 5px solid #0b56a3;
    padding: 10px;
    border-radius: 6px;
}

.saldo-conta {
    margin-top: -4px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #0b56a3;
    font-weight: bold;
}


@media (max-width: 1100px) {
    .layout-definicoes {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .config-grid {
        grid-template-columns: 1fr;
    }

    .form-admin {
        grid-template-columns: 1fr;
    }
}


/* S-26 */
.s26-wrapper {
    overflow-x: auto;
}

.s26-table {
    min-width: 1100px;
    font-size: 14px;
}

.s26-table th {
    background: #e9f1fb;
    text-align: center;
}

.s26-table tfoot td,
.s26-saldo-inicial td {
    background: #f8fafc;
}

.s26-table .centro {
    text-align: center;
}

/* S-26 página 2 */
.s26-pg2-card {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.s26-pg2-cabecalho {
    text-align: center;
    margin-bottom: 16px;
}

.s26-pg2-cabecalho h2 {
    margin-bottom: 8px;
    text-transform: uppercase;
}

.s26-pg2-cabecalho > strong {
    display: block;
    margin-bottom: 12px;
    font-size: 18px;
    text-transform: uppercase;
}

.s26-pg2-cabecalho label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

.s26-pg2-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
    gap: 16px;
    align-items: start;
}

.s26-pg2-seccao {
    border: 3px solid #7e98b3;
    padding: 16px;
    min-width: 0;
}

.s26-pg2-seccao h3 {
    margin: 0 0 4px;
    text-align: center;
    text-transform: uppercase;
}

.s26-pg2-seccao > .nota {
    margin: 0 0 16px;
    text-align: center;
}

.s26-rec-linhas {
    display: grid;
    gap: 10px;
}

.s26-rec-linhas label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 145px;
    gap: 14px;
    align-items: center;
}

.s26-rec-linhas input {
    width: 100%;
    box-sizing: border-box;
    text-align: right;
}

.s26-rec-linhas input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.s26-rec-linhas input[type="number"]::-webkit-inner-spin-button,
.s26-rec-linhas input[type="number"]::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.s26-rec-total {
    font-weight: bold;
}

.s26-rec-total input {
    border-width: 0 0 2px;
    border-radius: 0;
    background: #f8fafc;
    font-weight: bold;
}

.s26-movimentos {
    margin: 18px 0;
}

.s26-movimentos h4 {
    margin: 0 0 10px;
}

.s26-movimentos-cabecalho,
.s26-movimento-linha {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 145px;
    gap: 14px;
}

.s26-movimentos-cabecalho {
    font-weight: bold;
    border-bottom: 1px solid #7e98b3;
    padding-bottom: 5px;
}

.s26-movimento-linha {
    min-height: 28px;
    align-items: center;
    border-bottom: 1px solid #cfd8e3;
}

.s26-movimento-linha strong,
.s26-movimentos-cabecalho span:last-child {
    text-align: right;
}

.s26-movimento-manual input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.s26-movimento-manual input:last-child {
    text-align: right;
}

.s26-resumo-grupo {
    margin-top: 22px;
}

.s26-resumo-grupo h4 {
    margin: 0 0 8px;
    text-transform: uppercase;
}

.s26-resumo-grupo > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 12px;
    padding: 4px 0;
}

.s26-resumo-grupo strong {
    text-align: right;
}

.s26-resumo-final {
    margin-top: 4px;
    border-top: 1px solid #cfd8e3;
    font-weight: bold;
}

.s26-total-fundos {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 12px;
    align-items: end;
    margin-top: 28px;
    font-weight: bold;
    text-transform: uppercase;
}

.s26-total-fundos strong {
    border-bottom: 3px double #222;
    text-align: right;
    font-size: 18px;
}

.s26-pg2-botoes {
    justify-content: flex-end;
    margin-top: 16px;
}

.s26-pg2-botoes .btn-secondary {
    background: #5f6f7f;
}

.s26-pg2-botoes .btn-secondary:hover {
    background: #475563;
}

@media (max-width: 900px) {
    .s26-pg2-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .s26-rec-linhas label,
    .s26-movimentos-cabecalho,
    .s26-movimento-linha {
        grid-template-columns: minmax(0, 1fr) 105px;
    }

    .s26-pg2-cabecalho label {
        align-items: stretch;
        flex-direction: column;
    }
}

/* =========================================================
   S-26 - Folha de contas
   ========================================================= */
.s26-cabecalho {
    margin-bottom: 16px;
}

.s26-cabecalho h2 {
    margin-bottom: 12px;
}

.s26-identificacao {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 8px 18px;
    background: #f8fafc;
    border: 3px solid #7e98b3;
    border-radius: 8px;
    padding: 12px;
}

.s26-wrapper {
    overflow-x: auto;
}

.s26-table {
    min-width: 1150px;
    font-size: 14px;
    border-collapse: collapse;
}

.s26-table th {
    border: 2px solid #7e98b3;
    padding: 7px 8px;
    vertical-align: middle;
	border-collapse: collapse;
}	

.s26-table td {
    border: 1px solid #cfd8e3;
    padding: 7px 8px;
    vertical-align: middle;
}

/* Bordas externas mais grossas */
.s26-table thead th:first-child { border-left: 2px solid #7e98b3; border-collapse: collapse;}
.s26-table thead th:last-child { border-right: 2px solid #7e98b3; border-collapse: collapse;}
.s26-table tbody td:first-child { border-left: 2px solid #7e98b3; border-collapse: collapse;}
.s26-table tbody td:last-child { border-right: 2px solid #7e98b3; border-collapse: collapse;}
.s26-table tfoot td:first-child { border-left: 2px solid #7e98b3; border-collapse: collapse;}
.s26-table tfoot td:last-child { border-right: 2px solid #7e98b3; border-collapse: collapse;}

/* Borda superior (primeira linha) */
.s26-table thead tr:first-child th { border-top: 2px solid #7e98b3; border-collapse: collapse;}

/* Borda inferior (última linha) */
.s26-table tfoot tr:last-child td { border-bottom: 2px solid #7e98b3; border-collapse: collapse;}
/* ou se for tbody a última linha: */
.s26-table tbody tr:last-child td { border-bottom: 2px solid #7e98b3; border-collapse: collapse;}

.s26-table th {
    background: #e9f1fb;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.s26-table tbody tr:hover {
    background: #f7fbff;
}

.s26-table tfoot td,
.s26-saldo-inicial td {
    background: #f8fafc;
	border: 2px solid #7e98b3;
	border-collapse: collapse;
}

.s26-table tfoot td {
    border-top: 2px solid #8ea6c0;
}

.s26-data {
    text-align: center;
	border-right: 2px solid #7e98b3 !important;
    white-space: nowrap;
}

.s26-desc {
    min-width: 260px;
}

.s26-desc-conteudo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 82px;
    gap: 12px;
    align-items: center;
}

.s26-valor-virtual {
    border-left: 1px solid #cfd8e3;
    padding-left: 10px;
    text-align: right;
    white-space: nowrap;
}

.fecho-distribuicao {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    align-items: center;
    margin-top: 18px;
}

.fecho-distribuicao span {
    padding: 8px 10px;
    border: 1px solid #c8d7e6;
    background: #f8fafc;
}

.fecho-distribuicao small {
    flex-basis: 100%;
}

.s26-ct {
    text-align: center !important;
	border-left: 2px solid #7e98b3 !important;
    width: 48px;
}

.s26-table .num {
    text-align: right;
    white-space: nowrap;
}

.s26-table .centro {
    text-align: center;
}

.s26-grupo-inicio {
    border-left: 2px solid #7e98b3 !important;
}

.s26-extrato {
    width: 70px;
}

.s26-table input[type="checkbox"] {
    width: auto;
    transform: scale(1.1);
}

@media (max-width: 900px) {
    .s26-identificacao {
        grid-template-columns: 1fr;
    }
}


/* TO-62 */
.to62-card {
    max-width: 1200px;
    margin: 0 auto;
}

.to62-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.to62-header label,
.to62-section label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

.to62-header input,
.to62-section input {
    width: 100%;
    box-sizing: border-box;
}

.to62-section {
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 18px;
    background: #fbfdff;
}

.to62-section h3 {
    margin-top: 0;
    color: #0b56a3;
}

.to62-radios {
    display: grid;
    gap: 10px;
}

.to62-radios label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

.to62-radios input[type="radio"] {
    width: auto;
}

.to62-lines {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 10px 18px;
    align-items: center;
}

.to62-lines input[type="text"],
.to62-lines input:not([type]) {
    width: 100%;
}

.to62-total {
    font-weight: bold;
    background: #eef5ff;
    text-align: right;
}

.to62-valor {
    text-align: right;
}

.to62-single-line,
.to62-confirmacao {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 12px;
    align-items: center;
}

.to62-requisicao-resumo {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: center;
}

.to62-requisicao-resumo .nota:last-child {
    text-align: right;
}

.to62-botoes {
    justify-content: flex-end;
}

.to62-section .validacao-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.to62-section .validacao-assinatura {
    min-width: 0;
}

@media (max-width: 800px) {
    .to62-header,
    .to62-lines,
    .to62-single-line,
    .to62-confirmacao {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .to62-requisicao-resumo,
    .to62-section .validacao-grid {
        grid-template-columns: 1fr;
    }

    .to62-requisicao-resumo .nota:last-child {
        text-align: left;
    }
}


/* Ajustes Configurações - TO-62 / Fecho */
.config-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
}

.config-card {
    min-width: 0;
}

.config-form-grid input[type="number"] {
    max-width: none;
}

@media (max-width: 900px) {
    .config-stack {
        gap: 16px;
    }
}

/* Estado do documento TO-62 */
.to62-estado {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 14px;
    align-items: center;
    border-radius: 10px;
    padding: 14px 16px;
    margin: 0 0 20px;
    border-left: 6px solid #0b56a3;
}

.to62-estado p {
    margin: 4px 0 0;
    line-height: 1.35;
}

.to62-estado-icone {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    color: white;
}

.to62-estado-calculado {
    background: #e9f8ef;
    border-left-color: #168b35;
}

.to62-estado-calculado .to62-estado-icone {
    background: #168b35;
}

.to62-estado-guardado {
    background: #eef5ff;
    border-left-color: #0b56a3;
}

.to62-estado-guardado .to62-estado-icone {
    background: #0b56a3;
}

.to62-estado-alterado {
    background: #fff7db;
    border-left-color: #c48700;
}

.to62-estado-alterado .to62-estado-icone {
    background: #c48700;
}

.btn-alerta {
    background: #c48700 !important;
}

.btn-alerta:hover {
    background: #956500 !important;
}


/* S-26 - linhas navegáveis */
.linha-s26-doc {
    cursor: pointer;
}

.linha-s26-doc:hover td {
    background: #f0f7ff;
}


/* Validação / verificação de documentos */
.validacao-documento {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 14px;
    margin-bottom: 12px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
}

.validacao-documento label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    color: #0b56a3;
}

.validacao-documento input {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 800px) {
    .validacao-documento {
        grid-template-columns: 1fr;
    }
}



/* =========================================================
   S-30 - páginas separadas
   ========================================================= */
.s30-pagina {
    max-width: 1200px;
    margin: 0 auto 22px auto;
}

.s30-cabecalho {
    margin-bottom: 18px;
}

.s30-cabecalho h2 {
    text-align: center;
    text-transform: uppercase;
    margin: 0 0 14px;
}

.s30-identificacao {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px 18px;
    background: #f8fafc;
    border: 3px solid #7e98b3;
    border-radius: 8px;
    padding: 12px;
}

.s30-table-formulario {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #7e98b3;
    font-size: 14px;
}

.s30-table-formulario td {
    border: 1px solid #cfd8e3;
    padding: 7px 8px;
    vertical-align: middle;
}

.s30-table-formulario td:first-child {
    width: 76%;
}

.s30-table-formulario td:last-child {
    width: 24%;
    white-space: nowrap;
}

.s30-bloco td {
    background: #dfe8f3;
    color: #0b56a3;
    font-weight: bold;
    text-transform: uppercase;
    border-top: 2px solid #7e98b3;
}

.s30-subtitulo td {
    background: #eef5ff;
    font-weight: bold;
    padding-left: 22px;
}

.s30-indent1 {
    padding-left: 42px !important;
}

.s30-indent2 {
    padding-left: 62px !important;
}

.s30-total td {
    background: #f8fafc;
    font-weight: bold;
}

.s30-total-maior td {
    background: #eef5ff;
    font-weight: bold;
    border-top: 2px solid #7e98b3;
    border-bottom: 2px solid #7e98b3;
}

.s30-letra {
    color: #0b56a3;
    font-weight: bold;
    float: right;
    margin-left: 12px;
}

.s30-nota {
    color: #666;
    font-size: 12px;
    font-weight: normal;
}

.s30-anuncio-formulario {
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #fbfdff;
    padding: 18px;
    line-height: 1.65;
    font-size: 16px;
}

.s30-anuncio-formulario h3 {
    margin-top: 0;
    text-transform: uppercase;
    color: #0b56a3;
}

.s30-resumo-formulario {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.s30-resumo-formulario div {
    text-align: center;
}

.s30-resumo-formulario span {
    display: block;
    min-height: 26px;
    padding: 0 8px 6px;
    border-bottom: 2px solid #333;
    font-weight: bold;
}

.s30-resumo-formulario small {
    display: block;
    margin-top: 6px;
    color: #555;
    font-size: 13px;
}

@media (max-width: 900px) {
    .s30-identificacao,
    .s30-resumo-formulario {
        grid-template-columns: 1fr;
    }

    .s30-letra {
        float: none;
        display: inline-block;
    }
}

/* Anexos */
.btn-anexos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 42px;
    min-height: 36px;
    box-sizing: border-box;
    padding: 7px 10px;
    border: 1px solid #9bbbd3;
    border-radius: 6px;
    background: #b5daec;
    color: #0b56a3;
    font-weight: bold;
    line-height: 1;
    text-decoration: none;
}

.btn-anexos:hover {
    background: #9fcce2;
}

.btn-anexos.disabled {
    opacity: .55;
    cursor: not-allowed;
}

.btn-anexos-tabela {
    min-width: 36px;
    min-height: 30px;
    padding: 4px 7px;
}

.s26-anexos {
    width: 76px;
}

.s26-linha-com-anexo > span,
.to62-titulo-anexo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.s26-linha-com-anexo .btn-anexos {
    flex: 0 0 auto;
}

.to62-titulo-anexo {
    margin-bottom: 12px;
}

.to62-titulo-anexo h3 {
    margin: 0;
}

.anexos-pagina {
    max-width: 1050px;
    margin: 0 auto;
}

.anexos-cabecalho {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.anexos-cabecalho h2,
.anexos-cabecalho p {
    margin: 0 0 5px;
}

.anexos-upload {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 10px 14px;
    align-items: end;
    padding: 16px;
    border: 1px solid #c8d7e6;
    background: #f8fafc;
}

.anexos-upload label,
.anexos-upload small {
    grid-column: 1 / -1;
}

.anexos-upload input[type="file"] {
    min-width: 0;
    box-sizing: border-box;
}

.anexos-vazio {
    padding: 24px 0 8px;
    color: #5f6f7f;
}

.anexos-lista {
    margin-top: 20px;
    border-top: 1px solid #dbe4ee;
}

.anexo-item {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #dbe4ee;
}

.anexo-tipo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 34px;
    border: 1px solid #9bbbd3;
    background: #eef5ff;
    color: #0b56a3;
    font-size: 12px;
    font-weight: bold;
}

.anexo-dados {
    min-width: 0;
}

.anexo-dados strong,
.anexo-dados small {
    display: block;
    overflow-wrap: anywhere;
}

.anexo-dados small {
    margin-top: 4px;
    color: #5f6f7f;
}

.anexo-descricao {
    display: block;
    margin-top: 7px;
    color: #263746;
}

.anexo-descricao-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 8px;
    margin-top: 8px;
}

.anexo-descricao-form input[type="text"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.anexo-descricao-form button {
    white-space: nowrap;
}

.anexo-acoes {
    display: flex;
    align-items: center;
    gap: 8px;
}

.anexo-acoes .btn-link {
    margin: 0;
}

.anexo-acoes form {
    margin: 0;
}

@media (max-width: 700px) {
    .anexos-cabecalho,
    .anexo-acoes {
        align-items: stretch;
        flex-direction: column;
    }

    .anexos-upload,
    .anexo-item,
    .anexo-descricao-form {
        grid-template-columns: 1fr;
    }

    .anexo-acoes {
        display: grid;
        grid-template-columns: 1fr;
    }
}

/* Controlo mensal */
.controlo-card {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.controlo-cabecalho {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.controlo-cabecalho h2 {
    margin: 0 0 8px;
}

.controlo-cabecalho p {
    margin: 0;
}

.controlo-resumo {
    padding: 10px 14px;
    border: 1px solid #c8d7e6;
    background: #f8fafc;
    white-space: nowrap;
}

.controlo-legenda {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 12px;
}

.legenda-item {
    padding: 6px 9px;
    border: 1px solid #c8d7e6;
    font-size: 13px;
    font-weight: bold;
}

.calendario-mensal {
    display: grid;
    grid-template-columns: repeat(7, minmax(125px, 1fr));
    overflow-x: auto;
    border-top: 1px solid #b9c8d8;
    border-left: 1px solid #b9c8d8;
}

.calendario-dia-semana {
    padding: 9px;
    border-right: 1px solid #b9c8d8;
    border-bottom: 1px solid #b9c8d8;
    background: #dfe8f3;
    text-align: center;
    font-weight: bold;
}

.calendario-dia {
    min-height: 168px;
    padding: 10px;
    box-sizing: border-box;
    border-right: 1px solid #b9c8d8;
    border-bottom: 1px solid #b9c8d8;
    background: #fff;
}

.calendario-dia.fora-mes {
    background: #eef1f4;
}

.calendario-dia.com-registo,
.legenda-item.com-registo {
    background: #e9f8ef;
}

.calendario-dia.em-falta,
.legenda-item.em-falta {
    background: #ffe1e1;
}

.calendario-dia.sem-valores,
.legenda-item.sem-valores {
    background: #fff5d9;
}

.calendario-dia.previsto,
.legenda-item.previsto {
    background: #eef5ff;
}

.calendario-numero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.calendario-numero strong {
    font-size: 20px;
}

.calendario-numero span {
    color: #5f6f7f;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.calendario-valores {
    margin: 0;
}

.calendario-valores div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 0;
}

.calendario-valores dt,
.calendario-valores dd {
    margin: 0;
}

.calendario-valores dd {
    text-align: right;
    font-weight: bold;
}

.calendario-valores .total {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid #9fb0c1;
}

.calendario-estado {
    min-height: 38px;
    margin: 18px 0 10px;
    font-size: 13px;
    font-weight: bold;
}

.calendario-acao {
    margin-top: 10px;
}

.calendario-acao button {
    width: 100%;
    padding: 7px;
    font-size: 12px;
}

@media (max-width: 700px) {
    .controlo-cabecalho {
        flex-direction: column;
    }
}

/* Movimentos a reconciliar */
.reconciliar-card {
    max-width: 1150px;
    margin-left: auto;
    margin-right: auto;
}

.reconciliar-cabecalho {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.reconciliar-cabecalho h2 {
    margin: 0 0 6px;
}

.reconciliar-cabecalho p {
    margin: 0;
}

.reconciliar-table th:nth-child(4),
.reconciliar-table th:nth-child(5) {
    width: 130px;
    text-align: right;
}

.reconciliar-table .linha-reconciliar {
    transition: opacity .15s ease;
}

@media (max-width: 700px) {
    .reconciliar-cabecalho {
        flex-direction: column;
    }
}
