/* ============================================================
   css.css — Condomínios | Nuno Pragana
   ============================================================ */

/* ---- VARIÁVEIS ---- */
:root {
    --font-mono: 'Menlo', 'Andale Mono', 'Helvetica Neue', monospace;
    --font-cond: 'Avenir Next Condensed', 'Helvetica Neue', Arial, sans-serif;

    --blue: 75, 100, 125;
    --blue1: 237, 239, 242;
    --fuchsia: 225, 25, 100;
    --white: 255, 255, 255;
}


/* ---- RESET / BASE ---- */
* {
    box-sizing: border-box;
    font-size: 11px;
    letter-spacing: 1px;
}

body {
    font-family: var(--font-cond);
    margin: 0;
}

hr {
    border: none;
    border-bottom: 1px solid rgba(var(--blue), 0.8);
}


/* ---- CONTAINER ---- */
#container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    top: 0;
    margin: 0;
    padding: 0 10px;
}


/* ============================================================
   LOGIN
   ============================================================ */
.login {
    width: 400px;
    background-color: rgba(var(--blue), 0.2);
    box-shadow: 5px 5px 10px 0 rgba(0, 0, 0, 0.3);
    margin: 10% auto;
}

.login h1 {
    text-align: center;
    color: #5b6574;
    font-size: 1.65em;
    padding: 20px 0;
    border-bottom: 1px solid #dee0e4;
}

.login form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.login form label {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background-color: rgba(var(--blue), 0.8);
    color: #fff;
}

.login form input[type="password"],
.login form input[type="email"] {
    width: 310px;
    height: 50px;
    border: 1px solid rgba(var(--blue), 0.6);
    margin-bottom: 20px;
    padding: 0 15px;
}

.login form input[type="submit"],
.login input[type="button"] {
    padding: 15px;
    background-color: rgba(var(--blue), 0.8);
    border: 0;
    cursor: pointer;
    font-size: 1.3em;
    font-weight: bold;
    color: #fff;
    transition: background-color 0.3s;
}

.login form input[type="submit"] {
    width: 100%;
    margin-top: 20px;
}

.login input[type="button"] {
    width: 33.1%;
    margin-bottom: 60px;
}

.login form input[type="submit"]:hover,
.login form input[type="button"]:hover {
    background-color: rgba(var(--blue), 0.6);
}

.login form input[type="button"]:active {
    background-color: rgba(var(--fuchsia), 0.4);
}

.login form input[name="register"],
.login form input[name="reset"] {
    background-color: rgba(var(--blue), 0.2);
}


/* ============================================================
   HEADER
   ============================================================ */
.header {
    padding: 5px;
    text-align: center;
    background: rgba(var(--blue), 0.1);
    border-bottom: 2px solid rgba(var(--fuchsia), 1);
    height: 85px;
    overflow: hidden;
}

.header>h1 {
    font-size: 1.55em;
    color: rgba(var(--blue), 1);
    margin: 5px;
    letter-spacing: 3px;
}

.header>h2 {
    font-size: 1.25em;
    font-weight: normal;
    margin: 5px 5px 5px 0;
    letter-spacing: 1px;
}


/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    position: sticky;
    top: 0;
    background-color: rgba(var(--blue), 0.8);
    letter-spacing: 2px;
    z-index: 100;
}

.navbar a {
    float: left;
    display: block;
    color: #f2f2f2;
    text-align: center;
    padding: 10px 20px;
    text-decoration: none;
    font-size: 1.2em;
}

.navbar .logout {
    float: right;
}

.navbar .icon {
    display: none;
}

.navbar a:hover,
.dropdown:hover .dropbtn {
    background-color: rgba(var(--blue), 0.4);
    color: white;
}

.navbar_active {
    background-color: rgba(var(--fuchsia), 0.8);
    color: white;
}

/* Dropdown */
.dropdown {
    float: left;
    overflow: hidden;
}

.dropdown .dropbtn {
    font-size: 1.2em;
    border: none;
    outline: none;
    color: white;
    padding: 10px 20px;
    background-color: inherit;
    font-family: inherit;
    letter-spacing: 2px;
    margin: 0;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: rgba(var(--blue1), 1);
    min-width: 160px;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.dropdown-content a {
    float: none;
    color: black;
    padding: 10px 20px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.dropdown-content a:hover {
    background-color: rgba(var(--blue), 0.2);
}

.dropdown:hover .dropdown-content {
    display: block;
}


/* ============================================================
   LAYOUT: ROW / MAIN / SIDE
   ============================================================ */
.row {
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    margin: 10px 0;
    letter-spacing: 0;
}

.main {
    flex: 70%;
    padding: 10px;
}

.main>h2 {
    font-size: 1.5em;
    color: rgba(var(--blue), 1);
}

.side {
    flex: 30%;
    border: 1px solid rgba(var(--blue), 0.8);
    padding: 10px;
}

.side>h2 {
    color: rgba(var(--blue), 1);
}

.side td {
    font-size: 0.8em;
}


/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    position: sticky;
    bottom: 0;
    flex-grow: 0;
    padding: 5px;
    text-align: center;
    background: rgba(var(--blue), 0.6);
    color: #fff;
}


/* ============================================================
   BOTÕES
   ============================================================ */
button {
    background-color: transparent;
    border: none;
    font-size: 14px;
    /color: rgba(var(--blue), 0.5);
    */ cursor: pointer;
}

button:hover {
    color: rgba(var(--blue), 0.8);
}

button:active {
    color: rgba(var(--blue), 1);
}


/* ============================================================
   TABELAS
   ============================================================ */

/* Lista */
table.tlst {
    width: 100%;
}

table.tlst th {
    padding: 2px 10px;
}

table.tlst td {
    padding: 10px;
}

table.tlst td div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
}

table.tlst p {
    margin: 0;
}

table.tlst h4 {
    margin: 0;
}

table.tlst tbody tr:nth-child(even) {
    background-color: rgba(var(--blue), 0.05);
}

table.tlst tbody tr:nth-child(odd) {
    background-color: transparent;
}

table.tlst tbody tr:hover {
    background-color: rgba(var(--blue), 0.1);
    cursor: pointer;
}

.tlst .nolst {
    display: none;
}

/* Esconde elementos marcados como "não imprimir" (formulários de filtro,
   botões de acção, etc.) — utilitário genérico, útil em qualquer página
   com impressão, não só nos relatórios standalone. */
@media print {
    .noprint {
        display: none !important;
    }
}

/* Inverso de .noprint — mostra só em impressão/PDF, esconde em ecrã.
   Usado por exemplo no cabeçalho com o nome do condomínio e o "risco" de
   cor do edifício (movimentos.php), que só deve aparecer no documento
   final, não durante a navegação normal na página. */
.onlyprint {
    display: none;
}

@media print {
    .onlyprint {
        display: block;
    }
}

/* Sub-contas de entidades (fornecedores/bancos/etc.) — usado em inc.ent.php
   na lst(): uma entidade cujo p_entID aponta para OUTRA entidade (a "mãe"),
   em vez do prefixo genérico da categoria, é uma sub-conta. A query já as
   agrupa logo a seguir à mãe; esta classe dá-lhes um aspecto recuado e mais
   discreto, para ficar visualmente óbvio que pertencem a ela. */
tr.ent-sub td {
    color: rgba(0, 0, 0, 0.45);
    font-size: 0.92em;
    background-color: rgba(var(--blue), 0.03);
}

tr.ent-sub td:nth-child(2) {
    padding-left: 22px;
}

.ent-sub-arrow {
    color: rgba(var(--blue), 0.4);
    margin-right: 6px;
}

/* Detalhe (só leitura) — largura automática, colada ao conteúdo, NÃO estica ao .main */
.tdtl,
table.tdtl {
    width: auto;
    max-width: 640px;
    table-layout: auto;
}

table.tdtl th,
table.tfrm th {
    font-size: 0.9em;
    color: rgba(var(--blue), 0.6);
    text-align: right;
    padding-right: 10px;
    width: 150px;
    white-space: nowrap;
}

table.tdtl td {
    width: auto;
    text-align: left;
    white-space: nowrap;
}

/* Formulário (edição) — este sim deve ocupar a largura do .main, os inputs precisam do espaço.
   O th mantém a mesma largura fixa da tabela de detalhe (acima), para o rótulo não saltar de sítio. */
table.tfrm {
    width: 100%;
    max-width: 100%;
    table-layout: auto;
}

/* Variante para tabelas com linhas <td colspan="2"> de cabeçalho de secção
   (ex: inc.sin.php, para ligar duas secções na mesma tabela sem desalinhar
   as colunas entre elas — ver histórico do ficheiro). Com table-layout:auto,
   o Safari recalcula mal a largura da coluna de rótulos quando há uma célula
   colspan a meio da tabela (o Chromium não tem este problema) — table-layout:
   fixed com <colgroup> torna as larguras das colunas determinísticas e
   independentes do browser. max-width mantém o formulário com largura
   própria em ecrãs largos (espaço em branco à direita), tal como .tdtl. */
table.tfrm-sec,
table.tdtl-sec {
    table-layout: fixed;
    width: 100%;
    max-width: 700px;
}

table.tfrm-sec col.lbl,
table.tdtl-sec col.lbl {
    width: 150px;
}


/* ============================================================
   UTILITÁRIOS
   ============================================================ */
.aL {
    text-align: left;
}

.aC {
    text-align: center;
}

.aR {
    text-align: right;
}

.bg05 {
    background-color: rgba(var(--blue), 0.05);
}

.bg10 {
    background-color: rgba(var(--blue), 0.1);
}

.bg20 {
    background-color: rgba(var(--blue), 0.2);
}

.bt {
    border-top: 0.25px solid rgba(var(--blue), 0.5);
}

.bb {
    border-bottom: 0.25px solid rgba(var(--blue), 0.5);
}

.bl {
    border-left: 0.25px solid rgba(var(--blue), 0.5);
}

.br {
    border-right: 0.25px solid rgba(var(--blue), 0.1);
}

.cf {
    color: rgba(var(--blue), 1);
}

.df {
    color: rgba(0, 0, 0, 0.5);
}

.ic {
    color: rgba(0, 0, 0, 0.4);
}

.ic:hover {
    color: rgba(var(--fuchsia), 1);
}

.fw5 {
    font-weight: 500;
}

.fw6 {
    font-weight: 600;
}

.fs08 {
    font-size: 0.8em;
}

.fs12 {
    font-size: 1.2em;
}

.fs15 {
    font-size: 1.5em;
}

/* ---- Balancete de Condóminos / Notas de Débito (inc.bl.php) ---- */
.hdr-actions {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.bg-plain {
    background-color: #fff;
}

.clr-muted {
    color: #666;
}

.clr-danger {
    color: red;
}

.clr-silver {
    color: silver;
}

.in-date {
    width: 100px;
}

#btnHide:hover {
    background-color: rgba(var(--blue), 0.1);
}

/* Ícone de envio de email (envelope), clicável — usado no inc.bl.php e no
   inc.nd.lst.php, para terem a mesma cor/altura de linha nas duas listas. */
.icEnv {
    color: #888;
    cursor: pointer;
}

/* Usadas no inc.nd.lst.php (antes definidas inline no próprio ficheiro) */
.alC {
    text-align: center;
}

.wIcn {
    width: 30px;
    white-space: nowrap;
}

.wDoc {
    width: 60px;
}

.cP {
    cursor: pointer;
}


/* ============================================================
   RESPONSIVO
   ============================================================ */

/* Tablet */
@media screen and (max-width: 800px) {

    .row,
    .navbar {
        flex-direction: column;
    }

    .main {
        flex: 0;
        padding: 10px 0;
    }

    .side {
        flex: 0;
    }

    /* Em ecrãs pequenos, a tabela de detalhe pode ocupar a largura toda */
    .tdtl,
    table.tdtl {
        width: 100%;
        max-width: 100%;
    }

    table.tdtl th,
    table.tfrm th {
        width: auto;
        white-space: normal;
    }

    table.tdtl td {
        white-space: normal;
    }

    /* Volta ao layout automático em ecrãs pequenos — o colgroup de largura
       fixa (150px) de .tfrm-sec/.tdtl-sec não faz sentido quando o rótulo
       já passou a ficar em cima do campo (ver regra acima). */
    table.tfrm-sec,
    table.tdtl-sec {
        table-layout: auto;
        max-width: 100%;
    }

    table.tfrm-sec col.lbl,
    table.tdtl-sec col.lbl {
        width: auto;
    }
}

button {
    color: rgba(var(--blue), 0.5);
    background: transparent;
    border: none;
    cursor: pointer;
}

button i,
button .fa,
button .fa-solid,
button .fa-regular,
button .fa-brands {
    color: inherit;
}


/* Mobile */
@media screen and (max-width: 600px) {

    .navbar a:not(:first-child),
    .dropdown .dropbtn {
        display: none;
    }

    .navbar a.icon {
        float: right;
        display: block;
    }

    .navbar.responsive {
        position: relative;
    }

    .navbar.responsive .icon {
        position: absolute;
        right: 0;
        top: 0;
    }

    .navbar.responsive a {
        float: none;
        display: block;
        text-align: left;
    }

    .navbar.responsive .dropdown {
        float: none;
    }

    .navbar.responsive .dropdown-content {
        position: relative;
    }

    .navbar.responsive .dropdown .dropbtn {
        display: block;
        width: 100%;
        text-align: left;
    }

    .tlst .rsp_lst {
        display: none;
    }
}

/* Mobile pequeno */
@media screen and (max-width: 400px) {

    .row,
    .navbar {
        flex-direction: column;
    }

    #container {
        padding: 0;
    }

    .tlst .rsp_lst {
        display: none;
    }
}

/* ============================================================
   TOTP — verify + setup | acrescentar ao css.css
   ============================================================ */

/* Contentor centrado — usado por verify e setup */
.verify-outer {
    display: flex;
    justify-content: center;
    padding: 20px 10px;
}

/* Caixa verify (login 2FA) */
.verify-box {
    width: 100%;
    max-width: 380px;
    border: 1px solid rgba(var(--blue), 0.5);
    border-radius: 8px;
    padding: 28px 24px;
    background: #fff;
    text-align: center;
}

.verify-box h2 {
    font-size: 1.3em;
    color: rgba(var(--blue), 1);
    letter-spacing: 0.3em;
    font-weight: 500;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(var(--fuchsia), 0.5);
}

.verify-ico {
    font-size: 2em;
    color: rgba(var(--blue), 0.6);
    margin-bottom: 10px;
}

.verify-box p {
    color: rgba(0, 0, 0, 0.55);
    line-height: 160%;
    margin-bottom: 6px;
}

/* Caixa setup (gestão 2FA) */
.totp-box {
    width: 100%;
    max-width: 480px;
    border: 1px solid rgba(var(--blue), 0.5);
    border-radius: 8px;
    padding: 24px;
    background: #fff;
}

.totp-title {
    font-size: 1.3em;
    color: rgba(var(--blue), 1);
    letter-spacing: 0.25em;
    font-weight: 500;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(var(--fuchsia), 0.5);
}

.totp-subtitle {
    font-size: 1.1em;
    color: rgba(var(--blue), 1);
    letter-spacing: 0.2em;
    font-weight: 500;
    margin: 14px 0 8px;
}

.totp-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.totp-lbl {
    color: rgba(0, 0, 0, 0.4);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.totp-badge-on {
    background: rgba(var(--blue), 0.1);
    color: rgba(var(--blue), 1);
    border: 1px solid rgba(var(--blue), 0.4);
    border-radius: 20px;
    padding: 2px 10px;
}

.totp-badge-off {
    background: rgba(var(--fuchsia), 0.06);
    color: rgba(var(--fuchsia), 0.8);
    border: 1px solid rgba(var(--fuchsia), 0.4);
    border-radius: 20px;
    padding: 2px 10px;
}

.totp-msg-ok {
    color: rgba(var(--blue), 1);
    font-weight: 600;
    margin-bottom: 10px;
}

.totp-hint {
    color: rgba(0, 0, 0, 0.4);
    margin: 8px 0;
}

.totp-btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.totp-btn {
    display: inline-block;
    padding: 0 12px;
    line-height: 26px;
    border-radius: 4px;
    background-color: rgba(var(--blue), 0.08);
    border-top: 1px solid rgba(var(--blue), 0.25);
    border-bottom: 1px solid rgba(var(--blue), 1);
    border-left: 1px solid rgba(var(--blue), 0.25);
    border-right: 1px solid rgba(var(--blue), 0.25);
    color: rgba(var(--blue), 1);
    cursor: pointer;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    min-height: 30px;
}

.totp-btn:hover {
    background-color: rgba(var(--blue), 0.15);
}

.totp-btn-danger {
    background-color: rgba(var(--fuchsia), 0.06);
    border-bottom: 1px solid rgba(var(--fuchsia), 0.8);
    color: rgba(var(--fuchsia), 1);
}

.totp-btn-danger:hover {
    background-color: rgba(var(--fuchsia), 0.12);
}

.totp-ip-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 2px;
    margin-bottom: 12px;
}

.totp-ip-addr {
    font-family: var(--font-mono);
    color: rgba(var(--blue), 1);
    letter-spacing: 0;
    padding: 3px 8px 3px 0;
}

.totp-ip-label {
    color: rgba(0, 0, 0, 0.5);
    padding: 3px 8px;
}

.totp-ip-del {
    text-align: right;
}

.totp-del-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(var(--fuchsia), 0.7);
    min-height: auto;
    padding: 2px 4px;
}

.totp-del-btn:hover {
    color: rgba(var(--fuchsia), 1);
}

.totp-ip-form {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.totp-ip-input {
    font-family: var(--font-mono);
    letter-spacing: 0;
    width: 160px;
    padding: 3px 6px;
    border-top: 1px solid rgba(var(--blue), 0.25);
    border-bottom: 1px solid rgba(var(--blue), 1);
    border-left: 1px solid rgba(var(--blue), 0.25);
    border-right: 1px solid rgba(var(--blue), 0.25);
    outline: none;
    border-radius: 3px;
}

.totp-label-input {
    width: 140px;
    padding: 3px 6px;
    border-top: 1px solid rgba(var(--blue), 0.25);
    border-bottom: 1px solid rgba(var(--blue), 1);
    border-left: 1px solid rgba(var(--blue), 0.25);
    border-right: 1px solid rgba(var(--blue), 0.25);
    outline: none;
    border-radius: 3px;
}

.totp-ip-current {
    font-family: var(--font-mono);
    letter-spacing: 0;
}

.totp-qr {
    display: block;
    margin: 10px 0;
    border: 1px solid rgba(var(--blue), 0.15);
    border-radius: 4px;
}

.totp-secret {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 3px;
    background: rgba(var(--blue), 0.06);
    border: 1px solid rgba(var(--blue), 0.3);
    border-radius: 4px;
    padding: 5px 10px;
    color: rgba(var(--blue), 1);
    margin-bottom: 12px;
    word-break: break-all;
}

.totp-recovery-list {
    background: rgba(var(--blue), 0.04);
    border: 1px solid rgba(var(--blue), 0.2);
    border-radius: 6px;
    padding: 12px;
    margin: 12px 0;
}

.totp-recovery-code {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 3px;
    padding: 3px 0;
    color: rgba(var(--blue), 1);
}

/* Inputs verify */
.verify-input {
    width: 100%;
    padding: 10px 5px;
    font-size: 26px;
    letter-spacing: 16px;
    text-align: center;
    border-top: 1px solid rgba(var(--blue), 0.25);
    border-bottom: 1px solid rgba(var(--blue), 1);
    border-left: 1px solid rgba(var(--blue), 0.25);
    border-right: 1px solid rgba(var(--blue), 0.25);
    margin: 12px 0 14px;
    font-family: var(--font-mono);
    color: #333;
    outline: none;
    border-radius: 3px;
}

.verify-input-recovery {
    width: 100%;
    padding: 8px 5px;
    font-size: 14px;
    letter-spacing: 4px;
    text-align: center;
    border-top: 1px solid rgba(var(--blue), 0.25);
    border-bottom: 1px solid rgba(var(--blue), 1);
    border-left: 1px solid rgba(var(--blue), 0.25);
    border-right: 1px solid rgba(var(--blue), 0.25);
    margin: 12px 0 14px;
    font-family: var(--font-mono);
    color: #333;
    outline: none;
    border-radius: 3px;
    text-transform: uppercase;
}

.verify-input:focus,
.verify-input-recovery:focus {
    border-bottom-color: rgba(var(--fuchsia), 1);
}

.verify-btn {
    display: block;
    width: 100%;
    padding: 0;
    line-height: 28px;
    border-radius: 4px;
    background-color: rgba(var(--blue), 0.08);
    border-top: 1px solid rgba(var(--blue), 0.25);
    border-bottom: 1px solid rgba(var(--blue), 1);
    border-left: 1px solid rgba(var(--blue), 0.25);
    border-right: 1px solid rgba(var(--blue), 0.25);
    color: rgba(var(--blue), 1);
    cursor: pointer;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.verify-btn:hover {
    background-color: rgba(var(--blue), 0.15);
}

.verify-err {
    color: rgba(var(--fuchsia), 1);
    font-weight: 600;
    margin: 6px 0;
}

.verify-hr {
    border: none;
    border-top: 1px solid rgba(var(--blue), 0.2);
    margin: 20px 0 16px;
}

.verify-hint {
    color: rgba(0, 0, 0, 0.35);
}

.verify-toggle {
    display: inline-block;
    margin-top: 8px;
    color: rgba(var(--blue), 0.7);
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    min-height: auto;
}

.verify-toggle:hover {
    color: rgba(var(--fuchsia), 1);
}

.verify-cancel {
    display: inline-block;
    margin-top: 14px;
    color: rgba(var(--blue), 0.5);
    text-decoration: none;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.verify-cancel:hover {
    color: rgba(var(--fuchsia), 1);
}

.panel {
    display: none;
}

.panel.active {
    display: block;
}

/* ---- GLOBAL TYPOGRAPHY & FORM REFAC ---- */
body,
input,
select,
textarea,
button,
table,
th,
td {
    font-family: var(--font-cond);
}

.calendar-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(var(--blue), 1);
    letter-spacing: 1px;
}

.bt-hdr,
.bt-hdr i,
.bt-hdr svg {
    font-size: 14px;
}

/* Estado (cor/cursor/hover) do .bt-hdr — antes só tinha o tamanho definido.
   Segue o mesmo padrão de .ic/.icEnv: cinza-azulado em repouso, fúchsia no
   hover. Usado nos ícones FontAwesome da barra de acções (ex: Gerar PDF,
   Fechar, em movimentos.php). */
.bt-hdr {
    color: rgba(var(--blue), 0.5);
    cursor: pointer;
    transition: color 0.15s ease;
}

.bt-hdr:hover {
    color: rgba(var(--blue), 0.8);
}

.bt-hdr:active {
    color: rgba(var(--blue), 1);
}

/* ---- RESPONSIVE OVERRIDES FOR TABLES AND FIELDS ---- */
table.tfrm input:not([type="checkbox"]):not([type="radio"]),
table.tfrm textarea,
table.tfrm select {
    width: 80%;
}

@media screen and (max-width: 800px) {
    table.tfrm input:not([type="checkbox"]):not([type="radio"]),
    table.tfrm textarea,
    table.tfrm select {
        width: 100%;
    }
}

/* Campos curtos (NIF, NISS, CRP, Art Matricial, etc.) — só em desktop.
   Em mobile a regra acima (100%) já venceu por vir depois; aqui reforçamos
   que só se aplica a partir do breakpoint de desktop, nunca abaixo dele. */
@media screen and (min-width: 801px) {
    table.tfrm input.in-short {
        width: 80%;
        max-width: 200px;
    }
}

/* Par Código Postal + Cidade — layout flexível, sem calc() com px fixos.
   O código postal tem largura fixa (não precisa de escalar), a cidade
   ocupa o resto do espaço disponível — funciona em qualquer ecrã.
   O próprio .cp-row precisa da mesma largura que os outros campos (80%),
   senão fica mais largo que tudo o resto, por não ser um <input>. */
table.tfrm .cp-row {
    display: flex;
    gap: 4px;
    align-items: center;
    width: 80%;
}

table.tfrm .cp-row input.in-cp {
    width: 80px;
    flex: 0 0 80px;
}

table.tfrm .cp-row input.in-city {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
}

@media screen and (max-width: 800px) {
    table.tfrm .cp-row {
        width: 100%;
    }
}

/* ---- FOCUS de inputs/selects/textarea — substitui o anel azul do browser
   por um estilo consistente com o resto do site (cor --blue, já usada em
   todo o lado; não é fúchsia — o fúchsia é reservado para acentos/erros). ---- */
table.tfrm input:not([type="checkbox"]):not([type="radio"]):focus,
table.tfrm select:focus,
table.tfrm textarea:focus,
#age_ent_txt:focus {
   # outline: none;
   # border-color: rgba(var(--blue), 0.8);
   # box-shadow: 0 0 0 2px rgba(var(--blue), 0.15);
}

/* ============================================================
   jQuery UI — estrutura essencial (self-hosted, não depende de CDN)
   Sem isto, o autocomplete deixa visível o texto de acessibilidade
   ("1 result is available...") e o menu de resultados fica sem
   posicionamento/fundo correctos.
   ============================================================ */
.ui-helper-hidden-accessible {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

.ui-front {
    z-index: 1001;
}

.ui-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: block;
    outline: none;
}

.ui-menu .ui-menu-item {
    margin: 0;
    padding: 0;
    width: 100%;
    list-style: none;
}

.ui-autocomplete {
    position: absolute;
    cursor: default;
}

/* ============================================================
   jQuery UI — Datepicker & Autocomplete (tema custom)
   ============================================================ */

/* --- Datepicker --- */
.ui-datepicker {
    display: none;
    position: absolute;
    font-family: var(--font-cond);
    font-size: 11px;
    background: #fff;
    border: 1px solid rgba(var(--blue), 0.5);
    border-radius: 4px;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.15);
    padding: 6px 8px;
    z-index: 1001 !important;
}

.ui-datepicker .ui-datepicker-header {
    background: rgba(var(--blue), 0.8);
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 6px 32px;
    position: relative;
    text-align: center;
}

.ui-datepicker .ui-datepicker-title {
    color: #fff;
    font-weight: 600;
    letter-spacing: 1px;
}

.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    cursor: pointer;
}

.ui-datepicker .ui-datepicker-prev {
    left: 4px;
}

.ui-datepicker .ui-datepicker-next {
    right: 4px;
}

/* esconde o texto do prevText/nextText (seja "Anterior"/"Seguinte" ou "<"/">"
   — não importa o que estiver configurado no $.datepicker.setDefaults,
   este texto fica sempre escondido) e desenha a seta só com CSS */
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
    display: none;
}

.ui-datepicker .ui-datepicker-prev::before,
.ui-datepicker .ui-datepicker-next::before {
    font-size: 16px;
    line-height: 1;
    color: #fff;
}

.ui-datepicker .ui-datepicker-prev::before {
    content: '‹';
}

.ui-datepicker .ui-datepicker-next::before {
    content: '›';
}

.ui-datepicker .ui-datepicker-prev-hover,
.ui-datepicker .ui-datepicker-next-hover {
    background: rgba(255, 255, 255, 0.2);
    border: none;
}

.ui-datepicker table {
    width: 100%;
    border-collapse: collapse;
    margin: 4px 0;
}

.ui-datepicker th {
    color: rgba(var(--blue), 0.7);
    font-weight: 600;
    padding: 4px 0;
    text-align: center;
}

.ui-datepicker td {
    padding: 1px;
    text-align: center;
}

.ui-datepicker td a,
.ui-datepicker td span {
    display: block;
    padding: 4px 0;
    border-radius: 3px;
    color: #333;
    text-decoration: none;
}

.ui-datepicker td a.ui-state-default:hover {
    background: rgba(var(--blue), 0.15);
    color: rgba(var(--blue), 1);
}

.ui-datepicker td a.ui-state-active {
    background: rgba(var(--blue), 0.85);
    color: #fff;
    font-weight: 600;
}

.ui-datepicker td .ui-datepicker-today a {
    background: rgba(var(--blue1), 1);
    border: 1px solid rgba(var(--blue), 0.4);
}

.ui-datepicker-buttonpane button {
    font-family: var(--font-cond);
    font-size: 10px;
}

@media print {
    .ui-datepicker {
        display: none !important;
    }
}

/* --- Autocomplete --- */
.ui-autocomplete {
    font-family: var(--font-cond);
    font-size: 11px;
    background: #fff;
    border: 1px solid rgba(var(--blue), 0.5);
    border-radius: 0 0 4px 4px;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.15);
    max-height: 220px;
    overflow-y: auto;
    z-index: 1001 !important;
    padding: 2px 0;
    list-style: none;
    margin: 0;
}

.ui-autocomplete .ui-menu-item a {
    display: block;
    padding: 5px 10px;
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

.ui-autocomplete .ui-menu-item a.ui-state-focus,
.ui-autocomplete .ui-menu-item a:hover {
    background: rgba(var(--blue), 0.1);
    color: rgba(var(--blue), 1);
    border: none;
    margin: 0;
}


/* ============================================================
   BARRA DE FILTROS (datas, selects, pesquisa)
   Copiada tal-e-qual do estilo inline que já existe em utl_fltr_2.php
   (flt_mth) — para que qualquer módulo (conta-corrente, listagens,
   etc.) que precise da mesma barra à direita do título use esta
   classe em vez de repetir o <style> ficheiro a ficheiro.
   Flutua à direita com margem negativa para ficar alinhada com o
   <span class='title'> que a antecede na mesma "linha" visual.
   ============================================================ */

/* Layout do contentor de filtros — sem cor, só posicionamento */
.flt-bar {
    float: right;
    margin: -6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Cor/estilo de qualquer input/select de filtro, com ou sem .flt-bar à volta */
.in-flt {
    font-family: var(--font-cond);
    font-size: 11px;
    letter-spacing: 0.05em;
    color: rgba(var(--blue), 1);
    background: rgba(var(--blue), 0.2);
    border: 1px solid rgba(var(--blue), 0.4);
    border-radius: 4px;
    padding: 3px 8px;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.in-flt:hover,
.in-flt:focus {
    background: rgba(var(--blue), 0.3);
    border-color: rgba(var(--blue), 0.6);
}

.in-flt::placeholder {
    color: rgba(var(--blue), 0.6);
}

.nw {
    white-space: nowrap;
}

.bg-saldo {
    background-color: rgba(250, 200, 150, 0.25);
}
