﻿

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/bg-city.jpg') 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);
}

/* LOGO */
.login-logo {
    width: 200px;
    margin-bottom: 24px;
}

/* INPUTS */
.input {
    width: 100%;
    padding: 14px 14px;
    margin-bottom: 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    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: 14px;
    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 {
    max-height: 200px;
}

/* FLYOUT SUB-ITEMS */
.flyout-subitem {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 12px;
    font-size: 15px;
    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;
}

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

/* MAIN */

.main {
    margin-left: 70px;
    padding-top: 80px; /* compensa o topbar fixo */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: calc(100% - 70px);
    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: 22px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* STEP BAR */

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

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

/* z-index decrescente: primeiro fica por cima */
.step:nth-child(1)  { z-index: 10; }
.step:nth-child(2)  { z-index: 9; }
.step:nth-child(3)  { z-index: 8; }
.step:nth-child(4)  { z-index: 7; }
.step:nth-child(5)  { z-index: 6; }
.step:nth-child(6)  { z-index: 5; }
.step:nth-child(7)  { z-index: 4; }
.step:nth-child(8)  { z-index: 3; }
.step:nth-child(9)  { z-index: 2; }
.step:nth-child(10) { z-index: 1; }

.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: 12px;
    font-weight: 600;
    color: white;
    text-align: center;
    line-height: 1.3;
}

/* TEXTO PRINCIPAL dentro da seta */
.step-label {
    font-size: 11px;
    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: 11px;
    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: 10px;
    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: 11px;
    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; }

/* 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;
}

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


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


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

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

/* 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*/
.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: 14px;
    font-weight: 600;
    color: #374151;
}

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

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

.card-item {
    font-size: 13px;
    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: 12px;
        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: 13px;
}

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

.user-role {
    font-size: 11px;
    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: 14px;
    }

        .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;
}

    .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: 12px;
}

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

.file-item {
    display: flex;
    justify-content: space-between;
    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;
}

    .file-name i {
        font-size: 18px;
    }

.delete-btn {
    border: none;
    background: transparent;
    color: #c92a2a;
    cursor: pointer;
    font-size: 14px;
}
/* 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: 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: 14px;
    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: 13px;
    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: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

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

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

.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: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

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

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

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

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

.modal-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    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: 13px;
    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: 13px;
    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-grupo {
    margin-top: 12px;
}

.interv-grupo--sep {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

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

.interv-grupo-label {
    font-size: 11px;
    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: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}

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

.interv-vazio {
    font-size: 12px;
    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: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 3px;
    flex-shrink: 0;
}

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

.interv-nome {
    font-size: 13px;
    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: 13px;
}

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

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

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

.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: 13px;
    text-align: right;
}

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

.interv-pago {
    font-size: 12px;
    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: 12px;
}

.interv-search {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 13px;
    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: 13px;
    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: 13px;
    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: 13px;
    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: 22px;
    }

    /* 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: 18px;
        border-radius: 12px;
        padding-left: 48px;
        line-height: 64px;
    }

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

    /* 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: 12px;
    }

    .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;
    }

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