﻿

/* Tamanho base +1 (16px do browser → 17px): aumenta o texto que não tem font-size próprio
   (caixas de texto, listas, botões do Bootstrap) e os componentes MudBlazor, que usam rem.
   Os font-size em px do portal já foram todos aumentados 1px individualmente. */
html {
    font-size: 17px;
}

body {
    margin: 0;
    font-family: Segoe UI, Arial;
    background: #f4f6f9;
    display: flex;
}

/* ======= LOGIN =============*/

/* LOGIN - TOTALMENTE ISOLADO */


/* FUNDO */
.login-layout {
    position: fixed;
    inset: 0;
    background: url('/img/fundo.jpeg') no-repeat center center;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
}

    /* OVERLAY ESCURO */
    .login-layout::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 0;
    }

/* GARANTE QUE O CONTEÚDO FICA POR CIMA */
.login-container {
    position: relative;
    z-index: 1;
}

/* CARD */
.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    width: 360px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

    .login-card h3 {
        margin-top: 0;
    }

/* INPUTS */
.input {
    width: 100%;
    padding: 14px 14px;
    margin-bottom: 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
}

/* BOTÃO */
.btn-login {
    width: 100%;
    padding: 12px;
    background: #1c7ed6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* ERRO */
.error-box {
    background: #ffe3e3;
    color: #c92a2a;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    position: relative;
}

    .error-box .close {
        position: absolute;
        right: 10px;
        top: 5px;
        cursor: pointer;
    }

    /* LOADING*/
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-box {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
}

    .loading-box img {
        width: 120px;
        margin-bottom: 10px;
    }

/* ==========FIM LOGIN =========*/

/* ======= SIDEBAR =========*/

/*
 * WRAPPER: é o elemento que CSS :hover deteta.
 * Começa abaixo do topbar (top: 64px).
 * Collapsed = 70px; Hover = 270px instantâneo.
 * Quando o rato sai: delay de 0.35s para o flyout fechar primeiro.
 */
.sidebar-wrapper {
    position: fixed;
    left: 0;
    top: 80px;
    height: calc(100vh - 80px);
    width: 70px;
    overflow: hidden;
    z-index: 1000;
    transition: width 0s 0.35s;
}

.sidebar-wrapper:hover {
    width: 270px;
    transition: width 0s;
}

/* RAIL — barra estreita com ícones, sempre visível */
.sidebar-rail {
    position: absolute;
    left: 0;
    top: 0;
    width: 70px;
    height: 100%;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.rail-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 8px 0;
}

.rail-item {
    width: 70px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}

.rail-item:hover {
    background: #f0f6ff;
}

.rail-icon {
    width: 33px;
    height: 33px;
    stroke: #3b72ad;
    fill: none;
    flex-shrink: 0;
    transition: stroke 0.15s;
}

.rail-item:hover .rail-icon {
    stroke: #1d4ed8;
}

/* FLYOUT — painel que desliza para a direita cobrindo o rail */
.sidebar-flyout {
    position: absolute;
    left: 0;
    top: 0;
    width: 270px;
    height: 100%;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    box-shadow: 6px 0 20px rgba(0, 0, 0, 0.10);
    display: flex;
    flex-direction: column;
    z-index: 3; /* acima do rail (z-index:2) para o cobrir */
    transform: translateX(-270px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.sidebar-wrapper:hover .sidebar-flyout {
    transform: translateX(0);
    pointer-events: auto;
}

.flyout-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}

.flyout-nav::-webkit-scrollbar { display: none; }

/* FLYOUT ITEMS */
.flyout-item {
    display: flex;
    align-items: center;
    gap: 13px;
    height: 68px;
    padding: 0 16px;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.flyout-item:hover,
.flyout-item.active {
    background: #eff6ff;
    color: #1d4ed8;
}

.flyout-item svg {
    width: 30px;
    height: 30px;
    stroke: #3b72ad;
    fill: none;
    flex-shrink: 0;
    transition: stroke 0.15s;
}

.flyout-item:hover svg,
.flyout-item.active svg {
    stroke: #1d4ed8;
}

/* FLYOUT ITEM COM SUB-MENU */
.flyout-has-sub {
    position: relative;
}

.flyout-chevron {
    width: 15px !important;
    height: 15px !important;
    stroke: #9ca3af !important;
    margin-left: auto;
    transition: transform 0.3s ease, stroke 0.15s !important;
}

/* FLYOUT GROUP (item + submenu) */
.flyout-group {
    display: flex;
    flex-direction: column;
}

.flyout-group:hover .flyout-chevron {
    transform: rotate(180deg);
    stroke: #3b72ad !important;
}

.flyout-submenu {
    max-height: 0;
    overflow: hidden;
    background: #f8fafc;
    border-left: 2px solid #3b72ad;
    margin-left: 16px;
    transition: max-height 0.3s ease;
}

.flyout-group:hover .flyout-submenu {
    /* Bem maior do que qualquer submenu real precisa (só serve para a transição CSS
       animar) — o scroll de verdade é o do .flyout-nav à volta, que já tem overflow-y:
       auto. Com um max-height demasiado apertado (500px = ~10 itens de 48px), submenus
       com mais itens (ex: Tabelas Diversas, que só cresce à medida que se vão gerindo
       mais tabelas rel.*, já perto de 70) ficavam cortados sem forma de lá chegar, porque
       overflow:hidden não dá scroll nenhum. Valor com folga generosa para não ter de
       voltar aqui de cada vez que se acrescenta mais uma tabela.
     */
    max-height: 10000px;
}

/* SUB-SUB MENU */
.flyout-subgroup {
    display: flex;
    flex-direction: column;
}

.flyout-subgroup:hover .flyout-subchevron {
    transform: rotate(180deg);
    stroke: #3b72ad !important;
}

.flyout-subsubmenu {
    max-height: 0;
    overflow: hidden;
    background: #f1f5f9;
    border-left: 2px solid #93c5fd;
    margin-left: 16px;
    transition: max-height 0.3s ease;
}

.flyout-subgroup:hover .flyout-subsubmenu {
    max-height: 300px;
}

.flyout-subsubitem {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.flyout-subsubitem:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

/* FLYOUT SUB-ITEMS */
.flyout-subitem {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 12px;
    font-size: 16px;
    color: #4b5563;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.flyout-subitem:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.flyout-subitem svg {
    width: 16px;
    height: 16px;
    stroke: #6b7280;
    fill: none;
    flex-shrink: 0;
    transition: stroke 0.15s;
}

.flyout-subitem:hover svg {
    stroke: #1d4ed8;
}

/* Fill-based SVG icons (Phosphor style) — override the stroke rules */
.rail-item svg.icon-fill {
    width: 33px;
    height: 33px;
    fill: #3b72ad;
    stroke: none;
    flex-shrink: 0;
    transition: fill 0.15s;
}
.rail-item:hover svg.icon-fill { fill: #1d4ed8; }

.flyout-item svg.icon-fill {
    width: 30px;
    height: 30px;
    fill: #3b72ad;
    stroke: none;
    flex-shrink: 0;
    transition: fill 0.15s;
}
.flyout-item:hover svg.icon-fill,
.flyout-item.active svg.icon-fill { fill: #1d4ed8; }

.flyout-subitem svg.icon-fill {
    width: 16px;
    height: 16px;
    fill: #6b7280;
    stroke: none;
    flex-shrink: 0;
    transition: fill 0.15s;
}
.flyout-subitem:hover svg.icon-fill { fill: #1d4ed8; }

/* PNG icons in sidebar — match SVG stroke colours and sizes */
.rail-item img.rail-icon {
    width: 33px;
    height: 33px;
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(0) saturate(100%) invert(42%) sepia(57%) saturate(471%) hue-rotate(178deg) brightness(95%) contrast(95%);
    transition: filter 0.15s;
}
.rail-item:hover img.rail-icon {
    filter: brightness(0) saturate(100%) invert(25%) sepia(88%) saturate(713%) hue-rotate(214deg) brightness(90%) contrast(98%);
}

.flyout-item img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(0) saturate(100%) invert(42%) sepia(57%) saturate(471%) hue-rotate(178deg) brightness(95%) contrast(95%);
    transition: filter 0.15s;
}
.flyout-item:hover img,
.flyout-item.active img {
    filter: brightness(0) saturate(100%) invert(25%) sepia(88%) saturate(713%) hue-rotate(214deg) brightness(90%) contrast(98%);
}

.flyout-subitem img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(0) saturate(100%) invert(48%) sepia(8%) saturate(562%) hue-rotate(175deg) brightness(93%) contrast(88%);
    transition: filter 0.15s;
}
.flyout-subitem:hover img {
    filter: brightness(0) saturate(100%) invert(25%) sepia(88%) saturate(713%) hue-rotate(214deg) brightness(90%) contrast(98%);
}

/* ======= FIM SIDEBAR =========*/

/* MAIN */

.main {
    /* 70px do rail + 24px de folga — sem a folga, o cursor entra na zona de hover do
       menu (.sidebar-wrapper, também 70px) ao afastar-se ligeiramente de um campo perto
       da margem esquerda, abrindo o menu sem se querer. */
    margin-left: 94px;
    padding-top: 80px; /* compensa o topbar fixo */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: calc(100% - 94px);
    position: relative;
}

/* TOPBAR */

.topbar {
    background: white;
    padding: 15px 25px;
    border-bottom: 1px solid #e2e6ea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search {
    width: 400px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

/* CONTENT */

.container {
    padding: 25px;
    flex: 1;
    width: 100%; /*  IMPORTANTE */
    max-width: 100%; /*  GARANTE expansão */
    overflow: visible;
}
/* TITLE */

.title {
    font-size: 23px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0;
}

.title-divider {
    color: #9ca3af;
    margin: 0 4px;
}

.title-secondary {
    font-size: 16px;
    font-weight: 400;
    color: #6b7280;
}

/* STEP BAR */

.steps {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 8px;
}

/* LABEL DE DESTAQUE: estado 150 "Review de Execução" (texto vem da BD) */
.workflow-review-execucao-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 18px;
    border-radius: 6px;
    border: 2px solid #b45309;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
    margin-bottom: 10px;
    animation: workflow-review-execucao-pulse 1.6s ease-in-out infinite;
}

.workflow-review-execucao-label::before {
    content: "⚠";
    font-size: 17px;
}

@keyframes workflow-review-execucao-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5); }
    50%      { box-shadow: 0 2px 16px rgba(245, 158, 11, 0.9); }
}

/* STEP */
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-right: -18px; /* sobreposição para encadear as setas */
}

/* z-index definido via inline style no Razor (dinâmico, suporta steps opcionais) */

.step:last-child { margin-right: 0; }

/* SHAPE — seta com entalhe esquerdo e ponta direita */
.step-shape {
    width: 155px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(0% 0%, calc(100% - 20px) 0%, 100% 50%, calc(100% - 20px) 100%, 0% 100%, 20px 50%);
    position: relative;
}

/* Primeiro step: sem entalhe esquerdo */
.step:first-child .step-shape {
    clip-path: polygon(0% 0%, calc(100% - 20px) 0%, 100% 50%, calc(100% - 20px) 100%, 0% 100%);
    border-radius: 4px 0 0 4px;
}

/* DATA (dentro da seta) */
.step-date {
    font-size: 13px;
    font-weight: 600;
    color: white;
    text-align: center;
    line-height: 1.3;
}

/* TEXTO PRINCIPAL dentro da seta */
.step-label {
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-align: center;
    line-height: 1.3;
    max-width: 110px; /* área útil da seta descontando entalhe e ponta */
    word-wrap: break-word;
}

/* TÍTULO (em baixo) */
.step-title {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    text-align: center;
    max-width: 140px;
}

/* CORES */
.step.completed .step-shape { background: #3B72AD; }   /* azul logo */
.step.active .step-shape    { background: #f59e0b; }   /* laranja */
.step.next .step-shape      { background: #cbd5e1; }   /* cinzento azulado */

.step:not(.completed):not(.active):not(.next) .step-shape { background: #d1d5db; }

/* Texto dentro: cinzento mais escuro nos steps futuros */
.step.next .step-date                                  { color: #475569; }
.step:not(.completed):not(.active):not(.next) .step-date { color: #475569; }

/* BADGE ALERTA */
.step-alert-badge {
    position: absolute;
    top: 2px;
    right: 26px; /* dentro da área visível da seta */
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: bold;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    z-index: 2;
}

/* TOOLTIP */
.step-alert-badge .step-alert-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    font-size: 12px;
    font-weight: normal;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}

.step-alert-badge:hover .step-alert-tooltip {
    display: block;
}

/* FUTURE */
.step.future .step-shape { background: #e5e7eb; }
.step.future .step-date  { color: #9ca3af; }

/* META DO STEP — placeholder acima da seta, altura fixa para alinhar todas as setas */
.step-meta-top {
    min-height: 34px;
    max-width: 155px;
    width: 155px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 3px;
}

.step-meta-nome {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.4;
}

.step-meta-data {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    white-space: nowrap;
    line-height: 1.4;
}

/* BOTÃO DE AÇÃO POR BAIXO DA SETA */
.step-action-btn {
    margin-top: 6px;
    padding: 5px 14px;
    background: #2b8aef;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.step-action-btn:hover {
    background: #1a6dc9;
}

/* OPTIONAL STEPS */

.steps-optional {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.step-opt-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.step-opt-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 10px;
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    user-select: none;
    transition: background 0.12s;
}

.step-opt-label:hover {
    background: #e5e7eb;
}

.step-opt-label.step-opt-done {
    color: #3B72AD;
    border-color: #3B72AD;
    background: #eff6ff;
    cursor: default;
}

.step-opt-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #3B72AD;
    flex-shrink: 0;
}

.steps-opt-expanded {
    margin-left: 10px;
    margin-top: 2px;
}

/* MENU AÇÕES DO PROCESSO */

.processo-acoes {
    position: relative;
    display: inline-block;
    margin: 8px 0 10px 0;
}

.processo-acoes-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: background .15s;
}

.processo-acoes-btn:hover {
    background: #e5e7eb;
}

.processo-acoes-arrow {
    font-size: 11px;
    color: #6b7280;
}

.processo-acoes-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 200;
    min-width: 200px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.10);
    padding: 4px 0;
}

.processo-acoes-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    text-align: left;
    background: none;
    border: none;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background .12s;
}

.processo-acoes-item:hover {
    background: #f3f4f6;
}

/* INFO CARDS */

.cards {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background: white;
    padding: 18px;
    border-radius: 6px;
    border: 1px solid #e3e6ea;
    flex: 1;
}



.tabcontent {
    display: none;
    background: white;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e3e6ea;
    margin-top: 15px;
}

    .tabcontent.active {
        display: block;
    }

/* FORM */

.formgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Variante compacta em teste na tab "Dados do Pedido" — 3 colunas em vez de 2, caixas
   mais pequenas, para concentrar mais informação por ecrã (pedido do cliente do projeto).
   Classe própria (não reaproveita ".formgrid") para não afetar as outras tabs. */
.formgrid-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 36px;
}

.formgrid-3col .field {
    gap: 6px;
    margin-bottom: 18px;
}

.formgrid-3col .field > label {
    font-size: 13px;
}

.formgrid-3col input,
.formgrid-3col select,
.formgrid-3col textarea {
    padding: 6px 8px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ddd;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}


    .field > label {
        font-size: 14px;
        font-weight: 500;
        color: #4a4a4a;
    }


label {
    font-size: 14px;
    margin-bottom: 5px;
}

/* Nota curta por baixo de um campo (ex.: regra do cliente Particular - PH) */
.campo-nota {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.formgrid input,
.formgrid select,
.formgrid textarea {
    padding: 10px;
    border: 1px solid #ddd;
    width: 100%;
    box-sizing: border-box;
}

/* Campo obrigatório em falta ao gravar (ver camposFaltantes em PedidoPage.razor) — além
   do aviso, destaca o próprio campo. O box-shadow no wrapper cobre também controlos que
   não sejam um <input>/<select> simples (ex.: MudAutocomplete do Cliente/Segmento). */
.field-invalid {
    background: #fdecea;
    border-radius: 6px;
    box-shadow: 0 0 0 1px #e74c3c;
    padding: 6px 8px;
}
.formgrid .field-invalid input,
.formgrid .field-invalid select,
.formgrid .field-invalid textarea,
.field-invalid input,
.field-invalid select,
.field-invalid textarea {
    border-color: #e74c3c;
}
.field-invalid > label {
    color: #c0392b;
}

/* BUTTONS */

.buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-primary2 {
    background: #FF746C;
    color: white;
}

.btn-primary {
    background: #1971c2;
    color: white;
}

.btn-green {
    background: #2f9e44;
    color: white;
}

.btn-grey {
    background: #dee2e6;
}

.tabs-container {
    margin-top: 20px;
}

.tabs-header {
    display: flex;
    border-bottom: 2px solid #e3e6ea;
    position: relative;
}

.tab-item {
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 600;
    color: #5c6b77;
    position: relative;
    z-index: 1;
}

    .tab-item.active {
        color: #2b8aef;
    }

.tab-indicator {
    position: absolute;
    bottom: -2px;
    height: 3px;
    width: 140px;
    background: #2b8aef;
    transition: 0.3s ease;
    pointer-events: none;
}

/* conteúdo */
.tabs-content {
    background: white;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e3e6ea;
    margin-top: 15px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* TABELA DA TAB DA FATURAÇÂO*/
.faturacao-adiant-campos {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

    .faturacao-adiant-campos .field {
        flex: 1 1 180px;
        min-width: 160px;
    }

/* Dados de Faturação (nome / morada / NIF) — a morada ocupa mais espaço */
.faturacao-dados {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0.5rem 0 1.5rem;
}

    .faturacao-dados .field {
        flex: 1 1 220px;
        min-width: 160px;
    }

        .faturacao-dados .field:nth-child(2) {
            flex: 2 1 320px;
        }

        .faturacao-dados .field:nth-child(3) {
            flex: 0 1 160px;
        }

    .faturacao-dados input {
        width: 100%;
        box-sizing: border-box;
        padding: 10px;
        border: 1px solid #9ca3af;
        border-radius: 4px;
        background: #fff;
    }

        .faturacao-dados input:focus {
            outline: none;
            border-color: #2770CA;
            box-shadow: 0 0 0 2px rgba(39, 112, 202, .2);
        }

/* Campo + PDF da fatura lado a lado (Valor Adiantamento / Nº Fatura Final) */
.faturacao-linha-pdf {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

    .faturacao-linha-pdf > .field {
        flex: 1 1 200px;
        min-width: 160px;
    }

.fatura-pdf {
    flex: 1 1 260px;
    min-width: 220px;
}

    .fatura-pdf .fatura-pdf-area {
        padding: 10px 12px;
        font-size: 13px;
    }

.fatura-pdf-ficheiro {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #9ca3af;
    border-radius: 4px;
    background: #fff;
    min-height: 40px;
    box-sizing: border-box;
}

    .fatura-pdf-ficheiro a {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #2770CA;
    }

.fatura-pdf-btn {
    border: 1px solid #d1d5db;
    background: #f9fafb;
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
}

.fatura-pdf-btn--perigo {
    border-color: #c00;
    color: #c00;
}

.fatura-pdf-confirmar {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    white-space: nowrap;
}

.fatura-pdf-info {
    font-size: 13px;
    color: #6b7280;
    padding: 10px 0;
}

.fatura-pdf-erro {
    color: #c00;
    font-size: 13px;
}

.table-faturacao {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
}

    .table-faturacao th,
    .table-faturacao td {
        border: 1px solid #e3e6ea;
        padding: 10px;
        text-align: left;
    }

    .table-faturacao th {
        background: #f1f3f5;
        font-weight: 600;
    }


    /* DASHBOARD*/


/* GRID RESPONSIVO */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%; /*  CRÍTICO */
}

/* CARD BASE */
.dashboard-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

    /* HOVER */
    .dashboard-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    }

/* HEADER */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* TÍTULO */
.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
}

/* NÚMERO */
.card-count {
    font-size: 27px;
    font-weight: bold;
}

/* LISTA */
.card-list {
    margin-top: 12px;
}

.card-item {
    font-size: 14px;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    color: #6b7280;
}

    .card-item:last-child {
        border-bottom: none;
    }

/* FOOTER */
.card-footer {
    margin-top: 10px;
}

    .card-footer a {
        font-size: 13px;
        text-decoration: none;
        font-weight: 500;
    }

/*  CORES POR ESTADO */

/* INFO (normal) */
.card--info {
    border-left-color: #3b82f6;
}

    .card--info .card-count,
    .card--info .card-footer a {
        color: #3b82f6;
    }

/* WARNING */
.card--warning {
    border-left-color: #f59e0b;
}

    .card--warning .card-count,
    .card--warning .card-footer a {
        color: #f59e0b;
    }

/* DANGER */
.card--danger {
    border-left-color: #ef4444;
}

    .card--danger .card-count,
    .card--danger .card-footer a {
        color: #ef4444;
    }

/* SUCCESS */
.card--success {
    border-left-color: #10b981;
}

    .card--success .card-count,
    .card--success .card-footer a {
        color: #10b981;
    }


/* TOP BAR */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    z-index: 1001; /* acima do sidebar (z-index:1000) */
    padding-right: 20px;
}

/* Logo separado — ocupa a área do menu (270px) */
.topbar-logo {
    width: 270px;
    min-width: 270px;
    height: 80px;
    display: flex;
    align-items: center;
    padding-left: 20px;
    border-right: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.topbar-logo-img {
    height: 60px;
    max-width: 230px;
    object-fit: contain;
    object-position: left center;
}

/* Search bar começa depois do logo (x > 270px) */
.topbar-left {
    flex: 1;
    padding-left: 20px;
}

/* LEFT */
  

/* RIGHT */
.topbar-right {
    display: flex;
    align-items: center;
}

/* USER MENU */
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
}

/* AVATAR */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

/* INFO */
.user-info {
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

.user-name {
    font-weight: 600;
}

.user-role {
    font-size: 12px;
    color: #6b7280;
}


/* DROPDOWN DO USER*/
.dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    width: 200px;
    display: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

    .dropdown a {
        display: block;
        padding: 10px;
        text-decoration: none;
        color: #1f2937;
        font-size: 15px;
    }

        .dropdown a:hover {
            background: #f1f5f9;
        }
    .user-menu:hover .dropdown,.dropdown:hover {
        display: block;
    }


.logout {
    color: #ef4444;
}

/* UPLOAD DE FOTOS*/
.upload-box {
    border: 2px dashed #adb5bd;
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    user-select: none;
}

.upload-box:hover {
    border-color: #2b8aef;
    background: #f0f7ff;
}

    .upload-box.dragging {
        background: #e7f5ff;
        border-color: #2b8aef;
    }

.alert-custom {
    background: #ffe3e3;
    color: #c92a2a;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.close-btn {
    border: none;
    background: transparent;
    cursor: pointer;
}

.preview-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.preview-item {
    width: 120px;
    background: white;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

    .preview-item img {
        width: 100%;
    }

.progress-bar {
    background: #e9ecef;
    border-radius: 6px;
    height: 20px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress {
    background: #2b8aef;
    height: 100%;
    color: white;
    text-align: center;
    font-size: 13px;
}

.file-list {
    list-style: none;
    padding: 0;
}

.file-item {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e3e6ea;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 5px;
    gap: 8px;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

    .file-name i {
        font-size: 19px;
        flex-shrink: 0;
    }

.file-meta {
    flex: 0 0 150px;
    text-align: right;
}

.delete-btn {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: #c92a2a;
    cursor: pointer;
    font-size: 15px;
}
/* FIM UPLOAD FOTOS*/


.mud-popover {
    position: fixed;
    z-index: 999999;
}


.field .mud-input-control {
    margin-bottom: 0;
}

.page-scroll {
    overflow: auto;
    height: calc(100vh - 80px);
}

.mud-input-root input {
    all: unset;
}

/* ================ BARRA DE PESQUISA =============*/

.search-box {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
    pointer-events: none;
    font-size: 17px;
    display: flex;
}

.search-icon svg {
    width: 16px;
    height: 16px;
}

.search-input {
    width: 100%;
    height: 42px; /* 🔥 altura fixa */
    box-sizing: border-box;
    padding-left: 42px; /* espaço para ícone */
    padding-right: 12px;
    border-radius: 10px;
    font-size: 15px;
    line-height: 42px; /* 🔥 ALINHA O TEXTO VERTICALMENTE */
}
    /* focus */
    .search-input:focus {
        border-color: #1976d2;
        box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
    }

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 99999;
    opacity: 0;
    transform: translateY(-5px);
    animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.search-item {
    padding: 10px;
    cursor: pointer;
}

    .search-item:hover {
        background: #f5f5f5;
    }

.search-results {
    max-height: 300px;
    overflow-y: auto;
}
/* ================>FIM BARRA DE PESQUISA =============*/

/* ================> HISTÓRICO =============*/

.historico-wrapper {
    overflow-x: auto;
    margin-top: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.10);
}

.historico-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    min-width: 780px;
}

    /* Cabeçalho */
    .historico-table thead tr {
        background: #3B72AD;
        color: #fff;
    }

    .historico-table th {
        padding: 11px 16px;
        text-align: left;
        font-weight: 600;
        white-space: nowrap;
        border-right: 1px solid rgba(255,255,255,0.18);
        letter-spacing: .3px;
    }

    .historico-table th:last-child {
        border-right: none;
    }

    /* Larguras fixas */
    .historico-table th:nth-child(1),
    .historico-table td:nth-child(1) { width: 130px; white-space: nowrap; }

    .historico-table th:nth-child(2),
    .historico-table td:nth-child(2),
    .historico-table th:nth-child(3),
    .historico-table td:nth-child(3) { width: 180px; }

    .historico-table th:nth-child(4),
    .historico-table td:nth-child(4) { width: 130px; white-space: nowrap; }

    /* Células */
    .historico-table td {
        padding: 9px 16px;
        vertical-align: top;
        color: #1e293b;
        border-right: 1px solid #c7d7ec;
    }

    .historico-table td:last-child {
        border-right: none;
    }

    /* Linhas alternadas */
    .historico-table tbody tr:nth-child(odd) {
        background: #f0f5fb;
    }

    .historico-table tbody tr:nth-child(even) {
        background: #ffffff;
    }

    /* Separador horizontal entre linhas */
    .historico-table tbody tr {
        border-bottom: 1px solid #c7d7ec;
    }

    .historico-table tbody tr:last-child {
        border-bottom: none;
    }

    .historico-table tbody tr:hover {
        background: #dbeafe;
    }

/* ================>FIM HISTÓRICO =============*/

/* ================> INCIDÊNCIAS =============*/

.incidencias-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.btn-nova-incidencia {
    background: #3B72AD;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

    .btn-nova-incidencia:hover {
        background: #2D5A8C;
    }

/* ===== ALERTAS DE API ===== */
.amostra-api-alertas {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.amostra-api-alerta {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: #c2410c;
    line-height: 1.4;
}

.amostra-api-ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    color: #15803d;
    margin-bottom: 14px;
}

/* ===== GRID DE CARDS DA PROSPEÇÃO ===== */
.prospecao-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.prospecao-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: box-shadow .15s;
}

    .prospecao-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }

.prospecao-card-foto {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #f3f4f6;
    flex-shrink: 0;
}

    .prospecao-card-foto img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.prospecao-card-sem-foto {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 33px;
    color: #d1d5db;
}

.prospecao-card-info {
    padding: 12px 12px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 14px;
}

.prospecao-card-site {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.prospecao-card-link {
    font-size: 12px;
    color: #3B72AD;
    text-decoration: none;
    font-weight: 600;
}

    .prospecao-card-link:hover { text-decoration: underline; }

.prospecao-card-titulo {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
}

.prospecao-card-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.prospecao-card-row {
    font-size: 13px;
    color: #374151;
    line-height: 1.4;
}

    .prospecao-card-row span { color: #6b7280; }

.prospecao-card-preco {
    font-size: 16px;
    font-weight: 800;
    color: #1976D2;
    margin-top: 6px;
}

.prospecao-card-del {
    background: none;
    border: none;
    border-top: 1px solid #f3f4f6;
    padding: 7px;
    font-size: 12px;
    color: #dc2626;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: background .15s;
}

    .prospecao-card-del:hover { background: #fef2f2; }

.prospecao-empty {
    padding: 24px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* Links gerados */
.prospecao-links-section {
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.prospecao-links-toggle {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #3B72AD;
    cursor: pointer;
}

    .prospecao-links-toggle:hover { background: #f1f5f9; }

.prospecao-links-list {
    padding: 4px 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prospecao-link-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 13px;
}

.prospecao-link-site {
    min-width: 100px;
    font-weight: 600;
    color: #374151;
    flex-shrink: 0;
}

.prospecao-link-url {
    color: #3B72AD;
    word-break: break-all;
    text-decoration: none;
}

    .prospecao-link-url:hover { text-decoration: underline; }

/* Overlay bloqueado — não fecha ao clicar fora */
.modal-overlay-locked {
    cursor: default;
    z-index: 1100; /* acima da topbar (z-index:1001) */
}

/* ===== MODAL PROSPEÇÃO ===== */
.modal-prospecao {
    /* !important necessário porque .modal-box (definido depois) sobrescreveria width */
    width: 80vw !important;
    max-width: 80vw !important;
    height: 88vh;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.modal-prospecao .modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 0;
}

.prospecao-status {
    padding: 12px 18px;
    font-size: 14px;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 10px;
}

.prospecao-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #3B72AD;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.prospecao-erros {
    padding: 10px 18px;
    background: #fff7ed;
    border-bottom: 1px solid #fed7aa;
}

.prospecao-erro-item {
    font-size: 13px;
    color: #c2410c;
    padding: 2px 0;
}

.prospecao-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .prospecao-table th {
        position: sticky;
        top: 0;
        background: #f3f4f6;
        padding: 9px 10px;
        text-align: left;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: .4px;
        color: #6b7280;
        border-bottom: 1px solid #e5e7eb;
        white-space: nowrap;
    }

    .prospecao-table td {
        padding: 8px 10px;
        border-bottom: 1px solid #f3f4f6;
        vertical-align: middle;
        color: #374151;
    }

    .prospecao-table tr:hover td {
        background: #f9fafb;
    }

    .prospecao-table tr.row-selected td {
        background: #EBF3FC;
    }

.prospecao-link {
    color: #3B72AD;
    font-weight: 600;
    text-decoration: none;
}

    .prospecao-link:hover { text-decoration: underline; }

/* Tooltip de imagem ao hover */
.foto-cell {
    position: relative;
    cursor: pointer;
    color: #3B72AD;
    font-weight: 600;
    white-space: nowrap;
}

.foto-tooltip {
    display: none;
    position: absolute;
    /* À esquerda do texto "Foto" */
    right: calc(100% + 8px);
    left: auto;
    transform: none;
    z-index: 300;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 6px 20px rgba(0,0,0,.18);
    pointer-events: none;
}

    .foto-tooltip img {
        width: 220px;
        height: 160px;
        object-fit: cover;
        border-radius: 5px;
        display: block;
    }

/* 1ª metade da lista: tooltip abre para baixo */
.foto-abaixo .foto-tooltip {
    top: 0;
    bottom: auto;
}

/* 2ª metade da lista: tooltip abre para cima */
.foto-acima .foto-tooltip {
    bottom: 0;
    top: auto;
}

.foto-cell:hover .foto-tooltip {
    display: block;
}

.sem-foto {
    color: #9ca3af;
    font-size: 13px;
}

.prospecao-footer {
    padding: 14px 18px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9fafb;
}

.prospecao-sel-count {
    font-size: 14px;
    color: #6b7280;
}

.btn-gerar-prospecao {
    background: #16a34a;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}

    .btn-gerar-prospecao:hover:not(:disabled) { background: #15803d; }
    .btn-gerar-prospecao:disabled { background: #9ca3af; cursor: not-allowed; }

.prospecao-vazio {
    padding: 40px;
    text-align: center;
    color: #9ca3af;
    font-size: 15px;
}

/* ===== TAB AMOSTRA ===== */
.amostra-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.amostra-section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .6px;
    color: #6b7280;
    text-transform: uppercase;
    display: block;
    margin-bottom: 14px;
}

/* Dados da pesquisa — chips inline com wrap */
.amostra-info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.amostra-info-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 5px 11px;
    font-size: 14px;
    white-space: nowrap;
}

.amostra-info-label {
    color: #6b7280;
    font-weight: 500;
}

.amostra-info-sep {
    color: #d1d5db;
}

.amostra-info-valor {
    color: #111827;
    font-weight: 600;
}

.amostra-aviso {
    color: #b45309;
    font-size: 13px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 5px 11px;
    flex-basis: 100%;
}

/* Sites de pesquisa — pills inline com wrap */
.amostra-sites-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.amostra-site-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    user-select: none;
}

    .amostra-site-pill:hover {
        background: #f3f4f6;
        border-color: #d1d5db;
    }

    .amostra-site-pill input[type="checkbox"] {
        width: 15px;
        height: 15px;
        accent-color: #3B72AD;
        cursor: pointer;
        flex-shrink: 0;
    }

.amostra-site-selected {
    background: #EBF3FC;
    border-color: #3B72AD;
    color: #1a3a5c;
    font-weight: 600;
}

.amostra-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 4px;
}

.btn-amostra-pesquisar {
    background: #3B72AD;
    color: #fff;
    border: none;
    padding: 9px 22px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

    .btn-amostra-pesquisar:hover:not(:disabled) {
        background: #2D5A8C;
    }

    .btn-amostra-pesquisar:disabled {
        background: #9ca3af;
        cursor: not-allowed;
    }

.amostra-hint {
    font-size: 13px;
    color: #9ca3af;
}

.amostra-loading {
    font-size: 14px;
    color: #6b7280;
    padding: 4px 0;
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100; /* acima da topbar (z-index:1001) */
}

.modal-box {
    background: #fff;
    border-radius: 10px;
    width: 520px;
    max-width: 95vw;
    box-shadow: 0 8px 32px rgba(0,0,0,.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    background: #3B72AD;
    color: #fff;
    padding: 14px 20px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 19px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .modal-body label {
        font-size: 14px;
        font-weight: 600;
        color: #374151;
    }

    .modal-body textarea {
        width: 100%;
        border: 1px solid #c7d7ec;
        border-radius: 6px;
        padding: 10px;
        font-size: 14px;
        font-family: inherit;
        resize: vertical;
        box-sizing: border-box;
    }

        .modal-body textarea:focus {
            outline: none;
            border-color: #3B72AD;
        }

.modal-erro {
    color: #dc2626;
    font-size: 13px;
    margin-top: -6px;
}

.modal-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 400 !important;
    cursor: pointer;
}

.modal-footer {
    padding: 14px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #e5e7eb;
}

.btn-modal-cancelar {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 7px 18px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

    .btn-modal-cancelar:hover {
        background: #e5e7eb;
    }

.btn-modal-guardar {
    background: #3B72AD;
    color: #fff;
    border: none;
    padding: 7px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

    .btn-modal-guardar:hover {
        background: #2D5A8C;
    }

/* ================>FIM INCIDÊNCIAS =============*/

/* ================> CARD INTERVENIENTES =============*/

.card--interv {
    height: auto;
    align-self: flex-start;
    min-width: 0;
}

.interv-grupos-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-top: 12px;
}

.interv-grupos-row .interv-grupo {
    flex: 1;
    min-width: 0;
    margin-top: 0;
}

.interv-grupo {
    margin-top: 12px;
}

.interv-grupo--validadores {
    border-left: 1px solid #e5e7eb;
    padding-left: 20px;
}

.interv-grupo-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.interv-grupo-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #6b7280;
}

.interv-add-btn {
    background: none;
    border: 1px solid #3B72AD;
    color: #3B72AD;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}

    .interv-add-btn:hover {
        background: #3B72AD;
        color: #fff;
    }

.interv-vazio {
    font-size: 13px;
    color: #9ca3af;
    padding: 4px 0;
}

.interv-item {
    margin-bottom: 6px;
}

.interv-item-hdr {
    display: flex;
    align-items: center;
    gap: 6px;
}

.interv-del-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    padding: 0 3px;
    flex-shrink: 0;
}

    .interv-del-btn:hover { color: #b91c1c; }

.interv-nome {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

/* Honorários — tudo numa linha */
.interv-hon-bloco {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: 26px;
    margin-top: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 14px;
}

.interv-hon-item {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.interv-hon-sep {
    color: #cbd5e1;
    font-size: 16px;
}

.interv-hon-label {
    color: #6b7280;
    font-size: 13px;
}

.interv-hon-total {
    font-weight: 700;
    color: #3B72AD;
}

.interv-hon-inp {
    width: 85px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 14px;
    text-align: right;
}

.banco-disp-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 0 0 78px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    white-space: nowrap;
}

.interv-pagar-btn {
    padding: 2px 8px;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.interv-pagar-btn:hover { background: #15803d; }

.interv-hon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    margin-left: auto;
    line-height: 1;
}

.interv-pago {
    font-size: 13px;
    font-weight: 600;
    border-radius: 3px;
    padding: 1px 6px;
    white-space: nowrap;
}

.interv-pago--sim {
    background: #dcfce7;
    color: #16a34a;
    cursor: help;
}

.interv-pago--nao {
    background: #fef9c3;
    color: #92400e;
}

/* Formulário de adição */
.interv-form {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.interv-select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 13px;
}

.interv-search {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    margin-bottom: 4px;
    outline: none;
    transition: border-color 0.15s;
}

.interv-search:focus {
    border-color: #3B72AD;
    box-shadow: 0 0 0 2px rgba(59,114,173,0.12);
}

.interv-listbox {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 14px;
    height: 130px;
    overflow-y: auto;
    outline: none;
}

.interv-listbox option {
    padding: 5px 8px;
    cursor: pointer;
}

.interv-listbox option:checked {
    background: #dbeafe;
    color: #1d4ed8;
}

.interv-form-hon {
    display: flex;
    gap: 6px;
}

.interv-form-btns {
    display: flex;
    gap: 6px;
}

.interv-confirm-btn {
    background: #3B72AD;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

    .interv-confirm-btn:hover { background: #2D5A8C; }

.interv-cancel-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 14px;
    cursor: pointer;
}

    .interv-cancel-btn:hover { background: #e5e7eb; }

/* ================>FIM CARD INTERVENIENTES =============*/

/* RESPONSIVO EXTRA */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .card-count {
        font-size: 23px;
    }

    /* Topbar: 2 linhas em mobile — linha 1: logo + avatar | linha 2: pesquisa a 100% */
    .topbar {
        height: auto;
        flex-wrap: wrap;
        padding-right: 10px;
        padding-bottom: 10px;
    }

    .topbar-logo {
        width: 70px;
        min-width: 70px;
        height: 56px;
        padding-left: 10px;
        border-right: none;
    }

    .topbar-logo-img {
        max-width: 50px;
        height: 44px;
    }

    /* User info (nome + cargo): esconder em mobile para poupar espaço */
    .user-info {
        display: none;
    }

    /* Avatar empurrado para a direita da linha 1 */
    .topbar-right {
        margin-left: auto;
    }

    /* Pesquisa ocupa a linha 2 completa */
    .topbar-left {
        flex: 0 0 100%;
        box-sizing: border-box;
        max-width: 100%;
        padding: 8px 12px 14px;
    }

    /* Search input muito maior em mobile */
    .search-input {
        height: 64px;
        font-size: 19px;
        border-radius: 12px;
        padding-left: 48px;
        line-height: 64px;
    }

    .search-icon {
        font-size: 23px;
        left: 14px;
    }

    .search-icon svg {
        width: 22px;
        height: 22px;
    }

    /* Compensar a altura do topbar em 2 linhas (56px + ~86px) */
    .main {
        padding-top: 150px;
    }

    .page-scroll {
        height: calc(100vh - 150px);
    }

    /* Tabs: 2 por linha em mobile */
    .tabs-header {
        flex-wrap: wrap;
    }

    .tab-item {
        flex: 0 0 50%;
        box-sizing: border-box;
        text-align: center;
        padding: 14px 8px;
        border: 1px solid #e3e6ea;
        font-size: 13px;
    }

    .tab-item.active {
        background: #eff6ff;
        border-bottom: 3px solid #2b8aef;
    }

    /* Cards: empilhar verticalmente em vez de lado a lado */
    .cards {
        flex-direction: column;
    }

    /* Formgrid: 1 coluna em mobile */
    .formgrid {
        grid-template-columns: 1fr;
    }

    .formgrid input,
    .formgrid select,
    .formgrid textarea {
        width: 100%;
        box-sizing: border-box;
    }

    .formgrid-3col {
        grid-template-columns: 1fr;
    }

    /* Tabela faturação: inputs com largura automática */
    .table-faturacao input,
    .table-faturacao select {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
}

/* ===== BOTÕES DE AÇÃO DO PROCESSO ===== */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 20px;
    background: #f8f9fb;
    border-top: 1px solid #e3e6ea;
    border-bottom: 1px solid #e3e6ea;
    margin-bottom: 4px;
}

.btn-action {
    padding: 8px 20px;
    background: #2b8aef;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-action:hover {
    background: #1a6dc9;
}

/* ===== MODAIS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100; /* acima da topbar (z-index:1001) */
}

.modal-card {
    background: #fff;
    border-radius: 10px;
    padding: 28px 32px 22px;
    min-width: 340px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a2a3a;
    margin-bottom: 18px;
}

.modal-body p {
    margin: 0 0 4px;
    color: #374151;
    font-size: 15px;
    line-height: 1.5;
}

.modal-label {
    display: block;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 6px;
}

.modal-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    box-sizing: border-box;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 22px;
}

.btn-modal-confirm {
    padding: 8px 22px;
    background: #2b8aef;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-modal-confirm:hover { background: #1a6dc9; }

.btn-modal-cancel {
    padding: 8px 22px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-modal-cancel:hover { background: #e5e7eb; }
/* ===== DADOS TÉCNICOS TAB ===== */

.dt-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
    padding: 16px 0;
}

.dt-col {
    display: flex;
    flex-direction: column;
}

.dt-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #3B72AD;
    margin-bottom: 16px;
}

.dt-col-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0;
}

.btn-inserir-doc {
    background: #3B72AD;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

    .btn-inserir-doc:hover {
        background: #2D5A8C;
    }

/* Docs Técnicos: 4 colunas no total — cada documento (Caderneta / Certidão) com os campos em
   2 colunas. Tudo o que não é um campo simples (títulos de secção, tabelas, inscrições,
   botões, mapa) e os campos .dt-field-full ocupam a largura toda do documento. */
.dt-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    align-items: start;
}

    .dt-form > :not(.field),
    .dt-form > .dt-field-full {
        grid-column: 1 / -1;
    }

    .dt-form > button {
        justify-self: start;
    }

    .dt-form .field input,
    .dt-form .field select {
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .dt-form .field {
        display: flex;
        flex-direction: column;
        gap: 3px;
    }

    .dt-form .field > label {
        font-size: 13px;
        font-weight: 600;
        color: #374151;
    }

    .dt-form input,
    .dt-form select,
    .dt-form textarea {
        padding: 7px 9px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 14px;
        font-family: inherit;
        background: #fff;
    }

        .dt-form input:focus,
        .dt-form select:focus,
        .dt-form textarea:focus {
            outline: none;
            border-color: #3B72AD;
        }

.dt-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #3B72AD;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 10px 0 4px;
    border-bottom: 1px solid #e5e7eb;
    margin-top: 6px;
}

.dt-table-wrapper {
    overflow-x: auto;
    margin-bottom: 4px;
}

.dt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .dt-table th {
        background: #f0f4f9;
        color: #374151;
        font-weight: 600;
        padding: 5px 6px;
        text-align: left;
        border: 1px solid #dde3ea;
        white-space: nowrap;
    }

    .dt-table th.sortable {
        cursor: pointer;
        user-select: none;
    }

    .dt-table th.sortable:hover {
        background: #e2e8f0;
    }

    .dt-table td.cel-anomalia {
        border: 2px solid #dc2626;
        background: #fef2f2;
    }

    .modal-ia {
        width: 720px;
        max-width: 90vw;
        max-height: 82vh;
        display: flex;
        flex-direction: column;
    }

    .modal-ia .modal-body {
        overflow-y: auto;
        flex: 1;
    }

    .dt-table td {
        padding: 3px 4px;
        border: 1px solid #e5e7eb;
        vertical-align: middle;
    }

        .dt-table td input {
            width: 100%;
            padding: 4px 6px;
            border: 1px solid #ddd;
            border-radius: 3px;
            font-size: 13px;
            min-width: 60px;
            box-sizing: border-box;
        }

            .dt-table td input:focus {
                outline: none;
                border-color: #3B72AD;
            }

.dt-btn-add {
    background: none;
    border: 1px dashed #3B72AD;
    color: #3B72AD;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
    margin-top: 4px;
}

    .dt-btn-add:hover {
        background: #eef3f9;
    }

.dt-btn-remove {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    line-height: 1;
}

    .dt-btn-remove:hover {
        background: #fee2e2;
        border-radius: 3px;
    }

.dt-insc-item {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 6px;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dt-btn-remove-insc {
    background: none;
    border: 1px solid #dc2626;
    color: #dc2626;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 13px;
    cursor: pointer;
    align-self: flex-start;
}

    .dt-btn-remove-insc:hover {
        background: #fee2e2;
    }

.modal-file-input {
    display: block;
    margin-top: 8px;
    font-size: 14px;
}

@media (max-width: 900px) {
    .dt-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .dt-form {
        grid-template-columns: 1fr;
    }
}

.dt-upload-ok {
    margin-top: 10px;
    padding: 8px 12px;
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    border-radius: 6px;
    color: #065f46;
    font-size: 14px;
    font-weight: 600;
}

.dt-confirm-substituir {
    margin-top: 10px;
    padding: 12px 14px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    color: #92400e;
    font-size: 14px;
}

    .dt-confirm-substituir p {
        margin: 0 0 8px;
    }

    .dt-confirm-substituir p:last-of-type {
        margin-bottom: 12px;
    }

.dt-confirm-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dt-analisando {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    font-size: 14px;
    color: #3B72AD;
    font-weight: 500;
}

.dt-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #c7d7ec;
    border-top-color: #3B72AD;
    border-radius: 50%;
    flex-shrink: 0;
    animation: dt-spin 0.8s linear infinite;
}

@keyframes dt-spin {
    to { transform: rotate(360deg); }
}

/* TAB RELATÓRIO — SUB-TABS (pills) */
.rel-wrap {
}

.rel-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.rel-toolbar-ok {
    font-size: 14px;
    color: #065f46;
    font-weight: 600;
}

.rel-toolbar-erro {
    font-size: 14px;
    color: #dc2626;
    font-weight: 600;
}

.rel-subtabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid #f1f5f9;
}

.rel-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
}

    .rel-pill.on {
        background: #1e5eb8;
        color: white;
    }

.rel-dot {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #94a3b8;
    flex-shrink: 0;
}

.rel-pill.on .rel-dot {
    background: #dbe7f5;
}

.rel-pill.filled .rel-dot {
    background: #3a8a5e;
}

.rel-sec-h {
    font-size: 13px;
    font-weight: 700;
    color: #1e5eb8;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 0 0 16px;
}

.rel-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
}

@media (max-width: 900px) {
    .rel-grid2 {
        grid-template-columns: 1fr;
    }
}

.rel-field {
    margin-bottom: 16px;
}

    .rel-field label {
        display: block;
        font-size: 12.5px;
        color: #64748b;
        margin-bottom: 5px;
    }

    .rel-field input,
    .rel-field select,
    .rel-field textarea {
        width: 100%;
        padding: 7px 10px;
        font-size: 14px;
        border: 1px solid #dde3ec;
        border-radius: 6px;
        font-family: inherit;
        color: #0f172a;
        box-sizing: border-box;
    }

    .rel-field textarea {
        resize: vertical;
        min-height: 60px;
    }

    /* "Não aplicável" / "Sem certificado energético" por baixo do campo */
    .rel-field label.rel-na {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin: 6px 0 0;
        cursor: pointer;
    }

        .rel-field label.rel-na input {
            width: auto;
            padding: 0;
            margin: 0;
        }

    .rel-field input:disabled,
    .rel-field select:disabled {
        background: #f1f5f9;
        color: #94a3b8;
    }

.rel-doc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 1px solid #e6ebf2;
    border-radius: 7px;
    margin-bottom: 8px;
    font-size: 13.5px;
}

    .rel-doc-row .rel-doc-name {
        display: flex;
        align-items: center;
        gap: 8px;
        color: #0f172a;
    }

    .rel-doc-row .rel-doc-status {
        font-size: 12px;
        padding: 2px 8px;
        border-radius: 999px;
        background: #eef4fb;
        color: #1e5eb8;
        font-weight: 500;
    }

.rel-upload-box {
    border: 1.5px dashed #dde3ec;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    color: #94a3b8;
    font-size: 13.5px;
    margin-top: 12px;
}

.rel-placeholder {
    color: #94a3b8;
    font-size: 14px;
}

.rel-sub-h {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: 18px 0 12px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

    .rel-sub-h:first-child {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }

.rel-row2 {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

    .rel-row2 > .rel-field {
        flex: 1 1 220px;
        min-width: 0;
    }

.rel-add-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 12px;
    max-width: 460px;
}

    .rel-add-row .rel-field {
        flex: 1;
        margin-bottom: 0;
    }

.rel-btn-add {
    padding: 7px 14px;
    font-size: 13.5px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    background: #1e5eb8;
    color: white;
    cursor: pointer;
    white-space: nowrap;
}

    .rel-btn-add:disabled {
        background: #c7d7ec;
        cursor: not-allowed;
    }

.rel-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.rel-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 12px;
    background: #eef4fb;
    color: #1e5eb8;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
}

    /* Método de avaliação "ativo" (MetodologiasAvaliacao.razor) — só o clicado mostra o
       respetivo quadro por baixo, em vez de todos empilhados. */
    .rel-chip.rel-chip-ativo {
        background: #1e5eb8;
        color: #fff;
    }

        .rel-chip.rel-chip-ativo button {
            color: #fff;
        }

    .rel-chip button {
        border: none;
        background: none;
        color: #1e5eb8;
        cursor: pointer;
        font-size: 14px;
        line-height: 1;
        padding: 0;
    }

/* Seletor de Imóveis (tab Dados do Imóvel) */
.imovel-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.imovel-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    background: #eef4fb;
    color: #1e5eb8;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
}

    .imovel-tab.active {
        background: #1e5eb8;
        color: #fff;
    }

    .imovel-tab.imovel-tab-pending {
        border: 1px dashed #f59e0b;
    }

.imovel-tab-remove {
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    opacity: .65;
}

    .imovel-tab-remove:hover {
        opacity: 1;
    }

.imovel-tab-add {
    padding: 8px 16px;
    border-radius: 999px;
    background: #fff;
    border: 1px dashed #1e5eb8;
    color: #1e5eb8;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

    .imovel-tab-add:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

.imovel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e3e6ea;
    border-radius: 6px;
    font-size: 14px;
    color: #5c6b77;
}

    .imovel-toolbar strong {
        color: #1c2b3a;
    }

.rel-checkbox-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 20px;
    margin-bottom: 16px;
}

.rel-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #0f172a;
    padding: 4px 0;
}

    .rel-checkbox-item input {
        margin: 0;
    }

.rel-suffix-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .rel-suffix-field input {
        flex: 1;
    }

.rel-suffix-unit {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
}

/* Taxa de Capitalização: caixa "Taxa sem Risco" (OT / Bunds) com o botão da IA (MetodologiasAvaliacao.razor) */
.taxa-sem-risco {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px 0;
    margin-bottom: 16px;
    background: #fafbfd;
}

.taxa-sem-risco-cab {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
}

    .taxa-sem-risco-cab .rel-btn-secondary {
        margin-top: 0;
    }

        .taxa-sem-risco-cab .rel-btn-secondary:disabled {
            color: #94a3b8;
            cursor: not-allowed;
        }

.taxa-resultados {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px 32px;
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 8px;
    background: #f1f5f9;
}

.taxa-resultado {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
    color: #475569;
}

    .taxa-resultado strong {
        font-size: 15px;
        color: #0f172a;
    }

.rel-field label.taxa-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

    .rel-field label.taxa-radio input {
        width: auto;
        margin: 0;
        padding: 0;
    }

.rel-risk-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid #f1f5f9;
}

    .rel-risk-row .rel-risk-name {
        font-size: 14px;
        color: #0f172a;
    }

    .rel-risk-row select {
        width: 220px;
    }

.rel-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 6px;
    background: #eef4fb;
    color: #1e5eb8;
    text-decoration: none;
    margin-bottom: 20px;
}

    .rel-link-btn:hover {
        background: #dbe7f5;
    }

.rel-btn-secondary {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #dde3ec;
    border-radius: 6px;
    background: white;
    color: #1e5eb8;
    cursor: pointer;
    margin-top: 4px;
}

.coordmap-checks {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.coordmap-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #0f172a;
    cursor: pointer;
}

    .coordmap-check input {
        margin: 0;
    }

.coordmap-wrap {
    position: relative;
}

.coordmap-box {
    width: 100%;
    height: 320px;
    min-height: 200px;
    min-width: 240px;
    border-radius: 8px;
    border: 1px solid #dde3ec;
    margin-top: 8px;
    resize: both;
    overflow: hidden;
}

.coordmap-expand-btn {
    position: absolute;
    top: 16px;
    right: 8px;
    z-index: 1000;
    width: 28px;
    height: 28px;
    border: 1px solid #dde3ec;
    border-radius: 6px;
    background: white;
    color: #1e5eb8;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

    .coordmap-expand-btn:hover {
        background: #eef4fb;
    }

.coordmap-pin {
    background: transparent !important;
    border: none !important;
}

.coordmap-list {
    margin-top: 16px;
    border: 1px solid #e6ebf2;
    border-radius: 8px;
    max-height: 260px;
    overflow-y: auto;
}

.coordmap-list-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1.4fr;
    gap: 12px;
    padding: 8px 12px;
    font-size: 13.5px;
    color: #0f172a;
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
}

    .coordmap-list-row:last-child {
        border-bottom: none;
    }

    a.coordmap-list-row:hover {
        background: #f7f9fc;
    }

.coordmap-list-header {
    font-weight: 700;
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #f7f9fc;
    position: sticky;
    top: 0;
}

.coordmap-badge {
    margin-left: 8px;
    font-size: 11.5px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #fdecea;
    color: #c0392b;
    font-weight: 500;
    white-space: nowrap;
}

.coordmap-modal-card {
    width: 80vw !important;
    max-width: 80vw !important;
}

/* Drop-zone com upload por seleção ou arrastar — InputFile transparente por cima
   (ver MainLayout.razor "Adicionar por Cliente" e IdentificacaoLocalizacao.razor
   "Adicionar Certificado"). Classe já existia na marcação mas sem estilo próprio. */
.upload-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 22px 16px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: #fafafa;
    text-align: center;
    color: #6b7280;
    transition: border-color .15s ease, background-color .15s ease;
}
.upload-area--drag {
    border-color: #3b72ad;
    background: #eef4fa;
    color: #3b72ad;
}
.upload-area--ok {
    border-color: #22c55e;
    background: #f0fdf4;
}

.coordmap-box-modal {
    height: 75vh;
    resize: none;
}

/* ── Faturação por cliente (menu Faturação → Ver / Criar) ── */
.fat-cliente {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 32px;
    padding: 14px 16px;
    margin: 4px 0 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

    .fat-cliente > div {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 140px;
    }

    .fat-cliente span {
        font-size: 12px;
        color: #64748b;
    }

.fat-form {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px 16px;
    margin-bottom: 16px;
}

    .fat-form input, .fat-form select {
        width: 100%;
        box-sizing: border-box;
        padding: 8px 10px;
        border: 1px solid #9ca3af;
        border-radius: 4px;
        background: #fff;
    }

    .fat-form input[readonly] {
        background: #f1f5f9;
    }

.fat-form-pdf {
    grid-column: span 2;
}

.fat-invalido, .fat-form .fat-invalido {
    border-color: #c00 !important;
    background: #fff5f5 !important;
}

.fat-barra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 4px 0 14px;
}

.fat-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.fat-btn-gravar {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    background: #2770CA;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

    .fat-btn-gravar:disabled {
        background: #9ca3af;
        cursor: not-allowed;
    }

.fat-btn-pequeno {
    padding: 4px 10px;
    font-size: 13px;
    white-space: nowrap;
}

.fat-tabela tbody tr.fat-linha {
    cursor: pointer;
}

    .fat-tabela tbody tr.fat-linha:hover {
        background: #f1f5f9;
    }

.fat-tabela tr.fat-anulada td {
    color: #94a3b8;
    text-decoration: line-through;
}

    .fat-tabela tr.fat-anulada td:nth-last-child(-n+3) {
        text-decoration: none;
    }

.fat-tabela tr.fat-selecionado {
    background: #eef4fa;
}

.fat-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 10px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
}

.fat-modal {
    max-width: 560px;
    width: calc(100% - 32px);
}

.fat-modal--largo {
    max-width: 1100px;
    max-height: 85vh;
    overflow: auto;
}

.fat-detalhe {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 6px 12px;
    margin: 0;
}

    .fat-detalhe dt {
        color: #64748b;
    }

    .fat-detalhe dd {
        margin: 0;
        font-weight: 500;
    }

@media (max-width: 640px) {
    .fat-form-pdf { grid-column: auto; }
    .fat-detalhe { grid-template-columns: 1fr; }
    .fat-detalhe dd { margin-bottom: 6px; }
}

/* Anulação de fatura (modal da fatura em Faturação → Ver) */
.fat-anular {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fat-anular-titulo {
    font-weight: 600;
    color: #b91c1c;
}

.fat-anular-aviso {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.fat-btn-anular {
    padding: 8px 16px;
    border: 1px solid #c00;
    border-radius: 6px;
    background: #c00;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

    .fat-btn-anular:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

.fat-btn-anular--contorno {
    background: #fff;
    color: #c00;
    margin-right: auto;
}

/* Processos já faturados na lista de Faturação → Criar (só com "Ver todos"; não selecionáveis) */
.fat-tabela tr.fat-faturado td {
    background: #f3f4f6;
    color: #9ca3af;
}

    .fat-tabela tr.fat-faturado td a {
        color: #9ca3af;
    }

.fat-tabela tr.fat-faturado .fat-tag {
    background: #e5e7eb;
    color: #4b5563;
}

/* Filtro por data da fatura (Faturação → Ver) */
.fat-filtro-data {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin-right: 12px;
}

    .fat-filtro-data input {
        padding: 6px 8px;
        border: 1px solid #9ca3af;
        border-radius: 4px;
        background: #fff;
    }

    .fat-filtro-data label {
        font-size: 14px;
        color: #374151;
    }

/* Liquidação de fatura (Faturação → Ver) */
.fat-btn-liquidar {
    padding: 4px 12px;
    border: 1px solid #15803d;
    border-radius: 6px;
    background: #16a34a;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

    .fat-btn-liquidar:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

.modal-footer .fat-btn-liquidar {
    padding: 8px 16px;
}

.fat-liquidada {
    color: #15803d;
    font-size: 13px;
    white-space: nowrap;
}

.fat-aviso-valor {
    padding: 10px 12px;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    background: #fffbeb;
    color: #92400e;
    font-size: 14px;
}

.fat-ok-valor {
    padding: 8px 12px;
    border-radius: 6px;
    background: #f0fdf4;
    color: #15803d;
    font-size: 14px;
}

/* Relatório → Identificação e Localização / Características do Imóvel: campos em 3 colunas.
   As grelhas de 2 colunas (.rel-grid2) e as linhas (.rel-row2) destas subtabs passam a
   grelhas de 3; campos soltos (ex.: Proprietário, observações) continuam a toda a largura. */
.rel-3col .rel-grid2,
.rel-3col .rel-row2 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 24px;
}

    .rel-3col .rel-row2 > .rel-field {
        min-width: 0;
    }

@media (max-width: 1100px) {
    .rel-3col .rel-grid2,
    .rel-3col .rel-row2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .rel-3col .rel-grid2,
    .rel-3col .rel-row2 {
        grid-template-columns: 1fr;
    }
}

/* Faturação → Criar: valor a faturar editável por processo */
.fat-tabela td.fat-valor {
    padding: 2px 4px;
}

    .fat-tabela td.fat-valor input {
        width: 100px;
        padding: 4px 6px;
        border: 1px solid #9ca3af;
        border-radius: 4px;
        text-align: right;
        font-size: 13px;
    }

.fat-label-nota {
    font-weight: normal;
    font-size: 11px;
    color: #6b7280;
}

/* Separador Faturação de um processo já faturado (só datas de pagamento editáveis) */
.faturacao-bloqueada {
    margin-bottom: 14px;
    padding: 10px 14px;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    background: #fffbeb;
    color: #92400e;
    font-size: 14px;
}

/* Faturação → Criar: linhas de IVA da fatura (até 3 — Continente / Madeira / Açores) */
.fat-ivas {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.fat-ivas-titulo {
    font-weight: 600;
    color: #1e3a5f;
    margin-bottom: 8px;
}

.fat-ivas-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .fat-ivas-tabela th {
        text-align: left;
        font-weight: 600;
        color: #64748b;
        font-size: 12.5px;
        padding: 4px 8px;
        border-bottom: 1px solid #e5e7eb;
    }

    .fat-ivas-tabela td {
        padding: 6px 8px;
        border-bottom: 1px solid #f1f5f9;
        vertical-align: middle;
    }

    .fat-ivas-tabela select,
    .fat-ivas-tabela input {
        padding: 6px 8px;
        border: 1px solid #9ca3af;
        border-radius: 4px;
        background: #fff;
        max-width: 240px;
        box-sizing: border-box;
    }

    .fat-ivas-tabela input[readonly] {
        background: #f1f5f9;
        width: 130px;
    }

    .fat-ivas-tabela input[type=number] {
        width: 130px;
    }

.fat-ivas-erro td {
    background: #fef2f2;
}

.fat-ivas-rodape {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

/* Faturação → Criar: etiquetas numa só linha para todas as caixas ficarem niveladas */
.fat-form {
    align-items: start;
}

    .fat-form .rel-field > label {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-height: 1.3em;
    }

.fat-ivas-ref {
    font-size: 13.5px;
    color: #374151;
}

.fat-ivas-ok {
    margin-left: 6px;
    color: #15803d;
}

/* Prospeção → Quadro de resumo (igual a imgTemp/Prospecao.xlsx). Cores do Excel:
   título #3F71CA, cabeçalhos #B7CAEB, subcabeçalho/fórmulas Accent1 tint 80% (#DAE3F3),
   editáveis a branco (o amarelo do Excel só marcava as células editáveis). Largura das colunas proporcional às do Excel (scroll horizontal). */
.pr-wrap {
    overflow-x: auto;
    padding-bottom: 6px;
}

.pr-tabela {
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12.5px;
    color: #111827;
}

    .pr-tabela td {
        border: 1px solid #d1d5db;
        padding: 0;
        height: 28px;
        vertical-align: middle;
    }

    .pr-tabela tr > td:empty {
        border-color: transparent;
    }

.pr-titulo {
    background: #3F71CA;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    height: 64px !important;
    letter-spacing: .04em;
}

.pr-espaco td {
    height: 10px !important;
    border: none !important;
}

.pr-cab {
    background: #B7CAEB;
    text-align: center;
    font-weight: 600;
    padding: 4px 6px !important;
    line-height: 1.2;
}

.pr-sub {
    background: #DAE3F3;
    text-align: center;
    padding: 4px 6px !important;
}

.pr-rotulo {
    padding: 0 6px !important;
    white-space: nowrap;
    font-weight: 600;
}

.pr-edit {
    background: #fff;
}

    .pr-edit input,
    .pr-edit textarea {
        width: 100%;
        box-sizing: border-box;
        border: none;
        background: transparent;
        padding: 4px 6px;
        font: inherit;
        color: inherit;
    }

    .pr-edit textarea {
        resize: vertical;
        min-height: 28px;
        display: block;
    }

    .pr-edit input:focus,
    .pr-edit textarea:focus {
        outline: 2px solid #2770CA;
        outline-offset: -2px;
        background: #fffde0;
    }

.pr-num {
    text-align: right;
}

.pr-centro {
    text-align: center;
}

.pr-fonte {
    position: relative;
}

    .pr-fonte input {
        padding-right: 22px;
        text-overflow: ellipsis;
    }

    .pr-fonte a {
        position: absolute;
        right: 6px;
        top: 50%;
        transform: translateY(-50%);
        text-decoration: none;
        color: #1d4ed8;
        font-weight: 700;
    }

.pr-formula {
    background: #DAE3F3;
    text-align: right;
    padding: 0 6px !important;
    font-variant-numeric: tabular-nums;
}

/* Quadro de resumo: fatores em %, eliminar linha, barra de ações */
.pr-pct {
    display: flex;
    align-items: center;
}

    .pr-pct input {
        flex: 1;
        min-width: 0;
        padding-left: 4px;
        padding-right: 2px;
        -moz-appearance: textfield;   /* sem as setas do campo numérico — cortavam o valor */
    }

        .pr-pct input::-webkit-outer-spin-button,
        .pr-pct input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

    .pr-pct span {
        padding-right: 6px;
        color: #6b7280;
    }

.pr-del {
    margin-left: 6px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 12px;
    padding: 0 2px;
}

    .pr-del:hover {
        color: #c00;
    }

.pr-barra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.pr-nota {
    font-size: 12.5px;
    color: #6b7280;
}

/* Prospeção: resultados / imóveis separados em Venda e Arrendamento */
.prospecao-grupo-titulo {
    margin: 14px 0 8px;
    padding-bottom: 4px;
    border-bottom: 2px solid #3B72AD;
    font-weight: 700;
    color: #1e3a5f;
    font-size: 14px;
}

    .prospecao-grupo-titulo span {
        font-weight: 400;
        font-size: 12.5px;
        color: #6b7280;
        margin-left: 6px;
    }

/* Quadros de resumo da Prospeção — tabelas 2 (Resumo da Amostra Analisada) e 3 (Análise
   Estatística), mesmas cores do Excel: rótulos #D9E1F2, valores calculados #E7EDF9,
   classes #F7F9EB */
.pr-bloco {
    margin-top: 22px;
}

.pr-titulo-baixo {
    height: 34px !important;
    font-size: 15px;
}

.pr-negrito {
    font-weight: 600;
}

.pr-rot {
    background: #D9E1F2;
    padding: 3px 6px !important;
}

.pr-val {
    background: #D9E1F2;
    text-align: right;
    padding: 3px 6px !important;
    font-variant-numeric: tabular-nums;
}

.pr-calc {
    background: #E7EDF9 !important;
}

.pr-classes {
    background: #F7F9EB;
    text-align: center;
    padding: 3px 6px !important;
}

.pr-destaque {
    background: #fff3c4 !important;
    font-size: 13.5px;
}

.pr-nao-validado {
    background: #fecaca !important;
    color: #991b1b;
}

.pr-fora td.pr-rot,
.pr-fora td.pr-val {
    color: #9ca3af;
}

.pr-tabela-resumo .pr-sub,
.pr-tabela-resumo .pr-val {
    text-align: center;
}

/* Barra de pesquisa: botão ✕ para fechar a lista de resultados (e limpar o texto) */
.search-input {
    padding-right: 40px;
}

.search-fechar {
    position: absolute;
    right: 8px;
    top: 21px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #6b7280;
    font-size: 15px;
    line-height: 28px;
    cursor: pointer;
    z-index: 2;
}

    .search-fechar:hover {
        background: #f1f5f9;
        color: #111827;
    }

@media (max-width: 768px) {
    .search-fechar {
        top: 32px;
    }
}

/* Prospeção: "Valor a Usar" no fim de cada quadro de resumo (Venda / Arrendamento) */
.pr-valor-usar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 18px;
    padding: 12px 16px;
    border: 1px solid #B7CAEB;
    border-radius: 8px;
    background: #f3f6fb;
    max-width: 760px;
}

    .pr-valor-usar label {
        font-weight: 700;
        color: #1e3a5f;
    }

    .pr-valor-usar select {
        padding: 7px 10px;
        border: 1px solid #9ca3af;
        border-radius: 4px;
        background: #fff;
        min-width: 260px;
    }

.pr-valor-usar-valor {
    font-size: 17px;
    font-weight: 700;
    color: #1e3a5f;
    padding: 4px 12px;
    border-radius: 6px;
    background: #fff3c4;
}

.pr-valor-usar-vazio {
    background: transparent;
    color: #9ca3af;
    font-weight: 400;
}

/* Intervenientes: confirmação da remoção do técnico e cadeado quando já não pode ser removido */
.interv-confirmar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #b91c1c;
    margin-right: 6px;
}

.interv-bloqueado {
    font-size: 12px;
    margin-right: 6px;
    cursor: help;
    opacity: .7;
}

/* Intervenientes: quem fez a visita (👣) / elaborou o relatório (📝) — cinzento = não, colorido = sim */
.interv-autoria {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.interv-autoria-btn {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 6px;
    padding: 1px 5px;
    font-size: 13px;
    line-height: 1.3;
    cursor: pointer;
    filter: grayscale(1);
    opacity: .45;
}

    .interv-autoria-btn.ativo {
        filter: none;
        opacity: 1;
        background: #dcfce7;
        border-color: #86efac;
    }

    .interv-autoria-btn:disabled { cursor: default; }
    .interv-autoria-btn:not(:disabled):hover { opacity: .85; }

/* Intervenientes: aviso ao escolher quem já tem o outro papel no processo (técnico ↔ validador) */
.interv-aviso {
    margin-top: 6px;
    padding: 8px 10px;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    background: #fffbeb;
    color: #92400e;
    font-size: 12.5px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.interv-aviso-sim,
.interv-aviso-nao {
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 12.5px;
    cursor: pointer;
    border: 1px solid #d1d5db;
    background: #fff;
}

.interv-aviso-sim {
    border-color: #b45309;
    background: #f59e0b;
    color: #fff;
    font-weight: 600;
}

/* ── Quadro de avaliação: Vista Excel / Vista Formulário (QuadroFormulario.razor) ── */
.qx-vistas {
    display: inline-flex;
    margin: 4px 0 14px;
    border: 1px solid #1e5eb8;
    border-radius: 6px;
    overflow: hidden;
}

    .qx-vistas button {
        padding: 6px 14px;
        font-size: 13px;
        font-weight: 600;
        border: none;
        background: white;
        color: #1e5eb8;
        cursor: pointer;
    }

        .qx-vistas button.ativo {
            background: #1e5eb8;
            color: white;
        }

/* Descarregar / carregar o Excel do modelo: links discretos ao lado das vistas. */
.qx-modelo-excel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 14px;
    font-size: 12.5px;
    color: #8a94a3;
}

    .qx-modelo-excel a,
    .qx-modelo-excel label {
        color: #5b6b80;
        text-decoration: underline;
        text-underline-offset: 2px;
        cursor: pointer;
        margin: 0;
        font-weight: normal;
    }

        .qx-modelo-excel a:hover,
        .qx-modelo-excel label:hover {
            color: #1e5eb8;
        }

        .qx-modelo-excel label.desativado {
            cursor: default;
            text-decoration: none;
        }

    .qx-modelo-excel input[type=file] {
        display: none;
    }

/* A folha mantém as larguras do Excel; em ecrãs estreitos desloca-se na horizontal. */
.qx-wrap {
    max-width: 100%;
    overflow-x: auto;
    background: white;
    border: 1px solid #e2e6ea;
    border-radius: 6px;
    padding: 8px;
}

.qx-grid {
    border-collapse: collapse;
    table-layout: fixed;
    color: #000;
    font-family: Calibri, Arial, sans-serif;
    font-size: 14.7px;
}

    .qx-grid td {
        padding: 0 3px;
        overflow: hidden;
        text-overflow: clip;
        line-height: 1.2;
    }

    .qx-grid.qx-grelha td {
        outline: 1px solid #e6e6e6;
        outline-offset: -1px;
    }

    .qx-grid input,
    .qx-grid textarea {
        width: 100%;
        height: 100%;
        min-height: 18px;
        box-sizing: border-box;
        border: 1px dashed transparent;
        background: transparent;
        font: inherit;
        color: inherit;
        text-align: inherit;
        padding: 0 2px;
        margin: 0;
        resize: none;
    }

        .qx-grid input:hover,
        .qx-grid textarea:hover {
            border-color: #8aa9d6;
        }

        .qx-grid input:focus,
        .qx-grid textarea:focus {
            outline: 2px solid #1e5eb8;
            outline-offset: -2px;
            background: white;
        }

    /* Setas dos campos numéricos ocupam espaço numa célula estreita. */
    .qx-grid input[type=number] {
        -moz-appearance: textfield;
    }

        .qx-grid input[type=number]::-webkit-inner-spin-button,
        .qx-grid input[type=number]::-webkit-outer-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

    /* Texto que passa para as células vizinhas livres, como no Excel (QuadroLayoutService.EstiloTransborda). */
    .qx-grid td.qx-tb-td {
        overflow: visible;
    }

    .qx-grid .qx-tb {
        display: flex;
        white-space: nowrap;
    }

/* Prospeção: Yield de Mercado (Amostra.razor) — a conta por baixo do valor */
.pr-yield-formula {
    color: #6b7280;
    font-size: 13px;
}

/* Metodologias de Avaliação: tabela "Valor de Mercado" (MetodologiasAvaliacao.razor) */
.vm-tabela .vm-num {
    text-align: right;
    white-space: nowrap;
}

.vm-tabela .vm-peso {
    width: 140px;
}

.vm-sem-valor {
    color: #9ca3af;
    cursor: help;
}

.vm-resultado {
    font-size: 17px;
    font-weight: 700;
}

.vm-aviso {
    display: block;
    color: #b45309;
    font-size: 12.5px;
    margin-top: 4px;
}

    .vm-tabela td.vm-aviso {
        display: table-cell;
        font-size: inherit;
        font-weight: 700;
    }

/* Tabela "Valor de Mercado": bloco estreito e centrado (tabela + Valor a Utilizar) */
.vm-bloco {
    max-width: 480px;
    margin: 0 auto 24px;
}

    .vm-bloco .vm-tabela .vm-peso {
        width: 110px;
    }

.vm-controlos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
}

    .vm-controlos select {
        width: 100%;
    }

@media (max-width: 520px) {
    .vm-controlos {
        grid-template-columns: 1fr;
    }
}

/* Campo calculado noutro sítio (ex.: Conclusão → Valor de Mercado, vindo das Metodologias) */
.rel-input-calculado {
    background: #f3f6fb;
    color: #1e3a5f;
    font-weight: 700;
    cursor: default;
}

.rel-nota-calculado {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
}

/* Mapa dos Dados do Imóvel: botão "Obter imagem" (CoordMap.razor) */
.coordmap-acoes {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 8px 0 4px;
}

.coordmap-acoes-ajuda {
    font-size: 12px;
    color: #64748b;
}

/* Texto gerado por IA: dados em falta indicados pela IA (IdentificacaoLocalizacao.razor) */
.rel-ia-em-falta {
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    background: #fffbeb;
    color: #78350f;
    font-size: 13px;
    max-width: 760px;
}

/* Página Custos de IA (Components/Pages/Custos.razor) */
.cst-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

    .cst-filtros .rel-field {
        min-width: 180px;
        margin-bottom: 0;
    }

.cst-resumo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.cst-tile {
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    padding: 14px 16px;
}

.cst-tile-rotulo {
    font-size: 12.5px;
    color: #64748b;
}

.cst-tile-valor {
    margin-top: 4px;
    font-size: 22px;
    font-weight: 700;
    color: #1e3a5f;
    font-variant-numeric: tabular-nums;
}

.cst-tabela {
    margin-bottom: 24px;
}

    .cst-tabela .cst-num {
        text-align: right;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
    }

    .cst-tabela .cst-destaque {
        font-weight: 700;
    }

.cst-barra {
    display: inline-block;
    width: 60px;
    height: 6px;
    margin-right: 6px;
    vertical-align: middle;
    background: #e8eef7;
    border-radius: 3px;
    overflow: hidden;
}

    .cst-barra span {
        display: block;
        height: 100%;
        background: #1e5eb8;
    }

.cst-duas-colunas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .cst-duas-colunas {
        grid-template-columns: 1fr;
    }
}

.cst-nota {
    margin-top: 8px;
    padding: 12px 14px;
    background: #f3f6fb;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    font-size: 13px;
    color: #475569;
    max-width: 900px;
}

    .cst-tabela tr.cst-sem-cliente td {
        color: #64748b;
        font-style: italic;
    }

/* Texto gerado por IA: fontes externas consultadas (IdentificacaoLocalizacao.razor) */
.rel-ia-fontes {
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    background: #eff6ff;
    color: #1e3a5f;
    font-size: 13px;
    max-width: 760px;
    overflow-wrap: anywhere;
}

/* Alertas e fontes da IA guardados com o relatório — bloco fechado (IdentificacaoLocalizacao.razor) */
.rel-ia-detalhes {
    margin-top: 8px;
    max-width: 760px;
}

    .rel-ia-detalhes > summary {
        cursor: pointer;
        font-size: 13px;
        color: #475569;
        padding: 4px 0;
        user-select: none;
    }

        .rel-ia-detalhes > summary:hover {
            color: #1e5eb8;
        }

.rel-ia-contagem {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 10px;
    background: #eff6ff;
    color: #1e3a5f;
    font-size: 12px;
    font-weight: 600;
}

.rel-ia-contagem-alerta {
    background: #fffbeb;
    color: #92400e;
}

.rel-ia-nota {
    color: #94a3b8;
    font-size: 12px;
}

    .cst-tabela-curta {
        max-width: 640px;
    }

    .cst-barra.cst-barra-larga {
        width: 120px;
    }

    .cst-barra.cst-barra-alerta span {
        background: #d97706;
    }

/* Página Marcadores (Components/Pages/Marcadores.razor) */
.mrc-barra {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 12px;
}

    .mrc-barra .rel-field {
        margin-bottom: 0;
        min-width: 220px;
    }

.mrc-pesquisa {
    flex: 1;
    max-width: 520px;
}

.mrc-ajuda {
    margin-bottom: 16px;
}

    .mrc-ajuda > summary {
        cursor: pointer;
        color: #1e5eb8;
        font-weight: 600;
        padding: 4px 0;
    }

.mrc-contagem {
    font-size: 12.5px;
    color: #64748b;
    margin-bottom: 6px;
}

.mrc-tabela td {
    vertical-align: top;
}

.mrc-tabela code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 12.5px;
    background: #f3f6fb;
    padding: 1px 4px;
    border-radius: 4px;
    overflow-wrap: anywhere;
}

.mrc-codigo {
    min-width: 280px;
}

.mrc-copiar {
    margin-left: 4px;
    border: 1px solid #dde3ec;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    padding: 0 5px;
    color: #1e5eb8;
}

.mrc-area, .mrc-onde, .mrc-forma {
    font-size: 12.5px;
    color: #475569;
}

.mrc-notas {
    font-size: 12.5px;
    color: #64748b;
}

/* Características do Imóvel — Renda Potencial: subtítulo dentro de Arrendamento e dica com o valor da prospeção */
.rel-sub-h2 {
    font-size: 13px;
    margin-top: 14px;
}

.rel-dica {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: #64748b;
}

/* Consumo da geração por IA (Observações sobre o local / Mercado Imobiliário) */
.rel-ia-consumo {
    margin-top: 6px;
    font-size: 12px;
    color: #475569;
}

    .rel-ia-consumo > summary {
        cursor: pointer;
    }

.rel-ia-consumo-tabela {
    margin-top: 6px;
    border-collapse: collapse;
    font-size: 12px;
}

    .rel-ia-consumo-tabela th, .rel-ia-consumo-tabela td {
        border: 1px solid #dde3ec;
        padding: 3px 8px;
        text-align: right;
    }

    .rel-ia-consumo-tabela th {
        background: #f3f6fb;
        font-weight: 600;
    }

/* Pesquisa de mercado do concelho (reutilizada pelas secções geradas por IA) */
.rel-ia-pesquisa {
    margin-top: 6px;
    font-size: 12px;
    color: #475569;
}

    .rel-ia-pesquisa .rel-link-btn {
        margin-left: 6px;
    }

.rel-ia-pesquisa-expirada {
    color: #b45309;
}

/* Visto verde nas sub-tabs do Relatório (todos os campos visíveis preenchidos — relcompletude.js) */
.rel-visto {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    margin-right: 6px;
    flex-shrink: 0;
}

/* Prospeção — segunda prospeção: "Substituir as existentes" (a cor avisa que apaga as amostras gravadas) */
.btn-substituir-prospecao {
    margin-left: 8px;
    background: #c2410c;
}

    .btn-substituir-prospecao:hover:not(:disabled) {
        background: #9a3412;
    }

/* Logótipo do ecrã de login (regra que estava só na versão antiga do ficheiro) */
.login-logo {
    width: 200px;
    margin-bottom: 24px;
}

/* Metodologias de Avaliação — Valor de Mercado "Outro" (caixa + Gravar) */
.vm-outro {
    display: flex;
    gap: 8px;
    align-items: center;
}

    .vm-outro input {
        flex: 1;
        min-width: 0;
        text-align: right;
    }

    .vm-outro button {
        white-space: nowrap;
    }

/* Prospeção — freguesias da pesquisa (a do processo + as acrescentadas, umas por baixo das outras) */
.amostra-freg-bloco {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.amostra-freg-extra {
    background: #eef4fd;
    border-color: #c7dcf7;
}

.amostra-freg-remover {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 0 0 4px;
    font-size: 12px;
}

    .amostra-freg-remover:hover {
        color: #c0392b;
    }

.amostra-freg-adicionar {
    border: 1px dashed #93b4e0;
    background: #fff;
    color: #2770CA;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 13px;
    cursor: pointer;
}

    .amostra-freg-adicionar:hover {
        background: #eef4fd;
    }

/* Com concelhos acrescentados: freguesias a cinzento (a pesquisa é só por concelho) */
.amostra-freg-bloqueado .amostra-info-chip {
    opacity: .45;
    text-decoration: line-through;
}

.amostra-freg-bloqueado .amostra-freg-remover {
    cursor: default;
}

.amostra-freg-nota {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

/* Relatório — escolha "Relatório Único / 1 Relatório por Imóvel" (processos com mais de um imóvel) */
.rel-modo {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f5f8fd;
    border: 1px solid #dbe6f5;
    border-radius: 8px;
    font-size: 14px;
}

    .rel-modo label {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
    }

.rel-modo-titulo {
    color: #6b7280;
}

.rel-modo-nota {
    color: #92400e;
    font-size: 13px;
}

/* Check "Validado" por cima das descrições geradas por IA (IdentificacaoLocalizacao.razor) */
.rel-ia-validado {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 6px; padding: 5px 10px; border-radius: 6px;
    background: #fff7ed; border: 1px solid #fed7aa; font-size: 13px;
}
.rel-ia-validado-ok { background: #f0fdf4; border-color: #bbf7d0; }
.rel-field .rel-ia-validado label {
    display: inline-flex; align-items: center; gap: 6px; margin: 0;
    font-size: 13px; font-weight: 600; color: #1e3a5f; cursor: pointer;
}
.rel-field .rel-ia-validado input[type=checkbox] { width: 16px; height: 16px; margin: 0; padding: 0; }
.rel-ia-validado-quem { color: #64748b; font-size: 12px; }

/* Botões de gerar por IA desativados: o aviso (title) fica no invólucro, porque um botão
   desativado não recebe o rato em todos os browsers (IdentificacaoLocalizacao.razor). */
.rel-ia-btn-wrap { display: inline-block; }
.rel-ia-btn-wrap > button:disabled { pointer-events: none; }
.rel-ia-btn-wrap[title] { cursor: not-allowed; }

/* Prospeção: reabrir uma pesquisa guardada (Amostra.razor) */
.amostra-guardadas { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.amostra-guardadas select { padding: 7px 8px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; }
.btn-amostra-reabrir {
    background: #fff; color: #3B72AD; border: 1px solid #3B72AD;
    padding: 8px 16px; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-amostra-reabrir:hover:not(:disabled) { background: #eef4fb; }
.btn-amostra-reabrir:disabled { color: #9ca3af; border-color: #d1d5db; cursor: not-allowed; }

/* Prospeção: captura da página do anúncio de cada amostra (Amostra.razor / ProspecaoCapturaService) */
.prospecao-card-captura { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 12px 0; font-size: 12px; }
.prospecao-captura-estado { color: #6b7280; }
.prospecao-captura-erro { color: #b45309; cursor: help; }
.prospecao-captura-ver, .prospecao-captura-btn {
    border: 1px solid #cbd5e1; background: #fff; color: #1e3a5f; border-radius: 5px;
    padding: 3px 8px; font-size: 12px; cursor: pointer;
}
.prospecao-captura-ver { border-color: #3B72AD; color: #3B72AD; font-weight: 600; }
.prospecao-captura-ver:hover, .prospecao-captura-btn:hover:not(:disabled) { background: #eef4fb; }
.prospecao-captura-btn:disabled { color: #9ca3af; cursor: not-allowed; }
.prospecao-captura-modal { width: min(1100px, 95vw); max-height: 92vh; display: flex; flex-direction: column; }
.prospecao-captura-corpo { overflow: auto; flex: 1; background: #f3f4f6; text-align: center; }
.prospecao-captura-corpo img { max-width: 100%; height: auto; display: inline-block; }

/* Número do cartão da prospeção = "Amostra n" do quadro de resumo */
.prospecao-card-num {
    position: absolute;
    top: 8px;
    left: 8px;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 15px;
    background: #1e3a5f;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.35);
    z-index: 1;
}
.prospecao-card-num-fora { background: #9ca3af; }

/* Fotos (tab Outros): foto em destaque nos relatórios — ★ no canto da foto */
.preview-item { position: relative; }
.preview-item-destaque { border: 2px solid #f59e0b; padding: 9px; }
.preview-item .foto-destaque-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 26px;
    height: 26px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.85);
    color: #6b7280;
    font-size: 17px;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
    z-index: 1;
}
    .preview-item .foto-destaque-btn:hover { color: #f59e0b; }
    .preview-item .foto-destaque-btn.ativo { color: #f59e0b; background: #fff; }

/* Prospeção — quadro de resumo: fator escolhido em cada coluna de homogeneização */
.pr-sub.pr-fator { padding: 2px; }
.pr-fator select,
.pr-fator .pr-fator-outros {
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
    padding: 1px 2px;
    border: 1px solid #c7d2e3;
    border-radius: 3px;
    background: #fff;
}
.pr-fator .pr-fator-outros { margin-top: 2px; }

/* Prospeção — quadro de resumo: ordenar pelas áreas, preço e €/m² (clicar no subcabeçalho) */
.pr-sub.pr-ordenar { cursor: pointer; user-select: none; white-space: nowrap; }
.pr-sub.pr-ordenar:hover { background: #c9d6ee; }
.pr-sub.pr-ordenar.ativa { background: #b4c7e7; font-weight: 700; }
.pr-ordenar .pr-seta { margin-left: 3px; font-size: 10px; color: #1e3a5f; }
.pr-ordenar:not(.ativa) .pr-seta { opacity: .45; }

/* Prospeção — aviso de amostras insuficientes para o tratamento estatístico (< 10) */
.pr-aviso-amostras {
    margin: 10px 0 6px;
    padding: 8px 12px;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    color: #92400e;
    font-size: 13px;
}
