﻿* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background: #f2f2f2;
    color: #111;
}

input,
button,
textarea,
select {
    font-family: inherit;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background: #f2f2f2;
    color: #111;
}

input,
button,
textarea,
select {
    font-family: inherit;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.login-wrap {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: #fff;
    border: 2px solid #111;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

    .login-card h1 {
        margin: 0;
        text-align: center;
        font-size: 2.2rem;
    }

.login-subtitle {
    margin: 8px 0 22px 0;
    text-align: center;
    color: #555;
    font-size: 1rem;
}

.input-login {
    width: 100%;
    height: 54px;
    margin-bottom: 14px;
    padding: 0 14px;
    border: 2px solid #222;
    border-radius: 10px;
    background: #fff;
    font-size: 1.2rem;
}

.btn-principal {
    width: 100%;
    min-height: 58px;
    border: 0;
    border-radius: 10px;
    background: #111;
    color: #fff;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
}

.msg-erro {
    display: block;
    min-height: 22px;
    margin-bottom: 14px;
    color: #b00020;
    font-weight: bold;
    text-align: center;
}
.topo-app {
    min-height: 74px;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #111;
    color: #fff;
}

    .topo-app h1 {
        margin: 0;
        font-size: 1.8rem;
    }

    .topo-app span {
        display: block;
        margin-top: 2px;
        color: #d7d7d7;
    }

.topo-utilizador {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: bold;
}

.btn-sair {
    min-height: 40px;
    padding: 0 18px;
    border: 2px solid #fff;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

    .btn-sair:hover {
        background: #fff;
        color: #111;
    }

.pagina-conteudo {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 20px;
}

.menu-principal {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.menu-card {
    min-height: 150px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 2px solid #111;
    border-radius: 14px;
    background: #fff;
    color: #111;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

    .menu-card:hover {
        transform: translateY(-3px);
        background: #111;
        color: #fff;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
    }

.menu-card-titulo {
    font-size: 1.45rem;
    font-weight: 800;
}

.menu-card-descricao {
    margin-top: 10px;
    font-size: 1rem;
    line-height: 1.4;
    color: #555;
}

.menu-card:hover .menu-card-descricao {
    color: #ddd;
}

@media (max-width: 700px) {

    .topo-app {
        padding: 12px 14px;
        align-items: flex-start;
    }

    .topo-utilizador {
        flex-direction: column;
        align-items: flex-end;
        gap: 6px;
    }

    .pagina-conteudo {
        padding: 16px 12px;
    }

    .menu-principal {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .menu-card {
        min-height: 120px;
        padding: 18px;
    }
}
.topo-marca {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topo-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    padding: 4px;
    border-radius: 10px;
    background: #fff;
}

@media (max-width: 700px) {
    .topo-logo {
        width: 48px;
        height: 48px;
    }

    .topo-marca {
        gap: 10px;
    }
}
.btn-topo-link {
    min-height: 40px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
}

    .btn-topo-link:hover {
        background: #fff;
        color: #111;
    }

.pagina-socios {
    max-width: 1400px;
}

.painel {
    padding: 22px;
    border: 2px solid #111;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.painel-cabecalho {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

    .painel-cabecalho h2 {
        margin: 0 0 4px 0;
        font-size: 1.6rem;
    }

.texto-secundario {
    color: #666;
    font-size: 0.95rem;
}

.filtros-socios {
    display: grid;
    grid-template-columns: minmax(320px, 2fr) 220px 240px;
    gap: 14px;
    align-items: end;
}

    .filtros-socios .campo-filtro:nth-child(4) {
        grid-column: 1;
    }

    .filtros-socios .campo-filtro:nth-child(5) {
        grid-column: 2;
    }

.filtros-botoes {
    grid-column: 3;
    display: flex;
    gap: 10px;
    align-items: end;
}

.campo-filtro {
    min-width: 0;
}

    .campo-filtro label {
        display: block;
        margin-bottom: 6px;
        font-weight: 700;
    }

    .campo-filtro .input-normal {
        width: 100%;
        min-height: 46px;
        box-sizing: border-box;
    }

.filtros-botoes .btn-acao-principal,
.filtros-botoes .btn-acao-secundaria {
    min-height: 46px;
    padding-left: 20px;
    padding-right: 20px;
}

@media (max-width: 950px) {

    .filtros-socios {
        grid-template-columns: 1fr 1fr;
    }

    .campo-pesquisa {
        grid-column: 1 / -1;
    }

    .filtros-socios .campo-filtro:nth-child(4),
    .filtros-socios .campo-filtro:nth-child(5) {
        grid-column: auto;
    }

    .filtros-botoes {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {

    .filtros-socios {
        grid-template-columns: 1fr;
    }

        .campo-pesquisa,
        .filtros-socios .campo-filtro:nth-child(4),
        .filtros-socios .campo-filtro:nth-child(5),
        .filtros-botoes {
            grid-column: 1;
        }

    .filtros-botoes {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

        .filtros-botoes .btn-acao-principal,
        .filtros-botoes .btn-acao-secundaria {
            width: 100%;
        }
}

.btn-acao-principal,
.btn-acao-secundaria {
    min-height: 46px;
    padding: 0 18px;
    border: 2px solid #111;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
}

.btn-acao-principal {
    background: #111;
    color: #fff;
}

    .btn-acao-principal:hover {
        background: #333;
    }

.btn-acao-secundaria {
    background: #fff;
    color: #111;
}

    .btn-acao-secundaria:hover {
        background: #eee;
    }

.msg-erro-pagina {
    display: block;
    margin: 10px 0;
    color: #b00020;
    font-weight: bold;
}

.tabela-responsive {
    width: 100%;
    overflow-x: auto;
}

.tabela-dados {
    width: 100%;
    min-width: 950px;
    border-collapse: collapse;
}

    .tabela-dados th {
        padding: 12px 10px;
        border-bottom: 3px solid #111;
        background: #f2f2f2;
        color: #111;
        text-align: left;
        white-space: nowrap;
    }

    .tabela-dados td {
        padding: 11px 10px;
        border-bottom: 1px solid #ddd;
        vertical-align: middle;
    }

    .tabela-dados tr:hover td {
        background: #fafafa;
    }

.btn-tabela {
    display: inline-block;
    min-width: 70px;
    padding: 8px 12px;
    border-radius: 7px;
    background: #111;
    color: #fff;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
}

    .btn-tabela:hover {
        background: #333;
    }

@media (max-width: 900px) {

    .filtros-socios {
        grid-template-columns: 1fr 1fr;
    }

    .campo-pesquisa {
        grid-column: 1 / -1;
    }

    .filtros-botoes {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {

    .painel {
        padding: 14px;
    }

    .painel-cabecalho {
        align-items: stretch;
        flex-direction: column;
    }

    .filtros-socios {
        grid-template-columns: 1fr;
    }

    .campo-pesquisa,
    .filtros-botoes {
        grid-column: auto;
    }

    .filtros-botoes {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .btn-acao-principal,
    .btn-acao-secundaria {
        width: 100%;
    }
}

.pagina-ficha-socio {
    max-width: 1200px;
}

    .pagina-ficha-socio .painel {
        margin-bottom: 18px;
    }

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.input-normal {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 2px solid #222;
    border-radius: 8px;
    background: #fff;
    color: #111;
    font-size: 1rem;
    box-sizing: border-box;
}

select.input-normal {
    cursor: pointer;
}

    input.input-normal:disabled,
    select.input-normal:disabled,
    textarea.input-normal:disabled {
        background: #ededed;
        color: #666;
        cursor: not-allowed;
    }mns: 1fr 1fr;
    }

    .btn-acao-principal,
    .btn-acao-secundaria {
        width: 100%;
    }
}

.pagina-ficha-socio {
    max-width: 1200px;
}

    .pagina-ficha-socio .painel {
        margin-bottom: 18px;
    }

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.campo-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

.campo-pequeno {
    grid-column: span 1;
}

.campo-grande {
    grid-column: span 2;
}

.campo-linha-completa {
    grid-column: 1 / -1;
}

.ajuda-campo {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.input-bloqueado {
    background: #ededed;
    color: #555;
}

.checks-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.check-form {
    display: block;
    padding: 14px;
    border: 2px solid #ddd;
    border-radius: 9px;
    background: #fafafa;
    font-weight: bold;
}

    .check-form input {
        margin-right: 8px;
        transform: scale(1.2);
    }

.textarea-normal {
    width: 100%;
    min-height: 130px;
    padding: 12px;
    border: 2px solid #222;
    border-radius: 8px;
    resize: vertical;
    font-size: 1rem;
}

.acoes-ficha,
.rodape-acoes {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-link-secundario {
    min-height: 46px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #111;
    border-radius: 8px;
    background: #fff;
    color: #111;
    font-weight: bold;
    text-decoration: none;
}

    .btn-link-secundario:hover {
        background: #eee;
    }

.rodape-acoes {
    justify-content: flex-end;
    padding-bottom: 30px;
}

.msg-sucesso-pagina {
    display: block;
    margin: 10px 0;
    color: #08752a;
    font-weight: bold;
}

@media (max-width: 900px) {

    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .campo-grande {
        grid-column: span 2;
    }

    .checks-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {

    .form-grid {
        grid-template-columns: 1fr;
    }

    .campo-pequeno,
    .campo-grande,
    .campo-linha-completa {
        grid-column: auto;
    }

    .acoes-ficha,
    .rodape-acoes {
        display: grid;
        grid-template-columns: 1fr;
    }

    .btn-link-secundario {
        width: 100%;
    }
}
.painel-processo-anual {
    max-width: 720px;
    margin: 0 auto;
}

.texto-explicativo {
    margin: 0 0 20px 0;
    color: #555;
    line-height: 1.5;
}

.form-grid-processo {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 14px;
    align-items: end;
}

@media (max-width: 600px) {
    .form-grid-processo {
        grid-template-columns: 1fr;
    }
}
.checks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.check-item {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fafafa;
}

    .check-item span {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .check-item input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin: 0;
    }

    .check-item label {
        margin: 0;
        font-weight: 500;
    }

.acoes-form {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 18px 0 30px 0;
}

input.btn-form,
input[type="submit"].btn-form,
input[type="button"].btn-form {
    min-width: 130px;
    min-height: 46px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    appearance: none;
}

input.btn-form-principal,
input[type="submit"].btn-form-principal,
input[type="button"].btn-form-principal {
    border: 2px solid #111;
    background: #111;
    color: #fff;
}

input.btn-form-cancelar,
input[type="submit"].btn-form-cancelar,
input[type="button"].btn-form-cancelar {
    border: 2px solid #111;
    background: #fff;
    color: #111;
}

input.btn-form:hover {
    opacity: 0.85;
}

@media (max-width: 600px) {
    .checks-grid {
        grid-template-columns: 1fr;
    }

    .acoes-form {
        flex-direction: column;
    }

    input.btn-form,
    input[type="submit"].btn-form,
    input[type="button"].btn-form {
        width: 100%;
    }
}
.total-recebimento {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 18px;
    margin-top: 20px;
    padding: 16px 18px;
    border-top: 2px solid #222;
    font-size: 1.15rem;
}

    .total-recebimento strong {
        font-size: 1.5rem;
    }

a.btn-form {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
}

a.btn-form-principal {
    border: 2px solid #111;
    background: #111;
    color: #fff;
}

@media (max-width: 700px) {
    .tabela-dados {
        font-size: 0.88rem;
    }

    .total-recebimento {
        justify-content: space-between;
    }
}

.acoes-form .btn-form {
    min-width: 130px;
    height: 48px;
    padding: 0 22px;
    border: 2px solid #111;
    border-radius: 9px;
    box-sizing: border-box;
    font-size: 1rem;
    font-weight: bold;
    line-height: 1;
}

.acoes-form a.btn-form {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.acoes-form input.btn-form {
    display: inline-block;
}

.dados-socio-grid {
    display: grid;
    grid-template-columns: 140px minmax(280px, 1fr) 180px 160px;
    gap: 20px;
    align-items: end;
    margin-top: 18px;
}

.dados-socio-campo {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

    .dados-socio-campo label {
        display: block;
        margin: 0;
        font-weight: 700;
    }

.dados-socio-valor {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 2px solid #333;
    border-radius: 9px;
    background: #eee;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .dados-socio-grid {
        grid-template-columns: 1fr 2fr;
    }
}

@media (max-width: 600px) {
    .dados-socio-grid {
        grid-template-columns: 1fr;
    }
}

.filtros-quotas {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(220px, 1fr);
    gap: 14px;
    margin-top: 14px;
}

@media (max-width: 700px) {
    .filtros-quotas {
        grid-template-columns: 1fr;
    }
}

.linha-filtros {
    display: grid;
    gap: 12px;
    align-items: end;
    margin-top: 16px;
}

.linha-filtros-principal {
    grid-template-columns: minmax(320px, 1fr) 240px;
}

.linha-filtros-quotas {
    grid-template-columns: minmax(240px, 1fr) 160px 160px auto;
}

.campo-filtro {
    min-width: 0;
}

    .campo-filtro label {
        display: block;
        margin-bottom: 6px;
        font-weight: 700;
    }

    .campo-filtro .input-normal {
        width: 100%;
        box-sizing: border-box;
    }

.acoes-filtros {
    display: flex;
    gap: 8px;
    align-items: end;
}

@media (max-width: 900px) {
    .linha-filtros-principal,
    .linha-filtros-quotas {
        grid-template-columns: 1fr;
    }

    .acoes-filtros {
        align-items: stretch;
    }
}

.painel-resumo-marcacao {
    margin-top: 18px;
}

.resumo-valores-marcacao {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

    .resumo-valores-marcacao > div {
        padding: 16px;
        border: 2px solid #ddd;
        border-radius: 10px;
        background: #fafafa;
    }

    .resumo-valores-marcacao span {
        display: block;
        margin-bottom: 8px;
        color: #666;
        font-weight: bold;
    }

    .resumo-valores-marcacao label {
        display: block;
        font-size: 1.5rem;
        font-weight: 800;
    }

.resumo-total-marcacao {
    border-color: #111 !important;
    background: #111 !important;
    color: #fff;
}

    .resumo-total-marcacao span {
        color: #ddd;
    }

@media (max-width: 700px) {
    .resumo-valores-marcacao {
        grid-template-columns: 1fr;
    }
}

.pagina-agenda-espacos {
    max-width: 1500px;
}

.agenda-cabecalho {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

    .agenda-cabecalho h2 {
        margin: 0 0 4px 0;
        font-size: 1.7rem;
    }

.agenda-acoes {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-link-agenda {
    min-height: 46px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #111;
    border-radius: 8px;
    background: #111;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
}

    .btn-link-agenda:hover {
        background: #333;
    }

.agenda-legenda {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.legenda-item {
    padding: 6px 10px;
    border: 1px solid #aaa;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.legenda-salao,
.marcacao-salao {
    background: #e6f0ff;
}

.legenda-cozinha,
.marcacao-cozinha {
    background: #fff0d9;
}

.legenda-sala,
.marcacao-sala {
    background: #e7f7e7;
}

.legenda-combinado,
.marcacao-combinado {
    background: #f3e5ff;
}

.legenda-dormitorio,
.marcacao-dormitorio {
    background: #f7e7e7;
}

.agenda-scroll {
    width: 100%;
    overflow-x: auto;
}

.agenda-semana-cabecalho,
.agenda-calendario {
    min-width: 1050px;
    display: grid;
    grid-template-columns: repeat(7, minmax(150px, 1fr));
}

.agenda-semana-cabecalho {
    border-top: 2px solid #111;
    border-left: 2px solid #111;
}

    .agenda-semana-cabecalho > div {
        padding: 10px;
        border-right: 2px solid #111;
        border-bottom: 2px solid #111;
        background: #111;
        color: #fff;
        font-weight: bold;
        text-align: center;
    }

.agenda-calendario {
    border-left: 1px solid #bbb;
}

.agenda-dia {
    min-height: 155px;
    padding: 7px;
    border-right: 1px solid #bbb;
    border-bottom: 1px solid #bbb;
    background: #fff;
}

.agenda-dia-outro-mes {
    background: #f1f1f1;
    color: #888;
}

.agenda-dia-hoje {
    box-shadow: inset 0 0 0 3px #111;
}

.agenda-dia-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 7px;
}

.agenda-dia-numero {
    font-size: 1.05rem;
    font-weight: 800;
}

.agenda-dia-adicionar {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #111;
    color: #fff;
    font-size: 1.25rem;
    font-weight: bold;
    line-height: 1;
    text-decoration: none;
}

    .agenda-dia-adicionar:hover {
        background: #444;
    }

.agenda-marcacao {
    display: block;
    margin-bottom: 6px;
    padding: 7px;
    border: 1px solid #999;
    border-radius: 7px;
    color: #111;
    text-decoration: none;
    overflow: hidden;
}

    .agenda-marcacao:hover {
        border-color: #111;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
    }

.agenda-marcacao-periodo {
    display: block;
    margin-bottom: 2px;
    font-size: 0.72rem;
    font-weight: bold;
    text-transform: uppercase;
}

.agenda-marcacao strong {
    display: block;
    font-size: 0.85rem;
    line-height: 1.2;
}

.agenda-marcacao small {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    color: #555;
}

@media (max-width: 900px) {

    .agenda-cabecalho {
        align-items: stretch;
        flex-direction: column;
    }

    .agenda-acoes {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

        .agenda-acoes .btn-acao-secundaria,
        .agenda-acoes .btn-link-agenda {
            width: 100%;
        }
}

@media (max-width: 600px) {

    .agenda-acoes {
        grid-template-columns: 1fr;
    }

    .agenda-semana-cabecalho,
    .agenda-calendario {
        min-width: 980px;
        grid-template-columns: repeat(7, 140px);
    }

    .agenda-dia {
        min-height: 140px;
    }
}

.painel-recebimentos {
    margin-top: 18px;
}

.estado-pagamento {
    margin-top: 16px;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fafafa;
    font-weight: bold;
}

.estado-pagamento-valor {
    margin-left: 6px;
    font-weight: 800;
}

.recebimento-form {
    margin-top: 18px;
    align-items: end;
}

.campo-botao-recebimento {
    display: flex;
    align-items: flex-end;
}

    .campo-botao-recebimento .btn-form {
        width: 100%;
    }

.tabela-recebimentos {
    margin-top: 20px;
}

/* =========================================================
   RESPONSIVIDADE GLOBAL DO SITE
   ========================================================= */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

table {
    max-width: 100%;
}

input,
select,
textarea,
button {
    max-width: 100%;
}


/* =========================================================
   TABLET E TELEMÓVEL
   ========================================================= */

@media (max-width: 768px) {

    body {
        margin: 0;
        min-width: 0;
        font-size: 16px;
    }

    /* Evita zoom automático nos campos em iPhone */
    input,
    select,
    textarea,
    button {
        font-size: 16px !important;
    }

    /* Conteúdo principal */
    .page,
    .pagina,
    .pagina-conteudo,
    .conteudo,
    .conteudo-principal,
    .main-content,
    main {
        width: 100%;
        max-width: none;
        min-width: 0;
        margin: 0;
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Cabeçalho */
    .header,
    .topo,
    .topo-app,
    .cabecalho {
        width: 100%;
        min-width: 0;
        padding: 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .topo-marca,
    .cabecalho-marca {
        width: 100%;
        min-width: 0;
    }

        .topo-marca h1,
        .cabecalho h1,
        .header h1 {
            font-size: 1.25rem;
            line-height: 1.25;
            overflow-wrap: anywhere;
        }

    .topo-utilizador,
    .cabecalho-utilizador {
        width: 100%;
    }

    /* Menus */
    .menu,
    .menu-principal,
    .menu-topo,
    nav {
        width: 100%;
        min-width: 0;
    }

        .menu ul,
        .menu-principal ul,
        .menu-topo ul,
        nav ul {
            display: flex;
            flex-direction: column;
            width: 100%;
            margin: 0;
            padding: 0;
            gap: 6px;
        }

        .menu li,
        .menu-principal li,
        .menu-topo li,
        nav li {
            width: 100%;
            list-style: none;
        }

        .menu a,
        .menu-principal a,
        .menu-topo a,
        nav a {
            display: block;
            width: 100%;
            min-height: 44px;
            padding: 10px 12px;
        }

    /* Painéis e cartões */
    .painel,
    .card,
    .cartao,
    .bloco,
    section {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding: 14px;
        margin-left: 0;
        margin-right: 0;
    }

    /* Grelhas */
    .grid,
    .form-grid,
    .cards-grid,
    .dashboard-grid,
    .menu-grid {
        display: grid;
        grid-template-columns: 1fr !important;
        width: 100%;
        min-width: 0;
        gap: 12px;
    }

    /* Campos */
    .campo-form,
    .form-group,
    .campo,
    .campo-pequeno,
    .campo-grande,
    .campo-linha-completa {
        width: 100%;
        min-width: 0;
        grid-column: 1 !important;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    input[type="tel"],
    select,
    textarea,
    .input-normal,
    .textarea-normal {
        width: 100% !important;
        min-width: 0;
        height: auto;
        min-height: 44px;
        padding: 10px;
    }

    textarea,
    .textarea-normal {
        min-height: 100px;
    }

    label {
        display: block;
        margin-bottom: 5px;
    }

    /* Botões */
    .acoes,
    .acoes-form,
    .botoes,
    .grupo-botoes,
    .toolbar,
    .barra-acoes {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 8px;
    }

    .btn,
    .btn-form,
    .botao,
    .btn-link,
    .btn-topo-link,
    input[type="submit"],
    input[type="button"],
    button {
        width: 100%;
        min-width: 0;
        min-height: 46px;
        white-space: normal;
        text-align: center;
    }

    /* Títulos */
    h1 {
        font-size: 1.5rem;
        line-height: 1.25;
    }

    h2 {
        font-size: 1.3rem;
        line-height: 1.3;
    }

    h3 {
        font-size: 1.1rem;
        line-height: 1.35;
    }

    /* Tabelas */
    .tabela-responsive,
    .table-responsive,
    .grid-wrapper,
    .grelha-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table,
    .tabela-dados,
    .gridview {
        width: 100%;
        min-width: 700px;
        border-collapse: collapse;
    }

    th,
    td {
        padding: 8px;
        white-space: nowrap;
    }

    /* Mensagens */
    .erro,
    .sucesso,
    .aviso,
    .msg-erro,
    .msg-sucesso,
    .msg-aviso,
    .msg-erro-pagina,
    .msg-sucesso-pagina {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    /* Rodapé */
    footer,
    .footer,
    .rodape {
        width: 100%;
        padding: 12px;
        text-align: center;
    }
}


/* =========================================================
   TELEMÓVEIS PEQUENOS
   ========================================================= */

@media (max-width: 480px) {

    body {
        font-size: 15px;
    }

    .page,
    .pagina,
    .pagina-conteudo,
    .conteudo,
    .conteudo-principal,
    main {
        padding-left: 7px;
        padding-right: 7px;
    }

    .painel,
    .card,
    .cartao,
    .bloco,
    section {
        padding: 10px;
        border-radius: 8px;
    }

    h1 {
        font-size: 1.35rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .btn,
    .btn-form,
    .botao,
    input[type="submit"],
    input[type="button"],
    button {
        min-height: 48px;
    }
}

/* =========================================================
   MODAIS (usado em quotas.aspx e caixa)
   ========================================================= */

.modal-fundo {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
}

.modal-card {
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.modal-card-pequeno {
    max-width: 440px;
}

.modal-topo {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

    .modal-topo h2 {
        margin: 0 0 4px 0;
    }

.btn-fechar-modal {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f2f2f2;
    color: #111;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

    .btn-fechar-modal:hover {
        background: #ddd;
    }

.modal-acoes {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.form-grid-modal {
    margin-top: 4px;
}

.btn-perigo {
    min-height: 46px;
    padding: 0 18px;
    border: 2px solid #b00020;
    border-radius: 8px;
    background: #b00020;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

    .btn-perigo:hover {
        background: #8c0019;
    }

@media (max-width: 600px) {
    .modal-acoes {
        flex-direction: column;
    }
}

/* =========================================================
   RESUMOS EM CARTÃO (quotas, saldos de caixa)
   ========================================================= */

.resumo-quotas,
.resumo-caixas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.resumo-quota-card,
.resumo-caixa-card {
    padding: 16px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #fafafa;
}

    .resumo-quota-card span,
    .resumo-caixa-card span {
        display: block;
        margin-bottom: 8px;
        color: #666;
        font-weight: bold;
    }

    .resumo-quota-card label,
    .resumo-caixa-card label,
    .resumo-caixa-card strong {
        display: block;
        font-size: 1.4rem;
        font-weight: 800;
    }

.resumo-caixa-card-negativo strong {
    color: #b00020;
}

/* =========================================================
   ESTADOS / BADGES (quotas, movimentos de caixa)
   ========================================================= */

.linha-anulada td {
    background: #f5f5f5 !important;
    color: #999;
    text-decoration: line-through;
}

.linha-paga td {
    background: #eefaf0;
}

.linha-pendente td {
    background: #fff8ec;
}

.btn-tabela-pagar {
    background: #08752a;
}

    .btn-tabela-pagar:hover {
        background: #06611f;
    }

.btn-tabela-anular {
    background: #b00020;
}

    .btn-tabela-anular:hover {
        background: #8c0019;
    }

.badge-tipo {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-importacao {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 12px;
    background: #eee;
    color: #666;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-entrada {
    background: #dff3e4;
    color: #08752a;
}

.badge-saida {
    background: #fdeaec;
    color: #b00020;
}

.badge-transferencia {
    background: #e6f0ff;
    color: #1a4fb0;
}

.valor-positivo {
    color: #08752a;
    font-weight: bold;
}

.valor-negativo {
    color: #b00020;
    font-weight: bold;
}

.filtros-caixa {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 160px 160px 160px minmax(200px, 1.4fr);
    gap: 14px;
    align-items: end;
    margin-top: 14px;
}

@media (max-width: 950px) {
    .filtros-caixa {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .filtros-caixa {
        grid-template-columns: 1fr;
    }
}